@@ -759,6 +759,7 @@ impl Target {
759759 match & * self . arch {
760760 "x86" => {
761761 // We support 2 ABIs, hardfloat (default) and softfloat.
762+ // x86 has no sane ABI indicator so we have to use the target feature.
762763 if self . has_feature ( "soft-float" ) {
763764 NOTHING
764765 } else {
@@ -768,6 +769,7 @@ impl Target {
768769 }
769770 "x86_64" => {
770771 // We support 2 ABIs, hardfloat (default) and softfloat.
772+ // x86 has no sane ABI indicator so we have to use the target feature.
771773 if self . has_feature ( "soft-float" ) {
772774 NOTHING
773775 } else {
@@ -776,20 +778,20 @@ impl Target {
776778 }
777779 }
778780 "arm" => {
779- // We support 2 ABIs, hardfloat (default) and softfloat .
780- if self . has_feature ( " soft-float" ) {
781- NOTHING
782- } else {
783- // Hardfloat ABI. x87 must be enabled.
784- ( & [ "fpregs" ] , & [ ] )
781+ // It's unclear how the `abi` and the `soft-float` target feature interact .
782+ // We use the `abi` as our primary signal, and force ` soft-float` to match.
783+ match & * self . abi {
784+ "eabi" => ( & [ "soft-float" ] , & [ ] ) ,
785+ "eabihf" | "uwp" | "macabi" | "sim" | "" => ( & [ "fpregs" ] , & [ "soft-float" ] ) ,
786+ _ => unreachable ! ( ) ,
785787 }
786788 }
787789 "aarch64" | "arm64ec" => {
788790 match & * self . abi {
789791 "softfloat" => {
790792 // This is not fully correct, LLVM actually doesn't let us enforce the softfloat
791793 // ABI properly... see <https://github.com/rust-lang/rust/issues/134375>.
792- // FIXME: should be forbid "neon" here? But that would be a breaking change.
794+ // FIXME: should we forbid "neon" here? But that would be a breaking change.
793795 NOTHING
794796 }
795797 "uwp" | "llvm" | "macabi" | "sim" | "ilp32" | "" => {
0 commit comments