Rollup merge of #116365 - P1n3appl3:master, r=onur-ozkan

bootstrap: make copying linker binaries conditional

The change in #116276 breaks bootstrapping if you don't use `lld` for linking with your stage0 compiler. Making this copy conditional should be enough to fix it.
This commit is contained in:
Matthias Krüger 2023-10-04 05:02:06 +02:00 committed by GitHub
commit e6a9bb11fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,12 +167,14 @@ impl Step for Std {
.rustc_snapshot_sysroot()
.join("lib")
.join("rustlib")
.join(&compiler.host.triple)
.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));
builder.cp_r(&src_sysroot_bin, &target_sysroot_bin);
if src_sysroot_bin.exists() {
let target_sysroot_bin =
builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin");
t!(fs::create_dir_all(&target_sysroot_bin));
builder.cp_r(&src_sysroot_bin, &target_sysroot_bin);
}
}
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");