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");