Skip to content

Commit 8c5919b

Browse files
committed
Do not enable LLD if we don't build host code for targets that opt into it
1 parent e100792 commit 8c5919b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,15 @@ impl Config {
10161016
continue;
10171017
}
10181018

1019+
// The rust.lld option is global, and not target specific, so if we enable it, it will
1020+
// be applied to all targets being built.
1021+
// So we only apply an override if we're building a compiler/host code for the given
1022+
// override target.
1023+
// Note: we could also make the LLD config per-target, but that would complicate things
1024+
if !hosts.contains(&TargetSelection::from_user(&target)) {
1025+
continue;
1026+
}
1027+
10191028
let default_linux_linker_override = match linker_override {
10201029
DefaultLinuxLinkerOverride::Off => continue,
10211030
DefaultLinuxLinkerOverride::SelfContainedLldCc => {

0 commit comments

Comments
 (0)