From: Peter Collingbourne Date: Sat, 5 Nov 2011 03:47:53 +0000 (+0000) Subject: On Linux, enable the gold plugin if we are using LTO. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79d481a08522ab031528c0047df565330c1cd562;p=clang On Linux, enable the gold plugin if we are using LTO. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143778 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index bfd73827b4..6e739f0a95 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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));