[cfe-commits] r131840 - /cfe/trunk/lib/Driver/ToolChains.cpp

Chris Lattner sabre at nondot.org
Sat May 21 22:36:06 PDT 2011


Author: lattner
Date: Sun May 22 00:36:06 2011
New Revision: 131840

URL: http://llvm.org/viewvc/llvm-project?rev=131840&view=rev
Log:
Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
patch by Bryce Lelbach

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=131840&r1=131839&r2=131840&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun May 22 00:36:06 2011
@@ -1174,6 +1174,9 @@
   DebianLenny,
   DebianSqueeze,
   Exherbo,
+  RHEL4,
+  RHEL5,
+  RHEL6,
   Fedora13,
   Fedora14,
   Fedora15,
@@ -1191,7 +1194,7 @@
   UnknownDistro
 };
 
-static bool IsFedora(enum LinuxDistro Distro) {
+static bool IsRedhat(enum LinuxDistro Distro) {
   return Distro == Fedora13 || Distro == Fedora14 ||
          Distro == Fedora15 || Distro == FedoraRawhide;
 }
@@ -1268,6 +1271,15 @@
     else if (Data.startswith("Fedora release") &&
              Data.find("Rawhide") != llvm::StringRef::npos)
       return FedoraRawhide;
+    else if (Data.startswith("Red Hat Enterprise Linux") &&
+             Data.find("release 6") != llvm::StringRef::npos)
+      return RHEL6;
+    else if (Data.startswith("Red Hat Enterprise Linux") &&
+             Data.find("release 5") != llvm::StringRef::npos)
+      return RHEL5;
+    else if (Data.startswith("Red Hat Enterprise Linux") &&
+             Data.find("release 4") != llvm::StringRef::npos)
+      return RHEL4;
     return UnknownDistro;
   }
 
@@ -1439,18 +1451,18 @@
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
     ExtraOpts.push_back("-X");
 
-  if (IsFedora(Distro) || Distro == UbuntuMaverick || Distro == UbuntuNatty)
+  if (IsRedhat(Distro) || Distro == UbuntuMaverick || Distro == UbuntuNatty)
     ExtraOpts.push_back("--hash-style=gnu");
 
   if (IsDebian(Distro) || Distro == UbuntuLucid || Distro == UbuntuJaunty ||
       Distro == UbuntuKarmic)
     ExtraOpts.push_back("--hash-style=both");
 
-  if (IsFedora(Distro))
+  if (IsRedhat(Distro))
     ExtraOpts.push_back("--no-add-needed");
 
   if (Distro == DebianSqueeze || IsOpenSuse(Distro) ||
-      IsFedora(Distro) || Distro == UbuntuLucid || Distro == UbuntuMaverick ||
+      IsRedhat(Distro) || Distro == UbuntuLucid || Distro == UbuntuMaverick ||
       Distro == UbuntuKarmic || Distro == UbuntuNatty)
     ExtraOpts.push_back("--build-id");
 





More information about the cfe-commits mailing list