Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/3.7.1/compiler-rt/, sys-devel/llvm/files/3.7.1/clang/, ...
Date: Sat, 03 Jun 2017 10:28:06
Message-Id: 1496485670.9fbbd3f25a352065041ab0a94b08785e00ef44bc.mgorny@gentoo
1 commit: 9fbbd3f25a352065041ab0a94b08785e00ef44bc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 3 09:21:48 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 3 10:27:50 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fbbd3f2
7
8 sys-devel/llvm: Move 3.7.1 patchset to tarball
9
10 sys-devel/llvm/Manifest | 1 +
11 ...clang-runtime-into-usr-lib-without-suffix.patch | 52 ---
12 .../files/3.7.1/clang/ccc-analyzer-isystem.patch | 18 -
13 .../llvm/files/3.7.1/clang/gentoo-install.patch | 48 ---
14 .../files/3.7.1/compiler-rt/arm_march_flags.patch | 16 -
15 .../llvm/files/3.7.1/compiler-rt/msan-fix.patch | 86 ----
16 sys-devel/llvm/files/3.7.1/lldb/python.patch | 23 --
17 sys-devel/llvm/files/3.7.1/lldb/tinfo.patch | 12 -
18 sys-devel/llvm/files/3.7.1/llvm-config-0.patch | 83 ----
19 sys-devel/llvm/files/3.7.1/llvm-config-1.patch | 453 ---------------------
20 sys-devel/llvm/files/3.7.1/llvm-config-2.patch | 113 -----
21 sys-devel/llvm/files/3.7.1/llvm-config-3.patch | 29 --
22 sys-devel/llvm/files/3.7.1/msan-fix.patch | 79 ----
23 sys-devel/llvm/llvm-3.7.1-r3.ebuild | 47 +--
24 14 files changed, 25 insertions(+), 1035 deletions(-)
25
26 diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
27 index c10f9ba0cf1..e91c605e22e 100644
28 --- a/sys-devel/llvm/Manifest
29 +++ b/sys-devel/llvm/Manifest
30 @@ -26,6 +26,7 @@ DIST llvm-3.6.1-manpages.tar.bz2 38338 SHA256 b27c6198e09b11421841a7184d4e8a0f88
31 DIST llvm-3.6.2-patchset.tar.gz 4562 SHA256 7b85037d143732c0e635a2ba436d1f2418654161ecb5b9618f8e9ffad8fa3279 SHA512 6018e7d96317e6a46f373259430782a1377193ab64b337d5f6720a4ffe0eb0891e7e9373fb9c20da66e840f07e52f2bccb2a8c51bb55ded0f124748796cce1c8 WHIRLPOOL 01aeb3b454cc0d442c9a54ab3aca3be0106765f372ec4e82344f3967faa89fefec978562cdef56d1cc47cb418b0dd15ac685a2c1b05d415fb32b8684182aeb23
32 DIST llvm-3.6.2.src.tar.xz 12802380 SHA256 f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94 SHA512 42b44ce69cfb96e2dc12dc2246f0de8ff983a99741206e2c46ccf074b3248aaab9c0f22c6baad802de851d06f202f40db9dd62fe38aab4479b3f70026c936b36 WHIRLPOOL 1a15e16793fe4120f1c14a5334362c36db26745c493e7289281351b7c18c523d781ff9425dddfe1a2add9ea1e8aebb92f2313787da5f286259b55b0884b3039f
33 DIST llvm-3.7.0-manpages.tar.bz2 38095 SHA256 8597fa532464c6336aefbbef0b1ce452aaa98d474fa58108c6a6f57a9ccd6785 SHA512 ea70ac15dbaef3740b31f66aa798338f7f9b82484586582aa62e0364f9d74bf175be2f4f29721df253b8157c1cbc146ab9045c0656c42a6375434e994786b643 WHIRLPOOL 743b339b0df7c52d270a5197e9e765dfd92d4b5acee94cf9d9d7713e1a75aa9d987b3f5adab0952e7267febf88b318d0f31cb45847e2b0b42c7c7373b2358358
34 +DIST llvm-3.7.1-patchset.tar.gz 17234 SHA256 3add3f23c0eae09f52ac055362234a116da4fc1e5a7772cd9a90519549e9f096 SHA512 030dc7f72d11fcd53307f707d5dde321054feb0f0977601c3e188a37f2be6c14bfd05482d1c1e5f435aaf32ca7c7e3701cf5f1375fbd0cf83cf8afbad7f4f6be WHIRLPOOL fa5d3464ac6315dabac895b753918b0dbe301ef6d8e45a75934ba6b0ba947e30763d0522bd95b79ae4a714b1234bb08e654c0a9987fd74e692eeb2afe16694e8
35 DIST llvm-3.7.1.src.tar.xz 14592544 SHA256 be7794ed0cec42d6c682ca8e3517535b54555a3defabec83554dbc74db545ad5 SHA512 ac521debc02f6deba96ef975d6a546b0c5c77299c1dbf5e1b87a7974ff5e7fd715bd7e384b92d9adf572ce47130bdbf6d3c648eb0d7f72f16f976292e4909e90 WHIRLPOOL 788ce0907b906ebee595c766713bec5067563c8aba7460211f5830e116df7c830de84704834c0df2f2f2c90354d75521e4a4aff57e769a2d8ab590778c1e4a70
36 DIST llvm-3.8.0-manpages.tar.bz2 37889 SHA256 4dda7f69f9412e0fb50d32631df34d6ea7f93c945c9a59cb050a99f1d2d0508b SHA512 a93ed7a25b75c237a0967ba7a501c71af3e7e9292ebabf69733bc637e9a4534dcaee539c6b1f6b2df7a87103c2371b1cf130fac05b88047100988c814e89ab0f WHIRLPOOL 9790a576fd4db798c2339bb4ea1dc973f1057177364770a104be7916998a1ad824e6b4eee296066ddd32eb5e6c57ffd5716457cecbd8ca9fe1b317d0d5ed2676
37 DIST llvm-3.8.1.src.tar.xz 16551472 SHA256 6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 SHA512 99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 WHIRLPOOL a99cef164a0e05e5237b840bee776d48fe0bde460cb4536f03a5e4eb0cc630deeb96f76bdd42f912a4b2dab08133bd9137ea16be1b9582d375f0f5841dd40234
38
39 diff --git a/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
40 deleted file mode 100644
41 index 904a72a358a..00000000000
42 --- a/sys-devel/llvm/files/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
43 +++ /dev/null
44 @@ -1,52 +0,0 @@
45 -From b28503def986bcbc388a04be0d51cbe80bc59506 Mon Sep 17 00:00:00 2001
46 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
47 -Date: Tue, 9 Jun 2015 12:11:50 +0200
48 -Subject: [PATCH] Install clang runtime into /usr/lib (without suffix)
49 -
50 ----
51 - lib/Driver/Driver.cpp | 3 +--
52 - lib/Frontend/CompilerInvocation.cpp | 3 +--
53 - lib/Headers/CMakeLists.txt | 2 +-
54 - 3 files changed, 3 insertions(+), 5 deletions(-)
55 -
56 -diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
57 -index a04a1f8..418d46a 100644
58 ---- a/tools/clang/lib/Driver/Driver.cpp
59 -+++ b/tools/clang//lib/Driver/Driver.cpp
60 -@@ -66,8 +66,7 @@ Driver::Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
61 - if (ClangResourceDir != "") {
62 - llvm::sys::path::append(P, ClangResourceDir);
63 - } else {
64 -- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
65 -- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang",
66 -+ llvm::sys::path::append(P, "..", "lib", "clang",
67 - CLANG_VERSION_STRING);
68 - }
69 - ResourceDir = P.str();
70 -diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
71 -index 9485767..0b9ecbd 100644
72 ---- a/tools/clang/lib/Frontend/CompilerInvocation.cpp
73 -+++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp
74 -@@ -1053,8 +1053,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
75 - if (ClangResourceDir != "") {
76 - llvm::sys::path::append(P, ClangResourceDir);
77 - } else {
78 -- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
79 -- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang",
80 -+ llvm::sys::path::append(P, "..", "lib", "clang",
81 - CLANG_VERSION_STRING);
82 - }
83 -
84 -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
85 -index 29a738e..3769d23 100644
86 ---- a/tools/clang/lib/Headers/CMakeLists.txt
87 -+++ b/tools/clang/lib/Headers/CMakeLists.txt
88 -@@ -93,4 +93,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
89 - install(
90 - FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
91 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
92 -- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
93 -+ DESTINATION lib/clang/${CLANG_VERSION}/include)
94 ---
95 -2.4.3
96 -
97
98 diff --git a/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch b/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch
99 deleted file mode 100644
100 index 78ca922b636..00000000000
101 --- a/sys-devel/llvm/files/3.7.1/clang/ccc-analyzer-isystem.patch
102 +++ /dev/null
103 @@ -1,18 +0,0 @@
104 -https://bugs.gentoo.org/586168
105 -
106 -Index: tools/clang/tools/scan-build/ccc-analyzer
107 -===================================================================
108 ---- a/tools/clang/tools/scan-build/ccc-analyzer (revision 250980)
109 -+++ b/tools/clang/tools/scan-build/ccc-analyzer (working copy)
110 -@@ -586,9 +586,9 @@
111 - }
112 -
113 - # Compile mode flags.
114 -- if ($Arg =~ /^-[D,I,U,isystem](.*)$/) {
115 -+ if ($Arg =~ /^-(D|I|U|isystem)(.*)$/) {
116 - my $Tmp = $Arg;
117 -- if ($1 eq '') {
118 -+ if ($2 eq '') {
119 - # FIXME: Check if we are going off the end.
120 - ++$i;
121 - $Tmp = $Arg . $ARGV[$i];
122
123 diff --git a/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch b/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch
124 deleted file mode 100644
125 index 6d76ba9660c..00000000000
126 --- a/sys-devel/llvm/files/3.7.1/clang/gentoo-install.patch
127 +++ /dev/null
128 @@ -1,48 +0,0 @@
129 ----
130 - tools/clang/lib/Driver/Tools.cpp | 2 +-
131 - tools/clang/tools/scan-build/scan-build | 4 ++--
132 - tools/clang/tools/scan-view/scan-view | 2 +-
133 - 3 files changed, 4 insertions(+), 4 deletions(-)
134 -
135 -diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
136 -index 187ed38..55bcd99 100644
137 ---- a/tools/clang/lib/Driver/Tools.cpp
138 -+++ b/tools/clang/lib/Driver/Tools.cpp
139 -diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
140 -index 0f119f6..58f78d9 100755
141 ---- a/tools/clang/tools/scan-build/scan-build
142 -+++ b/tools/clang/tools/scan-build/scan-build
143 -@@ -419,7 +419,7 @@
144 -
145 - my $Dir = shift;
146 -
147 -- my $JS = Cwd::realpath("$RealBin/sorttable.js");
148 -+ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
149 -
150 - DieDiag("Cannot find 'sorttable.js'.\n")
151 - if (! -r $JS);
152 -@@ -429,7 +429,7 @@
153 - DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
154 - if (! -r "$Dir/sorttable.js");
155 -
156 -- my $CSS = Cwd::realpath("$RealBin/scanview.css");
157 -+ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
158 -
159 - DieDiag("Cannot find 'scanview.css'.\n")
160 - if (! -r $CSS);
161 -diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
162 -index fb27da6..1f8ddb8 100755
163 ---- a/tools/clang/tools/scan-view/scan-view
164 -+++ b/tools/clang/tools/scan-view/scan-view
165 -@@ -54,7 +54,7 @@ def start_browser(port, options):
166 - webbrowser.open(url)
167 -
168 - def run(port, options, root):
169 -- import ScanView
170 -+ from clang import ScanView
171 - try:
172 - print 'Starting scan-view at: http://%s:%d'%(options.host,
173 - port)
174 ---
175 -1.8.4.4
176 -
177
178 diff --git a/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch b/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch
179 deleted file mode 100644
180 index 943a8407f12..00000000000
181 --- a/sys-devel/llvm/files/3.7.1/compiler-rt/arm_march_flags.patch
182 +++ /dev/null
183 @@ -1,16 +0,0 @@
184 -diff -Naur llvm-3.7.0.src.orig/projects/compiler-rt/cmake/config-ix.cmake llvm-3.7.0.src/projects/compiler-rt/cmake/config-ix.cmake
185 ---- llvm-3.7.0.src.orig/projects/compiler-rt/cmake/config-ix.cmake 2015-07-30 06:28:50.000000000 +0200
186 -+++ llvm-3.7.0.src/projects/compiler-rt/cmake/config-ix.cmake 2015-10-27 17:10:47.365847079 +0100
187 -@@ -209,12 +209,6 @@
188 - test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
189 - test_target_arch(mips64 "" "-mips64r2" "-mabi=n64")
190 - endif()
191 -- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm")
192 -- test_target_arch(arm "" "-march=armv7-a")
193 -- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
194 -- test_target_arch(aarch32 "" "-march=armv8-a")
195 -- elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
196 -- test_target_arch(aarch64 "" "-march=armv8-a")
197 - endif()
198 - set(COMPILER_RT_OS_SUFFIX "")
199 - endif()
200
201 diff --git a/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch b/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch
202 deleted file mode 100644
203 index 3854a18497b..00000000000
204 --- a/sys-devel/llvm/files/3.7.1/compiler-rt/msan-fix.patch
205 +++ /dev/null
206 @@ -1,86 +0,0 @@
207 -From 5dad120f9c9bc74c73edadb0467d8df81ae46066 Mon Sep 17 00:00:00 2001
208 -From: "H.J. Lu" <hjl.tools@×××××.com>
209 -Date: Wed, 5 Aug 2015 05:34:27 -0700
210 -Subject: [PATCH 08/13] Apply split-layout-compiler-rt.patch
211 -
212 -https://llvm.org/bugs/show_bug.cgi?id=24155
213 ----
214 - lib/msan/msan.h | 30 ++++++++++++++++++++----------
215 - lib/msan/msan_allocator.cc | 12 +++++++++++-
216 - 2 files changed, 31 insertions(+), 11 deletions(-)
217 -
218 -diff --git a/lib/msan/msan.h b/lib/msan/msan.h
219 -index cd8bc19..6251b38 100644
220 ---- a/lib/msan/msan.h
221 -+++ b/lib/msan/msan.h
222 -@@ -94,17 +94,27 @@ const MappingDesc kMemoryLayout[] = {
223 -
224 - #elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
225 -
226 --// Requries PIE binary and ASLR enabled.
227 --// Main thread stack and DSOs at 0x7f0000000000 (sometimes 0x7e0000000000).
228 --// Heap at 0x600000000000.
229 -+// All of the following configurations are supported.
230 -+// ASLR disabled: main executable and DSOs at 0x555550000000
231 -+// PIE and ASLR: main executable and DSOs at 0x7f0000000000
232 -+// non-PIE: main executable below 0x100000000, DSOs at 0x7f0000000000
233 -+// Heap at 0x700000000000.
234 - const MappingDesc kMemoryLayout[] = {
235 -- {0x000000000000ULL, 0x200000000000ULL, MappingDesc::INVALID, "invalid"},
236 -- {0x200000000000ULL, 0x400000000000ULL, MappingDesc::SHADOW, "shadow"},
237 -- {0x400000000000ULL, 0x600000000000ULL, MappingDesc::ORIGIN, "origin"},
238 -- {0x600000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app"}};
239 --
240 --#define MEM_TO_SHADOW(mem) (((uptr)(mem)) & ~0x400000000000ULL)
241 --#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x200000000000ULL)
242 -+ {0x000000000000ULL, 0x050000000000ULL, MappingDesc::APP, "app-1"},
243 -+ {0x050000000000ULL, 0x100000000000ULL, MappingDesc::SHADOW, "shadow-2"},
244 -+ {0x100000000000ULL, 0x150000000000ULL, MappingDesc::INVALID, "invalid"},
245 -+ {0x150000000000ULL, 0x200000000000ULL, MappingDesc::ORIGIN, "origin-2"},
246 -+ {0x200000000000ULL, 0x300000000000ULL, MappingDesc::SHADOW, "shadow-3"},
247 -+ {0x300000000000ULL, 0x400000000000ULL, MappingDesc::ORIGIN, "origin-3"},
248 -+ {0x400000000000ULL, 0x500000000000ULL, MappingDesc::INVALID, "invalid"},
249 -+ {0x500000000000ULL, 0x550000000000ULL, MappingDesc::SHADOW, "shadow-1"},
250 -+ {0x550000000000ULL, 0x600000000000ULL, MappingDesc::APP, "app-2"},
251 -+ {0x600000000000ULL, 0x650000000000ULL, MappingDesc::ORIGIN, "origin-1"},
252 -+ {0x650000000000ULL, 0x700000000000ULL, MappingDesc::INVALID, "invalid"},
253 -+ {0x700000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app-3"}};
254 -+
255 -+#define MEM_TO_SHADOW(mem) (((uptr)(mem)) ^ 0x500000000000ULL)
256 -+#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x100000000000ULL)
257 -
258 - #else
259 - #error "Unsupported platform"
260 -diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc
261 -index 6df3566..e588bf8 100644
262 ---- a/lib/msan/msan_allocator.cc
263 -+++ b/lib/msan/msan_allocator.cc
264 -@@ -49,7 +49,8 @@ struct MsanMapUnmapCallback {
265 - typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(Metadata),
266 - SizeClassMap, kRegionSizeLog, ByteMap,
267 - MsanMapUnmapCallback> PrimaryAllocator;
268 --#elif defined(__x86_64__)
269 -+
270 -+#elif SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 64
271 - static const uptr kAllocatorSpace = 0x600000000000ULL;
272 - static const uptr kAllocatorSize = 0x80000000000; // 8T.
273 - static const uptr kMetadataSize = sizeof(Metadata);
274 -@@ -67,6 +68,15 @@ struct MsanMapUnmapCallback {
275 - typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
276 - DefaultSizeClassMap,
277 - MsanMapUnmapCallback> PrimaryAllocator;
278 -+#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
279 -+ static const uptr kAllocatorSpace = 0x700000000000ULL;
280 -+ static const uptr kAllocatorSize = 0x80000000000; // 8T.
281 -+ static const uptr kMetadataSize = sizeof(Metadata);
282 -+ static const uptr kMaxAllowedMallocSize = 8UL << 30;
283 -+
284 -+ typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
285 -+ DefaultSizeClassMap,
286 -+ MsanMapUnmapCallback> PrimaryAllocator;
287 - #endif
288 - typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache;
289 - typedef LargeMmapAllocator<MsanMapUnmapCallback> SecondaryAllocator;
290 ---
291 -2.6.4
292 -
293
294 diff --git a/sys-devel/llvm/files/3.7.1/lldb/python.patch b/sys-devel/llvm/files/3.7.1/lldb/python.patch
295 deleted file mode 100644
296 index 1a958271e18..00000000000
297 --- a/sys-devel/llvm/files/3.7.1/lldb/python.patch
298 +++ /dev/null
299 @@ -1,23 +0,0 @@
300 -diff -Naur llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py
301 ---- llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-06-04 05:12:37.000000000 +0200
302 -+++ llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-10-11 19:19:54.074935710 +0200
303 -@@ -371,14 +371,14 @@
304 - strLibFileExtn = ".dylib";
305 - else:
306 - strLibFileExtn = ".so";
307 -- strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
308 -+ strSrc = os.path.join("GENTOO_LIBDIR", "liblldb" + strLibFileExtn);
309 -
310 -- if eOSType != utilsOsType.EnumOsType.Windows:
311 -+# if eOSType != utilsOsType.EnumOsType.Windows:
312 - # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is
313 - # effective.
314 -- bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
315 -- if not bOk:
316 -- return (bOk, strErrMsg)
317 -+# bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
318 -+# if not bOk:
319 -+# return (bOk, strErrMsg)
320 -
321 - bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
322 -
323
324 diff --git a/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch b/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch
325 deleted file mode 100644
326 index 626498c57ee..00000000000
327 --- a/sys-devel/llvm/files/3.7.1/lldb/tinfo.patch
328 +++ /dev/null
329 @@ -1,12 +0,0 @@
330 ---- a/tools/lldb/cmake/LLDBDependencies.cmake 2015/09/16 20:13:53 247841
331 -+++ b/tools/lldb/cmake/LLDBDependencies.cmake 2015/09/16 20:14:01 247842
332 -@@ -141,6 +141,9 @@
333 - endif()
334 - if (NOT LLDB_DISABLE_CURSES)
335 - list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
336 -+ if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
337 -+ list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
338 -+ endif()
339 - endif()
340 - endif()
341 - # On FreeBSD backtrace() is provided by libexecinfo, not libc.
342
343 diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-0.patch b/sys-devel/llvm/files/3.7.1/llvm-config-0.patch
344 deleted file mode 100644
345 index 87f9ff8c5ad..00000000000
346 --- a/sys-devel/llvm/files/3.7.1/llvm-config-0.patch
347 +++ /dev/null
348 @@ -1,83 +0,0 @@
349 -From a59464503a7e059ddfd3fb4308753b692d03d996 Mon Sep 17 00:00:00 2001
350 -From: Tom Stellard <thomas.stellard@×××.com>
351 -Date: Wed, 9 Sep 2015 16:39:30 +0000
352 -Subject: [PATCH 1/4] llvm-config: Add --build-system option
353 -
354 -Summary:
355 -This can be used for distinguishing between cmake and autoconf builds.
356 -Users may need this in order to handle inconsistencies between the
357 -outputs of the two build systems.
358 -
359 -Reviewers: echristo, chandlerc, beanz
360 -
361 -Subscribers: llvm-commits
362 -
363 -Differential Revision: http://reviews.llvm.org/D11838
364 -
365 -git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247159 91177308-0d34-0410-b5e6-96231b3b80d8
366 ----
367 - tools/llvm-config/BuildVariables.inc.in | 1 +
368 - tools/llvm-config/CMakeLists.txt | 2 ++
369 - tools/llvm-config/Makefile | 2 ++
370 - tools/llvm-config/llvm-config.cpp | 3 +++
371 - 4 files changed, 8 insertions(+)
372 -
373 -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
374 -index 3f51f49..0f28fad 100644
375 ---- a/tools/llvm-config/BuildVariables.inc.in
376 -+++ b/tools/llvm-config/BuildVariables.inc.in
377 -@@ -26,3 +26,4 @@
378 - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
379 - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
380 - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
381 -+#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
382 -diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
383 -index edbd8c9..dd53460 100644
384 ---- a/tools/llvm-config/CMakeLists.txt
385 -+++ b/tools/llvm-config/CMakeLists.txt
386 -@@ -24,6 +24,8 @@ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
387 - set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
388 - set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
389 - set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
390 -+set(LLVM_BUILD_SYSTEM cmake)
391 -+
392 - # Use the C++ link flags, since they should be a superset of C link flags.
393 - set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
394 - set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
395 -diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
396 -index 1ff8b6f..c2b5e8f 100644
397 ---- a/tools/llvm-config/Makefile
398 -+++ b/tools/llvm-config/Makefile
399 -@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
400 - >> temp.sed
401 - $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
402 - >> temp.sed
403 -+ $(Verb) $(ECHO) 's/@LLVM_BUILD_SYSTEM@/autoconf/' \
404 -+ >> temp.sed
405 - $(Verb) $(SED) -f temp.sed < $< > $@
406 - $(Verb) $(RM) temp.sed
407 -
408 -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
409 -index 879b9ab..4ce8f10 100644
410 ---- a/tools/llvm-config/llvm-config.cpp
411 -+++ b/tools/llvm-config/llvm-config.cpp
412 -@@ -157,6 +157,7 @@ Options:\n\
413 - --host-target Target triple used to configure LLVM.\n\
414 - --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
415 - --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
416 -+ --build-system Print the build system used to build LLVM (autoconf or cmake).\n\
417 - Typical components:\n\
418 - all All LLVM libraries (default).\n\
419 - engine Either a native JIT or a bitcode interpreter.\n";
420 -@@ -323,6 +324,8 @@ int main(int argc, char **argv) {
421 - #else
422 - OS << "ON\n";
423 - #endif
424 -+ } else if (Arg == "--build-system") {
425 -+ OS << LLVM_BUILD_SYSTEM << '\n';
426 - } else if (Arg == "--obj-root") {
427 - OS << ActivePrefix << '\n';
428 - } else if (Arg == "--src-root") {
429 ---
430 -2.7.4
431 -
432
433 diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-1.patch b/sys-devel/llvm/files/3.7.1/llvm-config-1.patch
434 deleted file mode 100644
435 index 214a3bbbc0e..00000000000
436 --- a/sys-devel/llvm/files/3.7.1/llvm-config-1.patch
437 +++ /dev/null
438 @@ -1,453 +0,0 @@
439 -From 55433193c56e6b2e0792c3ca1b0ef3881ab01138 Mon Sep 17 00:00:00 2001
440 -From: Richard Diamond <wichard@×××××××××××××××.com>
441 -Date: Mon, 9 Nov 2015 23:15:38 +0000
442 -Subject: [PATCH 2/4] Fix `llvm-config` to adapt to the install environment.
443 -
444 -Summary:
445 -This patch does a couple of things:
446 -
447 - - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared.
448 - - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used.
449 - - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed.
450 - - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking.
451 - - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms.
452 -
453 -Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it.
454 -
455 -Reviewers: jfb, brad.king, whitequark, beanz
456 -
457 -Subscribers: beanz, jauhien, llvm-commits
458 -
459 -Differential Revision: http://reviews.llvm.org/D13198
460 -
461 -git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252532 91177308-0d34-0410-b5e6-96231b3b80d8
462 ----
463 - bindings/ocaml/Makefile.ocaml | 2 +
464 - tools/llvm-config/BuildVariables.inc.in | 3 +
465 - tools/llvm-config/CMakeLists.txt | 5 +
466 - tools/llvm-config/llvm-config.cpp | 265 +++++++++++++++++++++++++++++---
467 - 4 files changed, 253 insertions(+), 22 deletions(-)
468 -
469 -diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml
470 -index 1f65a7b..22b96a2 100644
471 ---- a/bindings/ocaml/Makefile.ocaml
472 -+++ b/bindings/ocaml/Makefile.ocaml
473 -@@ -277,6 +277,8 @@ uninstall-local:: uninstall-deplibs
474 -
475 - build-deplibs: $(OutputLibs)
476 -
477 -+$(OcamlDir)/%.so: $(LibDir)/%.so
478 -+ $(Verb) ln -sf $< $@
479 - $(OcamlDir)/%.a: $(LibDir)/%.a
480 - $(Verb) ln -sf $< $@
481 -
482 -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
483 -index 0f28fad..e384838 100644
484 ---- a/tools/llvm-config/BuildVariables.inc.in
485 -+++ b/tools/llvm-config/BuildVariables.inc.in
486 -@@ -27,3 +27,6 @@
487 - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
488 - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
489 - #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
490 -+#define LLVM_ENABLE_DYLIB "@LLVM_BUILD_LLVM_DYLIB@"
491 -+#define LLVM_ENABLE_SHARED "@LLVM_ENABLE_SHARED@"
492 -+#define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
493 -diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
494 -index dd53460..173f6dc 100644
495 ---- a/tools/llvm-config/CMakeLists.txt
496 -+++ b/tools/llvm-config/CMakeLists.txt
497 -@@ -30,6 +30,11 @@ set(LLVM_BUILD_SYSTEM cmake)
498 - set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
499 - set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
500 - set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
501 -+if(BUILD_SHARED_LIBS)
502 -+ set(LLVM_ENABLE_SHARED ON)
503 -+else()
504 -+ set(LLVM_ENABLE_SHARED OFF)
505 -+endif()
506 - string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
507 - configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
508 -
509 -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
510 -index 4ce8f10..51efbd8 100644
511 ---- a/tools/llvm-config/llvm-config.cpp
512 -+++ b/tools/llvm-config/llvm-config.cpp
513 -@@ -30,6 +30,7 @@
514 - #include <cstdlib>
515 - #include <set>
516 - #include <vector>
517 -+#include <unordered_set>
518 -
519 - using namespace llvm;
520 -
521 -@@ -51,12 +52,16 @@ using namespace llvm;
522 - /// \param Name - The component to traverse.
523 - /// \param ComponentMap - A prebuilt map of component names to descriptors.
524 - /// \param VisitedComponents [in] [out] - The set of already visited components.
525 --/// \param RequiredLibs [out] - The ordered list of required libraries.
526 -+/// \param RequiredLibs [out] - The ordered list of required
527 -+/// libraries.
528 -+/// \param GetComponentNames - Get the component names instead of the
529 -+/// library name.
530 - static void VisitComponent(StringRef Name,
531 - const StringMap<AvailableComponent*> &ComponentMap,
532 - std::set<AvailableComponent*> &VisitedComponents,
533 - std::vector<StringRef> &RequiredLibs,
534 -- bool IncludeNonInstalled) {
535 -+ bool IncludeNonInstalled, bool GetComponentNames,
536 -+ const std::string *ActiveLibDir, bool *HasMissing) {
537 - // Lookup the component.
538 - AvailableComponent *AC = ComponentMap.lookup(Name);
539 - assert(AC && "Invalid component name!");
540 -@@ -74,12 +79,22 @@ static void VisitComponent(StringRef Name,
541 - // Otherwise, visit all the dependencies.
542 - for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) {
543 - VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents,
544 -- RequiredLibs, IncludeNonInstalled);
545 -+ RequiredLibs, IncludeNonInstalled, GetComponentNames,
546 -+ ActiveLibDir, HasMissing);
547 -+ }
548 -+
549 -+ if (GetComponentNames) {
550 -+ RequiredLibs.push_back(Name);
551 -+ return;
552 - }
553 -
554 - // Add to the required library list.
555 -- if (AC->Library)
556 -+ if (AC->Library) {
557 -+ if (!IncludeNonInstalled && HasMissing && !*HasMissing && ActiveLibDir) {
558 -+ *HasMissing = !sys::fs::exists(*ActiveLibDir + "/" + AC->Library);
559 -+ }
560 - RequiredLibs.push_back(AC->Library);
561 -+ }
562 - }
563 -
564 - /// \brief Compute the list of required libraries for a given list of
565 -@@ -91,9 +106,12 @@ static void VisitComponent(StringRef Name,
566 - /// are required to link the given components.
567 - /// \param IncludeNonInstalled - Whether non-installed components should be
568 - /// reported.
569 -+/// \param GetComponentNames - True if one would prefer the component names.
570 - static void ComputeLibsForComponents(const std::vector<StringRef> &Components,
571 - std::vector<StringRef> &RequiredLibs,
572 -- bool IncludeNonInstalled) {
573 -+ bool IncludeNonInstalled, bool GetComponentNames,
574 -+ const std::string *ActiveLibDir,
575 -+ bool *HasMissing) {
576 - std::set<AvailableComponent*> VisitedComponents;
577 -
578 - // Build a map of component names to information.
579 -@@ -116,7 +134,8 @@ static void ComputeLibsForComponents(const std::vector<StringRef> &Components,
580 - }
581 -
582 - VisitComponent(ComponentLower, ComponentMap, VisitedComponents,
583 -- RequiredLibs, IncludeNonInstalled);
584 -+ RequiredLibs, IncludeNonInstalled, GetComponentNames,
585 -+ ActiveLibDir, HasMissing);
586 - }
587 -
588 - // The list is now ordered with leafs first, we want the libraries to printed
589 -@@ -157,6 +176,7 @@ Options:\n\
590 - --host-target Target triple used to configure LLVM.\n\
591 - --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
592 - --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
593 -+ --shared-mode Print how the provided components can be collectively linked (`shared` or `static`).\n\
594 - --build-system Print the build system used to build LLVM (autoconf or cmake).\n\
595 - Typical components:\n\
596 - all All LLVM libraries (default).\n\
597 -@@ -172,10 +192,38 @@ std::string GetExecutablePath(const char *Argv0) {
598 - return llvm::sys::fs::getMainExecutable(Argv0, P);
599 - }
600 -
601 -+/// \brief Expand the semi-colon delimited LLVM_DYLIB_COMPONENTS into
602 -+/// the full list of components.
603 -+std::vector<StringRef> GetAllDyLibComponents(const bool IsInDevelopmentTree,
604 -+ const bool GetComponentNames) {
605 -+ std::vector<StringRef> DyLibComponents;
606 -+ {
607 -+ StringRef DyLibComponentsStr(LLVM_DYLIB_COMPONENTS);
608 -+ size_t Offset = 0;
609 -+ while (true) {
610 -+ const size_t NextOffset = DyLibComponentsStr.find(';', Offset);
611 -+ DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset));
612 -+ if (NextOffset == std::string::npos) {
613 -+ break;
614 -+ }
615 -+ Offset = NextOffset + 1;
616 -+ }
617 -+
618 -+ assert(DyLibComponents.size() > 0);
619 -+ }
620 -+
621 -+ std::vector<StringRef> Components;
622 -+ ComputeLibsForComponents(DyLibComponents, Components,
623 -+ /*IncludeNonInstalled=*/IsInDevelopmentTree,
624 -+ GetComponentNames, nullptr, nullptr);
625 -+
626 -+ return std::move(Components);
627 -+}
628 -+
629 - int main(int argc, char **argv) {
630 - std::vector<StringRef> Components;
631 - bool PrintLibs = false, PrintLibNames = false, PrintLibFiles = false;
632 -- bool PrintSystemLibs = false;
633 -+ bool PrintSystemLibs = false, PrintSharedMode = false;
634 - bool HasAnyOption = false;
635 -
636 - // llvm-config is designed to support being run both from a development tree
637 -@@ -270,6 +318,108 @@ int main(int argc, char **argv) {
638 - ActiveIncludeOption = "-I" + ActiveIncludeDir;
639 - }
640 -
641 -+ /// We only use `shared library` mode in cases where the static library form
642 -+ /// of the components provided are not available; note however that this is
643 -+ /// skipped if we're run from within the build dir. However, once installed,
644 -+ /// we still need to provide correct output when the static archives are
645 -+ /// removed or, as in the case of CMake's `BUILD_SHARED_LIBS`, never present
646 -+ /// in the first place. This can't be done at configure/build time.
647 -+
648 -+ StringRef SharedExt, SharedVersionedExt, SharedDir, SharedPrefix, StaticExt,
649 -+ StaticPrefix, StaticDir = "lib";
650 -+ const Triple HostTriple(Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE));
651 -+ if (HostTriple.isOSWindows()) {
652 -+ SharedExt = "dll";
653 -+ SharedVersionedExt = PACKAGE_VERSION ".dll";
654 -+ StaticExt = "a";
655 -+ SharedDir = ActiveBinDir;
656 -+ StaticDir = ActiveLibDir;
657 -+ StaticPrefix = SharedPrefix = "";
658 -+ } else if (HostTriple.isOSDarwin()) {
659 -+ SharedExt = "dylib";
660 -+ SharedVersionedExt = PACKAGE_VERSION ".dylib";
661 -+ StaticExt = "a";
662 -+ StaticDir = SharedDir = ActiveLibDir;
663 -+ StaticPrefix = SharedPrefix = "lib";
664 -+ } else {
665 -+ // default to the unix values:
666 -+ SharedExt = "so";
667 -+ SharedVersionedExt = PACKAGE_VERSION ".so";
668 -+ StaticExt = "a";
669 -+ StaticDir = SharedDir = ActiveLibDir;
670 -+ StaticPrefix = SharedPrefix = "lib";
671 -+ }
672 -+
673 -+ const bool BuiltDyLib = (std::strcmp(LLVM_ENABLE_DYLIB, "ON") == 0);
674 -+
675 -+ enum { CMake, AutoConf } ConfigTool;
676 -+ if (std::strcmp(LLVM_BUILD_SYSTEM, "cmake") == 0) {
677 -+ ConfigTool = CMake;
678 -+ } else {
679 -+ ConfigTool = AutoConf;
680 -+ }
681 -+
682 -+ /// CMake style shared libs, ie each component is in a shared library.
683 -+ const bool BuiltSharedLibs =
684 -+ (ConfigTool == CMake && std::strcmp(LLVM_ENABLE_SHARED, "ON") == 0);
685 -+
686 -+ bool DyLibExists = false;
687 -+ const std::string DyLibName =
688 -+ (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
689 -+
690 -+ if (BuiltDyLib) {
691 -+ DyLibExists = sys::fs::exists(SharedDir + "/" + DyLibName);
692 -+ }
693 -+
694 -+ /// Get the component's library name without the lib prefix and the
695 -+ /// extension. Returns true if Lib is in a recognized format.
696 -+ auto GetComponentLibraryNameSlice = [&](const StringRef &Lib,
697 -+ StringRef &Out) {
698 -+ if (Lib.startswith("lib")) {
699 -+ unsigned FromEnd;
700 -+ if (Lib.endswith(StaticExt)) {
701 -+ FromEnd = StaticExt.size() + 1;
702 -+ } else if (Lib.endswith(SharedExt)) {
703 -+ FromEnd = SharedExt.size() + 1;
704 -+ } else {
705 -+ FromEnd = 0;
706 -+ }
707 -+
708 -+ if (FromEnd != 0) {
709 -+ Out = Lib.slice(3, Lib.size() - FromEnd);
710 -+ return true;
711 -+ }
712 -+ }
713 -+
714 -+ return false;
715 -+ };
716 -+ /// Maps Unixizms to the host platform.
717 -+ auto GetComponentLibraryFileName = [&](const StringRef &Lib,
718 -+ const bool ForceShared) {
719 -+ std::string LibFileName = Lib;
720 -+ StringRef LibName;
721 -+ if (GetComponentLibraryNameSlice(Lib, LibName)) {
722 -+ if (BuiltSharedLibs || ForceShared) {
723 -+ LibFileName = (SharedPrefix + LibName + "." + SharedExt).str();
724 -+ } else {
725 -+ // default to static
726 -+ LibFileName = (StaticPrefix + LibName + "." + StaticExt).str();
727 -+ }
728 -+ }
729 -+
730 -+ return LibFileName;
731 -+ };
732 -+ /// Get the full path for a possibly shared component library.
733 -+ auto GetComponentLibraryPath = [&](const StringRef &Name,
734 -+ const bool ForceShared) {
735 -+ auto LibFileName = GetComponentLibraryFileName(Name, ForceShared);
736 -+ if (BuiltSharedLibs || ForceShared) {
737 -+ return (SharedDir + "/" + LibFileName).str();
738 -+ } else {
739 -+ return (StaticDir + "/" + LibFileName).str();
740 -+ }
741 -+ };
742 -+
743 - raw_ostream &OS = outs();
744 - for (int i = 1; i != argc; ++i) {
745 - StringRef Arg = argv[i];
746 -@@ -303,13 +453,33 @@ int main(int argc, char **argv) {
747 - } else if (Arg == "--libfiles") {
748 - PrintLibFiles = true;
749 - } else if (Arg == "--components") {
750 -+ /// If there are missing static archives and a dylib was
751 -+ /// built, print LLVM_DYLIB_COMPONENTS instead of everything
752 -+ /// in the manifest.
753 -+ std::vector<StringRef> Components;
754 - for (unsigned j = 0; j != array_lengthof(AvailableComponents); ++j) {
755 - // Only include non-installed components when in a development tree.
756 - if (!AvailableComponents[j].IsInstalled && !IsInDevelopmentTree)
757 - continue;
758 -
759 -- OS << ' ';
760 -- OS << AvailableComponents[j].Name;
761 -+ Components.push_back(AvailableComponents[j].Name);
762 -+ if (AvailableComponents[j].Library && !IsInDevelopmentTree) {
763 -+ if (DyLibExists &&
764 -+ !sys::fs::exists(GetComponentLibraryPath(
765 -+ AvailableComponents[j].Library, false))) {
766 -+ Components = GetAllDyLibComponents(IsInDevelopmentTree, true);
767 -+ std::sort(Components.begin(), Components.end());
768 -+ break;
769 -+ }
770 -+ }
771 -+ }
772 -+
773 -+ for (unsigned I = 0; I < Components.size(); ++I) {
774 -+ if (I) {
775 -+ OS << ' ';
776 -+ }
777 -+
778 -+ OS << Components[I];
779 - }
780 - OS << '\n';
781 - } else if (Arg == "--targets-built") {
782 -@@ -324,6 +494,8 @@ int main(int argc, char **argv) {
783 - #else
784 - OS << "ON\n";
785 - #endif
786 -+ } else if (Arg == "--shared-mode") {
787 -+ PrintSharedMode = true;
788 - } else if (Arg == "--build-system") {
789 - OS << LLVM_BUILD_SYSTEM << '\n';
790 - } else if (Arg == "--obj-root") {
791 -@@ -341,35 +513,84 @@ int main(int argc, char **argv) {
792 - if (!HasAnyOption)
793 - usage();
794 -
795 -- if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs) {
796 -+ if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs ||
797 -+ PrintSharedMode) {
798 -+
799 -+ if (PrintSharedMode && BuiltSharedLibs) {
800 -+ OS << "shared\n";
801 -+ return 0;
802 -+ }
803 -+
804 - // If no components were specified, default to "all".
805 - if (Components.empty())
806 - Components.push_back("all");
807 -
808 - // Construct the list of all the required libraries.
809 - std::vector<StringRef> RequiredLibs;
810 -+ bool HasMissing = false;
811 - ComputeLibsForComponents(Components, RequiredLibs,
812 -- /*IncludeNonInstalled=*/IsInDevelopmentTree);
813 -+ /*IncludeNonInstalled=*/IsInDevelopmentTree, false,
814 -+ &ActiveLibDir, &HasMissing);
815 -+
816 -+ if (PrintSharedMode) {
817 -+ std::unordered_set<std::string> FullDyLibComponents;
818 -+ std::vector<StringRef> DyLibComponents =
819 -+ GetAllDyLibComponents(IsInDevelopmentTree, false);
820 -+
821 -+ for (auto &Component : DyLibComponents) {
822 -+ FullDyLibComponents.insert(Component);
823 -+ }
824 -+ DyLibComponents.clear();
825 -+
826 -+ for (auto &Lib : RequiredLibs) {
827 -+ if (!FullDyLibComponents.count(Lib)) {
828 -+ OS << "static\n";
829 -+ return 0;
830 -+ }
831 -+ }
832 -+ FullDyLibComponents.clear();
833 -+
834 -+ if (HasMissing && DyLibExists) {
835 -+ OS << "shared\n";
836 -+ return 0;
837 -+ } else {
838 -+ OS << "static\n";
839 -+ return 0;
840 -+ }
841 -+ }
842 -
843 - if (PrintLibs || PrintLibNames || PrintLibFiles) {
844 -- for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
845 -- StringRef Lib = RequiredLibs[i];
846 -- if (i)
847 -- OS << ' ';
848 -
849 -+ auto PrintForLib = [&](const StringRef &Lib, const bool ForceShared) {
850 - if (PrintLibNames) {
851 -- OS << Lib;
852 -+ OS << GetComponentLibraryFileName(Lib, ForceShared);
853 - } else if (PrintLibFiles) {
854 -- OS << ActiveLibDir << '/' << Lib;
855 -+ OS << GetComponentLibraryPath(Lib, ForceShared);
856 - } else if (PrintLibs) {
857 - // If this is a typical library name, include it using -l.
858 -- if (Lib.startswith("lib") && Lib.endswith(".a")) {
859 -- OS << "-l" << Lib.slice(3, Lib.size()-2);
860 -- continue;
861 -+ StringRef LibName;
862 -+ if (Lib.startswith("lib")) {
863 -+ if (GetComponentLibraryNameSlice(Lib, LibName)) {
864 -+ OS << "-l" << LibName;
865 -+ } else {
866 -+ OS << "-l:" << GetComponentLibraryFileName(Lib, ForceShared);
867 -+ }
868 -+ } else {
869 -+ // Otherwise, print the full path.
870 -+ OS << GetComponentLibraryPath(Lib, ForceShared);
871 - }
872 -+ }
873 -+ };
874 -+
875 -+ if (HasMissing && DyLibExists) {
876 -+ PrintForLib(DyLibName, true);
877 -+ } else {
878 -+ for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
879 -+ StringRef Lib = RequiredLibs[i];
880 -+ if (i)
881 -+ OS << ' ';
882 -
883 -- // Otherwise, print the full path.
884 -- OS << ActiveLibDir << '/' << Lib;
885 -+ PrintForLib(Lib, false);
886 - }
887 - }
888 - OS << '\n';
889 ---
890 -2.7.4
891 -
892
893 diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-2.patch b/sys-devel/llvm/files/3.7.1/llvm-config-2.patch
894 deleted file mode 100644
895 index 2895d38d7a2..00000000000
896 --- a/sys-devel/llvm/files/3.7.1/llvm-config-2.patch
897 +++ /dev/null
898 @@ -1,113 +0,0 @@
899 -From 4abc261d14c886c21d24f639293a60ce45c1dca3 Mon Sep 17 00:00:00 2001
900 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
901 -Date: Wed, 2 Dec 2015 16:04:56 +0100
902 -Subject: [PATCH 3/4] llvm-config: Clean up exported values, update for shared
903 - linking
904 -
905 -Gentoo-specific fixup for llvm-config, including:
906 -- wiping build-specific CFLAGS, CXXFLAGS,
907 -- updating library suffixes for shared libs,
908 -- wiping --system-libs for shared linking,
909 -- banning --obj-root and --src-root due to no sources installed,
910 -- making --build-mode return "Release" rather than "Gentoo".
911 -
912 -Thanks to Steven Newbury for the initial patch.
913 -
914 -Bug: https://bugs.gentoo.org/565358
915 -Bug: https://bugs.gentoo.org/501684
916 ----
917 - tools/llvm-config/CMakeLists.txt | 11 ++++++++---
918 - tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++-----
919 - utils/llvm-build/llvmbuild/main.py | 4 +++-
920 - 3 files changed, 26 insertions(+), 9 deletions(-)
921 -
922 -diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
923 -index 173f6dc..013ea8c 100644
924 ---- a/tools/llvm-config/CMakeLists.txt
925 -+++ b/tools/llvm-config/CMakeLists.txt
926 -@@ -22,14 +22,19 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS)
927 - set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
928 - set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
929 - set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
930 --set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
931 --set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
932 -+# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
933 -+# specific flags will be set when we don't know what compiler will be used
934 -+# with external project utilising llvm-config. C++ Standard is required.
935 -+# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
936 -+set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
937 -+set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
938 - set(LLVM_BUILD_SYSTEM cmake)
939 -
940 - # Use the C++ link flags, since they should be a superset of C link flags.
941 - set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
942 - set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
943 --set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
944 -+# We don't do static libs, so we don't need to supply any system-libs
945 -+set(LLVM_SYSTEM_LIBS "")
946 - if(BUILD_SHARED_LIBS)
947 - set(LLVM_ENABLE_SHARED ON)
948 - else()
949 -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
950 -index 51efbd8..315e5e1 100644
951 ---- a/tools/llvm-config/llvm-config.cpp
952 -+++ b/tools/llvm-config/llvm-config.cpp
953 -@@ -487,7 +487,8 @@ int main(int argc, char **argv) {
954 - } else if (Arg == "--host-target") {
955 - OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n';
956 - } else if (Arg == "--build-mode") {
957 -- OS << build_mode << '\n';
958 -+ // force Release since we force non-standard Gentoo build mode
959 -+ OS << "Release" << '\n';
960 - } else if (Arg == "--assertion-mode") {
961 - #if defined(NDEBUG)
962 - OS << "OFF\n";
963 -@@ -498,10 +499,19 @@ int main(int argc, char **argv) {
964 - PrintSharedMode = true;
965 - } else if (Arg == "--build-system") {
966 - OS << LLVM_BUILD_SYSTEM << '\n';
967 -- } else if (Arg == "--obj-root") {
968 -- OS << ActivePrefix << '\n';
969 -- } else if (Arg == "--src-root") {
970 -- OS << LLVM_SRC_ROOT << '\n';
971 -+ } else if (Arg == "--obj-root" || Arg == "--src-root") {
972 -+ if (IsInDevelopmentTree) {
973 -+ if (Arg == "--obj-root") {
974 -+ OS << ActivePrefix << '\n';
975 -+ } else {
976 -+ OS << LLVM_SRC_ROOT << '\n';
977 -+ }
978 -+ } else {
979 -+ // sources are not installed
980 -+ llvm::errs() << "llvm-config: sources not installed, "
981 -+ << Arg << " not available\n";
982 -+ exit(1);
983 -+ }
984 - } else {
985 - usage();
986 - }
987 -diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
988 -index 353741f..4ba5e91 100644
989 ---- a/utils/llvm-build/llvmbuild/main.py
990 -+++ b/utils/llvm-build/llvmbuild/main.py
991 -@@ -393,6 +393,8 @@ subdirectories = %s
992 - //
993 - //===----------------------------------------------------------------------===//
994 -
995 -+#include "llvm/Config/config.h"
996 -+
997 - """)
998 - f.write('struct AvailableComponent {\n')
999 - f.write(' /// The name of the component.\n')
1000 -@@ -413,7 +415,7 @@ subdirectories = %s
1001 - if library_name is None:
1002 - library_name_as_cstr = '0'
1003 - else:
1004 -- library_name_as_cstr = '"lib%s.a"' % library_name
1005 -+ library_name_as_cstr = '"lib%s" LTDL_SHLIB_EXT' % library_name
1006 - f.write(' { "%s", %s, %d, { %s } },\n' % (
1007 - name, library_name_as_cstr, is_installed,
1008 - ', '.join('"%s"' % dep
1009 ---
1010 -2.7.4
1011 -
1012
1013 diff --git a/sys-devel/llvm/files/3.7.1/llvm-config-3.patch b/sys-devel/llvm/files/3.7.1/llvm-config-3.patch
1014 deleted file mode 100644
1015 index 7a1547e255d..00000000000
1016 --- a/sys-devel/llvm/files/3.7.1/llvm-config-3.patch
1017 +++ /dev/null
1018 @@ -1,29 +0,0 @@
1019 -From 9308d1858852bdc6f099025ca0482d7b3a32a9aa Mon Sep 17 00:00:00 2001
1020 -From: NAKAMURA Takumi <geek4civic@×××××.com>
1021 -Date: Wed, 10 Feb 2016 01:12:55 +0000
1022 -Subject: [PATCH 4/4] llvm-config: Quick fix for cross compilation. Don't be
1023 - confsed between host and target. It has been there since r252532.
1024 -
1025 -FIXME: The clause may use conditions of host compiler, not HOST_TRIPLE.
1026 -
1027 -git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260343 91177308-0d34-0410-b5e6-96231b3b80d8
1028 ----
1029 - tools/llvm-config/llvm-config.cpp | 2 +-
1030 - 1 file changed, 1 insertion(+), 1 deletion(-)
1031 -
1032 -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
1033 -index 315e5e1..346c9d9 100644
1034 ---- a/tools/llvm-config/llvm-config.cpp
1035 -+++ b/tools/llvm-config/llvm-config.cpp
1036 -@@ -327,7 +327,7 @@ int main(int argc, char **argv) {
1037 -
1038 - StringRef SharedExt, SharedVersionedExt, SharedDir, SharedPrefix, StaticExt,
1039 - StaticPrefix, StaticDir = "lib";
1040 -- const Triple HostTriple(Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE));
1041 -+ const Triple HostTriple(Triple::normalize(LLVM_HOST_TRIPLE));
1042 - if (HostTriple.isOSWindows()) {
1043 - SharedExt = "dll";
1044 - SharedVersionedExt = PACKAGE_VERSION ".dll";
1045 ---
1046 -2.7.4
1047 -
1048
1049 diff --git a/sys-devel/llvm/files/3.7.1/msan-fix.patch b/sys-devel/llvm/files/3.7.1/msan-fix.patch
1050 deleted file mode 100644
1051 index e44baa8a516..00000000000
1052 --- a/sys-devel/llvm/files/3.7.1/msan-fix.patch
1053 +++ /dev/null
1054 @@ -1,79 +0,0 @@
1055 -From 8b0f2fff6e080c053e4fd94d44a694768b8c156e Mon Sep 17 00:00:00 2001
1056 -From: "H.J. Lu" <hjl.tools@×××××.com>
1057 -Date: Wed, 5 Aug 2015 05:35:26 -0700
1058 -Subject: [PATCH 78/84] Apply split-layout-llvm.patch
1059 -
1060 -https://llvm.org/bugs/show_bug.cgi?id=24155
1061 ----
1062 - lib/Transforms/Instrumentation/MemorySanitizer.cpp | 31 ++++++++++++++++------
1063 - 1 file changed, 23 insertions(+), 8 deletions(-)
1064 -
1065 -diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1066 -index 286a563..2ab8bfc 100644
1067 ---- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1068 -+++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1069 -@@ -194,6 +194,12 @@ static cl::opt<bool> ClCheckConstantShadow("msan-check-constant-shadow",
1070 - static const char *const kMsanModuleCtorName = "msan.module_ctor";
1071 - static const char *const kMsanInitName = "__msan_init";
1072 -
1073 -+static cl::opt<bool> ClSplitLayout(
1074 -+ "msan-split-layout", cl::desc(
1075 -+ "use experimental memory layout compatible with "
1076 -+ "non-pie and non-aslr execution"),
1077 -+ cl::Hidden, cl::init(true));
1078 -+
1079 - namespace {
1080 -
1081 - // Memory map parameters used in application-to-shadow address calculation.
1082 -@@ -228,6 +234,13 @@ static const MemoryMapParams Linux_X86_64_MemoryMapParams = {
1083 - 0x200000000000, // OriginBase
1084 - };
1085 -
1086 -+static const MemoryMapParams Linux_X86_64_Split_MemoryMapParams = {
1087 -+ 0, // AndMask (not used)
1088 -+ 0x500000000000, // XorMask
1089 -+ 0, // ShadowBase (not used)
1090 -+ 0x100000000000, // OriginBase
1091 -+};
1092 -+
1093 - // mips64 Linux
1094 - static const MemoryMapParams Linux_MIPS64_MemoryMapParams = {
1095 - 0x004000000000, // AndMask
1096 -@@ -483,7 +496,8 @@ bool MemorySanitizer::doInitialization(Module &M) {
1097 - case Triple::Linux:
1098 - switch (TargetTriple.getArch()) {
1099 - case Triple::x86_64:
1100 -- MapParams = Linux_X86_MemoryMapParams.bits64;
1101 -+ MapParams = ClSplitLayout ? &Linux_X86_64_Split_MemoryMapParams
1102 -+ : Linux_X86_MemoryMapParams.bits64;
1103 - break;
1104 - case Triple::x86:
1105 - MapParams = Linux_X86_MemoryMapParams.bits32;
1106 -@@ -893,16 +907,17 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
1107 - ///
1108 - /// Offset = (Addr & ~AndMask) ^ XorMask
1109 - Value *getShadowPtrOffset(Value *Addr, IRBuilder<> &IRB) {
1110 -+ Value *OffsetLong = IRB.CreatePointerCast(Addr, MS.IntptrTy);
1111 -+
1112 - uint64_t AndMask = MS.MapParams->AndMask;
1113 -- assert(AndMask != 0 && "AndMask shall be specified");
1114 -- Value *OffsetLong =
1115 -- IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy),
1116 -- ConstantInt::get(MS.IntptrTy, ~AndMask));
1117 -+ if (AndMask)
1118 -+ OffsetLong =
1119 -+ IRB.CreateAnd(OffsetLong, ConstantInt::get(MS.IntptrTy, ~AndMask));
1120 -
1121 - uint64_t XorMask = MS.MapParams->XorMask;
1122 -- if (XorMask != 0)
1123 -- OffsetLong = IRB.CreateXor(OffsetLong,
1124 -- ConstantInt::get(MS.IntptrTy, XorMask));
1125 -+ if (XorMask)
1126 -+ OffsetLong =
1127 -+ IRB.CreateXor(OffsetLong, ConstantInt::get(MS.IntptrTy, XorMask));
1128 - return OffsetLong;
1129 - }
1130 -
1131 ---
1132 -2.6.4
1133 -
1134
1135 diff --git a/sys-devel/llvm/llvm-3.7.1-r3.ebuild b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
1136 index 9da3d4f0aa3..5e3be43913a 100644
1137 --- a/sys-devel/llvm/llvm-3.7.1-r3.ebuild
1138 +++ b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
1139 @@ -16,7 +16,8 @@ SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
1140 http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
1141 http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
1142 lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
1143 - !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )"
1144 + !doc? ( https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )
1145 + https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
1146
1147 # Additional licenses:
1148 # 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
1149 @@ -156,21 +157,21 @@ src_prepare() {
1150 # Make ocaml warnings non-fatal, bug #537308
1151 sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
1152 # Fix libdir for ocaml bindings install, bug #559134
1153 - eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
1154 + eapply "${WORKDIR}/${P}-patchset"/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
1155 # Do not build/install ocaml docs with USE=-doc, bug #562008
1156 - eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
1157 + eapply "${WORKDIR}/${P}-patchset"/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
1158
1159 # Make it possible to override Sphinx HTML install dirs
1160 # https://llvm.org/bugs/show_bug.cgi?id=23780
1161 - eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
1162 + eapply "${WORKDIR}/${P}-patchset"/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
1163
1164 # Prevent race conditions with parallel Sphinx runs
1165 # https://llvm.org/bugs/show_bug.cgi?id=23781
1166 - eapply "${FILESDIR}"/3.8.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
1167 + eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
1168
1169 # Prevent installing libgtest
1170 # https://llvm.org/bugs/show_bug.cgi?id=18341
1171 - eapply "${FILESDIR}"/3.8.1/0005-cmake-Do-not-install-libgtest.patch
1172 + eapply "${WORKDIR}/${P}-patchset"/0005-cmake-Do-not-install-libgtest.patch
1173
1174 # Fix llvm-config for shared linking, sane flags and return values
1175 # in order:
1176 @@ -180,49 +181,49 @@ src_prepare() {
1177 # - backported r260343 that fixes cross-compilation
1178 # combination of backported upstream r252532 with our patch
1179 # https://bugs.gentoo.org/show_bug.cgi?id=565358
1180 - eapply "${FILESDIR}"/3.7.1/llvm-config-0.patch
1181 - eapply "${FILESDIR}"/3.7.1/llvm-config-1.patch
1182 - eapply "${FILESDIR}"/3.7.1/llvm-config-2.patch
1183 - eapply "${FILESDIR}"/3.7.1/llvm-config-3.patch
1184 + eapply "${WORKDIR}/${P}-patchset"/llvm-config-0.patch
1185 + eapply "${WORKDIR}/${P}-patchset"/llvm-config-1.patch
1186 + eapply "${WORKDIR}/${P}-patchset"/llvm-config-2.patch
1187 + eapply "${WORKDIR}/${P}-patchset"/llvm-config-3.patch
1188
1189 # Fix msan with newer kernels, #569894
1190 - eapply "${FILESDIR}"/3.7.1/msan-fix.patch
1191 + eapply "${WORKDIR}/${P}-patchset"/msan-fix.patch
1192
1193 # disable use of SDK on OSX, bug #568758
1194 sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
1195
1196 if use clang; then
1197 # Automatically select active system GCC's libraries, bugs #406163 and #417913
1198 - eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch
1199 + eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
1200
1201 # Support gcc4.9 search paths
1202 # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
1203 - eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch
1204 + eapply "${WORKDIR}/${P}-patchset"/clang/gcc4.9-search-path.patch
1205
1206 - eapply "${FILESDIR}"/3.7.1/clang/gentoo-install.patch
1207 + eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
1208
1209 - eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch
1210 + eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
1211 eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
1212
1213 # Fix -isystem support in ccc-analyzer
1214 - eapply "${FILESDIR}"/3.7.1/clang/ccc-analyzer-isystem.patch
1215 + eapply "${WORKDIR}/${P}-patchset"/clang/ccc-analyzer-isystem.patch
1216
1217 sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
1218 tools/clang/tools/scan-build/scan-build || die
1219
1220 # Install clang runtime into /usr/lib/clang
1221 # https://llvm.org/bugs/show_bug.cgi?id=23792
1222 - eapply "${FILESDIR}"/3.7.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
1223 - eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
1224 + eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
1225 + eapply "${WORKDIR}/${P}-patchset"/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
1226
1227 # Do not force -march flags on arm platforms
1228 # https://bugs.gentoo.org/show_bug.cgi?id=562706
1229 - eapply "${FILESDIR}"/3.7.1/compiler-rt/arm_march_flags.patch
1230 + eapply "${WORKDIR}/${P}-patchset"/compiler-rt/arm_march_flags.patch
1231
1232 # Make it possible to override CLANG_LIBDIR_SUFFIX
1233 # (that is used only to find LLVMgold.so)
1234 # https://llvm.org/bugs/show_bug.cgi?id=23793
1235 - eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
1236 + eapply "${WORKDIR}/${P}-patchset"/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
1237
1238 # Fix git-clang-format shebang, bug #562688
1239 python_fix_shebang tools/clang/tools/clang-format/git-clang-format
1240 @@ -230,7 +231,7 @@ src_prepare() {
1241 pushd projects/compiler-rt >/dev/null || die
1242
1243 # Fix msan with newer kernels, compiler-rt part, #569894
1244 - eapply "${FILESDIR}"/3.7.1/compiler-rt/msan-fix.patch
1245 + eapply "${WORKDIR}/${P}-patchset"/compiler-rt/msan-fix.patch
1246
1247 # Fix WX sections, bug #421527
1248 find lib/builtins -type f -name '*.S' -exec sed \
1249 @@ -247,13 +248,13 @@ src_prepare() {
1250 -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
1251
1252 # Fix Python paths, bugs #562436 and #562438
1253 - eapply "${FILESDIR}"/3.7.1/lldb/python.patch
1254 + eapply "${WORKDIR}/${P}-patchset"/lldb/python.patch
1255 sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
1256 -i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
1257
1258 # Fix build with ncurses[tinfo], #560474
1259 # http://llvm.org/viewvc/llvm-project?view=revision&revision=247842
1260 - eapply "${FILESDIR}"/3.7.1/lldb/tinfo.patch
1261 + eapply "${WORKDIR}/${P}-patchset"/lldb/tinfo.patch
1262 fi
1263
1264 # User patches