Skip to content

Commit 0eb298a

Browse files
committed
bootstrap: make copying linker binaries conditional
1 parent 5333b87 commit 0eb298a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/bootstrap/compile.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,15 @@ impl Step for Std {
161161
// The LLD wrappers and `rust-lld` are self-contained linking components that can be
162162
// necessary to link the stdlib on some targets. We'll also need to copy these binaries to
163163
// the `stage0-sysroot` to ensure the linker is found when bootstrapping on such a target.
164-
if compiler.stage == 0 && compiler.host == builder.config.build {
164+
let src_sysroot_bin = builder
165+
.rustc_snapshot_sysroot()
166+
.join("lib")
167+
.join("rustlib")
168+
.join(compiler.host.triple)
169+
.join("bin");
170+
if compiler.stage == 0 && compiler.host == builder.config.build && src_sysroot_bin.exists()
171+
{
165172
// We want to copy the host `bin` folder within the `rustlib` folder in the sysroot.
166-
let src_sysroot_bin = builder
167-
.rustc_snapshot_sysroot()
168-
.join("lib")
169-
.join("rustlib")
170-
.join(&compiler.host.triple)
171-
.join("bin");
172173
let target_sysroot_bin =
173174
builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin");
174175
t!(fs::create_dir_all(&target_sysroot_bin));

0 commit comments

Comments
 (0)