Skip to content

Make combining LLD with external LLVM config a hard error #143175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ impl Step for Assemble {
debug!("copying codegen backends to sysroot");
copy_codegen_backends_to_sysroot(builder, build_compiler, target_compiler);

if builder.config.lld_enabled && !builder.config.is_system_llvm(target_compiler.host) {
if builder.config.lld_enabled {
builder.ensure(crate::core::build_steps::tool::LldWrapper {
build_compiler,
target_compiler,
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,7 @@ impl Config {
}

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

config.optimized_compiler_builtins =
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "It is no longer possible to `x build` with stage 0. All build commands have to be on stage 1+.",
},
ChangeInfo {
change_id: 143175,
severity: ChangeSeverity::Info,
summary: "It is no longer possible to combine `rust.lld = true` with configuring external LLVM using `llvm.llvm-config`.",
},
];
2 changes: 2 additions & 0 deletions src/tools/opt-dist/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ change-id = 115898
[rust]
channel = "{channel}"
verbose-tests = true
# rust-lld cannot be combined with an external LLVM
lld = false

[build]
rustc = "{rustc}"
Expand Down
Loading