llvm-toolchain/debian/patches/28-gcc-4.7-paths.diff
2013-01-10 16:41:04 +00:00

45 lines
2.1 KiB
Diff

Index: clang-3.2/tools/clang/lib/Driver/ToolChains.cpp
===================================================================
--- clang-3.2.orig/tools/clang/lib/Driver/ToolChains.cpp 2013-01-06 09:30:46.047046507 +0100
+++ clang-3.2/tools/clang/lib/Driver/ToolChains.cpp 2013-01-06 11:22:09.982805979 +0100
@@ -2124,7 +2124,7 @@
const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
const std::string &LibPath = GCCInstallation.getParentLibPath();
- if (IsAndroid && isMipsR2Arch(Triple.getArch(), Args))
+ if (IsAndroid && isMipsR2Arch(Triple.getArch(), Args))
addPathIfExists(GCCInstallation.getInstallPath() +
GCCInstallation.getMultiarchSuffix() +
"/mips-r2",
@@ -2376,9 +2376,16 @@
StringRef InstallDir = GCCInstallation.getInstallPath();
StringRef Version = GCCInstallation.getVersion().Text;
StringRef TripleStr = GCCInstallation.getTriple().str();
+ llvm::Triple MultiarchTriple
+ = GCCInstallation.getTriple().isArch32Bit() ? GCCInstallation.getTriple().get64BitArchVariant()
+ : GCCInstallation.getTriple().get32BitArchVariant();
const std::string IncludePathCandidates[] = {
LibDir.str() + "/../include/c++/" + Version.str(),
+ // Once more, Debian headers locations changed (since gcc version 4.7.2-5)
+ // See Debian bug tracker #693240
+ LibDir.str() + "/../include/"+ TripleStr.str() +"/c++/" + Version.str(),
+ LibDir.str() + "/../include/"+ MultiarchTriple.str() +"/c++/" + Version.str(),
// Gentoo is weird and places its headers inside the GCC install, so if the
// first attempt to find the headers fails, try this pattern.
InstallDir.str() + "/include/g++-v4",
@@ -2390,10 +2397,10 @@
};
for (unsigned i = 0; i < llvm::array_lengthof(IncludePathCandidates); ++i) {
- if (addLibStdCXXIncludePaths(IncludePathCandidates[i], (TripleStr +
+ addLibStdCXXIncludePaths(IncludePathCandidates[i], (TripleStr +
GCCInstallation.getMultiarchSuffix()),
- DriverArgs, CC1Args))
- break;
+ DriverArgs, CC1Args);
+
}
}