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-libs/llvm-libunwind/
Date: Fri, 05 Aug 2022 19:50:14
Message-Id: 1659728999.303bca3f7979786d1b43e894dfab12287b18a9c1.mgorny@gentoo
1 commit: 303bca3f7979786d1b43e894dfab12287b18a9c1
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 5 19:48:43 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 5 19:49:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=303bca3f
7
8 sys-libs/llvm-libunwind: Add 16.* live ebuilds
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../llvm-libunwind-16.0.0.9999.ebuild | 123 +++++++++++++++++++++
13 1 file changed, 123 insertions(+)
14
15 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild
16 new file mode 100644
17 index 000000000000..2abe825b0946
18 --- /dev/null
19 +++ b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild
20 @@ -0,0 +1,123 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +CMAKE_ECLASS=cmake
27 +PYTHON_COMPAT=( python3_{8..11} )
28 +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \
29 + toolchain-funcs
30 +
31 +DESCRIPTION="C++ runtime stack unwinder from LLVM"
32 +HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html"
33 +
34 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
35 +SLOT="0"
36 +KEYWORDS=""
37 +IUSE="+clang debug static-libs test"
38 +REQUIRED_USE="test? ( clang )"
39 +RESTRICT="!test? ( test )"
40 +
41 +RDEPEND="
42 + !sys-libs/libunwind
43 +"
44 +# llvm-6 for new lit options
45 +DEPEND="
46 + >=sys-devel/llvm-6
47 +"
48 +BDEPEND="
49 + clang? (
50 + sys-devel/clang
51 + )
52 + !test? (
53 + ${PYTHON_DEPS}
54 + )
55 + test? (
56 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
57 + )
58 +"
59 +
60 +LLVM_COMPONENTS=( runtimes libunwind libcxx llvm/cmake cmake )
61 +LLVM_TEST_COMPONENTS=( libcxxabi llvm/utils/llvm-lit )
62 +llvm.org_set_globals
63 +
64 +python_check_deps() {
65 + use test || return 0
66 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
67 +}
68 +
69 +multilib_src_configure() {
70 + local use_compiler_rt=OFF
71 + local libdir=$(get_libdir)
72 +
73 + if use clang && ! tc-is-clang; then
74 + # Only do this conditionally to allow overriding with
75 + # e.g. CC=clang-13 in case of breakage
76 + local -x CC=${CHOST}-clang
77 + local -x CXX=${CHOST}-clang++
78 + strip-unsupported-flags
79 + fi
80 +
81 + # link to compiler-rt
82 + # https://github.com/gentoo/gentoo/pull/21516
83 + if tc-is-clang; then
84 + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
85 + ${LD_FLAGS} -print-libgcc-file-name)
86 + if [[ ${compiler_rt} == *libclang_rt* ]]; then
87 + use_compiler_rt=ON
88 + fi
89 + fi
90 +
91 + local mycmakeargs=(
92 + -DPython3_EXECUTABLE="${PYTHON}"
93 + -DLLVM_ENABLE_RUNTIMES="libunwind"
94 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
95 + -DLLVM_INCLUDE_TESTS=OFF
96 + -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
97 + -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
98 + -DLIBUNWIND_INCLUDE_TESTS=$(usex test)
99 + -DLIBUNWIND_INSTALL_HEADERS=ON
100 +
101 + # support non-native unwinding; given it's small enough,
102 + # enable it unconditionally
103 + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON
104 +
105 + # avoid dependency on libgcc_s if compiler-rt is used
106 + -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt}
107 + )
108 + if use test; then
109 + mycmakeargs+=(
110 + -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;libcxx"
111 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
112 + -DLLVM_LIT_ARGS="$(get_lit_flags)"
113 + -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
114 +
115 + -DLIBCXXABI_LIBDIR_SUFFIX=
116 + -DLIBCXXABI_ENABLE_SHARED=OFF
117 + -DLIBCXXABI_ENABLE_STATIC=ON
118 + -DLIBCXXABI_USE_LLVM_UNWINDER=ON
119 + -DLIBCXXABI_INCLUDE_TESTS=OFF
120 +
121 + -DLIBCXX_LIBDIR_SUFFIX=
122 + -DLIBCXX_ENABLE_SHARED=OFF
123 + -DLIBCXX_ENABLE_STATIC=ON
124 + -DLIBCXX_CXX_ABI=libcxxabi
125 + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
126 + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
127 + -DLIBCXX_HAS_GCC_S_LIB=OFF
128 + -DLIBCXX_INCLUDE_TESTS=OFF
129 + -DLIBCXX_INCLUDE_BENCHMARKS=OFF
130 + )
131 + fi
132 +
133 + cmake_src_configure
134 +}
135 +
136 +multilib_src_test() {
137 + local -x LIT_PRESERVES_TMP=1
138 + cmake_build check-unwind
139 +}
140 +
141 +multilib_src_install() {
142 + DESTDIR=${D} cmake_build install-unwind
143 +}