diff --git a/.github/workflows/abi-cafe.yml b/.github/workflows/abi-cafe.yml index a745f280..36ed44f9 100644 --- a/.github/workflows/abi-cafe.yml +++ b/.github/workflows/abi-cafe.yml @@ -51,6 +51,10 @@ jobs: if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' run: rustup set default-host x86_64-pc-windows-gnu + - name: Select XCode version + if: matrix.os == 'macos-latest' + run: sudo xcode-select -s /Applications/Xcode_14.3.1.app + - name: Prepare dependencies run: ./y.sh prepare diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14aa850f..4ab50ab7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,6 +104,10 @@ jobs: sudo apt-get update sudo apt-get install -y ${{ matrix.apt_deps }} + - name: Select XCode version + if: matrix.os == 'macos-latest' + run: sudo xcode-select -s /Applications/Xcode_14.3.1.app + - name: Prepare dependencies run: ./y.sh prepare @@ -236,6 +240,10 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-mingw-w64-x86-64 + - name: Select XCode version + if: matrix.os == 'macos-latest' + run: sudo xcode-select -s /Applications/Xcode_14.3.1.app + - name: Prepare dependencies run: ./y.sh prepare diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs index 10c3f9cf..062fe6a6 100644 --- a/build_system/build_sysroot.rs +++ b/build_system/build_sysroot.rs @@ -137,6 +137,14 @@ pub(crate) fn build_sysroot( if !is_native { target_compiler.set_cross_linker_and_runner(); } + match target_compiler.triple.as_str() { + "x86_64-apple-darwin" => { + // HACK: Force usage of ld classic to workaround crash with ld prime + target_compiler.rustflags.push("-Clink-arg=-ld_classic".to_owned()); + target_compiler.rustdocflags.push("-Clink-arg=-ld_classic".to_owned()); + } + _ => {} + } target_compiler } diff --git a/build_system/main.rs b/build_system/main.rs index cdd2bae0..19af7248 100644 --- a/build_system/main.rs +++ b/build_system/main.rs @@ -153,7 +153,7 @@ fn main() { process::exit(1); } }; - let bootstrap_host_compiler = { + let mut bootstrap_host_compiler = { let cargo = rustc_info::get_cargo_path(); let rustc = rustc_info::get_rustc_path(); let rustdoc = rustc_info::get_rustdoc_path(); @@ -171,6 +171,14 @@ fn main() { runner: vec![], } }; + match bootstrap_host_compiler.triple.as_str() { + "x86_64-apple-darwin" => { + // HACK: Force usage of ld classic to workaround crash with ld prime + bootstrap_host_compiler.rustflags.push("-Clink-arg=-ld_classic".to_owned()); + bootstrap_host_compiler.rustdocflags.push("-Clink-arg=-ld_classic".to_owned()); + } + _ => {} + } let target_triple = std::env::var("TARGET_TRIPLE") .ok() .or_else(|| config::get_value("target"))