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