summary refs log tree commit diff
path: root/src/librustc/back
AgeCommit message (Collapse)AuthorLines
2014-01-06auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichtonbors-1/+4
...stlib. Fixes #3319
2014-01-06librustc: tidy cleanupYoung-il Choi-1/+1
2014-01-06librustc: add get_system_tools for target specific environmentYoung-il Choi-17/+24
2014-01-06librustc: move target dependent logic to back::linkYoung-il Choi-8/+18
2014-01-06librustc: ar call fix to support android cross compile on macYoung-il Choi-1/+9
2014-01-05Make rustc's own lib directory configurable and change the default to ↵Jan Niklas Hasse-1/+4
rustlib. Fixes #3319
2014-01-01auto merge of #11247 : eddyb/rust/symbol-cleanup, r=alexcrichtonbors-2/+5
2013-12-31auto merge of #11215 : alexcrichton/rust/metadata-filename, r=pcwaltonbors-2/+5
Right now if you have concurrent builds of two libraries in the same directory (such as rustc's bootstrapping process), it's possible that two libraries will stomp over each others' metadata, producing corrupt rlibs. By placing the metadata file in a tempdir we're guranteed to not conflict with ay other builds happening concurrently. Normally this isn't a problem because output filenames are scoped to the name of the crate, but metadata is special in that it has the same name across all crates.
2013-12-31auto merge of #11187 : alexcrichton/rust/once, r=brsonbors-8/+4
Rationale can be found in the first commit, but this is basically the same thing as `pthread_once`
2013-12-31Convert relevant static mutexes to OnceAlex Crichton-8/+4
2014-01-01Truncate symbol hashes to 64 bits.Eduard Burtescu-2/+5
2013-12-31auto merge of #11157 : alexcrichton/rust/issue-11154, r=pcwaltonbors-0/+6
Closes #11154
2013-12-31Disallow LTO with a preference to dynamic linkingAlex Crichton-0/+6
Closes #11154
2013-12-30Revert "Embed Windows application manifest."Vadim Chugunov-113/+0
2013-12-30Add metadata from a tempdir instead of a build dirAlex Crichton-2/+5
Right now if you have concurrent builds of two libraries in the same directory (such as rustc's bootstrapping process), it's possible that two libraries will stomp over each others' metadata, producing corrupt rlibs. By placing the metadata file in a tempdir we're guranteed to not conflict with ay other builds happening concurrently. Normally this isn't a problem because output filenames are scoped to the name of the crate, but metadata is special in that it has the same name across all crates.
2013-12-29Rename PkgId to CrateIdLuis de Bethencourt-11/+11
2013-12-29Rename pkgid variablesLuis de Bethencourt-1/+1
2013-12-27Initialize LLVM only onceAlex Crichton-25/+25
This also appears to fix a race in LLVM that was causing a deadlock on the bots during the doc-test tests (where we use rustc in parallel).
2013-12-26librustc: De-`@mut` `outputs` in the sessionPatrick Walton-3/+6
2013-12-26librustc: De-`@mut` the additional library search pathsPatrick Walton-2/+7
2013-12-26librustc: De-`@mut` `CStore::used_link_args`Patrick Walton-1/+3
2013-12-26librustc: De-`@mut` `CStore::used_libraries`Patrick Walton-2/+6
2013-12-26librustc: De-`@mut` the crate contextPatrick Walton-6/+6
2013-12-26librustc: De-`@mut` `CrateContext::symbol_hasher`.Patrick Walton-1/+2
2013-12-26librustc: De-`@mut` `CrateContext::type_hashcodes`Patrick Walton-7/+11
2013-12-26auto merge of #10965 : alexcrichton/rust/libgreen, r=brsonbors-1/+11
This pull request extracts all scheduling functionality from libstd, moving it into its own separate crates. The new libnative and libgreen will be the new way in which 1:1 and M:N scheduling is implemented. The standard library still requires an interface to the runtime, however, (think of things like `std::comm` and `io::println`). The interface is now defined by the `Runtime` trait inside of `std::rt`. The booting process is now that libgreen defines the start lang-item and that's it. I want to extend this soon to have libnative also have a "start lang item" but also allow libgreen and libnative to be linked together in the same process. For now though, only libgreen can be used to start a program (unless you define the start lang item yourself). Again though, I want to change this soon, I just figured that this pull request is large enough as-is. This certainly wasn't a smooth transition, certain functionality has no equivalent in this new separation, and some functionality is now better enabled through this new system. I did my best to separate all of the commits by topic and keep things fairly bite-sized, although are indeed larger than others. As a note, this is currently rebased on top of my `std::comm` rewrite (or at least an old copy of it), but none of those commits need reviewing (that will all happen in another pull request).
2013-12-25Test fixes and rebase conflictsAlex Crichton-1/+11
* vec::raw::to_ptr is gone * Pausible => Pausable * Removing @ * Calling the main task "<main>" * Removing unused imports * Removing unused mut * Bringing some libextra tests up to date * Allowing compiletest to work at stage0 * Fixing the bootstrap-from-c rmake tests * assert => rtassert in a few cases * printing to stderr instead of stdout in fail!()
2013-12-25Method-ify CStoreSteven Fackler-13/+13
2013-12-24Stop using C++ exceptions for stack unwinding.Vadim Chugunov-40/+9
2013-12-21auto merge of #10997 : ↵bors-5/+14
cadencemarseille/rust/issue-10755-ICE-for-missing-linker, r=alexcrichton Trap the io_error condition so that a more informative error message is displayed when the linker program cannot be started, such as when the name of the linker binary is accidentally mistyped. closes #10755
2013-12-20auto merge of #11077 : alexcrichton/rust/crate-id, r=cmrbors-2/+2
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-20rustc: Improve crate id extractionAlex Crichton-2/+2
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-19rustc: Optimize reading metadata by 4xAlex Crichton-3/+59
We were previously reading metadata via `ar p`, but as learned from rustdoc awhile back, spawning a process to do something is pretty slow. Turns out LLVM has an Archive class to read archives, but it cannot write archives. This commits adds bindings to the read-only version of the LLVM archive class (with a new type that only has a read() method), and then it uses this class when reading the metadata out of rlibs. When you put this in tandem of not compressing the metadata, reading the metadata is 4x faster than it used to be The timings I got for reading metadata from the respective libraries was: libstd-04ff901e-0.9-pre.dylib => 100ms libstd-04ff901e-0.9-pre.rlib => 23ms librustuv-7945354c-0.9-pre.dylib => 4ms librustuv-7945354c-0.9-pre.rlib => 1ms librustc-5b94a16f-0.9-pre.dylib => 87ms librustc-5b94a16f-0.9-pre.rlib => 35ms libextra-a6ebb16f-0.9-pre.dylib => 63ms libextra-a6ebb16f-0.9-pre.rlib => 15ms libsyntax-2e4c0458-0.9-pre.dylib => 86ms libsyntax-2e4c0458-0.9-pre.rlib => 22ms In order to always take advantage of these faster metadata read-times, I sort the files in filesearch based on whether they have an rlib extension or not (prefer all rlib files first). Overall, this halved the compile time for a `fn main() {}` crate from 0.185s to 0.095s on my system (when preferring dynamic linking). Reading metadata is still the slowest pass of the compiler at 0.035s, but it's getting pretty close to linking at 0.021s! The next best optimization is to just not copy the metadata from LLVM because that's the most expensive part of reading metadata right now.
2013-12-19auto merge of #11041 : cmr/rust/pkgid_changes, r=cmr,metajackbors-8/+14
2013-12-19Add some things to inspect crate-id'sCorey Richardson-8/+14
2013-12-18Fix #10755 - ICE: `--linker=`Cadence Marseille-5/+14
Trap the io_error condition so that a more informative error message is displayed when the linker program cannot be started, such as when the name of the linker binary is accidentally mistyped. closes #10755
2013-12-19std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.Huon Wilson-12/+8
There's no need for the restrictions of a closure with the above methods.
2013-12-17auto merge of #10979 : alexcrichton/rust/less-bc, r=cmrbors-10/+3
By performing this logic very late in the build process, it ended up leading to bugs like those found in #10973 where certain stages of the build process expected a particular output format which didn't end up being the case. In order to fix this, the build output generation is moved very early in the build process to the absolute first thing in phase 2. Closes #10973
2013-12-15Move logic for test output generation forwardAlex Crichton-10/+3
By performing this logic very late in the build process, it ended up leading to bugs like those found in #10973 where certain stages of the build process expected a particular output format which didn't end up being the case. In order to fix this, the build output generation is moved very early in the build process to the absolute first thing in phase 2. Closes #10973
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-3/+2
2013-12-14Fix #10754 - `std::run` functions fail after io_errorCadence Marseille-23/+47
The problem was that std::run::Process::new() was unwrap()ing the result of std::io::process::Process::new(), which returns None in the case where the io_error condition is raised to signal failure to start the process. Have std::run::Process::new() similarly return an Option<run::Process> to reflect the fact that a subprocess might have failed to start. Update utility functions run::process_status() and run::process_output() to return Option<ProcessExit> and Option<ProcessOutput>, respectively. Various parts of librustc and librustpkg needed to be updated to reflect these API changes. closes #10754
2013-12-13auto merge of #10916 : alexcrichton/rust/nounwind, r=pcwaltonbors-0/+6
When performing LTO, the rust compiler has an opportunity to completely strip all landing pads in all dependent libraries. I've modified the LTO pass to recognize the -Z no-landing-pads option when also running an LTO pass to flag everything in LLVM as nothrow. I've verified that this prevents any and all invoke instructions from being emitted. I believe that this is one of our best options for moving forward with accomodating use-cases where unwinding doesn't really make sense. This will allow libraries to be built with landing pads by default but allow usage of them in contexts where landing pads aren't necessary.
2013-12-13auto merge of #10908 : alexcrichton/rust/issue-10907, r=cmrbors-4/+16
Turns out that one some platforms the ar/ranlib tool will die with an assertion if the file being added doesn't actually have any symbols (or if it's just not an object file presumably). This functionality is already all exercised on the bots, it just turns out that the bots don't have an ar tool which dies in this situation, so it's difficult for me to add a test. Closes #10907
2013-12-13auto merge of #10698 : metajack/rust/dep-info, r=alexcrichtonbors-3/+9
This isn't super useful for libraries yet without #10593. Fixes #7633.
2013-12-12Add --dep-info to write Makefile-compatible dependency info.Jack Moffitt-3/+9
When --dep-info is given, rustc will write out a `$input_base.d` file in the output directory that contains Makefile compatible dependency information for use with tools like make and ninja.
2013-12-11Fixed "unused variable" errors and trailing whitespace.Vadim Chugunov-2/+2
2013-12-11Don't always modify the symbol table in rlibsAlex Crichton-4/+16
Turns out that one some platforms the ar/ranlib tool will die with an assertion if the file being added doesn't actually have any symbols (or if it's just not an object file presumably). This functionality is already all exercised on the bots, it just turns out that the bots don't have an ar tool which dies in this situation, so it's difficult for me to add a test. Closes #10907
2013-12-11Embed Windows application manifest.Vadim Chugunov-0/+115
2013-12-11Disable all unwinding on -Z no-landing-pads LTOAlex Crichton-0/+6
When performing LTO, the rust compiler has an opportunity to completely strip all landing pads in all dependent libraries. I've modified the LTO pass to recognize the -Z no-landing-pads option when also running an LTO pass to flag everything in LLVM as nothrow. I've verified that this prevents any and all invoke instructions from being emitted. I believe that this is one of our best options for moving forward with accomodating use-cases where unwinding doesn't really make sense. This will allow libraries to be built with landing pads by default but allow usage of them in contexts where landing pads aren't necessary. cc #10780
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-182/+55
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.