[PATCH] Update usage of RHEL devtoolsets
- remove devtoolset-1 (obsoleted gcc 4.7) - add devtoolset-6 (gcc 6.2+) (There is no devtoolset-5, RH switched to gcc major version numbering.) Please apply, I don't have commit access. Thanks, Michael diff -ru a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp --- a/lib/Driver/ToolChains.cpp 2016-11-26 03:21:16.353564220 +0100 +++ b/lib/Driver/ToolChains.cpp 2016-11-26 03:24:40.096334795 +0100 @@ -1441,11 +1441,10 @@ // Then look for distribution supplied gcc installations. if (D.SysRoot.empty()) { // Look for RHEL devtoolsets. + Prefixes.push_back("/opt/rh/devtoolset-6/root/usr"); Prefixes.push_back("/opt/rh/devtoolset-4/root/usr"); Prefixes.push_back("/opt/rh/devtoolset-3/root/usr"); Prefixes.push_back("/opt/rh/devtoolset-2/root/usr"); - Prefixes.push_back("/opt/rh/devtoolset-1.1/root/usr"); - Prefixes.push_back("/opt/rh/devtoolset-1.0/root/usr"); // And finally in /usr. Prefixes.push_back("/usr"); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] RHEL: Look in more places to find g++ headers and runtime
No, I'm hoping on someone else to commit this. (You?) Same with this one: https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg18696.html -Michael Rafael Espíndola wrote: LGTM. Do you have commit access? Cheers, Rafael On 11 April 2016 at 14:49, Michael Lampe wrote: New patch attached. -Michael Rafael Espíndola wrote: LGTM with a comment saying why it is needed. Cheers, Rafael On 22 March 2016 at 23:02, Michael Lampe via cfe-commits wrote: Some distros with ten years of support ship an old gcc but later offer more recent versions for installation in parallel. These versions are typically not only needed for the compilation of llvm/clang, but also to properly use the clang binary that comes out. Clang already searches /usr at runtime for the most recent installation of gcc. This patch appends paths for add-on installations of gcc in RHEL. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] RHEL: Look in more places to find g++ headers and runtime
New patch attached. -Michael Rafael Espíndola wrote: LGTM with a comment saying why it is needed. Cheers, Rafael On 22 March 2016 at 23:02, Michael Lampe via cfe-commits wrote: Some distros with ten years of support ship an old gcc but later offer more recent versions for installation in parallel. These versions are typically not only needed for the compilation of llvm/clang, but also to properly use the clang binary that comes out. Clang already searches /usr at runtime for the most recent installation of gcc. This patch appends paths for add-on installations of gcc in RHEL. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits Index: clang/lib/Driver/ToolChains.cpp === --- clang/lib/Driver/ToolChains.cpp (revision 265970) +++ clang/lib/Driver/ToolChains.cpp (working copy) @@ -1370,9 +1370,17 @@ // Then look for gcc installed alongside clang. Prefixes.push_back(D.InstalledDir + "/.."); -// And finally in /usr. -if (D.SysRoot.empty()) +// Then look for distribution supplied gcc installations. +if (D.SysRoot.empty()) { + // Look for RHEL devtoolsets. + Prefixes.push_back("/opt/rh/devtoolset-4/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-3/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-2/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-1.1/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-1.0/root/usr"); + // And finally in /usr. Prefixes.push_back("/usr"); +} } // Loop over the various components which exist and select the best GCC ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] RHEL: Look in more places to find g++ headers and runtime
Some distros with ten years of support ship an old gcc but later offer more recent versions for installation in parallel. These versions are typically not only needed for the compilation of llvm/clang, but also to properly use the clang binary that comes out. Clang already searches /usr at runtime for the most recent installation of gcc. This patch appends paths for add-on installations of gcc in RHEL. --- a/tools/clang/lib/Driver/ToolChains.cpp 2014-08-27 22:07:31.0 +0200 +++ b/tools/clang/lib/Driver/ToolChains.cpp 2014-09-08 02:51:38.197987523 +0200 @@ -1249,8 +1249,14 @@ Prefixes.push_back(D.InstalledDir + "/.."); // And finally in /usr. -if (D.SysRoot.empty()) +if (D.SysRoot.empty()) { + Prefixes.push_back("/opt/rh/devtoolset-4/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-3/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-2/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-1.1/root/usr"); + Prefixes.push_back("/opt/rh/devtoolset-1.0/root/usr"); Prefixes.push_back("/usr"); +} } // Loop over the various components which exist and select the best GCC ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] Proper detection and handling of RHEL and variants
- Don't consider "/etc/lsb-release" to be Ubuntu only. - Detect SL, too. - Only add "--no-add-needed" for RHEL7 (or Fedora), not for RHEL6 (that's what the compilers shipped with RHEL do). --- a/tools/clang/lib/Driver/ToolChains.cpp 2015-09-02 04:26:13.266233474 +0200 +++ b/tools/clang/lib/Driver/ToolChains.cpp 2015-09-02 04:35:04.475976086 +0200 @@ -2934,7 +2934,8 @@ .Case("vivid", UbuntuVivid) .Case("wily", UbuntuWily) .Default(UnknownDistro); -return Version; +if (Version != UnknownDistro) + return Version; } File = llvm::MemoryBuffer::getFile("/etc/redhat-release"); @@ -2943,7 +2944,8 @@ if (Data.startswith("Fedora release")) return Fedora; if (Data.startswith("Red Hat Enterprise Linux") || -Data.startswith("CentOS")) { +Data.startswith("CentOS") || +Data.startswith("Scientific Linux")) { if (Data.find("release 7") != StringRef::npos) return RHEL7; else if (Data.find("release 6") != StringRef::npos) @@ -3176,7 +3178,7 @@ ExtraOpts.push_back("--hash-style=both"); } - if (IsRedhat(Distro)) + if (Distro == Fedora || Distro == RHEL7) ExtraOpts.push_back("--no-add-needed"); if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) || ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] Proper detection and handling of RHEL and variants
New patch attached. I've also removed RHEL4 which is now four years past EOL and certainly incapable of building or running any recent version of llvm/clang. -Michael Rafael Espíndola wrote: - if (IsRedhat(Distro)) + if (Distro == Fedora || Distro == RHEL7) RHEL8 will probably use --no-add-needed. Can you change this to "if (IsRedhat(Distro) && !old_rhel_distro) "? Cheers, Rafael On 22 March 2016 at 22:07, Michael Lampe via cfe-commits wrote: - Don't consider "/etc/lsb-release" to be Ubuntu only. - Detect SL, too. - Only add "--no-add-needed" for RHEL7 (or Fedora), not for RHEL6 (that's what the compilers shipped with RHEL do). ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits --- a/clang/lib/Driver/ToolChains.cpp 2016-03-27 01:02:56.161462540 +0100 +++ b/clang/lib/Driver/ToolChains.cpp 2016-03-27 01:04:56.299721653 +0100 @@ -3369,7 +3369,6 @@ DebianJessie, DebianStretch, Exherbo, - RHEL4, RHEL5, RHEL6, RHEL7, @@ -3396,7 +3395,7 @@ }; static bool IsRedhat(enum Distro Distro) { - return Distro == Fedora || (Distro >= RHEL4 && Distro <= RHEL7); + return Distro == Fedora || (Distro >= RHEL5 && Distro <= RHEL7); } static bool IsOpenSUSE(enum Distro Distro) { return Distro == OpenSUSE; } @@ -3438,7 +3437,8 @@ .Case("wily", UbuntuWily) .Case("xenial", UbuntuXenial) .Default(UnknownDistro); -return Version; +if (Version != UnknownDistro) + return Version; } File = llvm::MemoryBuffer::getFile("/etc/redhat-release"); @@ -3447,15 +3447,14 @@ if (Data.startswith("Fedora release")) return Fedora; if (Data.startswith("Red Hat Enterprise Linux") || -Data.startswith("CentOS")) { +Data.startswith("CentOS") || +Data.startswith("Scientific Linux")) { if (Data.find("release 7") != StringRef::npos) return RHEL7; else if (Data.find("release 6") != StringRef::npos) return RHEL6; else if (Data.find("release 5") != StringRef::npos) return RHEL5; - else if (Data.find("release 4") != StringRef::npos) -return RHEL4; } return UnknownDistro; } @@ -3680,11 +3679,11 @@ ExtraOpts.push_back("--hash-style=both"); } - if (IsRedhat(Distro)) + if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) ExtraOpts.push_back("--no-add-needed"); if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) || - (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || + (IsRedhat(Distro) && Distro != RHEL5) || (IsUbuntu(Distro) && Distro >= UbuntuKarmic)) ExtraOpts.push_back("--build-id"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits