Set link-shared if LLVM ThinLTO is enabled in config.rs
This avoids missing a shared build when uplifting LLVM artifacts into the sysroot. We were already producing a shared link anyway, though, so this is not a visible change from the end user's perspective.
This commit is contained in:
parent
a7b092f418
commit
2e87a6e78d
2 changed files with 8 additions and 1 deletions
|
@ -593,7 +593,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
|
|||
let file = compiler_file(builder, builder.cxx(target).unwrap(), target, "libstdc++.a");
|
||||
cargo.env("LLVM_STATIC_STDCPP", file);
|
||||
}
|
||||
if builder.config.llvm_link_shared || builder.config.llvm_thin_lto {
|
||||
if builder.config.llvm_link_shared {
|
||||
cargo.env("LLVM_LINK_SHARED", "1");
|
||||
}
|
||||
if builder.config.llvm_use_libcxx {
|
||||
|
|
|
@ -667,6 +667,13 @@ impl Config {
|
|||
// CI-built LLVM is shared
|
||||
config.llvm_link_shared = true;
|
||||
}
|
||||
|
||||
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.
|
||||
config.llvm_link_shared = true;
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref rust) = toml.rust {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue