From 3ec9ae83a9d65e1484fe33fe3a80bb3aa8c79738 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 10 Apr 2015 23:07:19 +0000 Subject: [PATCH] NaCl ARM: fix assembler float abi flags 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 | 3 ++- test/Driver/nacl-direct.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 9ebf681aab..012e69b7dc 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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); diff --git a/test/Driver/nacl-direct.c b/test/Driver/nacl-direct.c index f5d34d3626..9768eab24d 100644 --- a/test/Driver/nacl-direct.c +++ b/test/Driver/nacl-direct.c @@ -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++ -- 2.40.0