[clang] [Clang][Driver] Add gcc-14 & gcc-15 toolset path on RHEL (PR #178459)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 28 08:23:08 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver
Author: Etienne Malaboeuf (etiennemlb)
<details>
<summary>Changes</summary>
Adding these additional paths to mitigate tedious environment hoops (config, flags injection in wrappers) in RHEL-based distros with GCC 14 & 15 toolset.
Current toolsets:
https://pkgs.org/search/?q=gcc-toolset
Reasoning:
In High Performance Computing (HPC) site, people often have to deal with multiple Clang LLVM forks (AMD, Intel, or vanilla LLVM). Current upstream clang supports gcc toolset by default up to version 13 since only 3 weeks ago (https://github.com/llvm/llvm-project/commit/7c5eb6ab0cbfeb29f980c8fa17c0ee3ca5270984). Now the first GCC 14 was released in may 2024 (https://developers.redhat.com/articles/2024/05/15/new-c-features-gcc-14). Until this commit https://github.com/llvm/llvm-project/commit/4a5184f4c357eeafcced3371cd8539fa0ac9f24d, search was automatic (Tough broken according to the author).
The result is that HPC admin, which dont always know/understand the subtle details of toolchain interaction, install new RHEL gcc tool set without ensuring that the clang fork they also install will use them (either via the gcc-toolchain flag injected in wrappers or via a cfg).
In addition, while Intel seems to keep up with upstream LLVM, AMD is a bit behind (https://github.com/ROCm/llvm-project/blob/9abbec66bfa34922521ef88fad1d6fcd43c1c462/clang/lib/Driver/ToolChains/Gnu.cpp#L2298). So we end up with say, the system installed Clang/LLVM@<!-- -->v17, finding the GCC toolset 13, but the recent amdclang (ROCm 7) finding only gcc-toolset-12.
---
Full diff: https://github.com/llvm/llvm-project/pull/178459.diff
1 Files Affected:
- (modified) clang/lib/Driver/ToolChains/Gnu.cpp (+2)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index ac31a45b557f1..50e70e6d71e1b 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2298,6 +2298,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
D.getVFS().exists("/opt/rh")) {
// TODO: We may want to remove this, since the functionality
// can be achieved using config files.
+ Prefixes.push_back("/opt/rh/gcc-toolset-15/root/usr");
+ Prefixes.push_back("/opt/rh/gcc-toolset-14/root/usr");
Prefixes.push_back("/opt/rh/gcc-toolset-13/root/usr");
Prefixes.push_back("/opt/rh/gcc-toolset-12/root/usr");
Prefixes.push_back("/opt/rh/gcc-toolset-11/root/usr");
``````````
</details>
https://github.com/llvm/llvm-project/pull/178459
More information about the cfe-commits
mailing list