Statically enable a couple of target features always enabled on arm64 macOS
Ring fails to compile when they are not statically enabled when compiling for macOS. Fixes rust-lang/rustc_codegen_cranelift#1522
This commit is contained in:
parent
68b99fcb91
commit
f340c81caa
1 changed files with 14 additions and 3 deletions
15
src/lib.rs
15
src/lib.rs
|
@ -191,9 +191,20 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||
if sess.target.arch == "x86_64" && sess.target.os != "none" {
|
||||
// x86_64 mandates SSE2 support
|
||||
vec![Symbol::intern("fxsr"), sym::sse, Symbol::intern("sse2")]
|
||||
} else if sess.target.arch == "aarch64" && sess.target.os != "none" {
|
||||
} else if sess.target.arch == "aarch64" {
|
||||
match &*sess.target.os {
|
||||
"none" => vec![],
|
||||
// On macOS the aes, sha2 and sha3 features are enabled by default and ring
|
||||
// fails to compile on macOS when they are not present.
|
||||
"macos" => vec![
|
||||
sym::neon,
|
||||
Symbol::intern("aes"),
|
||||
Symbol::intern("sha2"),
|
||||
Symbol::intern("sha3"),
|
||||
],
|
||||
// AArch64 mandates Neon support
|
||||
vec![sym::neon]
|
||||
_ => vec![sym::neon],
|
||||
}
|
||||
} else {
|
||||
vec![]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue