1 |
commit: a1eb7f73fe00dafd8765f9144f93f5dd941ce3fc |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 1 08:53:26 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 1 16:17:29 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1eb7f73 |
7 |
|
8 |
sys-devel/llvm: Bump to 12.0.0-rc4 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/llvm/Manifest | 1 + |
13 |
sys-devel/llvm/llvm-12.0.0_rc4.ebuild | 525 ++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 526 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest |
17 |
index 0567a7bd04b..28abc1200a9 100644 |
18 |
--- a/sys-devel/llvm/Manifest |
19 |
+++ b/sys-devel/llvm/Manifest |
20 |
@@ -8,3 +8,4 @@ DIST llvmorg-11.0.1.tar.gz 122790338 BLAKE2B 0130996b4a8c4d9f757136fd7fb318068c9 |
21 |
DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81 |
22 |
DIST llvmorg-12.0.0-rc2.tar.gz 134242619 BLAKE2B bb741a311db608fc2ba7eeaab71c5c9f2a430f7fee3f0c5c4334e5c14caa19738d18c87b568de963d57d9b53e808ac412cf8554eca7fcae9ecca65aa4442e197 SHA512 d8f9b3dfeb0fe9b91eb7f49da393784333044db2653373fbb168afd3c8d50f3e3ec7a7b8f44df522d0facafbfe4cfc4d9e2906d19f1e6feb0bdc569b6c10a17d |
23 |
DIST llvmorg-12.0.0-rc3.tar.gz 134244008 BLAKE2B ed09aa361b264387711ba1ee2e4b01c0c78ad97391df95e2542d4edc31f657cc33c8a2a45de63eb421908d5dadd9392a736610fbb04b3ecbd336d6514a649da8 SHA512 1fae53c6f255160cf4be53848b8b92c8b162ddcfbddf1bf0017faf249859040c15c862c4b52bc3ba894149139afb814e0674da88793ddebfc0756ba3aa7626ce |
24 |
+DIST llvmorg-12.0.0-rc4.tar.gz 134245842 BLAKE2B 860a0551a42e2c6a28f213c151076c5ae64a9d85f7bfb2e2df4737acd5fe968f29d368a689d9a857e01038587e872722d216f044b3f665857d7ed71122fe334e SHA512 20e4440664227c9ea7af84df3643599cd7c96f5e2b6404c42be0ce0f0d7f989f5c7b8df1f1ba93d1473d3a30325cda5a53d3900c0229ccb042b365583b5aa846 |
25 |
|
26 |
diff --git a/sys-devel/llvm/llvm-12.0.0_rc4.ebuild b/sys-devel/llvm/llvm-12.0.0_rc4.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..099dadeda31 |
29 |
--- /dev/null |
30 |
+++ b/sys-devel/llvm/llvm-12.0.0_rc4.ebuild |
31 |
@@ -0,0 +1,525 @@ |
32 |
+# Copyright 1999-2021 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+PYTHON_COMPAT=( python3_{7..9} ) |
38 |
+inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \ |
39 |
+ toolchain-funcs |
40 |
+ |
41 |
+DESCRIPTION="Low Level Virtual Machine" |
42 |
+HOMEPAGE="https://llvm.org/" |
43 |
+ |
44 |
+# Those are in lib/Targets, without explicit CMakeLists.txt mention |
45 |
+ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY VE ) |
46 |
+# Keep in sync with CMakeLists.txt |
47 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 |
48 |
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore |
49 |
+ "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" ) |
50 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
51 |
+ |
52 |
+# Additional licenses: |
53 |
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. |
54 |
+# 2. xxhash: BSD. |
55 |
+# 3. MD5 code: public-domain. |
56 |
+# 4. ConvertUTF.h: TODO. |
57 |
+ |
58 |
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" |
59 |
+SLOT="$(ver_cut 1)" |
60 |
+KEYWORDS="" |
61 |
+IUSE="debug doc exegesis gold libedit +libffi ncurses test xar xml z3 |
62 |
+ kernel_Darwin ${ALL_LLVM_TARGETS[*]}" |
63 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )" |
64 |
+RESTRICT="!test? ( test )" |
65 |
+ |
66 |
+RDEPEND=" |
67 |
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}] |
68 |
+ exegesis? ( dev-libs/libpfm:= ) |
69 |
+ gold? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] ) |
70 |
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) |
71 |
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) |
72 |
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) |
73 |
+ xar? ( app-arch/xar ) |
74 |
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
75 |
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )" |
76 |
+DEPEND="${RDEPEND} |
77 |
+ gold? ( sys-libs/binutils-libs )" |
78 |
+BDEPEND=" |
79 |
+ dev-lang/perl |
80 |
+ >=dev-util/cmake-3.16 |
81 |
+ sys-devel/gnuconfig |
82 |
+ kernel_Darwin? ( |
83 |
+ <sys-libs/libcxx-$(ver_cut 1-3).9999 |
84 |
+ >=sys-devel/binutils-apple-5.1 |
85 |
+ ) |
86 |
+ doc? ( $(python_gen_any_dep ' |
87 |
+ dev-python/recommonmark[${PYTHON_USEDEP}] |
88 |
+ dev-python/sphinx[${PYTHON_USEDEP}] |
89 |
+ ') ) |
90 |
+ libffi? ( virtual/pkgconfig ) |
91 |
+ ${PYTHON_DEPS}" |
92 |
+# There are no file collisions between these versions but having :0 |
93 |
+# installed means llvm-config there will take precedence. |
94 |
+RDEPEND="${RDEPEND} |
95 |
+ !sys-devel/llvm:0" |
96 |
+PDEPEND="sys-devel/llvm-common |
97 |
+ gold? ( >=sys-devel/llvmgold-${SLOT} )" |
98 |
+ |
99 |
+LLVM_COMPONENTS=( llvm ) |
100 |
+LLVM_MANPAGES=build |
101 |
+llvm.org_set_globals |
102 |
+ |
103 |
+python_check_deps() { |
104 |
+ use doc || return 0 |
105 |
+ |
106 |
+ has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" && |
107 |
+ has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" |
108 |
+} |
109 |
+ |
110 |
+check_live_ebuild() { |
111 |
+ local prod_targets=( |
112 |
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ |
113 |
+ | tail -n +2 | head -n -1) |
114 |
+ ) |
115 |
+ local all_targets=( |
116 |
+ lib/Target/*/ |
117 |
+ ) |
118 |
+ all_targets=( "${all_targets[@]#lib/Target/}" ) |
119 |
+ all_targets=( "${all_targets[@]%/}" ) |
120 |
+ |
121 |
+ local exp_targets=() i |
122 |
+ for i in "${all_targets[@]}"; do |
123 |
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) |
124 |
+ done |
125 |
+ # reorder |
126 |
+ all_targets=( "${prod_targets[@]}" "${exp_targets[@]}" ) |
127 |
+ |
128 |
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then |
129 |
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" |
130 |
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" |
131 |
+ eqawarn "Expected: ${exp_targets[*]}" |
132 |
+ eqawarn |
133 |
+ fi |
134 |
+ |
135 |
+ if [[ ${all_targets[*]} != ${ALL_LLVM_TARGETS[*]#llvm_targets_} ]]; then |
136 |
+ eqawarn "ALL_LLVM_TARGETS is outdated!" |
137 |
+ eqawarn " Have: ${ALL_LLVM_TARGETS[*]#llvm_targets_}" |
138 |
+ eqawarn "Expected: ${all_targets[*]}" |
139 |
+ fi |
140 |
+} |
141 |
+ |
142 |
+check_distribution_components() { |
143 |
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then |
144 |
+ local all_targets=() my_targets=() l |
145 |
+ cd "${BUILD_DIR}" || die |
146 |
+ |
147 |
+ while read -r l; do |
148 |
+ if [[ ${l} == install-*-stripped:* ]]; then |
149 |
+ l=${l#install-} |
150 |
+ l=${l%%-stripped*} |
151 |
+ |
152 |
+ case ${l} in |
153 |
+ # shared libs |
154 |
+ LLVM|LLVMgold) |
155 |
+ ;; |
156 |
+ # TableGen lib + deps |
157 |
+ LLVMDemangle|LLVMSupport|LLVMTableGen) |
158 |
+ ;; |
159 |
+ # static libs |
160 |
+ LLVM*) |
161 |
+ continue |
162 |
+ ;; |
163 |
+ # meta-targets |
164 |
+ distribution|llvm-libraries) |
165 |
+ continue |
166 |
+ ;; |
167 |
+ # used only w/ USE=doc |
168 |
+ docs-llvm-html) |
169 |
+ use doc || continue |
170 |
+ ;; |
171 |
+ esac |
172 |
+ |
173 |
+ all_targets+=( "${l}" ) |
174 |
+ fi |
175 |
+ done < <(ninja -t targets all) |
176 |
+ |
177 |
+ while read -r l; do |
178 |
+ my_targets+=( "${l}" ) |
179 |
+ done < <(get_distribution_components $"\n") |
180 |
+ |
181 |
+ local add=() remove=() |
182 |
+ for l in "${all_targets[@]}"; do |
183 |
+ if ! has "${l}" "${my_targets[@]}"; then |
184 |
+ add+=( "${l}" ) |
185 |
+ fi |
186 |
+ done |
187 |
+ for l in "${my_targets[@]}"; do |
188 |
+ if ! has "${l}" "${all_targets[@]}"; then |
189 |
+ remove+=( "${l}" ) |
190 |
+ fi |
191 |
+ done |
192 |
+ |
193 |
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then |
194 |
+ eqawarn "get_distribution_components() is outdated!" |
195 |
+ eqawarn " Add: ${add[*]}" |
196 |
+ eqawarn "Remove: ${remove[*]}" |
197 |
+ fi |
198 |
+ cd - >/dev/null || die |
199 |
+ fi |
200 |
+} |
201 |
+ |
202 |
+src_prepare() { |
203 |
+ # Fix llvm-config for shared linking and sane flags |
204 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358 |
205 |
+ eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch |
206 |
+ |
207 |
+ # Disable LBR tests that are broken on non-Intel CPUs |
208 |
+ # https://bugs.llvm.org/show_bug.cgi?id=48918 |
209 |
+ rm -r test/tools/llvm-exegesis/X86/lbr || die |
210 |
+ |
211 |
+ # disable use of SDK on OSX, bug #568758 |
212 |
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die |
213 |
+ |
214 |
+ # Update config.guess to support more systems |
215 |
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die |
216 |
+ |
217 |
+ # Verify that the live ebuild is up-to-date |
218 |
+ check_live_ebuild |
219 |
+ |
220 |
+ llvm.org_src_prepare |
221 |
+} |
222 |
+ |
223 |
+# Is LLVM being linked against libc++? |
224 |
+is_libcxx_linked() { |
225 |
+ local code='#include <ciso646> |
226 |
+#if defined(_LIBCPP_VERSION) |
227 |
+ HAVE_LIBCXX |
228 |
+#endif |
229 |
+' |
230 |
+ local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1 |
231 |
+ |
232 |
+ [[ ${out} == *HAVE_LIBCXX* ]] |
233 |
+} |
234 |
+ |
235 |
+get_distribution_components() { |
236 |
+ local sep=${1-;} |
237 |
+ |
238 |
+ local out=( |
239 |
+ # shared libs |
240 |
+ LLVM |
241 |
+ LTO |
242 |
+ Remarks |
243 |
+ |
244 |
+ # tools |
245 |
+ llvm-config |
246 |
+ |
247 |
+ # common stuff |
248 |
+ cmake-exports |
249 |
+ llvm-headers |
250 |
+ |
251 |
+ # libraries needed for clang-tblgen |
252 |
+ LLVMDemangle |
253 |
+ LLVMSupport |
254 |
+ LLVMTableGen |
255 |
+ ) |
256 |
+ |
257 |
+ if multilib_is_native_abi; then |
258 |
+ out+=( |
259 |
+ # utilities |
260 |
+ llvm-tblgen |
261 |
+ FileCheck |
262 |
+ llvm-PerfectShuffle |
263 |
+ count |
264 |
+ not |
265 |
+ yaml-bench |
266 |
+ |
267 |
+ # tools |
268 |
+ bugpoint |
269 |
+ dsymutil |
270 |
+ llc |
271 |
+ lli |
272 |
+ lli-child-target |
273 |
+ llvm-addr2line |
274 |
+ llvm-ar |
275 |
+ llvm-as |
276 |
+ llvm-bcanalyzer |
277 |
+ llvm-bitcode-strip |
278 |
+ llvm-c-test |
279 |
+ llvm-cat |
280 |
+ llvm-cfi-verify |
281 |
+ llvm-config |
282 |
+ llvm-cov |
283 |
+ llvm-cvtres |
284 |
+ llvm-cxxdump |
285 |
+ llvm-cxxfilt |
286 |
+ llvm-cxxmap |
287 |
+ llvm-diff |
288 |
+ llvm-dis |
289 |
+ llvm-dlltool |
290 |
+ llvm-dwarfdump |
291 |
+ llvm-dwp |
292 |
+ llvm-elfabi |
293 |
+ llvm-exegesis |
294 |
+ llvm-extract |
295 |
+ llvm-gsymutil |
296 |
+ llvm-ifs |
297 |
+ llvm-install-name-tool |
298 |
+ llvm-jitlink |
299 |
+ llvm-jitlink-executor |
300 |
+ llvm-lib |
301 |
+ llvm-libtool-darwin |
302 |
+ llvm-link |
303 |
+ llvm-lipo |
304 |
+ llvm-lto |
305 |
+ llvm-lto2 |
306 |
+ llvm-mc |
307 |
+ llvm-mca |
308 |
+ llvm-ml |
309 |
+ llvm-modextract |
310 |
+ llvm-mt |
311 |
+ llvm-nm |
312 |
+ llvm-objcopy |
313 |
+ llvm-objdump |
314 |
+ llvm-opt-report |
315 |
+ llvm-pdbutil |
316 |
+ llvm-profdata |
317 |
+ llvm-profgen |
318 |
+ llvm-ranlib |
319 |
+ llvm-rc |
320 |
+ llvm-readelf |
321 |
+ llvm-readobj |
322 |
+ llvm-reduce |
323 |
+ llvm-rtdyld |
324 |
+ llvm-size |
325 |
+ llvm-split |
326 |
+ llvm-stress |
327 |
+ llvm-strings |
328 |
+ llvm-strip |
329 |
+ llvm-symbolizer |
330 |
+ llvm-undname |
331 |
+ llvm-xray |
332 |
+ obj2yaml |
333 |
+ opt |
334 |
+ sancov |
335 |
+ sanstats |
336 |
+ split-file |
337 |
+ verify-uselistorder |
338 |
+ yaml2obj |
339 |
+ |
340 |
+ # python modules |
341 |
+ opt-viewer |
342 |
+ ) |
343 |
+ |
344 |
+ if llvm_are_manpages_built; then |
345 |
+ out+=( |
346 |
+ # manpages |
347 |
+ docs-dsymutil-man |
348 |
+ docs-llvm-dwarfdump-man |
349 |
+ docs-llvm-man |
350 |
+ ) |
351 |
+ fi |
352 |
+ use doc && out+=( |
353 |
+ docs-llvm-html |
354 |
+ ) |
355 |
+ |
356 |
+ use gold && out+=( |
357 |
+ LLVMgold |
358 |
+ ) |
359 |
+ fi |
360 |
+ |
361 |
+ printf "%s${sep}" "${out[@]}" |
362 |
+} |
363 |
+ |
364 |
+multilib_src_configure() { |
365 |
+ local ffi_cflags ffi_ldflags |
366 |
+ if use libffi; then |
367 |
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) |
368 |
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) |
369 |
+ fi |
370 |
+ |
371 |
+ local libdir=$(get_libdir) |
372 |
+ local mycmakeargs=( |
373 |
+ # disable appending VCS revision to the version to improve |
374 |
+ # direct cache hit ratio |
375 |
+ -DLLVM_APPEND_VC_REV=OFF |
376 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}" |
377 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
378 |
+ |
379 |
+ -DBUILD_SHARED_LIBS=OFF |
380 |
+ -DLLVM_BUILD_LLVM_DYLIB=ON |
381 |
+ -DLLVM_LINK_LLVM_DYLIB=ON |
382 |
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) |
383 |
+ |
384 |
+ # cheap hack: LLVM combines both anyway, and the only difference |
385 |
+ # is that the former list is explicitly verified at cmake time |
386 |
+ -DLLVM_TARGETS_TO_BUILD="" |
387 |
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
388 |
+ -DLLVM_BUILD_TESTS=$(usex test) |
389 |
+ |
390 |
+ -DLLVM_ENABLE_FFI=$(usex libffi) |
391 |
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit) |
392 |
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses) |
393 |
+ -DLLVM_ENABLE_LIBXML2=$(usex xml) |
394 |
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug) |
395 |
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis) |
396 |
+ -DLLVM_ENABLE_EH=ON |
397 |
+ -DLLVM_ENABLE_RTTI=ON |
398 |
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) |
399 |
+ |
400 |
+ -DLLVM_HOST_TRIPLE="${CHOST}" |
401 |
+ |
402 |
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" |
403 |
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" |
404 |
+ # used only for llvm-objdump tool |
405 |
+ -DHAVE_LIBXAR=$(multilib_native_usex xar 1 0) |
406 |
+ |
407 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
408 |
+ |
409 |
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml) |
410 |
+ -DOCAMLFIND=NO |
411 |
+ ) |
412 |
+ |
413 |
+ if is_libcxx_linked; then |
414 |
+ # Smart hack: alter version suffix -> SOVERSION when linking |
415 |
+ # against libc++. This way we won't end up mixing LLVM libc++ |
416 |
+ # libraries with libstdc++ clang, and the other way around. |
417 |
+ mycmakeargs+=( |
418 |
+ -DLLVM_VERSION_SUFFIX="libcxx" |
419 |
+ -DLLVM_ENABLE_LIBCXX=ON |
420 |
+ ) |
421 |
+ fi |
422 |
+ |
423 |
+# Note: go bindings have no CMake rules at the moment |
424 |
+# but let's kill the check in case they are introduced |
425 |
+# if ! multilib_is_native_abi || ! use go; then |
426 |
+ mycmakeargs+=( |
427 |
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND |
428 |
+ ) |
429 |
+# fi |
430 |
+ |
431 |
+ use test && mycmakeargs+=( |
432 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
433 |
+ ) |
434 |
+ |
435 |
+ if multilib_is_native_abi; then |
436 |
+ local build_docs=OFF |
437 |
+ if llvm_are_manpages_built; then |
438 |
+ build_docs=ON |
439 |
+ mycmakeargs+=( |
440 |
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man" |
441 |
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" |
442 |
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF |
443 |
+ ) |
444 |
+ fi |
445 |
+ |
446 |
+ mycmakeargs+=( |
447 |
+ -DLLVM_BUILD_DOCS=${build_docs} |
448 |
+ -DLLVM_ENABLE_OCAMLDOC=OFF |
449 |
+ -DLLVM_ENABLE_SPHINX=${build_docs} |
450 |
+ -DLLVM_ENABLE_DOXYGEN=OFF |
451 |
+ -DLLVM_INSTALL_UTILS=ON |
452 |
+ ) |
453 |
+ use gold && mycmakeargs+=( |
454 |
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include |
455 |
+ ) |
456 |
+ fi |
457 |
+ |
458 |
+ if tc-is-cross-compiler; then |
459 |
+ local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen" |
460 |
+ [[ -x "${tblgen}" ]] \ |
461 |
+ || die "${tblgen} not found or usable" |
462 |
+ mycmakeargs+=( |
463 |
+ -DCMAKE_CROSSCOMPILING=ON |
464 |
+ -DLLVM_TABLEGEN="${tblgen}" |
465 |
+ ) |
466 |
+ fi |
467 |
+ |
468 |
+ # workaround BMI bug in gcc-7 (fixed in 7.4) |
469 |
+ # https://bugs.gentoo.org/649880 |
470 |
+ # apply only to x86, https://bugs.gentoo.org/650506 |
471 |
+ if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && |
472 |
+ [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] |
473 |
+ then |
474 |
+ local CFLAGS="${CFLAGS} -mno-bmi" |
475 |
+ local CXXFLAGS="${CXXFLAGS} -mno-bmi" |
476 |
+ fi |
477 |
+ |
478 |
+ # LLVM can have very high memory consumption while linking, |
479 |
+ # exhausting the limit on 32-bit linker executable |
480 |
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" |
481 |
+ |
482 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
483 |
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
484 |
+ cmake_src_configure |
485 |
+ |
486 |
+ multilib_is_native_abi && check_distribution_components |
487 |
+} |
488 |
+ |
489 |
+multilib_src_compile() { |
490 |
+ cmake_build distribution |
491 |
+ |
492 |
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld |
493 |
+ pax-mark m "${BUILD_DIR}"/bin/lli |
494 |
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target |
495 |
+ |
496 |
+ if use test; then |
497 |
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests |
498 |
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests |
499 |
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests |
500 |
+ fi |
501 |
+} |
502 |
+ |
503 |
+multilib_src_test() { |
504 |
+ # respect TMPDIR! |
505 |
+ local -x LIT_PRESERVES_TMP=1 |
506 |
+ cmake_build check |
507 |
+} |
508 |
+ |
509 |
+src_install() { |
510 |
+ local MULTILIB_CHOST_TOOLS=( |
511 |
+ /usr/lib/llvm/${SLOT}/bin/llvm-config |
512 |
+ ) |
513 |
+ |
514 |
+ local MULTILIB_WRAPPED_HEADERS=( |
515 |
+ /usr/include/llvm/Config/llvm-config.h |
516 |
+ ) |
517 |
+ |
518 |
+ local LLVM_LDPATHS=() |
519 |
+ multilib-minimal_src_install |
520 |
+ |
521 |
+ # move wrapped headers back |
522 |
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die |
523 |
+} |
524 |
+ |
525 |
+multilib_src_install() { |
526 |
+ DESTDIR=${D} cmake_build install-distribution |
527 |
+ |
528 |
+ # move headers to /usr/include for wrapping |
529 |
+ rm -rf "${ED}"/usr/include || die |
530 |
+ mv "${ED}"/usr/lib/llvm/${SLOT}/include "${ED}"/usr/include || die |
531 |
+ |
532 |
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" ) |
533 |
+} |
534 |
+ |
535 |
+multilib_src_install_all() { |
536 |
+ local revord=$(( 9999 - ${SLOT} )) |
537 |
+ newenvd - "60llvm-${revord}" <<-_EOF_ |
538 |
+ PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin" |
539 |
+ # we need to duplicate it in ROOTPATH for Portage to respect... |
540 |
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin" |
541 |
+ MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man" |
542 |
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" |
543 |
+ _EOF_ |
544 |
+ |
545 |
+ docompress "/usr/lib/llvm/${SLOT}/share/man" |
546 |
+ llvm_install_manpages |
547 |
+} |
548 |
+ |
549 |
+pkg_postinst() { |
550 |
+ elog "You can find additional opt-viewer utility scripts in:" |
551 |
+ elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer" |
552 |
+ elog "To use these scripts, you will need Python along with the following" |
553 |
+ elog "packages:" |
554 |
+ elog " dev-python/pygments (for opt-viewer)" |
555 |
+ elog " dev-python/pyyaml (for all of them)" |
556 |
+} |