aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-05-22 05:36:06 +0000
committerChris Lattner <sabre@nondot.org>2011-05-22 05:36:06 +0000
commitd753b56d777a6ec1e62373dde8c398ae070a556e (patch)
tree317441ae96350ebf306cac9f99f432639bb5b672 /lib/Driver/ToolChains.cpp
parent93104c10653cf03a3eb5996a1650a9a9e25e0811 (diff)
Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
patch by Bryce Lelbach git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 68c0146a3d..2f929db8ba 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1174,6 +1174,9 @@ enum LinuxDistro {
DebianLenny,
DebianSqueeze,
Exherbo,
+ RHEL4,
+ RHEL5,
+ RHEL6,
Fedora13,
Fedora14,
Fedora15,
@@ -1191,7 +1194,7 @@ enum LinuxDistro {
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 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
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 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
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");