Skip to content

Commit 0888c6d

Browse files
authored
Rollup merge of #89865 - tmandry:llvm-static, r=Mark-Simulacrum
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.
2 parents 29081f9 + c9af192 commit 0888c6d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/bootstrap/config.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -825,15 +825,10 @@ impl Config {
825825
};
826826
}
827827

828-
if config.llvm_thin_lto {
829-
// If we're building with ThinLTO on, we want to link to LLVM
830-
// shared, to avoid re-doing ThinLTO (which happens in the link
831-
// step) with each stage.
832-
assert_ne!(
833-
llvm.link_shared,
834-
Some(false),
835-
"setting link-shared=false is incompatible with thin-lto=true"
836-
);
828+
if config.llvm_thin_lto && llvm.link_shared.is_none() {
829+
// If we're building with ThinLTO on, by default we want to link
830+
// to LLVM shared, to avoid re-doing ThinLTO (which happens in
831+
// the link step) with each stage.
837832
config.llvm_link_shared = true;
838833
}
839834
}

0 commit comments

Comments
 (0)