static const char *const PPCLibDirs[] = { "/lib32", "/lib" };
static const char *const PPCTriples[] = {
"powerpc-linux-gnu",
- "powerpc-unknown-linux-gnu"
+ "powerpc-unknown-linux-gnu",
+ "powerpc-suse-linux"
};
LibDirs.append(PPCLibDirs, PPCLibDirs + llvm::array_lengthof(PPCLibDirs));
Triples.append(PPCTriples, PPCTriples + llvm::array_lengthof(PPCTriples));
static const char *const PPC64LibDirs[] = { "/lib64", "/lib" };
static const char *const PPC64Triples[] = {
"powerpc64-unknown-linux-gnu",
+ "powerpc64-suse-linux",
"ppc64-redhat-linux"
};
LibDirs.append(PPC64LibDirs,
continue;
if (CandidateVersion <= Version)
continue;
+
+ // Some versions of SUSE and Fedora on ppc64 put 32-bit libs
+ // in what would normally be GccInstallPath and put the 64-bit
+ // libs in a subdirectory named 64. We need the 64-bit libs
+ // for linking.
+ bool UseSlash64 = false;
+ if (HostArch == llvm::Triple::ppc64 &&
+ llvm::sys::fs::exists(LI->path() + "/64/crtbegin.o"))
+ UseSlash64 = true;
+
if (!llvm::sys::fs::exists(LI->path() + "/crtbegin.o"))
continue;
// Linux.
GccInstallPath = LibDir + Suffixes[i] + "/" + VersionText.str();
GccParentLibPath = GccInstallPath + InstallSuffixes[i];
+ if (UseSlash64) GccInstallPath = GccInstallPath + "/64";
IsValid = true;
}
}