about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back/link.rs
AgeCommit message (Collapse)AuthorLines
2019-04-20Remove cg_llvm/back/link.rsbjorn3-25/+0
2019-04-20Move almost all of cg_llvm/back/link.rs to cg_ssabjorn3-1102/+15
2019-04-20Remove get_reloc_model and target_cpu dependency from most of link.rsbjorn3-14/+18
2019-04-20Make link functions generic over archive builderbjorn3-46/+31
2019-04-20Move some filename constants to cg_ssabjorn3-2/+1
2019-04-20Move some function from cg_llvm/back/link.rs to cg_ssa/back/link.rsbjorn3-373/+3
2019-04-11Clean up handling of -Zpgo-gen commandline option.Michael Woerister-1/+1
2019-04-04Remove invalid assertion back::link::from add_upstream_rust_crates().Michael Woerister-4/+0
2019-03-20Add a -Z time option which prints only passes which runs onceJohn Kåre Alsaker-2/+2
2019-02-26rustc: Update LLVM, remove dead wasm codeAlex Crichton-1/+0
This commit updates the LLVM branch to the rebased version of the upstream release/8.x branch. This includes a wasm patch which means that the `rewrite_imports` pass in rustc is no longer needed (yay!) and we can instead rely on `wasm-import-module`, an attribute we're already emitting, to take care of all the work.
2019-02-25librustc_codegen_llvm: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-1/+1
2019-02-18librustc_codegen_llvm => 2018Taiki Endo-7/+7
2019-02-13Rollup merge of #58057 - michaelwoerister:stabilize-xlto, r=alexcrichtonMazdak Farrokhzad-2/+2
Stabilize linker-plugin based LTO (aka cross-language LTO) This PR stabilizes [linker plugin based LTO](https://github.com/rust-lang/rust/issues/49879), also known as "cross-language LTO" because it allows for doing inlining and other optimizations across language boundaries in mixed Rust/C/C++ projects. As described in the tracking issue, it works by making `rustc` emit LLVM bitcode instead of machine code, the same as `clang` does. A linker with the proper plugin (like LLD) can then run (Thin)LTO across all modules. The feature has been implemented over a number of pull requests and there are various [codegen](https://github.com/rust-lang/rust/blob/master/src/test/codegen/no-dllimport-w-cross-lang-lto.rs) and [run](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-clang)-[make](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs) [tests](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto) that make sure that it keeps working. It also works for building big projects like [Firefox](https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ce2d5ddcea6fbff790503eac406954e469b2f5d). The PR makes the feature available under the `-C linker-plugin-lto` flag. As discussed in the tracking issue it is not cross-language specific and also not LLD specific. `-C linker-plugin-lto` is descriptive of what it does. If someone has a better name, let me know `:)`
2019-02-12Stabilize linker-plugin based LTO.Michael Woerister-2/+2
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-18Search other library paths when loking for link objectsPetr Hosek-5/+19
Support the case when link objects are not located in Rust sysroot but in other locations which could be specify through library paths.
2018-12-12Replace `FileSearch::for_each_lib_search_path` with `search_paths`.Nicholas Nethercote-8/+4
Returning an iterator leads to nicer code all around.
2018-12-12Introduce `SearchPath` and replace `SearchPaths` with `Vec<SearchPath>`.Nicholas Nethercote-6/+6
It's more idiomatic, makes the code shorter, and will help with the next commit.
2018-12-12Remove `Session::sysroot()`.Nicholas Nethercote-2/+1
Instead of maybe storing its own sysroot and maybe deferring to the one in `Session::opts`, just clone the latter when necessary so one is always directly available. This removes the need for the getter.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-03codegen_llvm_back: improve allocationsljedrz-6/+6
2018-11-25Rollup merge of #56075 - alexcrichton:wasm-producer-section, r=estebankPietro Albini-0/+5
Encode a custom "producers" section in wasm files This commit implements WebAssembly/tool-conventions#65 for wasm files produced by the Rust compiler. This adds a bit of metadata to wasm modules to indicate that the file's language includes Rust and the file's "processed-by" tools includes rustc. The thinking with this section is to eventually have telemetry in browsers tracking all this.
2018-11-22Pass additional linker flags when targeting FuchsiaPetr Hosek-1/+9
This is a follow up to 8aa9267 which changed the driver to use lld directly rather than invoking it through Clang. This change ensures we pass all the necessary flags to lld.
2018-11-19Encode a custom "producers" section in wasm filesAlex Crichton-0/+5
This commit implements WebAssembly/tool-conventions#65 for wasm files produced by the Rust compiler. This adds a bit of metadata to wasm modules to indicate that the file's language includes Rust and the file's "processed-by" tools includes rustc. The thinking with this section is to eventually have telemetry in browsers tracking all this.
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-188/+11
2018-11-16Finished moving backend-agnostic code to rustc_codegen_ssaDenis Merigoux-1/+2
2018-11-16Fixed typosDenis Merigoux-1/+1
2018-11-16Traitification of common.rs methodsDenis Merigoux-1/+1
2018-11-10codegen_llvm_back: simplify a conversion to charljedrz-1/+1
2018-11-10codegen_llvm_back: remove a redundant continueljedrz-1/+0
2018-11-10codegen_llvm_back: possible minor speedup in logicljedrz-1/+1
2018-11-10codegen_llvm_back: improve common patternsljedrz-20/+11
2018-11-10codegen_llvm_back: remove explicit returnsljedrz-1/+2
2018-11-10codegen_llvm_back: whitespace & formatting fixesljedrz-9/+6
2018-11-03Move cg_llvm::back::linker to cg_utilsbjorn3-3/+4
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-09-29rust: Add a `-C default-linker-libraries` optionAlex Crichton-6/+10
This commit adds a new codegen option for the compiler which disables rustc's passing of `-nodefaultlibs` by default on relevant platforms. Sometimes Rust is linked with C code which fails to link with `-nodefaultlibs` and is unnecessarily onerous to get linking correctly with `-nodefaultlibs`. An example of this is that when you compile C code with sanitizers and then pass `-fsanitize=address` to the linker, it's incompatible with `-nodefaultlibs` also being passed to the linker. In these situations it's easiest to turn off Rust's default passing of `-nodefaultlibs`, which was more ideological to start with than anything! Preserving the default is somewhat important but having this be opt-in shouldn't cause any breakage. Closes #54237
2018-09-28Move `filename_for_metadata` to codegen_utilsIgor Matuszewski-10/+2
This function isn't strictly tied to LLVM (it's more of a utility) and it's now near an analogous, almost identical `filename_for_input` (for rlibs and so forth). Also this means not depending on the backend when one wants to know the accurate .rmeta output filename.
2018-09-05Allow for opting out of ThinLTO and clean up LTO related cli flag handling.Michael Woerister-1/+0
2018-08-21Rollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkorkennytm-2/+1
Remove LinkMeta struct Fixes #53291
2018-08-20Auto merge of #52101 - japaric:linker-flavor, r=alexcrichtonbors-33/+82
try to infer linker flavor from linker name and vice versa This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121 With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`. To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable. With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD). r? @alexcrichton
2018-08-19fix: preserve msvc linker fallback logicJorge Aparicio-1/+3
2018-08-19fix: use detected MSVC's link.exeJorge Aparicio-2/+5
2018-08-19LinkerFlavor::Gcc defaults to cc, not gccJorge Aparicio-1/+1
2018-08-18fatal -> bugJorge Aparicio-1/+1
2018-08-18add lld_flavor info to target specJorge Aparicio-0/+2
this field defaults to the LD / GNU flavor
2018-08-18Remove LinkMeta structbjorn3-2/+1
2018-08-15Use CGU name as LLVM module name and add some caching to CGU name generation.Michael Woerister-7/+0
2018-08-09address review commentsJorge Aparicio-49/+35