[cfe-commits] r139941 - /cfe/trunk/lib/Driver/ToolChains.cpp
Eli Friedman
eli.friedman at gmail.com
Fri Sep 16 14:04:38 PDT 2011
Author: efriedma
Date: Fri Sep 16 16:04:38 2011
New Revision: 139941
URL: http://llvm.org/viewvc/llvm-project?rev=139941&view=rev
Log:
Fix search paths for Ubuntu 11.04 x86. Patch by Stepan Dyatkovskiy.
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=139941&r1=139940&r2=139941&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Sep 16 16:04:38 2011
@@ -1513,6 +1513,14 @@
std::string t3 = "/usr/lib/" + GccTriple + "/gcc/" + Suffix;
if (!llvm::sys::fs::exists(t3 + "/crtbegin.o", Exists) && Exists)
return t3;
+ if (GccTriple == "i386-linux-gnu") {
+ // Ubuntu 11.04 uses an unusual path.
+ std::string t4 =
+ std::string("/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/") +
+ GccVersions[i];
+ if (!llvm::sys::fs::exists(t4 + "/crtbegin.o", Exists) && Exists)
+ return t4;
+ }
}
return "";
}
@@ -1578,6 +1586,9 @@
} else if (Arch == llvm::Triple::x86) {
if (!llvm::sys::fs::exists("/usr/lib/gcc/i686-linux-gnu", Exists) && Exists)
GccTriple = "i686-linux-gnu";
+ else if (!llvm::sys::fs::exists("/usr/lib/i386-linux-gnu", Exists) &&
+ Exists)
+ GccTriple = "i386-linux-gnu";
else if (!llvm::sys::fs::exists("/usr/lib/gcc/i686-pc-linux-gnu", Exists) &&
Exists)
GccTriple = "i686-pc-linux-gnu";
More information about the cfe-commits
mailing list