about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2025-01-20 16:44:24 -0500
committerjyn <github@jyn.dev>2025-01-24 10:30:47 -0500
commit7407c1268334a01142d1770dd5080ffeaa8eaa1a (patch)
tree6382a029a5f08514aaa30a39ae164e07afe218d8
parent0ff369c5a6359a586638254594cad328f8ce25d5 (diff)
downloadrust-7407c1268334a01142d1770dd5080ffeaa8eaa1a.tar.gz
rust-7407c1268334a01142d1770dd5080ffeaa8eaa1a.zip
Ignore linker warnings on macOS for ui-fulldeps
ld is showing things like this:
```
ld: ignoring duplicate libraries: '-lm'
```

I don't have time or a macbook that lets me investigate these. Just silence them for now.
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 38e056cbc14..95fbf76b79b 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -1862,12 +1862,19 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
         let mut hostflags = flags.clone();
         hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
         hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No));
-        for flag in hostflags {
-            cmd.arg("--host-rustcflags").arg(flag);
-        }
 
         let mut targetflags = flags;
         targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
+
+        // FIXME: on macOS, we get linker warnings about duplicate `-lm` flags. We should investigate why this happens.
+        if suite == "ui-fulldeps" && target.ends_with("darwin") {
+            hostflags.push("-Alinker_messages".into());
+            targetflags.push("-Alinker_messages".into());
+        }
+
+        for flag in hostflags {
+            cmd.arg("--host-rustcflags").arg(flag);
+        }
         for flag in targetflags {
             cmd.arg("--target-rustcflags").arg(flag);
         }