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/
Date: Mon, 20 Mar 2023 13:11:07
Message-Id: 1679317853.5d01e6eefaa7034439093ce833b00d61041bd2ba.mgorny@gentoo
1 commit: 5d01e6eefaa7034439093ce833b00d61041bd2ba
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 20 13:09:09 2023 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 20 13:10:53 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d01e6ee
7
8 sys-devel/llvm: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-devel/llvm/Manifest | 5 -
13 sys-devel/llvm/llvm-16.0.0_rc3.ebuild | 515 -------------------------
14 sys-devel/llvm/llvm-16.0.0_rc4.ebuild | 517 --------------------------
15 sys-devel/llvm/llvm-17.0.0_pre20230304.ebuild | 517 --------------------------
16 4 files changed, 1554 deletions(-)
17
18 diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
19 index f364115a69b2..1a180b504684 100644
20 --- a/sys-devel/llvm/Manifest
21 +++ b/sys-devel/llvm/Manifest
22 @@ -9,9 +9,4 @@ DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78
23 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
24 DIST llvm-project-16.0.0.src.tar.xz 117933476 BLAKE2B fa09cd8f647ce0daf5a7eae9ac03b99594a9b3193b12065f43f9a6731875243f2f5b354136bcadcb31622b246054e94f880eec3dab0bcd6ae89973fa9dca845c SHA512 3f040abc1b03205693824aeff2ee6efb0cff25fe04bd5265141c093f294655a1f3fcda73cab9c57cbed7523c8f186a7e2484afce0792c55e90e3fb80450fabb7
25 DIST llvm-project-16.0.0.src.tar.xz.sig 566 BLAKE2B daba130aa5662fbf7cc2e7aa8fa6b64f9cb355a72330f7a01a21b86389c6f2f85ae93de19ff08ba3f1cfe2834d9a2b7648bdf659caba3afdb2a0d13984774a54 SHA512 38e2449dce20cfbf813d1a9a68b36807722ac8ebb5ee07360fa215b2de8534d2329d3e41cfc3ed33e59e36714b94a6683a6d8077950bcf0037973492e0820fb3
26 -DIST llvm-project-16.0.0rc3.src.tar.xz 117914548 BLAKE2B 18ffa35eb73c7cc4626d7b6b7b30aade7171ee2e17fb8d72e79a67185e809f611fefa4cfef17e5cd16822a5a70de2222534dc9f146fc53987eb49ff6a9d98c18 SHA512 d14e5e5ec984a0dc0292a2d27440398b3e32f120c1579517054dcb1a05dbc4ac5f1c6d078a3d6ef8597a71af6f22863868680a972a571839dcd573418b4a4697
27 -DIST llvm-project-16.0.0rc3.src.tar.xz.sig 566 BLAKE2B 43683d2d7b266a847516f71412bf6236a355462430330fc0da1d624fb8dfbc98bfc982d367baee74d5b4964a9e82e7a4a6ea84bdcff3996d246932f516cced1a SHA512 61adc4dc3eb5a4c11a7f96f9267ff37895e5845a08d48a609a03a2696c1b6bca5af5861a6f28de936c48e6d621bf282170589187f2cb593a912b9078300cf47c
28 -DIST llvm-project-16.0.0rc4.src.tar.xz 117930024 BLAKE2B 55cf032ad3ba52d2af0942fe1c627319ae95b466122d04b24a917c33e29139fae546d92c375715600190c02426b798803ead0ab7a97d86960cf98fca80e8815c SHA512 8d628205c5b93fe6683b67b97b5c7f98bae945bd87cccebcdac00ddd4362108bd171f077a5196242be0fb909c795592b34bfa1c96c50a744fb68f287fd9781cc
29 -DIST llvm-project-16.0.0rc4.src.tar.xz.sig 566 BLAKE2B bfcf39070f32e16cfeae699d95d06f184b1331c3af403340c31cc5a973a3bb1faec0b6342445176cebed5819ddf68e4abfdaa8542ec425b1c822fc8c03c03349 SHA512 2af72e3d771e2361873007a944dcccfe81fbdbc3025a2101e03cbc15f1a173d39ceb94c4ae8966b1d7564bf004ee9a5ffa032e2334c0cf7154aea1090d04b00f
30 -DIST llvm-project-2708869801ae00f4681f6b2d9d69b25b3fce26b6.tar.gz 180523586 BLAKE2B cf918d1e23f922d201a44531c9765b7d8ec2b3b8499ea7954845abcd5fa2687e85b3a34819a583c4f4a6d6e1baa49dbac0b4450cd6b9b322b0f13c88cd7da93c SHA512 18cb00e93d819993a925ae0467d382bc952d82c1eb92dbbb5bb3cdf87043269948670713734ddc3ea4ec50544e54dd11b6747496f7eaa02479374ab9ad075aa5
31 DIST llvm-project-4bf004e07e2b9d6e04e3f33e1b02628c679de664.tar.gz 180304467 BLAKE2B 6750855453b575eb8fcc861d5b24b144497bba62df9b9292ac586cf340e04b2b58290fe9df6d89142f29b56aa37ddeb3bd11cc3337e4dc985a4487954d1e2ffa SHA512 d8a87064ba0f92967df019e9345222b87cda81852a9599902cedc4a49ec7d9e2175c972b7fa6d19920489c1d309822f9c31c23bdce0376a8d40c71d57bcd5068
32
33 diff --git a/sys-devel/llvm/llvm-16.0.0_rc3.ebuild b/sys-devel/llvm/llvm-16.0.0_rc3.ebuild
34 deleted file mode 100644
35 index 5783c357b804..000000000000
36 --- a/sys-devel/llvm/llvm-16.0.0_rc3.ebuild
37 +++ /dev/null
38 @@ -1,515 +0,0 @@
39 -# Copyright 1999-2023 Gentoo Authors
40 -# Distributed under the terms of the GNU General Public License v2
41 -
42 -EAPI=8
43 -
44 -PYTHON_COMPAT=( python3_{9..11} )
45 -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
46 - toolchain-funcs flag-o-matic
47 -
48 -DESCRIPTION="Low Level Virtual Machine"
49 -HOMEPAGE="https://llvm.org/"
50 -
51 -# Additional licenses:
52 -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
53 -# 2. xxhash: BSD.
54 -# 3. MD5 code: public-domain.
55 -# 4. ConvertUTF.h: TODO.
56 -
57 -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
58 -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
59 -KEYWORDS="~loong"
60 -IUSE="
61 - +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
62 - xml z3 zstd
63 -"
64 -RESTRICT="!test? ( test )"
65 -
66 -RDEPEND="
67 - sys-libs/zlib:0=[${MULTILIB_USEDEP}]
68 - exegesis? ( dev-libs/libpfm:= )
69 - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
70 - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
71 - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
72 - xar? ( app-arch/xar )
73 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
74 - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
75 - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
76 -"
77 -DEPEND="
78 - ${RDEPEND}
79 - binutils-plugin? ( sys-libs/binutils-libs )
80 -"
81 -BDEPEND="
82 - ${PYTHON_DEPS}
83 - dev-lang/perl
84 - >=dev-util/cmake-3.16
85 - sys-devel/gnuconfig
86 - kernel_Darwin? (
87 - <sys-libs/libcxx-${LLVM_VERSION}.9999
88 - >=sys-devel/binutils-apple-5.1
89 - )
90 - doc? ( $(python_gen_any_dep '
91 - dev-python/recommonmark[${PYTHON_USEDEP}]
92 - dev-python/sphinx[${PYTHON_USEDEP}]
93 - ') )
94 - libffi? ( virtual/pkgconfig )
95 -"
96 -# There are no file collisions between these versions but having :0
97 -# installed means llvm-config there will take precedence.
98 -RDEPEND="
99 - ${RDEPEND}
100 - !sys-devel/llvm:0
101 -"
102 -PDEPEND="
103 - sys-devel/llvm-common
104 - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
105 - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
106 -"
107 -
108 -LLVM_COMPONENTS=( llvm cmake )
109 -LLVM_TEST_COMPONENTS=( third-party )
110 -LLVM_MANPAGES=1
111 -LLVM_USE_TARGETS=provide
112 -llvm.org_set_globals
113 -
114 -python_check_deps() {
115 - use doc || return 0
116 -
117 - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
118 - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
119 -}
120 -
121 -check_uptodate() {
122 - local prod_targets=(
123 - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
124 - | tail -n +2 | head -n -1)
125 - )
126 - local all_targets=(
127 - lib/Target/*/
128 - )
129 - all_targets=( "${all_targets[@]#lib/Target/}" )
130 - all_targets=( "${all_targets[@]%/}" )
131 -
132 - local exp_targets=() i
133 - for i in "${all_targets[@]}"; do
134 - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
135 - done
136 -
137 - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
138 - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
139 - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
140 - eqawarn "Expected: ${exp_targets[*]}"
141 - eqawarn
142 - fi
143 -
144 - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
145 - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
146 - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
147 - eqawarn "Expected: ${prod_targets[*]}"
148 - fi
149 -}
150 -
151 -check_distribution_components() {
152 - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
153 - local all_targets=() my_targets=() l
154 - cd "${BUILD_DIR}" || die
155 -
156 - while read -r l; do
157 - if [[ ${l} == install-*-stripped:* ]]; then
158 - l=${l#install-}
159 - l=${l%%-stripped*}
160 -
161 - case ${l} in
162 - # shared libs
163 - LLVM|LLVMgold)
164 - ;;
165 - # TableGen lib + deps
166 - LLVMDemangle|LLVMSupport|LLVMTableGen)
167 - ;;
168 - # static libs
169 - LLVM*)
170 - continue
171 - ;;
172 - # meta-targets
173 - distribution|llvm-libraries)
174 - continue
175 - ;;
176 - # used only w/ USE=doc
177 - docs-llvm-html)
178 - use doc || continue
179 - ;;
180 - esac
181 -
182 - all_targets+=( "${l}" )
183 - fi
184 - done < <(${NINJA} -t targets all)
185 -
186 - while read -r l; do
187 - my_targets+=( "${l}" )
188 - done < <(get_distribution_components $"\n")
189 -
190 - local add=() remove=()
191 - for l in "${all_targets[@]}"; do
192 - if ! has "${l}" "${my_targets[@]}"; then
193 - add+=( "${l}" )
194 - fi
195 - done
196 - for l in "${my_targets[@]}"; do
197 - if ! has "${l}" "${all_targets[@]}"; then
198 - remove+=( "${l}" )
199 - fi
200 - done
201 -
202 - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
203 - eqawarn "get_distribution_components() is outdated!"
204 - eqawarn " Add: ${add[*]}"
205 - eqawarn "Remove: ${remove[*]}"
206 - fi
207 - cd - >/dev/null || die
208 - fi
209 -}
210 -
211 -src_prepare() {
212 - # disable use of SDK on OSX, bug #568758
213 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
214 -
215 - # Update config.guess to support more systems
216 - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
217 -
218 - # Verify that the ebuild is up-to-date
219 - check_uptodate
220 -
221 - llvm.org_src_prepare
222 -}
223 -
224 -get_distribution_components() {
225 - local sep=${1-;}
226 -
227 - local out=(
228 - # shared libs
229 - LLVM
230 - LTO
231 - Remarks
232 -
233 - # tools
234 - llvm-config
235 -
236 - # common stuff
237 - cmake-exports
238 - llvm-headers
239 -
240 - # libraries needed for clang-tblgen
241 - LLVMDemangle
242 - LLVMSupport
243 - LLVMTableGen
244 - )
245 -
246 - if multilib_is_native_abi; then
247 - out+=(
248 - # utilities
249 - llvm-tblgen
250 - FileCheck
251 - llvm-PerfectShuffle
252 - count
253 - not
254 - yaml-bench
255 - UnicodeNameMappingGenerator
256 -
257 - # tools
258 - bugpoint
259 - dsymutil
260 - llc
261 - lli
262 - lli-child-target
263 - llvm-addr2line
264 - llvm-ar
265 - llvm-as
266 - llvm-bcanalyzer
267 - llvm-bitcode-strip
268 - llvm-c-test
269 - llvm-cat
270 - llvm-cfi-verify
271 - llvm-config
272 - llvm-cov
273 - llvm-cvtres
274 - llvm-cxxdump
275 - llvm-cxxfilt
276 - llvm-cxxmap
277 - llvm-debuginfo-analyzer
278 - llvm-debuginfod
279 - llvm-debuginfod-find
280 - llvm-diff
281 - llvm-dis
282 - llvm-dlltool
283 - llvm-dwarfdump
284 - llvm-dwarfutil
285 - llvm-dwp
286 - llvm-exegesis
287 - llvm-extract
288 - llvm-gsymutil
289 - llvm-ifs
290 - llvm-install-name-tool
291 - llvm-jitlink
292 - llvm-jitlink-executor
293 - llvm-lib
294 - llvm-libtool-darwin
295 - llvm-link
296 - llvm-lipo
297 - llvm-lto
298 - llvm-lto2
299 - llvm-mc
300 - llvm-mca
301 - llvm-ml
302 - llvm-modextract
303 - llvm-mt
304 - llvm-nm
305 - llvm-objcopy
306 - llvm-objdump
307 - llvm-opt-report
308 - llvm-otool
309 - llvm-pdbutil
310 - llvm-profdata
311 - llvm-profgen
312 - llvm-ranlib
313 - llvm-rc
314 - llvm-readelf
315 - llvm-readobj
316 - llvm-reduce
317 - llvm-remark-size-diff
318 - llvm-remarkutil
319 - llvm-rtdyld
320 - llvm-sim
321 - llvm-size
322 - llvm-split
323 - llvm-stress
324 - llvm-strings
325 - llvm-strip
326 - llvm-symbolizer
327 - llvm-tapi-diff
328 - llvm-tli-checker
329 - llvm-undname
330 - llvm-windres
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 binutils-plugin && out+=(
357 - LLVMgold
358 - )
359 - fi
360 -
361 - printf "%s${sep}" "${out[@]}"
362 -}
363 -
364 -multilib_src_configure() {
365 - tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
366 -
367 - local ffi_cflags ffi_ldflags
368 - if use libffi; then
369 - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
370 - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
371 - fi
372 -
373 - local libdir=$(get_libdir)
374 - local mycmakeargs=(
375 - # disable appending VCS revision to the version to improve
376 - # direct cache hit ratio
377 - -DLLVM_APPEND_VC_REV=OFF
378 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
379 - -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
380 -
381 - -DBUILD_SHARED_LIBS=OFF
382 - -DLLVM_BUILD_LLVM_DYLIB=ON
383 - -DLLVM_LINK_LLVM_DYLIB=ON
384 - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
385 -
386 - # cheap hack: LLVM combines both anyway, and the only difference
387 - # is that the former list is explicitly verified at cmake time
388 - -DLLVM_TARGETS_TO_BUILD=""
389 - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
390 - -DLLVM_INCLUDE_BENCHMARKS=OFF
391 - -DLLVM_INCLUDE_TESTS=$(usex test)
392 - -DLLVM_BUILD_TESTS=$(usex test)
393 -
394 - -DLLVM_ENABLE_FFI=$(usex libffi)
395 - -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
396 - -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
397 - -DLLVM_ENABLE_LIBXML2=$(usex xml)
398 - -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
399 - -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
400 - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
401 - -DLLVM_ENABLE_ZSTD=$(usex zstd)
402 -
403 - -DLLVM_HOST_TRIPLE="${CHOST}"
404 -
405 - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
406 - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
407 - # used only for llvm-objdump tool
408 - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
409 -
410 - -DPython3_EXECUTABLE="${PYTHON}"
411 -
412 - # disable OCaml bindings (now in dev-ml/llvm-ocaml)
413 - -DOCAMLFIND=NO
414 - )
415 -
416 - local suffix=
417 - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
418 - # the ABI of the main branch is not stable, so let's include
419 - # the commit id in the SOVERSION to contain the breakage
420 - suffix+="git${EGIT_VERSION::8}"
421 - fi
422 - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
423 - # Smart hack: alter version suffix -> SOVERSION when linking
424 - # against libc++. This way we won't end up mixing LLVM libc++
425 - # libraries with libstdc++ clang, and the other way around.
426 - suffix+="+libcxx"
427 - mycmakeargs+=(
428 - -DLLVM_ENABLE_LIBCXX=ON
429 - )
430 - fi
431 - mycmakeargs+=(
432 - -DLLVM_VERSION_SUFFIX="${suffix}"
433 - )
434 -
435 - use test && mycmakeargs+=(
436 - -DLLVM_LIT_ARGS="$(get_lit_flags)"
437 - )
438 -
439 - if multilib_is_native_abi; then
440 - local build_docs=OFF
441 - if llvm_are_manpages_built; then
442 - build_docs=ON
443 - mycmakeargs+=(
444 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
445 - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
446 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
447 - )
448 - fi
449 -
450 - mycmakeargs+=(
451 - -DLLVM_BUILD_DOCS=${build_docs}
452 - -DLLVM_ENABLE_OCAMLDOC=OFF
453 - -DLLVM_ENABLE_SPHINX=${build_docs}
454 - -DLLVM_ENABLE_DOXYGEN=OFF
455 - -DLLVM_INSTALL_UTILS=ON
456 - )
457 - use binutils-plugin && mycmakeargs+=(
458 - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
459 - )
460 - fi
461 -
462 - # workaround BMI bug in gcc-7 (fixed in 7.4)
463 - # https://bugs.gentoo.org/649880
464 - # apply only to x86, https://bugs.gentoo.org/650506
465 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
466 - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
467 - then
468 - local CFLAGS="${CFLAGS} -mno-bmi"
469 - local CXXFLAGS="${CXXFLAGS} -mno-bmi"
470 - fi
471 -
472 - # LLVM can have very high memory consumption while linking,
473 - # exhausting the limit on 32-bit linker executable
474 - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
475 -
476 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
477 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
478 - cmake_src_configure
479 -
480 - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
481 - CMakeCache.txt ||
482 - die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
483 - multilib_is_native_abi && check_distribution_components
484 -}
485 -
486 -multilib_src_compile() {
487 - tc-env_build cmake_build distribution
488 -
489 - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
490 - pax-mark m "${BUILD_DIR}"/bin/lli
491 - pax-mark m "${BUILD_DIR}"/bin/lli-child-target
492 -
493 - if use test; then
494 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
495 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
496 - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
497 - fi
498 -}
499 -
500 -multilib_src_test() {
501 - # respect TMPDIR!
502 - local -x LIT_PRESERVES_TMP=1
503 - cmake_build check
504 -}
505 -
506 -src_install() {
507 - local MULTILIB_CHOST_TOOLS=(
508 - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
509 - )
510 -
511 - local MULTILIB_WRAPPED_HEADERS=(
512 - /usr/include/llvm/Config/llvm-config.h
513 - )
514 -
515 - local LLVM_LDPATHS=()
516 - multilib-minimal_src_install
517 -
518 - # move wrapped headers back
519 - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
520 -}
521 -
522 -multilib_src_install() {
523 - DESTDIR=${D} cmake_build install-distribution
524 -
525 - # move headers to /usr/include for wrapping
526 - rm -rf "${ED}"/usr/include || die
527 - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
528 -
529 - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
530 -}
531 -
532 -multilib_src_install_all() {
533 - local revord=$(( 9999 - ${LLVM_MAJOR} ))
534 - newenvd - "60llvm-${revord}" <<-_EOF_
535 - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
536 - # we need to duplicate it in ROOTPATH for Portage to respect...
537 - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
538 - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
539 - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
540 - _EOF_
541 -
542 - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
543 - llvm_install_manpages
544 -}
545 -
546 -pkg_postinst() {
547 - elog "You can find additional opt-viewer utility scripts in:"
548 - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
549 - elog "To use these scripts, you will need Python along with the following"
550 - elog "packages:"
551 - elog " dev-python/pygments (for opt-viewer)"
552 - elog " dev-python/pyyaml (for all of them)"
553 -}
554
555 diff --git a/sys-devel/llvm/llvm-16.0.0_rc4.ebuild b/sys-devel/llvm/llvm-16.0.0_rc4.ebuild
556 deleted file mode 100644
557 index 5228bf50a680..000000000000
558 --- a/sys-devel/llvm/llvm-16.0.0_rc4.ebuild
559 +++ /dev/null
560 @@ -1,517 +0,0 @@
561 -# Copyright 1999-2023 Gentoo Authors
562 -# Distributed under the terms of the GNU General Public License v2
563 -
564 -EAPI=8
565 -
566 -PYTHON_COMPAT=( python3_{9..11} )
567 -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
568 - toolchain-funcs flag-o-matic
569 -
570 -DESCRIPTION="Low Level Virtual Machine"
571 -HOMEPAGE="https://llvm.org/"
572 -
573 -# Additional licenses:
574 -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
575 -# 2. xxhash: BSD.
576 -# 3. MD5 code: public-domain.
577 -# 4. ConvertUTF.h: TODO.
578 -
579 -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
580 -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
581 -KEYWORDS="~loong"
582 -IUSE="
583 - +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
584 - xml z3 zstd
585 -"
586 -RESTRICT="!test? ( test )"
587 -
588 -RDEPEND="
589 - sys-libs/zlib:0=[${MULTILIB_USEDEP}]
590 - exegesis? ( dev-libs/libpfm:= )
591 - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
592 - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
593 - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
594 - xar? ( app-arch/xar )
595 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
596 - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
597 - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
598 -"
599 -DEPEND="
600 - ${RDEPEND}
601 - binutils-plugin? ( sys-libs/binutils-libs )
602 -"
603 -BDEPEND="
604 - ${PYTHON_DEPS}
605 - dev-lang/perl
606 - >=dev-util/cmake-3.16
607 - sys-devel/gnuconfig
608 - kernel_Darwin? (
609 - <sys-libs/libcxx-${LLVM_VERSION}.9999
610 - >=sys-devel/binutils-apple-5.1
611 - )
612 - doc? ( $(python_gen_any_dep '
613 - dev-python/recommonmark[${PYTHON_USEDEP}]
614 - dev-python/sphinx[${PYTHON_USEDEP}]
615 - ') )
616 - libffi? ( virtual/pkgconfig )
617 -"
618 -# There are no file collisions between these versions but having :0
619 -# installed means llvm-config there will take precedence.
620 -RDEPEND="
621 - ${RDEPEND}
622 - !sys-devel/llvm:0
623 -"
624 -PDEPEND="
625 - sys-devel/llvm-common
626 - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
627 - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
628 -"
629 -
630 -LLVM_COMPONENTS=( llvm cmake )
631 -LLVM_TEST_COMPONENTS=( third-party )
632 -LLVM_MANPAGES=1
633 -LLVM_USE_TARGETS=provide
634 -llvm.org_set_globals
635 -
636 -python_check_deps() {
637 - use doc || return 0
638 -
639 - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
640 - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
641 -}
642 -
643 -check_uptodate() {
644 - local prod_targets=(
645 - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
646 - | tail -n +2 | head -n -1)
647 - )
648 - local all_targets=(
649 - lib/Target/*/
650 - )
651 - all_targets=( "${all_targets[@]#lib/Target/}" )
652 - all_targets=( "${all_targets[@]%/}" )
653 -
654 - local exp_targets=() i
655 - for i in "${all_targets[@]}"; do
656 - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
657 - done
658 -
659 - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
660 - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
661 - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
662 - eqawarn "Expected: ${exp_targets[*]}"
663 - eqawarn
664 - fi
665 -
666 - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
667 - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
668 - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
669 - eqawarn "Expected: ${prod_targets[*]}"
670 - fi
671 -}
672 -
673 -check_distribution_components() {
674 - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
675 - local all_targets=() my_targets=() l
676 - cd "${BUILD_DIR}" || die
677 -
678 - while read -r l; do
679 - if [[ ${l} == install-*-stripped:* ]]; then
680 - l=${l#install-}
681 - l=${l%%-stripped*}
682 -
683 - case ${l} in
684 - # shared libs
685 - LLVM|LLVMgold)
686 - ;;
687 - # TableGen lib + deps
688 - LLVMDemangle|LLVMSupport|LLVMTableGen)
689 - ;;
690 - # static libs
691 - LLVM*)
692 - continue
693 - ;;
694 - # meta-targets
695 - distribution|llvm-libraries)
696 - continue
697 - ;;
698 - # used only w/ USE=doc
699 - docs-llvm-html)
700 - use doc || continue
701 - ;;
702 - esac
703 -
704 - all_targets+=( "${l}" )
705 - fi
706 - done < <(${NINJA} -t targets all)
707 -
708 - while read -r l; do
709 - my_targets+=( "${l}" )
710 - done < <(get_distribution_components $"\n")
711 -
712 - local add=() remove=()
713 - for l in "${all_targets[@]}"; do
714 - if ! has "${l}" "${my_targets[@]}"; then
715 - add+=( "${l}" )
716 - fi
717 - done
718 - for l in "${my_targets[@]}"; do
719 - if ! has "${l}" "${all_targets[@]}"; then
720 - remove+=( "${l}" )
721 - fi
722 - done
723 -
724 - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
725 - eqawarn "get_distribution_components() is outdated!"
726 - eqawarn " Add: ${add[*]}"
727 - eqawarn "Remove: ${remove[*]}"
728 - fi
729 - cd - >/dev/null || die
730 - fi
731 -}
732 -
733 -src_prepare() {
734 - # disable use of SDK on OSX, bug #568758
735 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
736 -
737 - # Update config.guess to support more systems
738 - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
739 -
740 - # Verify that the ebuild is up-to-date
741 - check_uptodate
742 -
743 - llvm.org_src_prepare
744 -}
745 -
746 -get_distribution_components() {
747 - local sep=${1-;}
748 -
749 - local out=(
750 - # shared libs
751 - LLVM
752 - LTO
753 - Remarks
754 -
755 - # tools
756 - llvm-config
757 -
758 - # common stuff
759 - cmake-exports
760 - llvm-headers
761 -
762 - # libraries needed for clang-tblgen
763 - LLVMDemangle
764 - LLVMSupport
765 - LLVMTableGen
766 - )
767 -
768 - if multilib_is_native_abi; then
769 - out+=(
770 - # utilities
771 - llvm-tblgen
772 - FileCheck
773 - llvm-PerfectShuffle
774 - count
775 - not
776 - yaml-bench
777 - UnicodeNameMappingGenerator
778 -
779 - # tools
780 - bugpoint
781 - dsymutil
782 - llc
783 - lli
784 - lli-child-target
785 - llvm-addr2line
786 - llvm-ar
787 - llvm-as
788 - llvm-bcanalyzer
789 - llvm-bitcode-strip
790 - llvm-c-test
791 - llvm-cat
792 - llvm-cfi-verify
793 - llvm-config
794 - llvm-cov
795 - llvm-cvtres
796 - llvm-cxxdump
797 - llvm-cxxfilt
798 - llvm-cxxmap
799 - llvm-debuginfo-analyzer
800 - llvm-debuginfod
801 - llvm-debuginfod-find
802 - llvm-diff
803 - llvm-dis
804 - llvm-dlltool
805 - llvm-dwarfdump
806 - llvm-dwarfutil
807 - llvm-dwp
808 - llvm-exegesis
809 - llvm-extract
810 - llvm-gsymutil
811 - llvm-ifs
812 - llvm-install-name-tool
813 - llvm-jitlink
814 - llvm-jitlink-executor
815 - llvm-lib
816 - llvm-libtool-darwin
817 - llvm-link
818 - llvm-lipo
819 - llvm-lto
820 - llvm-lto2
821 - llvm-mc
822 - llvm-mca
823 - llvm-ml
824 - llvm-modextract
825 - llvm-mt
826 - llvm-nm
827 - llvm-objcopy
828 - llvm-objdump
829 - llvm-opt-report
830 - llvm-otool
831 - llvm-pdbutil
832 - llvm-profdata
833 - llvm-profgen
834 - llvm-ranlib
835 - llvm-rc
836 - llvm-readelf
837 - llvm-readobj
838 - llvm-reduce
839 - llvm-remark-size-diff
840 - llvm-remarkutil
841 - llvm-rtdyld
842 - llvm-sim
843 - llvm-size
844 - llvm-split
845 - llvm-stress
846 - llvm-strings
847 - llvm-strip
848 - llvm-symbolizer
849 - llvm-tapi-diff
850 - llvm-tli-checker
851 - llvm-undname
852 - llvm-windres
853 - llvm-xray
854 - obj2yaml
855 - opt
856 - sancov
857 - sanstats
858 - split-file
859 - verify-uselistorder
860 - yaml2obj
861 -
862 - # python modules
863 - opt-viewer
864 - )
865 -
866 - if llvm_are_manpages_built; then
867 - out+=(
868 - # manpages
869 - docs-dsymutil-man
870 - docs-llvm-dwarfdump-man
871 - docs-llvm-man
872 - )
873 - fi
874 - use doc && out+=(
875 - docs-llvm-html
876 - )
877 -
878 - use binutils-plugin && out+=(
879 - LLVMgold
880 - )
881 - fi
882 -
883 - printf "%s${sep}" "${out[@]}"
884 -}
885 -
886 -multilib_src_configure() {
887 - tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
888 -
889 - local ffi_cflags ffi_ldflags
890 - if use libffi; then
891 - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
892 - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
893 - fi
894 -
895 - local libdir=$(get_libdir)
896 - local mycmakeargs=(
897 - # disable appending VCS revision to the version to improve
898 - # direct cache hit ratio
899 - -DLLVM_APPEND_VC_REV=OFF
900 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
901 - -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
902 -
903 - -DBUILD_SHARED_LIBS=OFF
904 - -DLLVM_BUILD_LLVM_DYLIB=ON
905 - -DLLVM_LINK_LLVM_DYLIB=ON
906 - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
907 -
908 - # cheap hack: LLVM combines both anyway, and the only difference
909 - # is that the former list is explicitly verified at cmake time
910 - -DLLVM_TARGETS_TO_BUILD=""
911 - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
912 - -DLLVM_INCLUDE_BENCHMARKS=OFF
913 - -DLLVM_INCLUDE_TESTS=$(usex test)
914 - -DLLVM_BUILD_TESTS=$(usex test)
915 -
916 - -DLLVM_ENABLE_FFI=$(usex libffi)
917 - -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
918 - -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
919 - -DLLVM_ENABLE_LIBXML2=$(usex xml)
920 - -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
921 - -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
922 - -DLLVM_ENABLE_EH=ON
923 - -DLLVM_ENABLE_RTTI=ON
924 - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
925 - -DLLVM_ENABLE_ZSTD=$(usex zstd)
926 -
927 - -DLLVM_HOST_TRIPLE="${CHOST}"
928 -
929 - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
930 - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
931 - # used only for llvm-objdump tool
932 - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
933 -
934 - -DPython3_EXECUTABLE="${PYTHON}"
935 -
936 - # disable OCaml bindings (now in dev-ml/llvm-ocaml)
937 - -DOCAMLFIND=NO
938 - )
939 -
940 - local suffix=
941 - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
942 - # the ABI of the main branch is not stable, so let's include
943 - # the commit id in the SOVERSION to contain the breakage
944 - suffix+="git${EGIT_VERSION::8}"
945 - fi
946 - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
947 - # Smart hack: alter version suffix -> SOVERSION when linking
948 - # against libc++. This way we won't end up mixing LLVM libc++
949 - # libraries with libstdc++ clang, and the other way around.
950 - suffix+="+libcxx"
951 - mycmakeargs+=(
952 - -DLLVM_ENABLE_LIBCXX=ON
953 - )
954 - fi
955 - mycmakeargs+=(
956 - -DLLVM_VERSION_SUFFIX="${suffix}"
957 - )
958 -
959 - use test && mycmakeargs+=(
960 - -DLLVM_LIT_ARGS="$(get_lit_flags)"
961 - )
962 -
963 - if multilib_is_native_abi; then
964 - local build_docs=OFF
965 - if llvm_are_manpages_built; then
966 - build_docs=ON
967 - mycmakeargs+=(
968 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
969 - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
970 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
971 - )
972 - fi
973 -
974 - mycmakeargs+=(
975 - -DLLVM_BUILD_DOCS=${build_docs}
976 - -DLLVM_ENABLE_OCAMLDOC=OFF
977 - -DLLVM_ENABLE_SPHINX=${build_docs}
978 - -DLLVM_ENABLE_DOXYGEN=OFF
979 - -DLLVM_INSTALL_UTILS=ON
980 - )
981 - use binutils-plugin && mycmakeargs+=(
982 - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
983 - )
984 - fi
985 -
986 - # workaround BMI bug in gcc-7 (fixed in 7.4)
987 - # https://bugs.gentoo.org/649880
988 - # apply only to x86, https://bugs.gentoo.org/650506
989 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
990 - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
991 - then
992 - local CFLAGS="${CFLAGS} -mno-bmi"
993 - local CXXFLAGS="${CXXFLAGS} -mno-bmi"
994 - fi
995 -
996 - # LLVM can have very high memory consumption while linking,
997 - # exhausting the limit on 32-bit linker executable
998 - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
999 -
1000 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
1001 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
1002 - cmake_src_configure
1003 -
1004 - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
1005 - CMakeCache.txt ||
1006 - die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
1007 - multilib_is_native_abi && check_distribution_components
1008 -}
1009 -
1010 -multilib_src_compile() {
1011 - tc-env_build cmake_build distribution
1012 -
1013 - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
1014 - pax-mark m "${BUILD_DIR}"/bin/lli
1015 - pax-mark m "${BUILD_DIR}"/bin/lli-child-target
1016 -
1017 - if use test; then
1018 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
1019 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
1020 - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
1021 - fi
1022 -}
1023 -
1024 -multilib_src_test() {
1025 - # respect TMPDIR!
1026 - local -x LIT_PRESERVES_TMP=1
1027 - cmake_build check
1028 -}
1029 -
1030 -src_install() {
1031 - local MULTILIB_CHOST_TOOLS=(
1032 - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
1033 - )
1034 -
1035 - local MULTILIB_WRAPPED_HEADERS=(
1036 - /usr/include/llvm/Config/llvm-config.h
1037 - )
1038 -
1039 - local LLVM_LDPATHS=()
1040 - multilib-minimal_src_install
1041 -
1042 - # move wrapped headers back
1043 - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
1044 -}
1045 -
1046 -multilib_src_install() {
1047 - DESTDIR=${D} cmake_build install-distribution
1048 -
1049 - # move headers to /usr/include for wrapping
1050 - rm -rf "${ED}"/usr/include || die
1051 - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
1052 -
1053 - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
1054 -}
1055 -
1056 -multilib_src_install_all() {
1057 - local revord=$(( 9999 - ${LLVM_MAJOR} ))
1058 - newenvd - "60llvm-${revord}" <<-_EOF_
1059 - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
1060 - # we need to duplicate it in ROOTPATH for Portage to respect...
1061 - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
1062 - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
1063 - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
1064 - _EOF_
1065 -
1066 - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
1067 - llvm_install_manpages
1068 -}
1069 -
1070 -pkg_postinst() {
1071 - elog "You can find additional opt-viewer utility scripts in:"
1072 - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
1073 - elog "To use these scripts, you will need Python along with the following"
1074 - elog "packages:"
1075 - elog " dev-python/pygments (for opt-viewer)"
1076 - elog " dev-python/pyyaml (for all of them)"
1077 -}
1078
1079 diff --git a/sys-devel/llvm/llvm-17.0.0_pre20230304.ebuild b/sys-devel/llvm/llvm-17.0.0_pre20230304.ebuild
1080 deleted file mode 100644
1081 index 6b874a5fe20f..000000000000
1082 --- a/sys-devel/llvm/llvm-17.0.0_pre20230304.ebuild
1083 +++ /dev/null
1084 @@ -1,517 +0,0 @@
1085 -# Copyright 1999-2023 Gentoo Authors
1086 -# Distributed under the terms of the GNU General Public License v2
1087 -
1088 -EAPI=8
1089 -
1090 -PYTHON_COMPAT=( python3_{9..11} )
1091 -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
1092 - toolchain-funcs flag-o-matic
1093 -
1094 -DESCRIPTION="Low Level Virtual Machine"
1095 -HOMEPAGE="https://llvm.org/"
1096 -
1097 -# Additional licenses:
1098 -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
1099 -# 2. xxhash: BSD.
1100 -# 3. MD5 code: public-domain.
1101 -# 4. ConvertUTF.h: TODO.
1102 -
1103 -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
1104 -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
1105 -KEYWORDS=""
1106 -IUSE="
1107 - +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
1108 - xml z3 zstd
1109 -"
1110 -RESTRICT="!test? ( test )"
1111 -
1112 -RDEPEND="
1113 - sys-libs/zlib:0=[${MULTILIB_USEDEP}]
1114 - exegesis? ( dev-libs/libpfm:= )
1115 - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
1116 - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
1117 - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
1118 - xar? ( app-arch/xar )
1119 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
1120 - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
1121 - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
1122 -"
1123 -DEPEND="
1124 - ${RDEPEND}
1125 - binutils-plugin? ( sys-libs/binutils-libs )
1126 -"
1127 -BDEPEND="
1128 - ${PYTHON_DEPS}
1129 - dev-lang/perl
1130 - >=dev-util/cmake-3.16
1131 - sys-devel/gnuconfig
1132 - kernel_Darwin? (
1133 - <sys-libs/libcxx-${LLVM_VERSION}.9999
1134 - >=sys-devel/binutils-apple-5.1
1135 - )
1136 - doc? ( $(python_gen_any_dep '
1137 - dev-python/recommonmark[${PYTHON_USEDEP}]
1138 - dev-python/sphinx[${PYTHON_USEDEP}]
1139 - ') )
1140 - libffi? ( virtual/pkgconfig )
1141 -"
1142 -# There are no file collisions between these versions but having :0
1143 -# installed means llvm-config there will take precedence.
1144 -RDEPEND="
1145 - ${RDEPEND}
1146 - !sys-devel/llvm:0
1147 -"
1148 -PDEPEND="
1149 - sys-devel/llvm-common
1150 - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
1151 - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
1152 -"
1153 -
1154 -LLVM_COMPONENTS=( llvm cmake )
1155 -LLVM_TEST_COMPONENTS=( third-party )
1156 -LLVM_MANPAGES=1
1157 -LLVM_USE_TARGETS=provide
1158 -llvm.org_set_globals
1159 -
1160 -python_check_deps() {
1161 - use doc || return 0
1162 -
1163 - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
1164 - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
1165 -}
1166 -
1167 -check_uptodate() {
1168 - local prod_targets=(
1169 - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
1170 - | tail -n +2 | head -n -1)
1171 - )
1172 - local all_targets=(
1173 - lib/Target/*/
1174 - )
1175 - all_targets=( "${all_targets[@]#lib/Target/}" )
1176 - all_targets=( "${all_targets[@]%/}" )
1177 -
1178 - local exp_targets=() i
1179 - for i in "${all_targets[@]}"; do
1180 - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
1181 - done
1182 -
1183 - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
1184 - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
1185 - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
1186 - eqawarn "Expected: ${exp_targets[*]}"
1187 - eqawarn
1188 - fi
1189 -
1190 - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
1191 - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
1192 - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
1193 - eqawarn "Expected: ${prod_targets[*]}"
1194 - fi
1195 -}
1196 -
1197 -check_distribution_components() {
1198 - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
1199 - local all_targets=() my_targets=() l
1200 - cd "${BUILD_DIR}" || die
1201 -
1202 - while read -r l; do
1203 - if [[ ${l} == install-*-stripped:* ]]; then
1204 - l=${l#install-}
1205 - l=${l%%-stripped*}
1206 -
1207 - case ${l} in
1208 - # shared libs
1209 - LLVM|LLVMgold)
1210 - ;;
1211 - # TableGen lib + deps
1212 - LLVMDemangle|LLVMSupport|LLVMTableGen)
1213 - ;;
1214 - # static libs
1215 - LLVM*)
1216 - continue
1217 - ;;
1218 - # meta-targets
1219 - distribution|llvm-libraries)
1220 - continue
1221 - ;;
1222 - # used only w/ USE=doc
1223 - docs-llvm-html)
1224 - use doc || continue
1225 - ;;
1226 - esac
1227 -
1228 - all_targets+=( "${l}" )
1229 - fi
1230 - done < <(${NINJA} -t targets all)
1231 -
1232 - while read -r l; do
1233 - my_targets+=( "${l}" )
1234 - done < <(get_distribution_components $"\n")
1235 -
1236 - local add=() remove=()
1237 - for l in "${all_targets[@]}"; do
1238 - if ! has "${l}" "${my_targets[@]}"; then
1239 - add+=( "${l}" )
1240 - fi
1241 - done
1242 - for l in "${my_targets[@]}"; do
1243 - if ! has "${l}" "${all_targets[@]}"; then
1244 - remove+=( "${l}" )
1245 - fi
1246 - done
1247 -
1248 - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
1249 - eqawarn "get_distribution_components() is outdated!"
1250 - eqawarn " Add: ${add[*]}"
1251 - eqawarn "Remove: ${remove[*]}"
1252 - fi
1253 - cd - >/dev/null || die
1254 - fi
1255 -}
1256 -
1257 -src_prepare() {
1258 - # disable use of SDK on OSX, bug #568758
1259 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
1260 -
1261 - # Update config.guess to support more systems
1262 - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
1263 -
1264 - # Verify that the ebuild is up-to-date
1265 - check_uptodate
1266 -
1267 - llvm.org_src_prepare
1268 -}
1269 -
1270 -get_distribution_components() {
1271 - local sep=${1-;}
1272 -
1273 - local out=(
1274 - # shared libs
1275 - LLVM
1276 - LTO
1277 - Remarks
1278 -
1279 - # tools
1280 - llvm-config
1281 -
1282 - # common stuff
1283 - cmake-exports
1284 - llvm-headers
1285 -
1286 - # libraries needed for clang-tblgen
1287 - LLVMDemangle
1288 - LLVMSupport
1289 - LLVMTableGen
1290 - )
1291 -
1292 - if multilib_is_native_abi; then
1293 - out+=(
1294 - # utilities
1295 - llvm-tblgen
1296 - FileCheck
1297 - llvm-PerfectShuffle
1298 - count
1299 - not
1300 - yaml-bench
1301 - UnicodeNameMappingGenerator
1302 -
1303 - # tools
1304 - bugpoint
1305 - dsymutil
1306 - llc
1307 - lli
1308 - lli-child-target
1309 - llvm-addr2line
1310 - llvm-ar
1311 - llvm-as
1312 - llvm-bcanalyzer
1313 - llvm-bitcode-strip
1314 - llvm-c-test
1315 - llvm-cat
1316 - llvm-cfi-verify
1317 - llvm-config
1318 - llvm-cov
1319 - llvm-cvtres
1320 - llvm-cxxdump
1321 - llvm-cxxfilt
1322 - llvm-cxxmap
1323 - llvm-debuginfo-analyzer
1324 - llvm-debuginfod
1325 - llvm-debuginfod-find
1326 - llvm-diff
1327 - llvm-dis
1328 - llvm-dlltool
1329 - llvm-dwarfdump
1330 - llvm-dwarfutil
1331 - llvm-dwp
1332 - llvm-exegesis
1333 - llvm-extract
1334 - llvm-gsymutil
1335 - llvm-ifs
1336 - llvm-install-name-tool
1337 - llvm-jitlink
1338 - llvm-jitlink-executor
1339 - llvm-lib
1340 - llvm-libtool-darwin
1341 - llvm-link
1342 - llvm-lipo
1343 - llvm-lto
1344 - llvm-lto2
1345 - llvm-mc
1346 - llvm-mca
1347 - llvm-ml
1348 - llvm-modextract
1349 - llvm-mt
1350 - llvm-nm
1351 - llvm-objcopy
1352 - llvm-objdump
1353 - llvm-opt-report
1354 - llvm-otool
1355 - llvm-pdbutil
1356 - llvm-profdata
1357 - llvm-profgen
1358 - llvm-ranlib
1359 - llvm-rc
1360 - llvm-readelf
1361 - llvm-readobj
1362 - llvm-reduce
1363 - llvm-remark-size-diff
1364 - llvm-remarkutil
1365 - llvm-rtdyld
1366 - llvm-sim
1367 - llvm-size
1368 - llvm-split
1369 - llvm-stress
1370 - llvm-strings
1371 - llvm-strip
1372 - llvm-symbolizer
1373 - llvm-tapi-diff
1374 - llvm-tli-checker
1375 - llvm-undname
1376 - llvm-windres
1377 - llvm-xray
1378 - obj2yaml
1379 - opt
1380 - sancov
1381 - sanstats
1382 - split-file
1383 - verify-uselistorder
1384 - yaml2obj
1385 -
1386 - # python modules
1387 - opt-viewer
1388 - )
1389 -
1390 - if llvm_are_manpages_built; then
1391 - out+=(
1392 - # manpages
1393 - docs-dsymutil-man
1394 - docs-llvm-dwarfdump-man
1395 - docs-llvm-man
1396 - )
1397 - fi
1398 - use doc && out+=(
1399 - docs-llvm-html
1400 - )
1401 -
1402 - use binutils-plugin && out+=(
1403 - LLVMgold
1404 - )
1405 - fi
1406 -
1407 - printf "%s${sep}" "${out[@]}"
1408 -}
1409 -
1410 -multilib_src_configure() {
1411 - tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
1412 -
1413 - local ffi_cflags ffi_ldflags
1414 - if use libffi; then
1415 - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
1416 - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
1417 - fi
1418 -
1419 - local libdir=$(get_libdir)
1420 - local mycmakeargs=(
1421 - # disable appending VCS revision to the version to improve
1422 - # direct cache hit ratio
1423 - -DLLVM_APPEND_VC_REV=OFF
1424 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
1425 - -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
1426 -
1427 - -DBUILD_SHARED_LIBS=OFF
1428 - -DLLVM_BUILD_LLVM_DYLIB=ON
1429 - -DLLVM_LINK_LLVM_DYLIB=ON
1430 - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
1431 -
1432 - # cheap hack: LLVM combines both anyway, and the only difference
1433 - # is that the former list is explicitly verified at cmake time
1434 - -DLLVM_TARGETS_TO_BUILD=""
1435 - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
1436 - -DLLVM_INCLUDE_BENCHMARKS=OFF
1437 - -DLLVM_INCLUDE_TESTS=$(usex test)
1438 - -DLLVM_BUILD_TESTS=$(usex test)
1439 -
1440 - -DLLVM_ENABLE_FFI=$(usex libffi)
1441 - -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
1442 - -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
1443 - -DLLVM_ENABLE_LIBXML2=$(usex xml)
1444 - -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
1445 - -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
1446 - -DLLVM_ENABLE_EH=ON
1447 - -DLLVM_ENABLE_RTTI=ON
1448 - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
1449 - -DLLVM_ENABLE_ZSTD=$(usex zstd)
1450 -
1451 - -DLLVM_HOST_TRIPLE="${CHOST}"
1452 -
1453 - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
1454 - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
1455 - # used only for llvm-objdump tool
1456 - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
1457 -
1458 - -DPython3_EXECUTABLE="${PYTHON}"
1459 -
1460 - # disable OCaml bindings (now in dev-ml/llvm-ocaml)
1461 - -DOCAMLFIND=NO
1462 - )
1463 -
1464 - local suffix=
1465 - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
1466 - # the ABI of the main branch is not stable, so let's include
1467 - # the commit id in the SOVERSION to contain the breakage
1468 - suffix+="git${EGIT_VERSION::8}"
1469 - fi
1470 - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
1471 - # Smart hack: alter version suffix -> SOVERSION when linking
1472 - # against libc++. This way we won't end up mixing LLVM libc++
1473 - # libraries with libstdc++ clang, and the other way around.
1474 - suffix+="+libcxx"
1475 - mycmakeargs+=(
1476 - -DLLVM_ENABLE_LIBCXX=ON
1477 - )
1478 - fi
1479 - mycmakeargs+=(
1480 - -DLLVM_VERSION_SUFFIX="${suffix}"
1481 - )
1482 -
1483 - use test && mycmakeargs+=(
1484 - -DLLVM_LIT_ARGS="$(get_lit_flags)"
1485 - )
1486 -
1487 - if multilib_is_native_abi; then
1488 - local build_docs=OFF
1489 - if llvm_are_manpages_built; then
1490 - build_docs=ON
1491 - mycmakeargs+=(
1492 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
1493 - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
1494 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
1495 - )
1496 - fi
1497 -
1498 - mycmakeargs+=(
1499 - -DLLVM_BUILD_DOCS=${build_docs}
1500 - -DLLVM_ENABLE_OCAMLDOC=OFF
1501 - -DLLVM_ENABLE_SPHINX=${build_docs}
1502 - -DLLVM_ENABLE_DOXYGEN=OFF
1503 - -DLLVM_INSTALL_UTILS=ON
1504 - )
1505 - use binutils-plugin && mycmakeargs+=(
1506 - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
1507 - )
1508 - fi
1509 -
1510 - # workaround BMI bug in gcc-7 (fixed in 7.4)
1511 - # https://bugs.gentoo.org/649880
1512 - # apply only to x86, https://bugs.gentoo.org/650506
1513 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
1514 - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
1515 - then
1516 - local CFLAGS="${CFLAGS} -mno-bmi"
1517 - local CXXFLAGS="${CXXFLAGS} -mno-bmi"
1518 - fi
1519 -
1520 - # LLVM can have very high memory consumption while linking,
1521 - # exhausting the limit on 32-bit linker executable
1522 - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
1523 -
1524 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
1525 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
1526 - cmake_src_configure
1527 -
1528 - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
1529 - CMakeCache.txt ||
1530 - die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
1531 - multilib_is_native_abi && check_distribution_components
1532 -}
1533 -
1534 -multilib_src_compile() {
1535 - tc-env_build cmake_build distribution
1536 -
1537 - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
1538 - pax-mark m "${BUILD_DIR}"/bin/lli
1539 - pax-mark m "${BUILD_DIR}"/bin/lli-child-target
1540 -
1541 - if use test; then
1542 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
1543 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
1544 - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
1545 - fi
1546 -}
1547 -
1548 -multilib_src_test() {
1549 - # respect TMPDIR!
1550 - local -x LIT_PRESERVES_TMP=1
1551 - cmake_build check
1552 -}
1553 -
1554 -src_install() {
1555 - local MULTILIB_CHOST_TOOLS=(
1556 - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
1557 - )
1558 -
1559 - local MULTILIB_WRAPPED_HEADERS=(
1560 - /usr/include/llvm/Config/llvm-config.h
1561 - )
1562 -
1563 - local LLVM_LDPATHS=()
1564 - multilib-minimal_src_install
1565 -
1566 - # move wrapped headers back
1567 - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
1568 -}
1569 -
1570 -multilib_src_install() {
1571 - DESTDIR=${D} cmake_build install-distribution
1572 -
1573 - # move headers to /usr/include for wrapping
1574 - rm -rf "${ED}"/usr/include || die
1575 - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
1576 -
1577 - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
1578 -}
1579 -
1580 -multilib_src_install_all() {
1581 - local revord=$(( 9999 - ${LLVM_MAJOR} ))
1582 - newenvd - "60llvm-${revord}" <<-_EOF_
1583 - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
1584 - # we need to duplicate it in ROOTPATH for Portage to respect...
1585 - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
1586 - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
1587 - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
1588 - _EOF_
1589 -
1590 - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
1591 - llvm_install_manpages
1592 -}
1593 -
1594 -pkg_postinst() {
1595 - elog "You can find additional opt-viewer utility scripts in:"
1596 - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
1597 - elog "To use these scripts, you will need Python along with the following"
1598 - elog "packages:"
1599 - elog " dev-python/pygments (for opt-viewer)"
1600 - elog " dev-python/pyyaml (for all of them)"
1601 -}