From 964b2a20dfd2392ca307e24c22df44a030c28f71 Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Fri, 2 Jan 2015 11:05:07 -0700 Subject: [PATCH] Adding CLANG_DTS_LIST for turning on devtoolset use at runtime --- 0004-devtoolset.patch | 28 +++++++++++++++------------- llvm.spec | 5 ++++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/0004-devtoolset.patch b/0004-devtoolset.patch index 1febfe3..500d41e 100644 --- a/0004-devtoolset.patch +++ b/0004-devtoolset.patch @@ -1,17 +1,19 @@ ---- a/tools/clang/lib/Driver/ToolChains.cpp 2014-08-27 22:07:31.000000000 +0200 -+++ b/tools/clang/lib/Driver/ToolChains.cpp 2014-09-08 02:51:38.197987523 +0200 -@@ -1249,8 +1249,13 @@ - Prefixes.push_back(D.InstalledDir + "/.."); - +--- a/tools/clang/lib/Driver/ToolChains.cpp ++++ b/tools/clang/lib/Driver/ToolChains.cpp +@@ -1223,6 +1223,18 @@ // And finally in /usr. -- if (D.SysRoot.empty()) -+ if (D.SysRoot.empty()) { -+ 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"); + if (D.SysRoot.empty()) Prefixes.push_back("/usr"); ++ ++ // RedHat Developer Toolset support ++ if (const char *software_collections = getenv("CLANG_DTS_LIST")) { ++ SmallVector 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); ++ } + } } - - // Loop over the various components which exist and select the best GCC diff --git a/llvm.spec b/llvm.spec index c55c638..f3d68a6 100644 --- a/llvm.spec +++ b/llvm.spec @@ -49,7 +49,7 @@ Obsoletes: pure <= 0.55 Name: llvm Version: %{version_base}.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Low Level Virtual Machine Group: Development/Languages @@ -671,6 +671,9 @@ exit 0 %endif %changelog +* Fri Jan 02 2015 Dave Johansen 3.4.2-4 +- Adding CLANG_DTS_LIST for turning on devtoolset use at runtime + * Thu Nov 20 2014 Dave Johansen 3.4.2-3 - Fix for CVE-2014-2893