]> granicus.if.org Git - clang/commitdiff
Add support for ArchLinux, patch by Kevin Winchester.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 25 Feb 2011 06:39:53 +0000 (06:39 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 25 Feb 2011 06:39:53 +0000 (06:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126476 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 000c713534cb319dfd62f605f2ff52df13ce266f..d8c374437b2b3d04a528312fbe8b9388e0154c64 100644 (file)
@@ -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)