r198311 - In the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky
rdivacky at freebsd.org
Thu Jan 2 07:13:19 PST 2014
Author: rdivacky
Date: Thu Jan 2 09:13:18 2014
New Revision: 198311
URL: http://llvm.org/viewvc/llvm-project?rev=198311&view=rev
Log:
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=198311&r1=198310&r2=198311&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jan 2 09:13:18 2014
@@ -5850,6 +5850,19 @@ void freebsd::Assemble::ConstructJob(Com
default:
CmdArgs.push_back("-matpcs");
}
+ } else if (getToolChain().getArch() == llvm::Triple::sparc ||
+ getToolChain().getArch() == llvm::Triple::sparcv9) {
+ Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC,
+ options::OPT_fpic, options::OPT_fno_pic,
+ options::OPT_fPIE, options::OPT_fno_PIE,
+ options::OPT_fpie, options::OPT_fno_pie);
+ if (LastPICArg &&
+ (LastPICArg->getOption().matches(options::OPT_fPIC) ||
+ LastPICArg->getOption().matches(options::OPT_fpic) ||
+ LastPICArg->getOption().matches(options::OPT_fPIE) ||
+ LastPICArg->getOption().matches(options::OPT_fpie))) {
+ CmdArgs.push_back("-KPIC");
+ }
}
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
More information about the cfe-commits
mailing list