]> granicus.if.org Git - clang/commitdiff
MachO embedded: default to soft float without issuing warning
authorTim Northover <tnorthover@apple.com>
Thu, 23 Jan 2014 15:00:01 +0000 (15:00 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 23 Jan 2014 15:00:01 +0000 (15:00 +0000)
This is a simpler rule, broadly in line with previous Darwin (which chose
between "soft" and "softfp") but probably safer. In practice the only real
reason for "softfp" is ABI compatibility, not usually an issue on limited chips
like these, so anyone who wanted hard-float should already be saying so.

That's my story and I'm sticking to it.

rdar://problem/15887493

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199896 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/darwin-embedded.c

index acb87a9414882b10df19021aa24ed833c4915f7c..a3a385d1cf13fef3dee8c4855607cf2d6a669dea 100644 (file)
@@ -662,6 +662,10 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args,
         // EABI is always AAPCS, and if it was not marked 'hard', it's softfp
         FloatABI = "softfp";
         break;
+      case llvm::Triple::MachO: {
+        FloatABI = "soft";
+        break;
+      }
       case llvm::Triple::Android: {
         std::string ArchName =
           arm::getLLVMArchSuffixForARM(arm::getARMTargetCPU(Args, Triple));
index 5f545d535f25a91bbd21f4b92cd1db806c8eab3c..66b7bd9fa7fbd551d3c1fc67440efdbe7e605993 100644 (file)
 // RUN: FileCheck %s < %t
 
 // ARMv6m has no float
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "soft"
 // CHECK: libclang_rt.soft_static.a
 
 // ARMv7em does, but defaults to soft
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "soft"
 // CHECK: libclang_rt.soft_static.a
 
 // Which can be overridden
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "hard"
 // CHECK: libclang_rt.hard_static.a
 
 // ARMv7m has no float either
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "soft"
 // CHECK: libclang_rt.soft_pic.a
 
 // But it can be enabled on ARMv7em
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "hard"
 // CHECK: libclang_rt.hard_pic.a
 
 // "softfp" must link against a soft-float library since that's what the
 // callers we're compiling will expect.
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "soft"
 // CHECK: libclang_rt.soft_pic.a
 
 // -arch "armv7" (== embedded v7a) can be used in a couple of variants:
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "hard"
 // CHECK: libclang_rt.hard_static.a
+
+// CHECK-LABEL: Target:
+// CHECK-NOT: warning: unknown platform
+// CHECK: "-mfloat-abi" "soft"
 // CHECK: libclang_rt.soft_pic.a