about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic+github@gmail.com>2023-09-27 20:21:14 +0000
committerRémy Rakic <remy.rakic+github@gmail.com>2024-05-16 16:08:06 +0000
commit28ce76eba429603624455e13f52a0dca8147ae8e (patch)
treeb0104e455372ccf240d954b9e06ee63fb24e9666
parent4a78c00e227124ff9d5ece2d493472e7325c87d3 (diff)
bootstrap: introduce rust-lld env var for rustc
This is used to notify we want to use rust-lld as the default linker in
a target.
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 48a6602e2df..66692a2a2cb 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1136,6 +1136,11 @@ pub fn rustc_cargo_env(
         cargo.env("CFG_DEFAULT_LINKER", s);
     }
 
+    // Enable rustc's env var for `rust-lld` when requested.
+    if builder.config.lld_enabled {
+        cargo.env("CFG_USE_SELF_CONTAINED_LINKER", "1");
+    }
+
     if builder.config.rust_verify_llvm_ir {
         cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
     }