about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-10-07 13:57:29 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-10-08 10:05:25 +0300
commitb563595c6e6002ab582e2eb4ebd2a19baa8a1e34 (patch)
tree42b12822c3acede6dcf09a143319c5c64a263f24 /src
parent1516ca1bc01181af73c7b7760fb90137007da75f (diff)
downloadrust-b563595c6e6002ab582e2eb4ebd2a19baa8a1e34.tar.gz
rust-b563595c6e6002ab582e2eb4ebd2a19baa8a1e34.zip
linker: Remove `-Zgcc-ld` option
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/compile.rs10
-rw-r--r--src/bootstrap/dist.rs13
-rw-r--r--src/tools/compiletest/src/header/needs.rs4
-rw-r--r--src/tools/lld-wrapper/src/main.rs4
4 files changed, 17 insertions, 14 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index cf1f97c5b41..6821ded1458 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -1677,15 +1677,17 @@ 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));
+            let self_contained_lld_dir = libdir_bin.join("gcc-ld");
+            t!(fs::create_dir(&self_contained_lld_dir));
             let lld_wrapper_exe = builder.ensure(crate::tool::LldWrapper {
                 compiler: build_compiler,
                 target: target_compiler.host,
             });
             for name in crate::LLD_FILE_NAMES {
-                builder.copy(&lld_wrapper_exe, &gcc_ld_dir.join(exe(name, target_compiler.host)));
+                builder.copy(
+                    &lld_wrapper_exe,
+                    &self_contained_lld_dir.join(exe(name, target_compiler.host)),
+                );
             }
         }
 
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 32da4ac29a4..05556d2f679 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -471,14 +471,15 @@ impl Step for Rustc {
                 let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin");
                 let rust_lld = exe("rust-lld", compiler.host);
                 builder.copy(&src_dir.join(&rust_lld), &dst_dir.join(&rust_lld));
-                // for `-Z gcc-ld=lld`
-                let gcc_lld_src_dir = src_dir.join("gcc-ld");
-                let gcc_lld_dst_dir = dst_dir.join("gcc-ld");
-                t!(fs::create_dir(&gcc_lld_dst_dir));
+                let self_contained_lld_src_dir = src_dir.join("gcc-ld");
+                let self_contained_lld_dst_dir = dst_dir.join("gcc-ld");
+                t!(fs::create_dir(&self_contained_lld_dst_dir));
                 for name in crate::LLD_FILE_NAMES {
                     let exe_name = exe(name, compiler.host);
-                    builder
-                        .copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
+                    builder.copy(
+                        &self_contained_lld_src_dir.join(&exe_name),
+                        &self_contained_lld_dst_dir.join(&exe_name),
+                    );
                 }
             }
 
diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs
index 2b7a4387ceb..4a40fb55f5c 100644
--- a/src/tools/compiletest/src/header/needs.rs
+++ b/src/tools/compiletest/src/header/needs.rs
@@ -241,8 +241,8 @@ impl CachedNeedsConditions {
             profiler_support: std::env::var_os("RUSTC_PROFILER_SUPPORT").is_some(),
             xray: config.target_cfg().xray,
 
-            // For tests using the `needs-rust-lld` directive (e.g. for `-Zgcc-ld=lld`), we need to find
-            // whether `rust-lld` is present in the compiler under test.
+            // For tests using the `needs-rust-lld` directive (e.g. for `-Clink-self-contained=+linker`),
+            // we need to find whether `rust-lld` is present in the compiler under test.
             //
             // The --compile-lib-path is the path to host shared libraries, but depends on the OS. For
             // example:
diff --git a/src/tools/lld-wrapper/src/main.rs b/src/tools/lld-wrapper/src/main.rs
index b5e977b2637..da94e686f38 100644
--- a/src/tools/lld-wrapper/src/main.rs
+++ b/src/tools/lld-wrapper/src/main.rs
@@ -4,8 +4,8 @@
 //! two arguments the `<flavor>` command line interface is used to process the remaining arguments.
 //! If no `-flavor` argument is present the flavor is determined by the executable name.
 //!
-//! In Rust with `-Z gcc-ld=lld` we have gcc or clang invoke rust-lld. Since there is no way to
-//! make gcc/clang pass `-flavor <flavor>` as the first two arguments in the linker invocation
+//! With `-Clink-self-contained=+linker` we have gcc or clang invoke rust-lld. Since there is no way
+//! to make gcc/clang pass `-flavor <flavor>` as the first two arguments in the linker invocation
 //! and since Windows does not support symbolic links for files this wrapper is used in place of a
 //! symbolic link. It execs `../rust-lld -flavor <flavor>` by propagating the flavor argument
 //! obtained from the wrapper's name as the first two arguments.