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, 01 Oct 2021 13:27:23
Message-Id: 1633094815.11a856ebedb6ed111a951c05901f6708479a2190.mgorny@gentoo
1 commit: 11a856ebedb6ed111a951c05901f6708479a2190
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 1 12:36:37 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 1 13:26:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11a856eb
7
8 sys-libs/llvm-libunwind: Bump to 13.0.0 (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-13.0.0.ebuild | 141 +++++++++++++++++++++
14 2 files changed, 142 insertions(+)
15
16 diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
17 index 23bb7af47e1..743ab9d8e74 100644
18 --- a/sys-libs/llvm-libunwind/Manifest
19 +++ b/sys-libs/llvm-libunwind/Manifest
20 @@ -4,3 +4,4 @@ DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f6
21 DIST llvmorg-13.0.0-rc2.tar.gz 147267736 BLAKE2B 153bf7320f2aa911112d366ffc79f7110cb04f135c2a8b176c263f0a75eb768206d9bd462893d45504b0e58aa9e127fdcafb02300eab1666e4616aa654d457dd SHA512 a01baf3eaa02f02af42bfcf6dcf24f166351bf1c09601495617c81e41def23210573bad40a344270f40c5deb881d06863536abac2a6481930766a6a56335fb44
22 DIST llvmorg-13.0.0-rc3.tar.gz 147281901 BLAKE2B 640065a2f32dc48edf084d776cb6b950fae86c2a204999e2eec67f93b57615df40adec19785099b0ef2fe11837c3304794ec3585289a5b5051a557618c63c749 SHA512 1401d5a4d6bb5c930d74b9cfbc8e792872f721aab7d7f0c819e2ba5cf47fb818d160c1f71784fba69827f3c9b7414aa91a585d2b813c1851b4799f9d62cebc46
23 DIST llvmorg-13.0.0-rc4.tar.gz 147286367 BLAKE2B a43c54b8bb379b0374f99ae07066d7ba4ae2a83dfdb61390101c736f91dc44aa07a88778551aaaf903033562b2a0a863ea6b27392b700c9cddc74e2c7899cad1 SHA512 8ccaaea21ec4fe3c4b4446d3a7cae36a47ed196f407d341da45824bcefefffd3c412c0c5c27670ceaba1458bc53107273f9d3aec2de261b6b82c6d209b45b14d
24 +DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
25
26 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.ebuild
27 new file mode 100644
28 index 00000000000..ad3bb8063d6
29 --- /dev/null
30 +++ b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.ebuild
31 @@ -0,0 +1,141 @@
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 )
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 +wrap_libcxxabi() {
113 + local mycmakeargs=(
114 + -DLIBCXXABI_LIBDIR_SUFFIX=
115 + -DLIBCXXABI_ENABLE_SHARED=OFF
116 + -DLIBCXXABI_ENABLE_STATIC=ONF
117 + -DLIBCXXABI_USE_LLVM_UNWINDER=ON
118 + -DLIBCXXABI_INCLUDE_TESTS=OFF
119 +
120 + -DLIBCXXABI_LIBCXX_INCLUDES="${BUILD_DIR}"/libcxx/include/c++/v1
121 + -DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include
122 + )
123 +
124 + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)"
125 + local CMAKE_USE_DIR=${WORKDIR}/libcxxabi
126 + local BUILD_DIR=${BUILD_DIR}/libcxxabi
127 +
128 + "${@}"
129 +}
130 +
131 +wrap_libcxx() {
132 + local mycmakeargs=(
133 + -DLIBCXX_LIBDIR_SUFFIX=
134 + -DLIBCXX_ENABLE_SHARED=OFF
135 + -DLIBCXX_ENABLE_STATIC=ON
136 + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
137 + -DLIBCXXABI_USE_LLVM_UNWINDER=ON
138 + -DLIBCXX_CXX_ABI=libcxxabi
139 + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include
140 + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
141 + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
142 + -DLIBCXX_HAS_GCC_S_LIB=OFF
143 + -DLIBCXX_INCLUDE_TESTS=OFF
144 + )
145 +
146 + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)"
147 + local CMAKE_USE_DIR=${WORKDIR}/libcxx
148 + local BUILD_DIR=${BUILD_DIR}/libcxx
149 +
150 + "${@}"
151 +}
152 +
153 +multilib_src_test() {
154 + # build local copies of libc++ & libc++abi for testing to avoid
155 + # circular deps
156 + wrap_libcxx cmake_src_configure
157 + wrap_libcxx cmake_build generate-cxx-headers
158 + wrap_libcxxabi cmake_src_configure
159 + wrap_libcxxabi cmake_src_compile
160 + wrap_libcxx cmake_src_compile
161 + mv "${BUILD_DIR}"/libcxx*/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die
162 +
163 + local -x LIT_PRESERVES_TMP=1
164 + cmake_build check-unwind
165 +}
166 +
167 +multilib_src_install() {
168 + cmake_src_install
169 +
170 + # install headers like sys-libs/libunwind
171 + doheader "${S}"/include/*.h
172 +}