From 3fd345a59db34de5bc8e29a64ebd9f68a1e9eb44 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 25 Feb 2011 06:39:53 +0000 Subject: [PATCH] Add support for ArchLinux, patch by Kevin Winchester. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126476 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 000c713534..d8c374437b 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1271,6 +1271,7 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA) const { /// Linux toolchain (very bare-bones at the moment). enum LinuxDistro { + ArchLinux, DebianLenny, DebianSqueeze, Exherbo, @@ -1367,6 +1368,9 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { if (!llvm::sys::fs::exists("/etc/exherbo-release", Exists) && Exists) return Exherbo; + if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists) + return ArchLinux; + return UnknownDistro; } @@ -1436,8 +1440,9 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) GccTriple = "i586-suse-linux"; } - const char* GccVersions[] = {"4.5.1", "4.5", "4.4.5", "4.4.4", "4.4.3", "4.4", - "4.3.4", "4.3.3", "4.3.2", "4.3"}; + const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4", + "4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2", + "4.3"}; std::string Base = ""; for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) { std::string Suffix = GccTriple + "/" + GccVersions[i]; @@ -1498,6 +1503,9 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) Distro == UbuntuKarmic) ExtraOpts.push_back("--build-id"); + if (Distro == ArchLinux) + Lib = "lib"; + Paths.push_back(Base + Suffix); if (HasMultilib(Arch, Distro)) { if (IsOpenSuse(Distro) && Is32Bits) -- 2.50.1