summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-05-09 13:03:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-05-09 13:03:10 +0000
commit2edca417c1f62633301e29433a72f9d3537bf9ce (patch)
treeb43023debb6c405a51ca19a84fac5e9d00138d7f
parentdcb98e61c73306895ba623cd43657bd593494bb1 (diff)
downloadbcm5719-llvm-2edca417c1f62633301e29433a72f9d3537bf9ce.tar.gz
bcm5719-llvm-2edca417c1f62633301e29433a72f9d3537bf9ce.zip
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. Patch by Michael Lampe. llvm-svn: 268912
-rw-r--r--clang/lib/Driver/ToolChains.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 1bf17e480d5..613ddb80f7e 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1410,9 +1410,17 @@ void Generic_GCC::GCCInstallationDetector::init(
// 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
OpenPOWER on IntegriCloud