]> granicus.if.org Git - clang/commitdiff
Add the necessary -L option for finding libprofile_rt.a. It might be a good
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 1 Jun 2011 21:37:00 +0000 (21:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 1 Jun 2011 21:37:00 +0000 (21:37 +0000)
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

lib/Driver/Tools.cpp

index 5bf014150d412572d0c682b4087bfe56502b534a..eff5942599082457860bb42d9a76ecfd00db7c01 100644 (file)
@@ -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<inst>/gcc/lib/gcc/<triple>/<ver> 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;