]> granicus.if.org Git - clang/commitdiff
On Linux, enable the gold plugin if we are using LTO.
authorPeter Collingbourne <peter@pcc.me.uk>
Sat, 5 Nov 2011 03:47:53 +0000 (03:47 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 5 Nov 2011 03:47:53 +0000 (03:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index bfd73827b4ef2a03c3021fca2cc2f58b9e295225..6e739f0a95bee0a5deba391024bb53b12e0ba377 100644 (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));