diff options
author | Hal Finkel <hfinkel@anl.gov> | 2011-12-08 05:50:03 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2011-12-08 05:50:03 +0000 |
commit | 221e11e8646082f2dd1005a75c4405c190419197 (patch) | |
tree | 22d781680795fcd53ff5e55eec53109876d14db5 /clang/lib/Driver/ToolChains.cpp | |
parent | cab36a3a59d1ac0b87c1457f17eb88e74cc94911 (diff) | |
download | bcm5719-llvm-221e11e8646082f2dd1005a75c4405c190419197.tar.gz bcm5719-llvm-221e11e8646082f2dd1005a75c4405c190419197.zip |
Allow clang to find gcc libs on suse ppc64
llvm-svn: 146142
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 29559a6ae22..e1731b8e917 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1256,7 +1256,8 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(const Driver &D) 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)); @@ -1264,6 +1265,7 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(const Driver &D) 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, @@ -1309,6 +1311,16 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 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; @@ -1319,6 +1331,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( // Linux. GccInstallPath = LibDir + Suffixes[i] + "/" + VersionText.str(); GccParentLibPath = GccInstallPath + InstallSuffixes[i]; + if (UseSlash64) GccInstallPath = GccInstallPath + "/64"; IsValid = true; } } |