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 5bf0141..eff5942 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -114,6 +114,11 @@
   // (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;