about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2025-03-24 22:42:23 +0100
committerMads Marquart <mads@marquart.dk>2025-03-28 04:15:41 +0100
commite8704e899cc72e8a04e0235e2ad7c7375d0c0633 (patch)
tree0c688dd6b896fa445b5fb2f582afba2210cc88c4
parenta9cb15d793495b6b6318c7a60c42d12ddcf1609a (diff)
downloadrust-e8704e899cc72e8a04e0235e2ad7c7375d0c0633.tar.gz
rust-e8704e899cc72e8a04e0235e2ad7c7375d0c0633.zip
bootstrap: Set CMAKE_SYSTEM_NAME=Darwin on Apple platforms
compiler-rt's CMake setup seems to have special logic for Apple
platforms that works poorly when this is not set.
-rw-r--r--src/bootstrap/src/core/build_steps/llvm.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index 41d3ca2c4cd..de91b5d1eb5 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -697,6 +697,14 @@ fn configure_cmake(
         // reported, the system version is currently left unset.
 
         if target.contains("apple") {
+            if !target.contains("darwin") {
+                // FIXME(madsmtm): compiler-rt's CMake setup is kinda weird, it seems like they do
+                // version testing etc. for macOS (i.e. Darwin), even while building for iOS?
+                //
+                // So for now we set it to "Darwin" on all Apple platforms.
+                cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
+            }
+
             // Make sure that CMake does not build universal binaries on macOS.
             // Explicitly specify the one single target architecture.
             if target.starts_with("aarch64") {