about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJakub Beránek <jakub.beranek@vsb.cz>2025-01-01 18:49:07 +0100
committerJakub Beránek <jakub.beranek@vsb.cz>2025-01-01 18:49:07 +0100
commitab5446c9923090d5ebe33aeea559d9c9fa05a1ad (patch)
treeedf2fb3142efee8492248c666e7d56728b5f8d1a /src
parenteeeff9a66cda13934600800eee40fd84ba1647eb (diff)
Actually use self-contained lld in bootstrap when `use-lld = "self-contained"` is used
Before, we just used the global `lld` anyway.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/utils/helpers.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs
index 923cc2dfc28..5ef8ea52084 100644
--- a/src/bootstrap/src/utils/helpers.rs
+++ b/src/bootstrap/src/utils/helpers.rs
@@ -475,7 +475,20 @@ pub fn linker_flags(
 ) -> Vec<String> {
     let mut args = vec![];
     if !builder.is_lld_direct_linker(target) && builder.config.lld_mode.is_used() {
-        args.push(String::from("-Clink-arg=-fuse-ld=lld"));
+        match builder.config.lld_mode {
+            LldMode::External => {
+                args.push("-Clinker-flavor=gnu-lld-cc".to_string());
+                // FIXME(kobzol): remove this flag once MCP510 gets stabilized
+                args.push("-Zunstable-options".to_string());
+            }
+            LldMode::SelfContained => {
+                args.push("-Clinker-flavor=gnu-lld-cc".to_string());
+                args.push("-Clink-self-contained=+linker".to_string());
+                // FIXME(kobzol): remove this flag once MCP510 gets stabilized
+                args.push("-Zunstable-options".to_string());
+            }
+            LldMode::Unused => unreachable!(),
+        };
 
         if matches!(lld_threads, LldThreads::No) {
             args.push(format!(