Skip to content

Commit c51b229

Browse files
committedMar 1, 2025·
Disable f16 on Aarch64 without neon
LLVM has crashes at some `half` operations when built with assertions enabled if fp-armv8 is not available [1]. Things seem to usually work, but we are reaching LLVM undefined behavior so this needs to be disabled. [1]: llvm/llvm-project#129394
1 parent 8c39296 commit c51b229

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎library/std/build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ fn main() {
1212
.expect("CARGO_CFG_TARGET_POINTER_WIDTH was not set")
1313
.parse()
1414
.unwrap();
15+
let target_features: Vec<_> = env::var("CARGO_CFG_TARGET_FEATURE")
16+
.unwrap_or_default()
17+
.split(",")
18+
.map(ToOwned::to_owned)
19+
.collect();
1520
let is_miri = env::var_os("CARGO_CFG_MIRI").is_some();
1621

1722
println!("cargo:rustc-check-cfg=cfg(netbsd10)");
@@ -101,6 +106,8 @@ fn main() {
101106
("s390x", _) => false,
102107
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
103108
("arm64ec", _) => false,
109+
// LLVM crash <https://github.com/llvm/llvm-project/issues/129394>
110+
("aarch64", _) if !target_features.iter().any(|f| f == "neon") => false,
104111
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
105112
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
106113
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>

0 commit comments

Comments
 (0)