[cfe-commits] r132551 - /cfe/trunk/lib/Driver/ToolChains.cpp

Rafael Espindola rafael.espindola at gmail.com
Fri Jun 3 08:39:42 PDT 2011


Author: rafael
Date: Fri Jun  3 10:39:42 2011
New Revision: 132551

URL: http://llvm.org/viewvc/llvm-project?rev=132551&view=rev
Log:
We were looking at /usr/lib only if the distro had multilib. This is bogus:
we look in /usr/lib to find crt1.o, and that depends only on where libc
is installed.

This fixes the case of using a different gcc installation in a distro
without multilib.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=132551&r1=132550&r2=132551&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jun  3 10:39:42 2011
@@ -1521,9 +1521,14 @@
     if (IsOpenSuse(Distro) && Is32Bits)
       Paths.push_back(Base + "/../../../../" + GccTriple + "/lib/../lib");
     Paths.push_back(Base + "/../../../../" + Lib);
-    Paths.push_back("/lib/../" + Lib);
-    Paths.push_back("/usr/lib/../" + Lib);
   }
+
+  // FIXME: This is in here to find crt1.o. It is provided by libc, and
+  // libc (like gcc), can be installed in any directory. Once we are
+  // fetching this from a config file, we should have a libc prefix.
+  Paths.push_back("/lib/../" + Lib);
+  Paths.push_back("/usr/lib/../" + Lib);
+
   if (!Suffix.empty())
     Paths.push_back(Base);
   if (IsOpenSuse(Distro))





More information about the cfe-commits mailing list