Skip to content

Commit

Permalink
bootstrap: make copying linker binaries conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
P1n3appl3 committed Oct 3, 2023
1 parent 5333b87 commit 0eb298a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,15 @@ impl Step for Std {
// The LLD wrappers and `rust-lld` are self-contained linking components that can be
// necessary to link the stdlib on some targets. We'll also need to copy these binaries to
// the `stage0-sysroot` to ensure the linker is found when bootstrapping on such a target.
if compiler.stage == 0 && compiler.host == builder.config.build {
let src_sysroot_bin = builder
.rustc_snapshot_sysroot()
.join("lib")
.join("rustlib")
.join(compiler.host.triple)
.join("bin");
if compiler.stage == 0 && compiler.host == builder.config.build && src_sysroot_bin.exists()
{
// We want to copy the host `bin` folder within the `rustlib` folder in the sysroot.
let src_sysroot_bin = builder
.rustc_snapshot_sysroot()
.join("lib")
.join("rustlib")
.join(&compiler.host.triple)
.join("bin");
let target_sysroot_bin =
builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin");
t!(fs::create_dir_all(&target_sysroot_bin));
Expand Down

0 comments on commit 0eb298a

Please sign in to comment.