about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back/link.rs
AgeCommit message (Collapse)AuthorLines
2018-08-09try to infer linker flavor from linker name and vice versaJorge Aparicio-26/+82
2018-08-09Move rustc::util::fs into separate (new) crateMark Rousskov-1/+1
2018-08-08Address review comments for #53031 and fix some merge fallout.Michael Woerister-5/+5
2018-08-07Make sure upstream object files are added to staticlibs when compilingMichael Woerister-1/+5
with ThinLTO and cross-lang-lto. Normally, when compiling with whole-crate-graph ThinLTO, we expect rustc's LTO step to "uplift" upstream object files/LLVM modules to the current set of compilation artifacts. Therefore the staticlib creation code skips this uplifting. However, when compiling with "cross-language LTO" (i.e. defer LTO to the actual linker), the LTO step in rustc is not performed, so we have to take care of copying upstream object files during archive creation (like we already do when compiling without any LTO).
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-3/+3
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-20/+20
This is a clippy-breaking change.
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-2/+2
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-1/+1
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-28Don't format!() string literalsljedrz-2/+2
2018-07-27Prefer to_string() to format!()ljedrz-1/+1
2018-07-26Improve a few vectors - calculate capacity or build from iteratorsljedrz-2/+3
2018-07-18rustc: Stabilize #[wasm_import_module] as #[link(...)]Alex Crichton-23/+36
This commit stabilizes the `#[wasm_import_module]` attribute as `#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in the `#[link]` attribute is used to configured the module name that the imports are listed with. The WebAssembly specification indicates two utf-8 names are associated with all imported items, one for the module the item comes from and one for the item itself. The item itself is configurable in Rust via its identifier or `#[link_name = "..."]`, but the module name was previously not configurable and defaulted to `"env"`. This commit ensures that this is also configurable. Closes #52090
2018-07-16Revert "Clean up LLVM module naming (just use CodegenUnit names)."Michael Woerister-0/+7
This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.
2018-07-13Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, ↵bors-7/+0
r=alexcrichton Preliminary work for incremental ThinLTO. Since implementing incremental ThinLTO is a bit more involved than I initially thought, I'm splitting out some of the things that already work. This PR (1) adds a way accessing some ThinLTO information in `rustc` and (2) does some cleanup around CGU/object file naming (which makes things quite a bit nicer). This is probably best reviewed one commit at a time.
2018-07-11Clean up LLVM module naming (just use CodegenUnit names).Michael Woerister-7/+0
2018-07-11Deny bare trait objects in in src/librustc_codegen_llvmljedrz-8/+8
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-4/+2
This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug] Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-04Shorten the lineCrLF0710-2/+2
Shorten the line to make tidy happy.
2018-07-04Include VS 2017 in error message.CrLF0710-1/+1
Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-06-20Fix tidyBastien Orivel-1/+4
2018-06-20Replace tempdir by tempfile in librustc_transBastien Orivel-3/+3
2018-05-31musl: don't use the included startfiles with -crt-staticJohannes Nixdorf-0/+16
This fixes (only for -crt-static) #36710.
2018-05-17Revert "musl: don't use the included startfiles with -crt-static"Alex Crichton-16/+0
This reverts commit a5a875d17b34b61326d803eb2edea526d3bd6914.
2018-05-17Revert "musl: link crt{begin,end}.o from the system compiler"Alex Crichton-11/+0
This reverts commit 6d9154a830dd9773fe8a4e34e1fc3dfb1ca6f935.
2018-05-17Rename trans to codegen everywhere.Irina Popa-0/+1630