const char *LinkingOutput) const {
claimNoWarnArgs(Args);
ArgStringList CmdArgs;
- bool NeedsKPIC = false;
switch (getToolChain().getArch()) {
case llvm::Triple::x86:
break;
case llvm::Triple::sparc:
- case llvm::Triple::sparcel:
+ case llvm::Triple::sparcel: {
CmdArgs.push_back("-32");
- NeedsKPIC = true;
+ std::string CPU = getCPUName(Args, getToolChain().getTriple());
+ CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
+ }
- case llvm::Triple::sparcv9:
+ case llvm::Triple::sparcv9: {
CmdArgs.push_back("-64");
- CmdArgs.push_back("-Av9a");
- NeedsKPIC = true;
+ std::string CPU = getCPUName(Args, getToolChain().getTriple());
+ CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
+ }
case llvm::Triple::mips64:
case llvm::Triple::mips64el: {
else
CmdArgs.push_back("-EL");
- NeedsKPIC = true;
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
}
break;
}
- if (NeedsKPIC)
- AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
-
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
CmdArgs.push_back("-o");
}
case llvm::Triple::sparc:
case llvm::Triple::sparcel:
- case llvm::Triple::sparcv9:
- if (getToolChain().getArch() == llvm::Triple::sparc)
- CmdArgs.push_back("-Av8plusa");
- else
- CmdArgs.push_back("-Av9a");
-
+ case llvm::Triple::sparcv9: {
+ std::string CPU = getCPUName(Args, getToolChain().getTriple());
+ CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
}
+ }
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
llvm::Triple Triple = llvm::Triple(TripleStr);
ArgStringList CmdArgs;
- bool NeedsKPIC = false;
llvm::Reloc::Model RelocationModel;
unsigned PICLevel;
CmdArgs.push_back("-mlittle-endian");
break;
case llvm::Triple::sparc:
- case llvm::Triple::sparcel:
+ case llvm::Triple::sparcel: {
CmdArgs.push_back("-32");
- CmdArgs.push_back("-Av8plusa");
- NeedsKPIC = true;
+ std::string CPU = getCPUName(Args, getToolChain().getTriple());
+ CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
- case llvm::Triple::sparcv9:
+ }
+ case llvm::Triple::sparcv9: {
CmdArgs.push_back("-64");
- CmdArgs.push_back("-Av9a");
- NeedsKPIC = true;
+ std::string CPU = getCPUName(Args, getToolChain().getTriple());
+ CmdArgs.push_back(getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
+ }
case llvm::Triple::arm:
case llvm::Triple::armeb:
case llvm::Triple::thumb:
Args.AddLastArg(CmdArgs, options::OPT_modd_spreg,
options::OPT_mno_odd_spreg);
- NeedsKPIC = true;
+ AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
}
case llvm::Triple::systemz: {
}
}
- if (NeedsKPIC) {
- if (RelocationModel != llvm::Reloc::Static)
- CmdArgs.push_back("-KPIC");
- }
-
Args.AddAllArgs(CmdArgs, options::OPT_I);
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);