Skip to content

Commit 47d7c9d

Browse files
authored
Unrolled build for #143175
Rollup merge of #143175 - Kobzol:bootstrap-lld-external-llvm-config, r=Jieyouxu 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 if we need to use a hack, do it only for our CI. 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 Fixes: #143175
2 parents f26e580 + 5cf2a50 commit 47d7c9d

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-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/bootstrap/src/utils/change_tracker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,4 +431,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
431431
severity: ChangeSeverity::Warning,
432432
summary: "It is no longer possible to `x build` with stage 0. All build commands have to be on stage 1+.",
433433
},
434+
ChangeInfo {
435+
change_id: 143175,
436+
severity: ChangeSeverity::Info,
437+
summary: "It is no longer possible to combine `rust.lld = true` with configuring external LLVM using `llvm.llvm-config`.",
438+
},
434439
];

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)