3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
PYTHON_COMPAT=( python3_{9..11} )
|
7 |
|
inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
|
8 |
|
toolchain-funcs
|
|
6 |
PYTHON_COMPAT=( python3_{10..12} )
|
|
7 |
|
|
8 |
inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
|
|
9 |
inherit toolchain-funcs
|
9 |
10 |
|
10 |
11 |
DESCRIPTION="Low Level Virtual Machine"
|
11 |
12 |
HOMEPAGE="https://llvm.org/"
|
... | ... | |
18 |
19 |
|
19 |
20 |
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
|
20 |
21 |
SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
|
21 |
|
KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
|
|
22 |
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
|
22 |
23 |
IUSE="
|
23 |
24 |
+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
|
24 |
25 |
xml z3 zstd
|
... | ... | |
67 |
68 |
binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
|
68 |
69 |
"
|
69 |
70 |
|
70 |
|
LLVM_COMPONENTS=( llvm cmake third-party )
|
|
71 |
LLVM_COMPONENTS=( llvm cmake )
|
|
72 |
LLVM_TEST_COMPONENTS=( third-party )
|
71 |
73 |
LLVM_MANPAGES=1
|
72 |
|
LLVM_PATCHSET=${PV/_/-}-r3
|
|
74 |
LLVM_PATCHSET=${PV}
|
73 |
75 |
LLVM_USE_TARGETS=provide
|
74 |
76 |
llvm.org_set_globals
|
75 |
77 |
|
... | ... | |
236 |
238 |
llvm-cxxdump
|
237 |
239 |
llvm-cxxfilt
|
238 |
240 |
llvm-cxxmap
|
|
241 |
llvm-debuginfo-analyzer
|
239 |
242 |
llvm-debuginfod
|
240 |
243 |
llvm-debuginfod-find
|
241 |
244 |
llvm-diff
|
... | ... | |
276 |
279 |
llvm-readobj
|
277 |
280 |
llvm-reduce
|
278 |
281 |
llvm-remark-size-diff
|
|
282 |
llvm-remarkutil
|
279 |
283 |
llvm-rtdyld
|
280 |
284 |
llvm-sim
|
281 |
285 |
llvm-size
|
... | ... | |
322 |
326 |
}
|
323 |
327 |
|
324 |
328 |
multilib_src_configure() {
|
|
329 |
tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
|
|
330 |
|
325 |
331 |
local ffi_cflags ffi_ldflags
|
326 |
332 |
if use libffi; then
|
327 |
333 |
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
|
... | ... | |
345 |
351 |
# is that the former list is explicitly verified at cmake time
|
346 |
352 |
-DLLVM_TARGETS_TO_BUILD=""
|
347 |
353 |
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
|
|
354 |
-DLLVM_INCLUDE_BENCHMARKS=OFF
|
|
355 |
-DLLVM_INCLUDE_TESTS=$(usex test)
|
348 |
356 |
-DLLVM_BUILD_TESTS=$(usex test)
|
349 |
357 |
|
350 |
358 |
-DLLVM_ENABLE_FFI=$(usex libffi)
|
... | ... | |
371 |
379 |
-DOCAMLFIND=NO
|
372 |
380 |
)
|
373 |
381 |
|
|
382 |
local suffix=
|
|
383 |
if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
|
|
384 |
# the ABI of the main branch is not stable, so let's include
|
|
385 |
# the commit id in the SOVERSION to contain the breakage
|
|
386 |
suffix+="git${EGIT_VERSION::8}"
|
|
387 |
fi
|
374 |
388 |
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
375 |
389 |
# Smart hack: alter version suffix -> SOVERSION when linking
|
376 |
390 |
# against libc++. This way we won't end up mixing LLVM libc++
|
377 |
391 |
# libraries with libstdc++ clang, and the other way around.
|
|
392 |
suffix+="+libcxx"
|
378 |
393 |
mycmakeargs+=(
|
379 |
|
-DLLVM_VERSION_SUFFIX="libcxx"
|
380 |
394 |
-DLLVM_ENABLE_LIBCXX=ON
|
381 |
395 |
)
|
382 |
396 |
fi
|
383 |
|
|
384 |
|
# Note: go bindings have no CMake rules at the moment
|
385 |
|
# but let's kill the check in case they are introduced
|
386 |
|
# if ! multilib_is_native_abi || ! use go; then
|
387 |
|
mycmakeargs+=(
|
388 |
|
-DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
|
389 |
|
)
|
390 |
|
# fi
|
|
397 |
mycmakeargs+=(
|
|
398 |
-DLLVM_VERSION_SUFFIX="${suffix}"
|
|
399 |
)
|
391 |
400 |
|
392 |
401 |
use test && mycmakeargs+=(
|
393 |
402 |
-DLLVM_LIT_ARGS="$(get_lit_flags)"
|
... | ... | |
416 |
425 |
)
|
417 |
426 |
fi
|
418 |
427 |
|
419 |
|
if tc-is-cross-compiler; then
|
420 |
|
local tblgen="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
|
421 |
|
[[ -x "${tblgen}" ]] \
|
422 |
|
|| die "${tblgen} not found or usable"
|
423 |
|
mycmakeargs+=(
|
424 |
|
-DCMAKE_CROSSCOMPILING=ON
|
425 |
|
-DLLVM_TABLEGEN="${tblgen}"
|
426 |
|
)
|
427 |
|
fi
|
|
428 |
# On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
|
|
429 |
# libncurses, but llvm tries to use libtinfo before libncurses, and ends up
|
|
430 |
# using libtinfo (actually, libncurses.dylib) from system instead of prefix
|
|
431 |
use kernel_Darwin && mycmakeargs+=(
|
|
432 |
-DTerminfo_LIBRARIES=-lncurses
|
|
433 |
)
|
428 |
434 |
|
429 |
435 |
# workaround BMI bug in gcc-7 (fixed in 7.4)
|
430 |
436 |
# https://bugs.gentoo.org/649880
|