2015-01-02 18:05:07 +00:00
|
|
|
--- a/tools/clang/lib/Driver/ToolChains.cpp
|
|
|
|
+++ b/tools/clang/lib/Driver/ToolChains.cpp
|
2015-01-02 18:26:46 +00:00
|
|
|
@@ -1062,6 +1062,18 @@
|
2014-11-15 14:59:37 +00:00
|
|
|
// And finally in /usr.
|
2015-01-02 18:05:07 +00:00
|
|
|
if (D.SysRoot.empty())
|
2014-11-15 14:59:37 +00:00
|
|
|
Prefixes.push_back("/usr");
|
2015-01-02 18:05:07 +00:00
|
|
|
+
|
|
|
|
+ // RedHat Developer Toolset support
|
2015-01-02 19:12:17 +00:00
|
|
|
+ if (const char *software_collections = getenv("X_SCLS")) {
|
2015-01-02 18:05:07 +00:00
|
|
|
+ SmallVector<StringRef, 4> Scls;
|
|
|
|
+ StringRef(software_collections).split(Scls, StringRef(" "), -1, false);
|
2015-01-02 19:21:09 +00:00
|
|
|
+ for (SmallVector<StringRef, 4>::const_iterator SclsIter = Scls.begin(); SclsIter != Scls.end(); ++SclsIter) {
|
|
|
|
+ if (!SclsIter->startswith(StringRef("devtoolset-")))
|
2015-01-02 18:05:07 +00:00
|
|
|
+ continue;
|
2015-01-02 19:21:09 +00:00
|
|
|
+ const std::string SclPath = std::string("/opt/rh/") + SclsIter->str() + std::string("/root/usr");
|
2015-01-02 18:05:07 +00:00
|
|
|
+ Prefixes.push_back(SclPath);
|
|
|
|
+ }
|
2014-11-15 14:59:37 +00:00
|
|
|
+ }
|
|
|
|
}
|
2015-01-02 18:26:46 +00:00
|
|
|
|
|
|
|
// Loop over the various components which exist and select the best GCC
|