segfault codemodel workaround

This commit is contained in:
Anton-4 2023-07-11 16:18:22 +02:00
parent 03af6749ed
commit b92bc4922e
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937

View file

@ -149,13 +149,20 @@ pub fn target_machine(
init_arch(target); init_arch(target);
// workaround for issue:
#[cfg(all(target_arch = "aarch64", target_os = "macos"))]
let code_model = CodeModel::Large;
#[cfg(not(all(target_arch = "aarch64", target_os = "macos")))]
let code_model = CodeModel::Default;
Target::from_name(arch).unwrap().create_target_machine( Target::from_name(arch).unwrap().create_target_machine(
&TargetTriple::create(target_triple_str(target)), &TargetTriple::create(target_triple_str(target)),
"generic", "generic",
"", "",
opt, opt,
reloc, reloc,
CodeModel::Default, code_model,
) )
} }