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, 09 Jul 2021 14:44:47
Message-Id: 1625841848.86e84ec20ee8cd0bee81da9a94588a8030d97334.mgorny@gentoo
1 commit: 86e84ec20ee8cd0bee81da9a94588a8030d97334
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 9 07:39:19 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 9 14:44:08 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86e84ec2
7
8 sys-libs/llvm-libunwind: Bump to 12.0.1 (final)
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/llvm-libunwind/Manifest | 1 +
13 .../llvm-libunwind/llvm-libunwind-12.0.1.ebuild | 138 +++++++++++++++++++++
14 2 files changed, 139 insertions(+)
15
16 diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
17 index c5254d02f1d..f3cacde58cc 100644
18 --- a/sys-libs/llvm-libunwind/Manifest
19 +++ b/sys-libs/llvm-libunwind/Manifest
20 @@ -2,3 +2,4 @@ DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3
21 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
22 DIST llvmorg-12.0.0.tar.gz 134226215 BLAKE2B f9c3ba8c58571855caa4f206fd285c9b5be66672fb0814cb8bc0964a051f57f5d35013aa1e27cbda502652b37df1ec23474129109e76a42066847860db441dbe SHA512 0cff02155c5ac0d6db2b72d60d9819d5b5dd859663b45f721b1c7540239c2fceb1f57d9173f6870c49de851c242ed8e85c5c6d6577a1f8092a7c5dcd12513b26
23 DIST llvmorg-12.0.1-rc4.tar.gz 134278617 BLAKE2B d407421c7244bb125151e69e2a341f1af0a0cf8c1fda3b8ae3d4114c3a285d6307620bbf82b22d96d2c7782b37b0975e87be80c24e3ce1fdc71152734be1e8f8 SHA512 1a2c18435a970491eb9fc9381ba66af726e17dcbd5bf6774f9341b1e82fd35f2e5686844743f5317ebd2106b902c39e09aa98102e58a86e290b29102241c949f
24 +DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
25
26 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.ebuild
27 new file mode 100644
28 index 00000000000..cafdb17dce2
29 --- /dev/null
30 +++ b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.ebuild
31 @@ -0,0 +1,138 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +CMAKE_ECLASS=cmake
38 +PYTHON_COMPAT=( python3_{8..10} )
39 +inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs
40 +
41 +DESCRIPTION="C++ runtime stack unwinder from LLVM"
42 +HOMEPAGE="https://github.com/llvm-mirror/libunwind"
43 +
44 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~x64-macos"
47 +IUSE="debug static-libs test"
48 +RESTRICT="!test? ( test )"
49 +
50 +RDEPEND="!sys-libs/libunwind"
51 +# llvm-6 for new lit options
52 +DEPEND="
53 + >=sys-devel/llvm-6"
54 +BDEPEND="
55 + test? ( >=sys-devel/clang-3.9.0
56 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
57 + )"
58 +
59 +LLVM_COMPONENTS=( libunwind libcxx llvm/cmake/modules )
60 +LLVM_TEST_COMPONENTS=( libcxxabi )
61 +llvm.org_set_globals
62 +
63 +python_check_deps() {
64 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
65 +}
66 +
67 +pkg_setup() {
68 + use test && python-any-r1_pkg_setup
69 +}
70 +
71 +multilib_src_configure() {
72 + local use_compiler_rt=OFF
73 + local libdir=$(get_libdir)
74 +
75 + # link to compiler-rt
76 + # https://github.com/gentoo/gentoo/pull/21516
77 + if tc-is-clang; then
78 + local compiler-rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
79 + ${LD_FLAGS} -print-libgcc-file-name)
80 + if [[ ${compiler_rt} == *libclang_rt* ]]; then
81 + use_compiler_rt=ON
82 + fi
83 + fi
84 +
85 + local mycmakeargs=(
86 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
87 + -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
88 + -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
89 + -DLLVM_INCLUDE_TESTS=$(usex test)
90 +
91 + # support non-native unwinding; given it's small enough,
92 + # enable it unconditionally
93 + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON
94 +
95 + # avoid dependency on libgcc_s if compiler-rt is used
96 + -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt}
97 + )
98 + if use test; then
99 + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
100 + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
101 +
102 + mycmakeargs+=(
103 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
104 + -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
105 + -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
106 + )
107 + fi
108 +
109 + cmake_src_configure
110 +}
111 +
112 +build_libcxxabi() {
113 + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)"
114 + local CMAKE_USE_DIR=${WORKDIR}/libcxxabi
115 + local BUILD_DIR=${BUILD_DIR}/libcxxabi
116 + local mycmakeargs=(
117 + -DLIBCXXABI_LIBDIR_SUFFIX=
118 + -DLIBCXXABI_ENABLE_SHARED=OFF
119 + -DLIBCXXABI_ENABLE_STATIC=ONF
120 + -DLIBCXXABI_USE_LLVM_UNWINDER=ON
121 + -DLIBCXXABI_INCLUDE_TESTS=OFF
122 +
123 + -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
124 + -DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include
125 + )
126 +
127 + cmake_src_configure
128 + cmake_src_compile
129 +}
130 +
131 +build_libcxx() {
132 + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)"
133 + local CMAKE_USE_DIR=${WORKDIR}/libcxx
134 + local BUILD_DIR=${BUILD_DIR}/libcxx
135 + local mycmakeargs=(
136 + -DLIBCXX_LIBDIR_SUFFIX=
137 + -DLIBCXX_ENABLE_SHARED=OFF
138 + -DLIBCXX_ENABLE_STATIC=ON
139 + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
140 + -DLIBCXXABI_USE_LLVM_UNWINDER=ON
141 + -DLIBCXX_CXX_ABI=libcxxabi
142 + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include
143 + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
144 + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
145 + -DLIBCXX_HAS_GCC_S_LIB=OFF
146 + -DLIBCXX_INCLUDE_TESTS=OFF
147 + )
148 +
149 + cmake_src_configure
150 + cmake_src_compile
151 +}
152 +
153 +multilib_src_test() {
154 + # build local copies of libc++ & libc++abi for testing to avoid
155 + # circular deps
156 + build_libcxxabi
157 + build_libcxx
158 + mv "${BUILD_DIR}"/libcxx*/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die
159 +
160 + local -x LIT_PRESERVES_TMP=1
161 + cmake_build check-unwind
162 +}
163 +
164 +multilib_src_install() {
165 + cmake_src_install
166 +
167 + # install headers like sys-libs/libunwind
168 + doheader "${S}"/include/*.h
169 +}