Skip to content

Commit a5791ba

Browse files
author
Simon Moll
committed
[clang] Add gcc-toolset-10 support (RHEL/CentOS 8)
Clang only adds GCC paths for RHEL <= 7 'devtoolset-<N>' Software Collections (SCL). This generalizes this support to also include the 'gcc-toolset-10' SCL in RHEL/CentOS 8. Reviewed By: stephan.dollberg Differential Revision: https://reviews.llvm.org/D108908
1 parent af2920e commit a5791ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
20522052

20532053
// Non-Solaris is much simpler - most systems just go with "/usr".
20542054
if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
2055-
// Yet, still look for RHEL devtoolsets.
2055+
// Yet, still look for RHEL/CentOS devtoolsets and gcc-toolsets.
2056+
Prefixes.push_back("/opt/rh/gcc-toolset-10/root/usr");
20562057
Prefixes.push_back("/opt/rh/devtoolset-10/root/usr");
20572058
Prefixes.push_back("/opt/rh/devtoolset-9/root/usr");
20582059
Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
206206
ExtraOpts.push_back("max-page-size=4096");
207207
}
208208

209-
if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
210-
StringRef::npos)
209+
if (GCCInstallation.getParentLibPath().find("opt/rh/") != StringRef::npos)
211210
// With devtoolset on RHEL, we want to add a bin directory that is relative
212211
// to the detected gcc install, because if we are using devtoolset gcc then
213212
// we want to use other tools from devtoolset (e.g. ld) instead of the

0 commit comments

Comments
 (0)