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);
|
|
|
|
+ for (const auto &Scl : Scls) {
|
|
|
|
+ if (!Scl.startswith(StringRef("devtoolset-")))
|
|
|
|
+ continue;
|
|
|
|
+ const std::string SclPath = std::string("/opt/rh/") + Scl.str() + std::string("/root/usr");
|
|
|
|
+ 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
|