[llvm-commits] problem with r132497 on linux
pageexec at freemail.hu
pageexec at freemail.hu
Sun Jun 5 06:15:00 PDT 2011
Hi,
r132497 breaks clang on gentoo when one sets CXX_INCLUDE_ROOT as i do (to avoid
all the guesswork regarding gcc paths). in particular, i set it to
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/g++-v4
which doesn't match the pattern that this commit assumes and hence produces invalid
paths for the linker. for now my workaround is below but i guess the proper solution
is to explicitly pass linker paths to configure.
Index: llvm/tools/clang/lib/Driver/ToolChains.cpp
===================================================================
--- llvm/tools/clang/lib/Driver/ToolChains.cpp (revision 132660)
+++ llvm/tools/clang/lib/Driver/ToolChains.cpp (working copy)
@@ -1343,17 +1343,20 @@
llvm::SmallString<128> CxxIncludeRoot(CXX_INCLUDE_ROOT);
if (CxxIncludeRoot != "") {
// This is of the form /foo/bar/include/c++/4.5.2/
+ // /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/g++-v4
if (CxxIncludeRoot.back() == '/')
llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the /
- llvm::StringRef Version = llvm::sys::path::filename(CxxIncludeRoot);
- llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the version
- llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the c++
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the g++-v4
llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the include
+// llvm::StringRef Version = llvm::sys::path::filename(CxxIncludeRoot);
+// llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the version
+// llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the c++
+// llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the include
std::string ret(CxxIncludeRoot.c_str());
- ret.append("/lib/gcc/");
- ret.append(CXX_INCLUDE_ARCH);
- ret.append("/");
- ret.append(Version);
+// ret.append("/lib/gcc/");
+// ret.append(CXX_INCLUDE_ARCH);
+// ret.append("/");
+// ret.append(Version);
return ret;
}
static const char* GccVersions[] = {"4.6.0", "4.6",
More information about the llvm-commits
mailing list