Skip to content

Commit

Permalink
Force usage of ld classic to workaround crash with ld prime
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Apr 28, 2024
1 parent 1e485f1 commit 5311644
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions build_system/build_sysroot.rs
Expand Up @@ -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
}

Expand Down
10 changes: 9 additions & 1 deletion build_system/main.rs
Expand Up @@ -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();
Expand All @@ -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"))
Expand Down

0 comments on commit 5311644

Please sign in to comment.