1 |
commit: 1570c90b2c8294194794670419ec91b2c8b3da04 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 6 18:44:50 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 6 22:18:14 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1570c90b |
7 |
|
8 |
sys-devel/lld: Bump to 4.0.0rc3, fix tests |
9 |
|
10 |
sys-devel/lld/Manifest | 4 +- |
11 |
...pport-running-tests-in-stand-alone-builds.patch | 160 +++++++++++++++++++++ |
12 |
...D-specific-binary-library-dirs-when-build.patch | 97 +++++++++++++ |
13 |
...ib-cond-when-building-stand-alone-clean-u.patch | 82 +++++++++++ |
14 |
.../{lld-4.0.0_rc2.ebuild => lld-4.0.0_rc3.ebuild} | 12 +- |
15 |
5 files changed, 350 insertions(+), 5 deletions(-) |
16 |
|
17 |
diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest |
18 |
index cfedfe9ca38..03405ac6d90 100644 |
19 |
--- a/sys-devel/lld/Manifest |
20 |
+++ b/sys-devel/lld/Manifest |
21 |
@@ -1,2 +1,2 @@ |
22 |
-DIST lld-4.0.0rc2.src.tar.xz 592856 SHA256 37381d14b13fee27bffef0b6d2650d82c79d69100385f6fa181a0034c2aa9b90 SHA512 49740da609df0416a8d69b0188ab89a90f8e9a90f1c75a2651f0d26a179a3b1d4412f0ed2fda707ee83a9cbc3a8098d7cc1478da3cfb19626e3da82026b03f15 WHIRLPOOL 4c31f0141e6d95275ed5d1762db72b0c45da3eb40e2d5415a9745f0cdd80686820a257bd3b0a1f9a49d0d38126154c1213cf3e8a795414c2c3f68c995538076e |
23 |
-DIST llvm-4.0.0rc2.src.tar.xz 21005416 SHA256 2257faed3795fedfc509d6dd5905be158231c508c6fcaaa02e4a09c5e8dadbe1 SHA512 537356226123b8c9454ec3dfc3adbfb13cfa4bd35f530b85f2b3242391ea1fbd9abf65dfbb62db533e6eae4c9049bb260fb21dccfeb7e355306f4621d35474b7 WHIRLPOOL d79f343ca00c60dd49a3ada4808e779c45210ab03e365e614563b54879ac72b7e80b4022641db10ad2075a0d417ba7c182f9d3abf8c6b012622c0d1541a7dc69 |
24 |
+DIST lld-4.0.0rc3.src.tar.xz 592796 SHA256 851c9f5f4fa8834f0e7deff5ddbce314fe0dfdfc4c1ee41f37c711e7e3b9be4e SHA512 99e00b06b08aa2a5be83a18dec910869d9468c433f216082f9d226236b653165bf13a82f1db004c28213e257500343c938490efae7b218dd3cc60200c2144923 WHIRLPOOL 4651fc099634fc39eaf39a7d5bc4821e0d6075d1ebac99dd677341e129868f832b96a2e0d4728e24042519f389414bf57cc76f48c4e5615b7ac25b962e551ca4 |
25 |
+DIST llvm-4.0.0rc3.src.tar.xz 21013952 SHA256 6727c98f436581adc6b8f9c2ad055d8e27832f60a127e97b3451eba85ef28345 SHA512 a64eaf59388be6641b6d654ceddd63232f83ad50226204255a0c9bcc3d1b36470f7acbf43615b2bd9758cd6077f55fc6155803a12947e1bd2be5661e1ff07e4a WHIRLPOOL 7aef4913c8a33ff0e35670063cb26ddd5d7b72cb08c699116dd93c72f25b6b75187bdf6bfd63b3d3b5c964c118c2db71893024524b864412f4f8daa594be7faa |
26 |
|
27 |
diff --git a/sys-devel/lld/files/4.0.0/0001-cmake-Support-running-tests-in-stand-alone-builds.patch b/sys-devel/lld/files/4.0.0/0001-cmake-Support-running-tests-in-stand-alone-builds.patch |
28 |
new file mode 100644 |
29 |
index 00000000000..e61801a70d5 |
30 |
--- /dev/null |
31 |
+++ b/sys-devel/lld/files/4.0.0/0001-cmake-Support-running-tests-in-stand-alone-builds.patch |
32 |
@@ -0,0 +1,160 @@ |
33 |
+From b06a494b5a8cbacfa3ce34106a8aaba10c0e7948 Mon Sep 17 00:00:00 2001 |
34 |
+From: Michal Gorny <mgorny@g.o> |
35 |
+Date: Tue, 31 Jan 2017 14:10:20 +0000 |
36 |
+Subject: [PATCH 1/3] [cmake] Support running tests in stand-alone builds |
37 |
+ |
38 |
+Add the CMake bits necessary to run lld tests (and unittests) when |
39 |
+building stand-alone. The code is based on the equivalent code in clang, |
40 |
+and includes: |
41 |
+ |
42 |
+1. checking for Python, searching for lit and necessary LLVM test tools |
43 |
+(FileCount and not), |
44 |
+ |
45 |
+2. building LLVM test tools (FileCount and not) from LLVM sources if |
46 |
+they are not installed, |
47 |
+ |
48 |
+3. building gtest libraries from LLVM sources, |
49 |
+ |
50 |
+4. adjusting dependencies so that test targets depend only on those LLVM |
51 |
+targets that are available for a particular variant of stand-alone |
52 |
+build. |
53 |
+ |
54 |
+With this patch, I am able to successfully run 1002 (+10 unsupported) |
55 |
+lit tests on Gentoo using installed LLVM. |
56 |
+ |
57 |
+Differential Revision: https://reviews.llvm.org/D28750 |
58 |
+ |
59 |
+git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@293630 91177308-0d34-0410-b5e6-96231b3b80d8 |
60 |
+--- |
61 |
+ CMakeLists.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++- |
62 |
+ test/CMakeLists.txt | 16 ++++++++----- |
63 |
+ 2 files changed, 77 insertions(+), 7 deletions(-) |
64 |
+ |
65 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
66 |
+index be424efbb..7fcb1a748 100644 |
67 |
+--- a/CMakeLists.txt |
68 |
++++ b/CMakeLists.txt |
69 |
+@@ -11,8 +11,11 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) |
70 |
+ message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") |
71 |
+ endif() |
72 |
+ |
73 |
+- execute_process(COMMAND "${LLVM_CONFIG_PATH}" "--obj-root" "--includedir" |
74 |
++ execute_process(COMMAND "${LLVM_CONFIG_PATH}" |
75 |
++ "--obj-root" |
76 |
++ "--includedir" |
77 |
+ "--cmakedir" |
78 |
++ "--src-root" |
79 |
+ RESULT_VARIABLE HAD_ERROR |
80 |
+ OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT |
81 |
+ OUTPUT_STRIP_TRAILING_WHITESPACE) |
82 |
+@@ -25,9 +28,11 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) |
83 |
+ list(GET LLVM_CONFIG_OUTPUT 0 OBJ_ROOT) |
84 |
+ list(GET LLVM_CONFIG_OUTPUT 1 MAIN_INCLUDE_DIR) |
85 |
+ list(GET LLVM_CONFIG_OUTPUT 2 LLVM_CMAKE_PATH) |
86 |
++ list(GET LLVM_CONFIG_OUTPUT 3 MAIN_SRC_DIR) |
87 |
+ |
88 |
+ set(LLVM_OBJ_ROOT ${OBJ_ROOT} CACHE PATH "path to LLVM build tree") |
89 |
+ set(LLVM_MAIN_INCLUDE_DIR ${MAIN_INCLUDE_DIR} CACHE PATH "path to llvm/include") |
90 |
++ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") |
91 |
+ |
92 |
+ file(TO_CMAKE_PATH ${LLVM_OBJ_ROOT} LLVM_BINARY_DIR) |
93 |
+ |
94 |
+@@ -49,6 +54,67 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) |
95 |
+ include(AddLLVM) |
96 |
+ include(TableGen) |
97 |
+ include(HandleLLVMOptions) |
98 |
++ |
99 |
++ if(LLVM_INCLUDE_TESTS) |
100 |
++ set(Python_ADDITIONAL_VERSIONS 2.7) |
101 |
++ include(FindPythonInterp) |
102 |
++ if(NOT PYTHONINTERP_FOUND) |
103 |
++ message(FATAL_ERROR |
104 |
++"Unable to find Python interpreter, required for testing. |
105 |
++ |
106 |
++Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") |
107 |
++ endif() |
108 |
++ |
109 |
++ if(${PYTHON_VERSION_STRING} VERSION_LESS 2.7) |
110 |
++ message(FATAL_ERROR "Python 2.7 or newer is required") |
111 |
++ endif() |
112 |
++ |
113 |
++ # Check prebuilt llvm/utils. |
114 |
++ if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX} |
115 |
++ AND EXISTS ${LLVM_TOOLS_BINARY_DIR}/not${CMAKE_EXECUTABLE_SUFFIX}) |
116 |
++ set(LLVM_UTILS_PROVIDED ON) |
117 |
++ endif() |
118 |
++ |
119 |
++ if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) |
120 |
++ # Note: path not really used, except for checking if lit was found |
121 |
++ set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) |
122 |
++ if(NOT LLVM_UTILS_PROVIDED) |
123 |
++ add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck) |
124 |
++ add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/not utils/not) |
125 |
++ set(LLVM_UTILS_PROVIDED ON) |
126 |
++ set(LLD_TEST_DEPS FileCheck not) |
127 |
++ endif() |
128 |
++ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) |
129 |
++ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h |
130 |
++ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} |
131 |
++ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) |
132 |
++ add_subdirectory(${UNITTEST_DIR} utils/unittest) |
133 |
++ endif() |
134 |
++ else() |
135 |
++ # Seek installed Lit. |
136 |
++ find_program(LLVM_LIT |
137 |
++ NAMES llvm-lit lit.py lit |
138 |
++ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit" |
139 |
++ DOC "Path to lit.py") |
140 |
++ endif() |
141 |
++ |
142 |
++ if(LLVM_LIT) |
143 |
++ # Define the default arguments to use with 'lit', and an option for the user |
144 |
++ # to override. |
145 |
++ set(LIT_ARGS_DEFAULT "-sv") |
146 |
++ if (MSVC OR XCODE) |
147 |
++ set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") |
148 |
++ endif() |
149 |
++ set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") |
150 |
++ |
151 |
++ # On Win32 hosts, provide an option to specify the path to the GnuWin32 tools. |
152 |
++ if(WIN32 AND NOT CYGWIN) |
153 |
++ set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools") |
154 |
++ endif() |
155 |
++ else() |
156 |
++ set(LLVM_INCLUDE_TESTS OFF) |
157 |
++ endif() |
158 |
++ endif() |
159 |
+ endif() |
160 |
+ |
161 |
+ set(LLD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) |
162 |
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt |
163 |
+index 678880b7f..ede92c13d 100644 |
164 |
+--- a/test/CMakeLists.txt |
165 |
++++ b/test/CMakeLists.txt |
166 |
+@@ -19,13 +19,17 @@ configure_lit_site_cfg( |
167 |
+ ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg |
168 |
+ ) |
169 |
+ |
170 |
+-set(LLD_TEST_DEPS |
171 |
+- FileCheck not llvm-ar llvm-as llvm-dis llvm-dwarfdump llvm-nm |
172 |
+- llc lld llvm-config llvm-objdump llvm-readobj yaml2obj obj2yaml |
173 |
+- llvm-mc llvm-lib llvm-pdbdump opt |
174 |
+- ) |
175 |
++set(LLD_TEST_DEPS lld) |
176 |
++if (NOT LLD_BUILT_STANDALONE) |
177 |
++ list(APPEND LLD_TEST_DEPS |
178 |
++ FileCheck not llvm-ar llvm-as llvm-dis llvm-dwarfdump llvm-nm |
179 |
++ llc llvm-config llvm-objdump llvm-readobj yaml2obj obj2yaml |
180 |
++ llvm-mc llvm-lib llvm-pdbdump opt |
181 |
++ ) |
182 |
++endif() |
183 |
++ |
184 |
+ if (LLVM_INCLUDE_TESTS) |
185 |
+- set(LLD_TEST_DEPS ${LLD_TEST_DEPS} LLDUnitTests) |
186 |
++ list(APPEND LLD_TEST_DEPS LLDUnitTests) |
187 |
+ endif() |
188 |
+ |
189 |
+ set(LLD_TEST_PARAMS |
190 |
+-- |
191 |
+2.12.0 |
192 |
+ |
193 |
|
194 |
diff --git a/sys-devel/lld/files/4.0.0/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch b/sys-devel/lld/files/4.0.0/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch |
195 |
new file mode 100644 |
196 |
index 00000000000..2a7935f7683 |
197 |
--- /dev/null |
198 |
+++ b/sys-devel/lld/files/4.0.0/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch |
199 |
@@ -0,0 +1,97 @@ |
200 |
+From 72b099306f586382a32cb0b37ad6a07dc7cddcf9 Mon Sep 17 00:00:00 2001 |
201 |
+From: Michal Gorny <mgorny@g.o> |
202 |
+Date: Wed, 8 Feb 2017 20:08:25 +0000 |
203 |
+Subject: [PATCH 2/3] [test] Use LLD-specific binary&library dirs when building |
204 |
+ stand-alone |
205 |
+ |
206 |
+Use both LLD- and LLVM-specific binary&library directories when LLD is |
207 |
+being built stand-alone. This ensures that the freshly built tools and |
208 |
+libraries are found and used correctly. |
209 |
+ |
210 |
+Without this patch, the test suite uses LLVM_TOOLS_DIR and LLVM_LIBS_DIR |
211 |
+to locate lld, and set PATH and LD_LIBRARY_PATH. When doing |
212 |
+a stand-alone builds, these variables represent the installed LLVM. |
213 |
+As a result, tests either fail due to missing lld executables/libraries |
214 |
+or use an earlier installed LLD version rather than the one being built. |
215 |
+ |
216 |
+To solve this, an additional LLD_TOOLS_DIR and LLD_LIBS_DIR variables |
217 |
+are added that are populated using LLVM_*_OUTPUT_INTDIR. Those variables |
218 |
+are populated with directories used to output built executables |
219 |
+and libraries. In stand-alone builds, they represent the directories |
220 |
+used by LLD. In integrated builds, they have the same values as |
221 |
+LLVM_*_DIR and therefore using them does not harm. |
222 |
+ |
223 |
+The new variables are prepended to PATH and LD_LIBRARY_PATH to ensure |
224 |
+that freshly built binaries are preferred over potentially earlier |
225 |
+installed ones. Furthermore, the resulting PATH is used to locate tools |
226 |
+for substitutions since the search includes both tools built as part of |
227 |
+LLD and of LLVM. |
228 |
+ |
229 |
+Differential Revision: https://reviews.llvm.org/D29335 |
230 |
+ |
231 |
+git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294507 91177308-0d34-0410-b5e6-96231b3b80d8 |
232 |
+--- |
233 |
+ test/lit.cfg | 14 ++++++++++---- |
234 |
+ test/lit.site.cfg.in | 2 ++ |
235 |
+ 2 files changed, 12 insertions(+), 4 deletions(-) |
236 |
+ |
237 |
+diff --git a/test/lit.cfg b/test/lit.cfg |
238 |
+index 0db879312..8dff2fb4e 100644 |
239 |
+--- a/test/lit.cfg |
240 |
++++ b/test/lit.cfg |
241 |
+@@ -66,18 +66,24 @@ config.llvm_obj_root = getattr(config, 'llvm_obj_root', None) |
242 |
+ |
243 |
+ # Tweak the PATH to include the tools dir and the scripts dir. |
244 |
+ if lld_obj_root is not None: |
245 |
++ lld_tools_dir = getattr(config, 'lld_tools_dir', None) |
246 |
++ if not lld_tools_dir: |
247 |
++ lit_config.fatal('No LLD tools dir set!') |
248 |
+ llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) |
249 |
+ if not llvm_tools_dir: |
250 |
+ lit_config.fatal('No LLVM tools dir set!') |
251 |
+- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) |
252 |
++ path = os.path.pathsep.join((lld_tools_dir, llvm_tools_dir, config.environment['PATH'])) |
253 |
+ path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', None),'test','Scripts'),path)) |
254 |
+ |
255 |
+ config.environment['PATH'] = path |
256 |
+ |
257 |
++ lld_libs_dir = getattr(config, 'lld_libs_dir', None) |
258 |
++ if not lld_libs_dir: |
259 |
++ lit_config.fatal('No LLD libs dir set!') |
260 |
+ llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) |
261 |
+ if not llvm_libs_dir: |
262 |
+ lit_config.fatal('No LLVM libs dir set!') |
263 |
+- path = os.path.pathsep.join((llvm_libs_dir, |
264 |
++ path = os.path.pathsep.join((lld_libs_dir, llvm_libs_dir, |
265 |
+ config.environment.get('LD_LIBRARY_PATH',''))) |
266 |
+ config.environment['LD_LIBRARY_PATH'] = path |
267 |
+ |
268 |
+@@ -174,10 +180,10 @@ for pattern in tool_patterns: |
269 |
+ pattern) |
270 |
+ tool_pipe = tool_match.group(2) |
271 |
+ tool_name = tool_match.group(4) |
272 |
+- tool_path = lit.util.which(tool_name, llvm_tools_dir) |
273 |
++ tool_path = lit.util.which(tool_name, config.environment['PATH']) |
274 |
+ if not tool_path: |
275 |
+ # Warn, but still provide a substitution. |
276 |
+- lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir) |
277 |
++ lit_config.note('Did not find ' + tool_name + ' in ' + path) |
278 |
+ tool_path = llvm_tools_dir + '/' + tool_name |
279 |
+ config.substitutions.append((pattern, tool_pipe + tool_path)) |
280 |
+ |
281 |
+diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in |
282 |
+index 5293f24c1..9dcb48174 100644 |
283 |
+--- a/test/lit.site.cfg.in |
284 |
++++ b/test/lit.site.cfg.in |
285 |
+@@ -6,6 +6,8 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" |
286 |
+ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" |
287 |
+ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" |
288 |
+ config.lld_obj_root = "@LLD_BINARY_DIR@" |
289 |
++config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" |
290 |
++config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" |
291 |
+ config.target_triple = "@TARGET_TRIPLE@" |
292 |
+ config.python_executable = "@PYTHON_EXECUTABLE@" |
293 |
+ config.have_zlib = "@HAVE_LIBZ@" |
294 |
+-- |
295 |
+2.12.0 |
296 |
+ |
297 |
|
298 |
diff --git a/sys-devel/lld/files/4.0.0/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch b/sys-devel/lld/files/4.0.0/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch |
299 |
new file mode 100644 |
300 |
index 00000000000..b1333ac40bc |
301 |
--- /dev/null |
302 |
+++ b/sys-devel/lld/files/4.0.0/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch |
303 |
@@ -0,0 +1,82 @@ |
304 |
+From a7fe305520085cff8e4bec0110d323c4f1ccbcab Mon Sep 17 00:00:00 2001 |
305 |
+From: Michal Gorny <mgorny@g.o> |
306 |
+Date: Wed, 8 Feb 2017 20:08:29 +0000 |
307 |
+Subject: [PATCH 3/3] [test] Fix zlib cond when building stand-alone, clean up |
308 |
+ |
309 |
+Fix the test zlib conditional to use LLVM_ENABLE_ZLIB value when |
310 |
+building stand-alone. The HAVE_LIBZ is not available when performing |
311 |
+a stand-alone build. Since the zlib support is a feature of |
312 |
+the underlying LLVM library, it exports the actual status as the final |
313 |
+value of LLVM_ENABLE_ZLIB in LLVMConfig. |
314 |
+ |
315 |
+While at it, canonicalize the boolean value into 0/1 and remove unused |
316 |
+CMake definitions (most likely copied from clang). |
317 |
+ |
318 |
+Differential Revision: https://reviews.llvm.org/D29340 |
319 |
+ |
320 |
+git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294508 91177308-0d34-0410-b5e6-96231b3b80d8 |
321 |
+--- |
322 |
+ test/CMakeLists.txt | 19 ++++++++++++------- |
323 |
+ test/lit.cfg | 2 +- |
324 |
+ test/lit.site.cfg.in | 2 +- |
325 |
+ 3 files changed, 14 insertions(+), 9 deletions(-) |
326 |
+ |
327 |
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt |
328 |
+index ede92c13d..962274160 100644 |
329 |
+--- a/test/CMakeLists.txt |
330 |
++++ b/test/CMakeLists.txt |
331 |
+@@ -3,13 +3,18 @@ set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") |
332 |
+ set(LLVM_BUILD_MODE "%(build_mode)s") |
333 |
+ set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") |
334 |
+ set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s") |
335 |
+-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") |
336 |
+-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") |
337 |
+-if(BUILD_SHARED_LIBS) |
338 |
+- set(ENABLE_SHARED 1) |
339 |
+-else() |
340 |
+- set(ENABLE_SHARED 0) |
341 |
+-endif(BUILD_SHARED_LIBS) |
342 |
++ |
343 |
++if(LLD_BUILT_STANDALONE) |
344 |
++ # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This |
345 |
++ # value is forced to 0 if zlib was not found, so it is fine to use it |
346 |
++ # instead of HAVE_LIBZ (not recorded). |
347 |
++ if(LLVM_ENABLE_ZLIB) |
348 |
++ set(HAVE_LIBZ 1) |
349 |
++ endif() |
350 |
++endif() |
351 |
++ |
352 |
++llvm_canonicalize_cmake_booleans( |
353 |
++ HAVE_LIBZ) |
354 |
+ |
355 |
+ configure_lit_site_cfg( |
356 |
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
357 |
+diff --git a/test/lit.cfg b/test/lit.cfg |
358 |
+index 8dff2fb4e..85469ff6f 100644 |
359 |
+--- a/test/lit.cfg |
360 |
++++ b/test/lit.cfg |
361 |
+@@ -202,7 +202,7 @@ if execute_external: |
362 |
+ config.available_features.add('shell') |
363 |
+ |
364 |
+ # zlib compression library |
365 |
+-if config.have_zlib == "1": |
366 |
++if config.have_zlib: |
367 |
+ config.available_features.add("zlib") |
368 |
+ |
369 |
+ # Running on Darwin OS |
370 |
+diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in |
371 |
+index 9dcb48174..1fb8d3690 100644 |
372 |
+--- a/test/lit.site.cfg.in |
373 |
++++ b/test/lit.site.cfg.in |
374 |
+@@ -10,7 +10,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" |
375 |
+ config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" |
376 |
+ config.target_triple = "@TARGET_TRIPLE@" |
377 |
+ config.python_executable = "@PYTHON_EXECUTABLE@" |
378 |
+-config.have_zlib = "@HAVE_LIBZ@" |
379 |
++config.have_zlib = @HAVE_LIBZ@ |
380 |
+ |
381 |
+ # Support substitution of the tools and libs dirs with user parameters. This is |
382 |
+ # used when we can't determine the tool dir at configuration time. |
383 |
+-- |
384 |
+2.12.0 |
385 |
+ |
386 |
|
387 |
diff --git a/sys-devel/lld/lld-4.0.0_rc2.ebuild b/sys-devel/lld/lld-4.0.0_rc3.ebuild |
388 |
similarity index 80% |
389 |
rename from sys-devel/lld/lld-4.0.0_rc2.ebuild |
390 |
rename to sys-devel/lld/lld-4.0.0_rc3.ebuild |
391 |
index f37c0c3db8b..f0400e77e95 100644 |
392 |
--- a/sys-devel/lld/lld-4.0.0_rc2.ebuild |
393 |
+++ b/sys-devel/lld/lld-4.0.0_rc3.ebuild |
394 |
@@ -26,9 +26,6 @@ DEPEND="${RDEPEND} |
395 |
|
396 |
S=${WORKDIR}/${P/_/}.src |
397 |
|
398 |
-# TODO: fix test suite to build stand-alone |
399 |
-RESTRICT="test" |
400 |
- |
401 |
# least intrusive of all |
402 |
CMAKE_BUILD_TYPE=RelWithDebInfo |
403 |
|
404 |
@@ -49,6 +46,15 @@ src_unpack() { |
405 |
fi |
406 |
} |
407 |
|
408 |
+src_prepare() { |
409 |
+ # backport stand-alone build test fixes from master |
410 |
+ eapply "${FILESDIR}/4.0.0/0001-cmake-Support-running-tests-in-stand-alone-builds.patch" |
411 |
+ eapply "${FILESDIR}/4.0.0/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch" |
412 |
+ eapply "${FILESDIR}/4.0.0/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch" |
413 |
+ |
414 |
+ eapply_user |
415 |
+} |
416 |
+ |
417 |
src_configure() { |
418 |
local mycmakeargs=( |
419 |
-DBUILD_SHARED_LIBS=ON |