]> granicus.if.org Git - clang/commitdiff
We were looking at /usr/lib only if the distro had multilib. This is bogus:
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2011 15:39:42 +0000 (15:39 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2011 15:39:42 +0000 (15:39 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132551 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 87703ddffc688b0ffc21625cf01597a4ee64705c..4953d4b3eef6798d66634213d72bba306c3e0287 100644 (file)
@@ -1521,9 +1521,14 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
     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))