From 341d9b41d4938cb71d117aeda94c319e9f664b9f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 1 Jun 2011 21:37:00 +0000 Subject: 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. llvm-svn: 132425 --- clang/lib/Driver/Tools.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5bf014150d4..eff59425990 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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; -- cgit v1.2.3