5 |
5 |
|
6 |
6 |
PYTHON_COMPAT=( python3_{10..12} )
|
7 |
7 |
|
8 |
|
inherit cmake flag-o-matic llvm llvm.org multilib multilib-minimal
|
|
8 |
inherit cmake llvm llvm.org multilib multilib-minimal
|
9 |
9 |
inherit prefix python-single-r1 toolchain-funcs
|
10 |
10 |
|
11 |
11 |
DESCRIPTION="C language family frontend for LLVM"
|
... | ... | |
16 |
16 |
|
17 |
17 |
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
|
18 |
18 |
SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
|
19 |
|
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x64-macos"
|
|
19 |
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x64-macos"
|
20 |
20 |
IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
|
21 |
21 |
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
22 |
22 |
RESTRICT="!test? ( test )"
|
... | ... | |
52 |
52 |
)
|
53 |
53 |
LLVM_MANPAGES=1
|
54 |
54 |
LLVM_TEST_COMPONENTS=(
|
55 |
|
llvm/lib/Testing
|
56 |
55 |
llvm/utils
|
57 |
|
third-party
|
58 |
56 |
)
|
59 |
|
LLVM_PATCHSET=${PV}
|
60 |
57 |
LLVM_USE_TARGETS=llvm
|
61 |
58 |
llvm.org_set_globals
|
62 |
59 |
|
... | ... | |
256 |
253 |
}
|
257 |
254 |
|
258 |
255 |
multilib_src_configure() {
|
259 |
|
tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
|
260 |
|
|
261 |
256 |
local mycmakeargs=(
|
262 |
257 |
-DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
|
263 |
258 |
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
|
... | ... | |
277 |
272 |
-DLLVM_ENABLE_EH=ON
|
278 |
273 |
-DLLVM_ENABLE_RTTI=ON
|
279 |
274 |
|
280 |
|
-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
|
281 |
275 |
# libgomp support fails to find headers without explicit -I
|
282 |
276 |
# furthermore, it provides only syntax checking
|
283 |
277 |
-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
|
284 |
278 |
|
285 |
279 |
# disable using CUDA to autodetect GPU, just build for all
|
286 |
|
-DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
|
|
280 |
-DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
|
287 |
281 |
# disable linking to HSA to avoid automagic dep,
|
288 |
282 |
# load it dynamically instead
|
289 |
283 |
-DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
|
290 |
284 |
|
291 |
285 |
-DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
|
292 |
286 |
|
|
287 |
-DCLANG_ENABLE_LIBXML2=$(usex xml)
|
293 |
288 |
-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
|
294 |
289 |
-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
|
|
290 |
# TODO: CLANG_ENABLE_HLSL?
|
295 |
291 |
|
296 |
292 |
-DPython3_EXECUTABLE="${PYTHON}"
|
297 |
293 |
)
|
... | ... | |
367 |
363 |
|
368 |
364 |
multilib_src_compile() {
|
369 |
365 |
cmake_build distribution
|
370 |
|
|
371 |
|
# provide a symlink for tests
|
372 |
|
if [[ ! -L ${WORKDIR}/lib/clang ]]; then
|
373 |
|
mkdir -p "${WORKDIR}"/lib || die
|
374 |
|
ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
|
375 |
|
fi
|
376 |
366 |
}
|
377 |
367 |
|
378 |
368 |
multilib_src_test() {
|
... | ... | |
441 |
431 |
# (also drop the version suffix from runtime headers)
|
442 |
432 |
rm -rf "${ED}"/usr/include || die
|
443 |
433 |
mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
|
444 |
|
mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die
|
|
434 |
mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
|
445 |
435 |
if multilib_native_use extra; then
|
446 |
436 |
# don't wrap clang-tidy headers, the list is too long
|
447 |
437 |
# (they're fine for non-native ABI but enabling the targets is problematic)
|