]> git.lizzy.rs Git - rust.git/commit
bootstrap: Link LLVM as a dylib with ThinLTO
authorAlex Crichton <alex@alexcrichton.com>
Tue, 18 Dec 2018 05:10:59 +0000 (21:10 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 2 Jan 2019 19:33:38 +0000 (11:33 -0800)
commitea7fef1ccf4b44effbc3bbc902f9b0b9dbd251a4
tree44748ddc1ac03ae5ade8faee09eeb26bc6d2704e
parenta36b960df626cbb8bea74f01243318b73f0bd201
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
src/bootstrap/check.rs
src/bootstrap/compile.rs
src/bootstrap/dist.rs
src/bootstrap/tool.rs
src/librustc_llvm/build.rs