From: Rafael Espindola Date: Wed, 1 Jun 2011 21:37:00 +0000 (+0000) Subject: Add the necessary -L option for finding libprofile_rt.a. It might be a good X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=446b8472c77b71b3aa7fed2158b62fde171c2922;p=clang Add the necessary -L option for finding libprofile_rt.a. It might be a good idea at some point to split out the directories where we install our runtime libraries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132425 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 5bf014150d..eff5942599 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -114,6 +114,11 @@ static void AddLinkerInputs(const ToolChain &TC, // (constructed via -Xarch_). Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input); + // Add our corresponding lib directory. This is necessary for finding libprofile_rt.a + // for example. This matches gcc's behaviour that adds + // -L/gcc/lib/gcc// to the link line. + CmdArgs.push_back(Args.MakeArgString("-L" + TC.getDriver().Dir + "/../lib")); + for (InputInfoList::const_iterator it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { const InputInfo &II = *it;