2015-01-02 18:05:07 +00:00
|
|
|
--- a/tools/clang/lib/Driver/ToolChains.cpp
|
|
|
|
+++ b/tools/clang/lib/Driver/ToolChains.cpp
|
|
|
|
@@ -1223,6 +1223,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
|
|
|
|
+ if (const char *software_collections = getenv("CLANG_DTS_LIST")) {
|
|
|
|
+ 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
|
|
|
+ }
|
|
|
|
}
|