Skip to content

Commit 3d62165

Browse files
Auto merge of #143175 - Kobzol:bootstrap-lld-external-llvm-config, r=<try>
Make combining LLD with external LLVM config a hard error Younger me made this only a warning in #139853, because our post-dist tests were relying on this. But that was not a good idea, because there are a bunch of places in bootstrap that outright try to build LLD/copy LLD to sysroot when `lld_enabled` is true (rightfully so), which is causing issues (#143076). Instead of piling more hacks, I'd like to just disallow this, and use hack to make our CI work instead. If this breaks the CI post-dist tests, I'll either add some special environment variable for it, or, as an alternative, make the error back into a warning, but also disable `lld_enabled` when this situation happens. try-job: dist-x86_64-linux
2 parents dddd7ab + 1a8b6f5 commit 3d62165

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ impl Step for Assemble {
22412241
debug!("copying codegen backends to sysroot");
22422242
copy_codegen_backends_to_sysroot(builder, build_compiler, target_compiler);
22432243

2244-
if builder.config.lld_enabled && !builder.config.is_system_llvm(target_compiler.host) {
2244+
if builder.config.lld_enabled {
22452245
builder.ensure(crate::core::build_steps::tool::LldWrapper {
22462246
build_compiler,
22472247
target_compiler,

src/bootstrap/src/core/config/config.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,7 @@ impl Config {
10031003
}
10041004

10051005
if config.lld_enabled && config.is_system_llvm(config.host_target) {
1006-
eprintln!(
1007-
"Warning: LLD is enabled when using external llvm-config. LLD will not be built and copied to the sysroot."
1008-
);
1006+
panic!("Cannot enable LLD with `rust.lld = true` when using external llvm-config.");
10091007
}
10101008

10111009
config.optimized_compiler_builtins =

src/tools/opt-dist/src/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ change-id = 115898
7272
[rust]
7373
channel = "{channel}"
7474
verbose-tests = true
75+
# rust-lld cannot be combined with an external LLVM
76+
lld = false
7577
7678
[build]
7779
rustc = "{rustc}"

0 commit comments

Comments
 (0)