From 2e47624c3ff93e177e0f336045aae88d3b528f78 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 5 Dec 2013 21:07:29 +0000 Subject: [PATCH] Pass down the target CPU to the system assembler for NetBSD/ARM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196532 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 6e33e8f923..8df2742e5f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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"); -- 2.40.0