From: Rafael Espindola Date: Thu, 11 Nov 2010 02:07:13 +0000 (+0000) Subject: Add support for Exherbo. Patch by Elias Pipping. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a84aee0a3ada448fb4ae5fd4964791d42a501b3;p=clang Add support for Exherbo. Patch by Elias Pipping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118769 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 0ac1d9292f..f1e3e7f85f 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1198,6 +1198,7 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA) const { enum LinuxDistro { DebianLenny, DebianSqueeze, + Exherbo, Fedora13, Fedora14, OpenSuse11_3, @@ -1228,8 +1229,12 @@ static bool IsDebianBased(enum LinuxDistro Distro) { } static bool HasMultilib(llvm::Triple::ArchType Arch, enum LinuxDistro Distro) { - if (Arch == llvm::Triple::x86_64) + if (Arch == llvm::Triple::x86_64) { + if (Distro == Exherbo && !llvm::sys::Path("/usr/lib32/libc.so").exists()) + return false; + return true; + } if (Arch == llvm::Triple::x86 && IsDebianBased(Distro)) return true; return false; @@ -1284,6 +1289,9 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { return UnknownDistro; } + if (llvm::sys::Path("/etc/exherbo-release").exists()) + return Exherbo; + return UnknownDistro; } @@ -1317,6 +1325,8 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple& Triple) } else if (Arch == llvm::Triple::x86_64) { if (llvm::sys::Path("/usr/lib/gcc/x86_64-linux-gnu").exists()) GccTriple = "x86_64-linux-gnu"; + else if (llvm::sys::Path("/usr/lib/gcc/x86_64-pc-linux-gnu").exists()) + GccTriple = "x86_64-pc-linux-gnu"; else if (llvm::sys::Path("/usr/lib/gcc/x86_64-redhat-linux").exists()) GccTriple = "x86_64-redhat-linux"; else if (llvm::sys::Path("/usr/lib64/gcc/x86_64-suse-linux").exists())