Skip to content

Commit c79f701

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 9a69447 commit c79f701

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

+6
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ pub fn from_fn_attrs<'ll, 'tcx>(
502502
InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(),
503503
InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(),
504504
}))
505+
// HACK: LLVM versions 19+ do not have the FPMR feature and treat it as always enabled
506+
// It only exists as a feature in LLVM 18, cannot be passed down for any other version
507+
.chain(match &*cx.tcx.sess.target.arch {
508+
"aarch64" if llvm_util::get_version().0 == 18 => vec!["+fpmr".to_string()],
509+
_ => vec![],
510+
})
505511
.collect::<Vec<String>>();
506512

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

compiler/rustc_target/src/target_features.rs

-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Stability)] = &[
132132
("fp8dot4", Unstable(sym::aarch64_unstable_target_feature)),
133133
// FEAT_FP8FMA
134134
("fp8fma", Unstable(sym::aarch64_unstable_target_feature)),
135-
// FEAT_FPMR
136-
("fpmr", Unstable(sym::aarch64_unstable_target_feature)),
137135
// FEAT_FRINTTS
138136
("frintts", Stable),
139137
// FEAT_HBC

0 commit comments

Comments
 (0)