diff options
| author | Kajetan Puchalski <kajetan.puchalski@arm.com> | 2024-07-29 13:08:31 +0100 |
|---|---|---|
| committer | Kajetan Puchalski <kajetan.puchalski@arm.com> | 2024-08-27 11:11:47 +0100 |
| commit | 4fc4019cbc6f88350dd0faee1aa658f9508e293e (patch) | |
| tree | dcd595b7dee50997fb96884bba287d01b172e4fc /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | c3518067c74c2f875b3941beb601160175e1a698 (diff) | |
| download | rust-4fc4019cbc6f88350dd0faee1aa658f9508e293e.tar.gz rust-4fc4019cbc6f88350dd0faee1aa658f9508e293e.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/attributes.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs index 317e970d704..33bdfd3825c 100644 --- a/compiler/rustc_codegen_llvm/src/attributes.rs +++ b/compiler/rustc_codegen_llvm/src/attributes.rs @@ -528,6 +528,12 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>( InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(), InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(), })) + // HACK: LLVM versions 19+ do not have the FPMR feature and treat it as always enabled + // It only exists as a feature in LLVM 18, cannot be passed down for any other version + .chain(match &*cx.tcx.sess.target.arch { + "aarch64" if llvm_util::get_version().0 == 18 => vec!["+fpmr".to_string()], + _ => vec![], + }) .collect::<Vec<String>>(); if cx.tcx.sess.target.is_like_wasm { |
