diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-03-20 09:46:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-20 09:46:51 +0100 |
| commit | 96d5dd6fca93322babc1caa531aa789f4e82ecf6 (patch) | |
| tree | 30cdc005fdbe24e4425748c5e802ccf91a1848c2 | |
| parent | e91364bcf5100017a8bd5b18cdebefdd3e5f0bb1 (diff) | |
| parent | d10b113b355a49aa2bb1552e96c48b19b7846c27 (diff) | |
| download | rust-96d5dd6fca93322babc1caa531aa789f4e82ecf6.tar.gz rust-96d5dd6fca93322babc1caa531aa789f4e82ecf6.zip | |
Rollup merge of #109170 - eggyal:xc-linux-cmake, r=Mark-Simulacrum
Set `CMAKE_SYSTEM_NAME` for Linux targets When bootstrap compiles native dependencies like LLVM, it should set `CMAKE_SYSTEM_NAME` for the target system; otherwise cmake may not identify that it is cross-compiling. In particular, when building a Linux rustc on a macOS host, cmake was including `-isysroot /path/to/macOS.sdk` options that caused things to break. By setting `CMAKE_SYSTEM_NAME=Linux` when building for Linux targets, the macOS SDK is no longer passed as sysroot to the compiler. r? bootstrap
| -rw-r--r-- | src/bootstrap/native.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 41ee5096553..dff46b500e3 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -567,6 +567,8 @@ fn configure_cmake( cfg.define("CMAKE_SYSTEM_NAME", "Haiku"); } else if target.contains("solaris") || target.contains("illumos") { cfg.define("CMAKE_SYSTEM_NAME", "SunOS"); + } else if target.contains("linux") { + cfg.define("CMAKE_SYSTEM_NAME", "Linux"); } // When cross-compiling we should also set CMAKE_SYSTEM_VERSION, but in // that case like CMake we cannot easily determine system version either. |
