]> granicus.if.org Git - clang/commitdiff
Merging r196532:
authorBill Wendling <isanbard@gmail.com>
Fri, 6 Dec 2013 19:12:36 +0000 (19:12 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 6 Dec 2013 19:12:36 +0000 (19:12 +0000)
------------------------------------------------------------------------
r196532 | joerg | 2013-12-05 13:07:29 -0800 (Thu, 05 Dec 2013) | 2 lines

Pass down the target CPU to the system assembler for NetBSD/ARM.

------------------------------------------------------------------------

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

lib/Driver/Tools.cpp

index b92b25eadb33e04e8ac054e20d4c0d897463e910..09a969d6a9e3b017c098d14bd71c55bd19a899ff 100644 (file)
@@ -5967,6 +5967,13 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
   if (getToolChain().getArch() == llvm::Triple::x86)
     CmdArgs.push_back("--32");
 
+  // Pass the target CPU to GNU as for ARM, since the source code might
+  // not have the correct .cpu annotation.
+  if (getToolChain().getArch() == llvm::Triple::arm) {
+    std::string MArch(getARMTargetCPU(Args, getToolChain().getTriple()));
+    CmdArgs.push_back(Args.MakeArgString("-mcpu=" + MArch));
+  }
+
   // Set byte order explicitly
   if (getToolChain().getArch() == llvm::Triple::mips)
     CmdArgs.push_back("-EB");