Skip to content

Commit 25511ed

Browse files
committed
Revert "bypass linker configuration and cross target check for specific commands #128871"
Signed-off-by: onur-ozkan <[email protected]>
1 parent adf8d16 commit 25511ed

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

src/bootstrap/src/core/builder.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,15 +2463,7 @@ impl Cargo {
24632463
cmd_kind: Kind,
24642464
) -> Cargo {
24652465
let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind);
2466-
2467-
match cmd_kind {
2468-
// No need to configure the target linker for these command types.
2469-
Kind::Clean | Kind::Check | Kind::Suggest | Kind::Format | Kind::Setup => {}
2470-
_ => {
2471-
cargo.configure_linker(builder);
2472-
}
2473-
}
2474-
2466+
cargo.configure_linker(builder);
24752467
cargo
24762468
}
24772469

src/bootstrap/src/utils/cc_detect.rs

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,15 @@ fn new_cc_build(build: &Build, target: TargetSelection) -> cc::Build {
8787
}
8888

8989
pub fn find(build: &Build) {
90-
let targets: HashSet<_> = match build.config.cmd {
91-
// We don't need to check cross targets for these commands.
92-
crate::Subcommand::Clean { .. }
93-
| crate::Subcommand::Check { .. }
94-
| crate::Subcommand::Suggest { .. }
95-
| crate::Subcommand::Format { .. }
96-
| crate::Subcommand::Setup { .. } => {
97-
build.hosts.iter().cloned().chain(iter::once(build.build)).collect()
98-
}
99-
100-
_ => {
101-
// For all targets we're going to need a C compiler for building some shims
102-
// and such as well as for being a linker for Rust code.
103-
build
104-
.targets
105-
.iter()
106-
.chain(&build.hosts)
107-
.cloned()
108-
.chain(iter::once(build.build))
109-
.collect()
110-
}
111-
};
112-
90+
// For all targets we're going to need a C compiler for building some shims
91+
// and such as well as for being a linker for Rust code.
92+
let targets = build
93+
.targets
94+
.iter()
95+
.chain(&build.hosts)
96+
.cloned()
97+
.chain(iter::once(build.build))
98+
.collect::<HashSet<_>>();
11399
for target in targets.into_iter() {
114100
find_target(build, target);
115101
}

0 commit comments

Comments
 (0)