Fix compilation for AArch64

This commit is contained in:
bjorn3 2021-06-29 20:37:06 +02:00
parent 1bd9a132f6
commit cda811173e
2 changed files with 24 additions and 7 deletions

View file

@ -287,10 +287,12 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Box<dyn isa::Tar
}
None => {
let mut builder =
cranelift_codegen::isa::lookup_variant(target_triple, variant).unwrap();
// Don't use "haswell" as the default, as it implies `has_lzcnt`.
// macOS CI is still at Ivy Bridge EP, so `lzcnt` is interpreted as `bsr`.
builder.enable("nehalem").unwrap();
cranelift_codegen::isa::lookup_variant(target_triple.clone(), variant).unwrap();
if target_triple.architecture == target_lexicon::Architecture::X86_64 {
// Don't use "haswell" as the default, as it implies `has_lzcnt`.
// macOS CI is still at Ivy Bridge EP, so `lzcnt` is interpreted as `bsr`.
builder.enable("nehalem").unwrap();
}
builder
}
};