On Linux, enable the gold plugin if we are using LTO.

llvm-svn: 143778
This commit is contained in:
Peter Collingbourne 2011-11-05 03:47:53 +00:00
parent 62c219809c
commit 4a089ad86d
1 changed files with 1 additions and 1 deletions

View File

@ -4462,7 +4462,7 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
addProfileRT(getToolChain(), Args, CmdArgs, getToolChain().getTriple());
if (Args.hasArg(options::OPT_use_gold_plugin)) {
if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
CmdArgs.push_back("-plugin");
std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
CmdArgs.push_back(Args.MakeArgString(Plugin));