Skip to content

Commit a7c7f22

Browse files
authored
Unrolled build for #143125
Rollup merge of #143125 - tgross35:aarch64-neon-llvm19-f16, r=cuviper Disable f16 on Aarch64 without neon for llvm < 20.1.1 This check was added unconditionally in c51b229 ("Disable f16 on Aarch64 without `neon`") and reverted in 4a8d357 ("Revert "Disable `f16` on Aarch64 without `neon`"") since it did not fail in Rust's build. However, it is still possible to hit this crash if using LLVM 19 built with assertions, so disable the type conditionally based on version here. Note that for these builds, a similar patch is needed in the build script for `compiler-builtins` since it does not yet use `cfg(target_has_reliable_f16)` (hopefully to be resolved in the near future). Report: #139276 (comment) Original LLVM issue: llvm/llvm-project#129394
2 parents 6988a8f + 4fd37c7 commit a7c7f22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,18 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
370370
let target_env = sess.target.options.env.as_ref();
371371
let target_abi = sess.target.options.abi.as_ref();
372372
let target_pointer_width = sess.target.pointer_width;
373+
let version = get_version();
373374

374375
cfg.has_reliable_f16 = match (target_arch, target_os) {
375376
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
376377
("s390x", _) => false,
378+
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (now fixed)
379+
("aarch64", _)
380+
if !cfg.target_features.iter().any(|f| f.as_str() == "neon")
381+
&& version < (20, 1, 1) =>
382+
{
383+
false
384+
}
377385
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
378386
("arm64ec", _) => false,
379387
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>

0 commit comments

Comments
 (0)