diff options
author | Alex Crichton <alex@alexcrichton.com> | 2018-12-17 21:10:59 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2018-12-17 21:13:32 -0800 |
commit | bd18a9295cd1bd19daac3369f29776a8f4272016 (patch) | |
tree | a9709009df18e0c50b7a36a6903e3d12586421f2 /src/librustc_llvm | |
parent | c9bb68f5ae5cc297246a084a2cd589787d1ee315 (diff) | |
download | rust-bd18a9295cd1bd19daac3369f29776a8f4272016.tar.gz |
bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.
Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!
[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
Diffstat (limited to 'src/librustc_llvm')
-rw-r--r-- | src/librustc_llvm/build.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index ce482087bba..1b645389337 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -142,6 +142,10 @@ fn main() { continue; } + if flag.starts_with("-flto") { + continue; + } + // -Wdate-time is not supported by the netbsd cross compiler if is_crossed && target.contains("netbsd") && flag.contains("date-time") { continue; |