From 838e67413b30df7cbb7a171ec1d1a1573b6c0d20 Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Fri, 24 Sep 2021 11:26:01 +0000 Subject: [PATCH] Include copies of rust-lld for `-Z gcc-ld=lld` only in nightly builds. --- src/bootstrap/compile.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index ae234fb1dc729..5040d7d576b4e 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -1133,17 +1133,20 @@ impl Step for Assemble { let src_exe = exe("lld", target_compiler.host); let dst_exe = exe("rust-lld", target_compiler.host); builder.copy(&lld_install.join("bin").join(&src_exe), &libdir_bin.join(&dst_exe)); - // for `-Z gcc-ld=lld` - let gcc_ld_dir = libdir_bin.join("gcc-ld"); - t!(fs::create_dir(&gcc_ld_dir)); - builder.copy( - &lld_install.join("bin").join(&src_exe), - &gcc_ld_dir.join(exe("ld", target_compiler.host)), - ); - builder.copy( - &lld_install.join("bin").join(&src_exe), - &gcc_ld_dir.join(exe("ld64", target_compiler.host)), - ); + + if builder.build.unstable_features() { + // for `-Z gcc-ld=lld` + let gcc_ld_dir = libdir_bin.join("gcc-ld"); + t!(fs::create_dir(&gcc_ld_dir)); + builder.copy( + &lld_install.join("bin").join(&src_exe), + &gcc_ld_dir.join(exe("ld", target_compiler.host)), + ); + builder.copy( + &lld_install.join("bin").join(&src_exe), + &gcc_ld_dir.join(exe("ld64", target_compiler.host)), + ); + } } // Similarly, copy `llvm-dwp` into libdir for Split DWARF. Only copy it when the LLVM