llvm/0004-devtoolset.patch

22 lines
788 B
Diff
Raw Normal View History

--- 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.
if (D.SysRoot.empty())
2014-11-15 14:59:37 +00:00
Prefixes.push_back("/usr");
+
+ // 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
+ }
}
2015-01-02 18:26:46 +00:00
// Loop over the various components which exist and select the best GCC