]> granicus.if.org Git - clang/commitdiff
Pass down the target CPU to the system assembler for NetBSD/ARM.
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 5 Dec 2013 21:07:29 +0000 (21:07 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 5 Dec 2013 21:07:29 +0000 (21:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196532 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 6e33e8f923a62931852c29a177d58d96ba60c7b1..8df2742e5f4c51fb0bf9924fbeaa12539053a122 100644 (file)
@@ -5975,6 +5975,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");