From e8704e899cc72e8a04e0235e2ad7c7375d0c0633 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 24 Mar 2025 22:42:23 +0100 Subject: 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. --- src/bootstrap/src/core/build_steps/llvm.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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") { -- cgit 1.4.1-3-g733a5