[PATCH] D58477: [Driver] Fix float ABI default for Android ARMv8.

Dan Albert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 20 14:14:28 PST 2019


danalbert created this revision.
danalbert added reviewers: srhines, pirama.
Herald added subscribers: kristof.beyls, javed.absar.
Herald added a project: clang.

Android doesn't regress back to soft float after ARMv7 :)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58477

Files:
  clang/lib/Driver/ToolChains/Arch/ARM.cpp
  clang/test/Driver/arm-float-abi.c


Index: clang/test/Driver/arm-float-abi.c
===================================================================
--- clang/test/Driver/arm-float-abi.c
+++ clang/test/Driver/arm-float-abi.c
@@ -4,3 +4,13 @@
 
 // ARMV7-ERROR: unsupported option '-mfloat-abi=hard' for target 'thumbv7'
 // NOERROR-NOT: unsupported option
+
+// RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-ARM7-ANDROID %s
+// CHECK-ARM7-ANDROID-NOT: "-target-feature" "+soft-float"
+// CHECK-ARM7-ANDROID: "-target-feature" "+soft-float-abi"
+
+// RUN: %clang -target armv8-linux-androideabi21 %s -### -c 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-ARM8-ANDROID %s
+// CHECK-ARM8-ANDROID-NOT: "-target-feature" "+soft-float"
+// CHECK-ARM8-ANDROID: "-target-feature" "+soft-float-abi"
Index: clang/lib/Driver/ToolChains/Arch/ARM.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -248,7 +248,7 @@
         ABI = FloatABI::SoftFP;
         break;
       case llvm::Triple::Android:
-        ABI = (SubArch == 7) ? FloatABI::SoftFP : FloatABI::Soft;
+        ABI = (SubArch >= 7) ? FloatABI::SoftFP : FloatABI::Soft;
         break;
       default:
         // Assume "soft", but warn the user we are guessing.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58477.187673.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190220/1b873e30/attachment.bin>


More information about the cfe-commits mailing list