From 4a089ad86d5a0e189178b308c960b34b1e38df5f Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 5 Nov 2011 03:47:53 +0000 Subject: [PATCH] On Linux, enable the gold plugin if we are using LTO. llvm-svn: 143778 --- clang/lib/Driver/Tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index bfd73827b4ef..6e739f0a95be 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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));