about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-05-24 23:29:15 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-05-25 23:55:22 +0300
commit2984bf674f5f1839c19002f4fd032eacc98596c9 (patch)
tree4482219c0cc9ac5d8ab5c4704328c0a5019cbf2a /src/bootstrap
parent1b5e1215efa47cf4d78a945c7be1c04cda4f57d4 (diff)
downloadrust-2984bf674f5f1839c19002f4fd032eacc98596c9.tar.gz
rust-2984bf674f5f1839c19002f4fd032eacc98596c9.zip
Simplify implementation of `-Z gcc-ld`
- The logic is now unified for all targets (wasm targets should also be supported now)
- Additional "symlink" files like `ld64` are eliminated
- lld-wrapper is used for propagating the correct lld flavor
- Cleanup "unwrap or exit" logic in lld-wrapper
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/compile.rs13
-rw-r--r--src/bootstrap/dist.rs7
-rw-r--r--src/bootstrap/tool.rs3
3 files changed, 8 insertions, 15 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 0b430f64e1e..b35eba21e6b 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -1164,14 +1164,11 @@ impl Step for Assemble {
             // for `-Z gcc-ld=lld`
             let gcc_ld_dir = libdir_bin.join("gcc-ld");
             t!(fs::create_dir(&gcc_ld_dir));
-            for flavor in ["ld", "ld64"] {
-                let lld_wrapper_exe = builder.ensure(crate::tool::LldWrapper {
-                    compiler: build_compiler,
-                    target: target_compiler.host,
-                    flavor_feature: flavor,
-                });
-                builder.copy(&lld_wrapper_exe, &gcc_ld_dir.join(exe(flavor, target_compiler.host)));
-            }
+            let lld_wrapper_exe = builder.ensure(crate::tool::LldWrapper {
+                compiler: build_compiler,
+                target: target_compiler.host,
+            });
+            builder.copy(&lld_wrapper_exe, &gcc_ld_dir.join(exe("ld", target_compiler.host)));
         }
 
         if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 0be11e3fb46..cc10d67c551 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -407,11 +407,8 @@ impl Step for Rustc {
                 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));
-                for flavor in ["ld", "ld64"] {
-                    let exe_name = exe(flavor, compiler.host);
-                    builder
-                        .copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
-                }
+                let exe_name = exe("ld", compiler.host);
+                builder.copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
             }
 
             // Man pages
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 3b30e6de12a..2f4d07d77a5 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -656,7 +656,6 @@ impl Step for Cargo {
 pub struct LldWrapper {
     pub compiler: Compiler,
     pub target: TargetSelection,
-    pub flavor_feature: &'static str,
 }
 
 impl Step for LldWrapper {
@@ -676,7 +675,7 @@ impl Step for LldWrapper {
                 path: "src/tools/lld-wrapper",
                 is_optional_tool: false,
                 source_type: SourceType::InTree,
-                extra_features: vec![self.flavor_feature.to_owned()],
+                extra_features: Vec::new(),
             })
             .expect("expected to build -- essential tool");