Skip to content

Commit bf61974

Browse files
committed
rustc_target: Remove fpmr target feature
FEAT_FPMR has been removed from upstream LLVM as of LLVM 19. Remove the feature from the target features list and temporarily hack the LLVM codegen to always enable it until the minimum LLVM version is bumped to 19.
1 parent 8be8db5 commit bf61974

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

+6
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,12 @@ pub fn llfn_attrs_from_instance<'ll, 'tcx>(
528528
InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(),
529529
InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(),
530530
}))
531+
// HACK: LLVM versions 19+ do not have the FPMR feature and treat it as always enabled
532+
// It only exists as a feature in LLVM 18, cannot be passed down for any other version
533+
.chain(match &*cx.tcx.sess.target.arch {
534+
"aarch64" if llvm_util::get_version().0 == 18 => vec!["+fpmr".to_string()],
535+
_ => vec![],
536+
})
531537
.collect::<Vec<String>>();
532538

533539
if cx.tcx.sess.target.is_like_wasm {

0 commit comments

Comments
 (0)