]> granicus.if.org Git - clang/commitdiff
NaCl ARM: fix assembler float abi flags
authorDerek Schuff <dschuff@google.com>
Fri, 10 Apr 2015 23:07:19 +0000 (23:07 +0000)
committerDerek Schuff <dschuff@google.com>
Fri, 10 Apr 2015 23:07:19 +0000 (23:07 +0000)
Summary:
tools::arm::getARMFloatABI() was falling back to guessing soft-float because
it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple
when it was called from gnutools::Assemble::ConstructJob.

Fix by using the effective clang triple in gnutools::Assemble, which now
matches the -triple flag used by cc1 and ClangAs jobs.

Reviewers: jvoung

Subscribers: rengolin, jfb, aemerson, cfe-commits

Differential Revision: http://reviews.llvm.org/D8902

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

lib/Driver/Tools.cpp
test/Driver/nacl-direct.c

index 9ebf681aabde39324c80bfb15808928b0a722d49..012e69b7dcaab94afbb49b5045422c90858ac685 100644 (file)
@@ -7414,7 +7414,8 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
     }
 
     StringRef ARMFloatABI = tools::arm::getARMFloatABI(
-        getToolChain().getDriver(), Args, Triple);
+        getToolChain().getDriver(), Args,
+        llvm::Triple(getToolChain().ComputeEffectiveClangTriple(Args)));
     CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=" + ARMFloatABI));
 
     Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
index f5d34d36260086c47f3d2023c693f3668abe8044..9768eab24dce4cbf86c084ca8ed7d3be20c6bccb 100644 (file)
@@ -54,6 +54,7 @@
 // CHECK-ARM: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}arm-nacl{{/|\\\\}}usr{{/|\\\\}}include"
 // CHECK-ARM: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}arm-nacl{{/|\\\\}}include"
 // CHECK-ARM: as{{(.exe)?}}"
+// CHECK-ARM: "-mfloat-abi=hard"
 // CHECK-ARM: ld{{(.exe)?}}"
 // CHECK-ARM: "--build-id"
 // CHECK-ARM: "-m" "armelf_nacl"
@@ -71,6 +72,8 @@
 // CHECK-ARM-NOV7: "-triple" "armv7--nacl-gnueabihf"
 // CHECK-ARM-NOV7: "-target-abi" "aapcs-linux"
 // CHECK-ARM-NOV7: "-mfloat-abi" "hard"
+// CHECK-ARM-NOV7: as{{(.exe)?}}"
+// CHECK-ARM-NOV7: "-mfloat-abi=hard"
 
 // Test clang c++ include dirs and link line when using clang++