Skip to content

Commit

Permalink
Rollup merge of #89865 - tmandry:llvm-static, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Allow static linking LLVM with ThinLTO

There's no reason not to allow this if the user wants it. It works, at least in a local build on linux host.

For our use case, we're happy to spend more time building the compiler if it creates a speedup every time we run it, and we've observed speedups like this with clang.
  • Loading branch information
matthiaskrgr authored Oct 14, 2021
2 parents 29081f9 + c9af192 commit 0888c6d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,10 @@ impl Config {
};
}

if config.llvm_thin_lto {
// If we're building with ThinLTO on, we want to link to LLVM
// shared, to avoid re-doing ThinLTO (which happens in the link
// step) with each stage.
assert_ne!(
llvm.link_shared,
Some(false),
"setting link-shared=false is incompatible with thin-lto=true"
);
if config.llvm_thin_lto && llvm.link_shared.is_none() {
// If we're building with ThinLTO on, by default we want to link
// to LLVM shared, to avoid re-doing ThinLTO (which happens in
// the link step) with each stage.
config.llvm_link_shared = true;
}
}
Expand Down

0 comments on commit 0888c6d

Please sign in to comment.