r354622 - [Driver] Fix float ABI default for Android ARMv8.

Dan Albert via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 21 13:13:04 PST 2019


Author: danalbert
Date: Thu Feb 21 13:13:03 2019
New Revision: 354622

URL: http://llvm.org/viewvc/llvm-project?rev=354622&view=rev
Log:
[Driver] Fix float ABI default for Android ARMv8.

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

Reviewers: srhines, pirama

Reviewed By: srhines, pirama

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58477

Modified:
    cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
    cfe/trunk/test/Driver/arm-float-abi.c

Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=354622&r1=354621&r2=354622&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Thu Feb 21 13:13:03 2019
@@ -248,7 +248,7 @@ arm::FloatABI arm::getARMFloatABI(const
         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.

Modified: cfe/trunk/test/Driver/arm-float-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-float-abi.c?rev=354622&r1=354621&r2=354622&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arm-float-abi.c (original)
+++ cfe/trunk/test/Driver/arm-float-abi.c Thu Feb 21 13:13:03 2019
@@ -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"




More information about the cfe-commits mailing list