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/libcxx/
Date: Sat, 25 Sep 2021 07:46:06
Message-Id: 1632555940.145a432e97ed0080b937f7a21d2120f4ddd5124c.mgorny@gentoo
1 commit: 145a432e97ed0080b937f7a21d2120f4ddd5124c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 07:02:07 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 25 07:45:40 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=145a432e
7
8 sys-libs/libcxx: Bump to 13.0.0_rc4
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/libcxx/Manifest | 2 +
13 sys-libs/libcxx/libcxx-13.0.0_rc4.ebuild | 213 +++++++++++++++++++++++++++++++
14 2 files changed, 215 insertions(+)
15
16 diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
17 index 0ec4ff0932b..7c09f04d292 100644
18 --- a/sys-libs/libcxx/Manifest
19 +++ b/sys-libs/libcxx/Manifest
20 @@ -3,9 +3,11 @@ DIST llvm-gentoo-patchset-11.1.0-1.tar.xz 4032 BLAKE2B e69138a422e315b31a3d9c11f
21 DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
22 DIST llvm-gentoo-patchset-13.0.0-rc2.tar.xz 5556 BLAKE2B e6c7ecfe8f842edc4d4f30a20c66973519182ecb46e21fb20b6c5fcb6d54cdef830fcb120a405b77f1332e3557acbbbbfa99170b20d17f137e0a63b2d0dc1258 SHA512 ddeaf1d07f0ba893ce93e5fe1eff1c0716769a7879fc503c397f4db7becb363f94747f59b6d53c204df73a93954fb0ca5aae6ad544ce55c964c4bf441a410cd2
23 DIST llvm-gentoo-patchset-13.0.0-rc3.tar.xz 5012 BLAKE2B 5399feeffe73e8fbd099c8058f1cc41e2fcb2feb446acc1394589c0397167786895d328d45ff481fb30605f215774b9e51e332124c0b071e969a2f01c5943c04 SHA512 d4fb2b08e253d9fa89070045282b4309ca9938011bf7f9b5364cc69c5030ff9353abb1624895b4bfeef2cd8e2f8c9b9f93fc8196f98dc0970457bca7787270c9
24 +DIST llvm-gentoo-patchset-13.0.0-rc4.tar.xz 5016 BLAKE2B 021ba4e67904e4cf4dfdf1ecfc1cd1cc860c2f43db97e04c40ca7d95567f6235a27a2a919083c58b89b269eefa2d751cb9c324bda6518c22e9fc01007936a520 SHA512 dce61179dffafc5992fb0e18314bba2d5fbf2f0470a491bc1ffc036274b65d0a1de741b23e2de32e873250c856a53707e06f8c560bd29f8a54a6ae0c74267f43
25 DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
26 DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3c8a6ff1a1f152f94bfe362c07884339fe571ff7fe903ed3b3deb150b2fa868c387887a0dea2930dc08b81db71a5b1 SHA512 48078fff9293a87f1a973f3348f79506f04c3da774295f5eb67d74dd2d1aa94f0973f8ced3f4ab9e8339902071f82c603b43d5608ad7227046c4da769c5d2151
27 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
28 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
29 DIST llvmorg-13.0.0-rc2.tar.gz 147267736 BLAKE2B 153bf7320f2aa911112d366ffc79f7110cb04f135c2a8b176c263f0a75eb768206d9bd462893d45504b0e58aa9e127fdcafb02300eab1666e4616aa654d457dd SHA512 a01baf3eaa02f02af42bfcf6dcf24f166351bf1c09601495617c81e41def23210573bad40a344270f40c5deb881d06863536abac2a6481930766a6a56335fb44
30 DIST llvmorg-13.0.0-rc3.tar.gz 147281901 BLAKE2B 640065a2f32dc48edf084d776cb6b950fae86c2a204999e2eec67f93b57615df40adec19785099b0ef2fe11837c3304794ec3585289a5b5051a557618c63c749 SHA512 1401d5a4d6bb5c930d74b9cfbc8e792872f721aab7d7f0c819e2ba5cf47fb818d160c1f71784fba69827f3c9b7414aa91a585d2b813c1851b4799f9d62cebc46
31 +DIST llvmorg-13.0.0-rc4.tar.gz 147286367 BLAKE2B a43c54b8bb379b0374f99ae07066d7ba4ae2a83dfdb61390101c736f91dc44aa07a88778551aaaf903033562b2a0a863ea6b27392b700c9cddc74e2c7899cad1 SHA512 8ccaaea21ec4fe3c4b4446d3a7cae36a47ed196f407d341da45824bcefefffd3c412c0c5c27670ceaba1458bc53107273f9d3aec2de261b6b82c6d209b45b14d
32
33 diff --git a/sys-libs/libcxx/libcxx-13.0.0_rc4.ebuild b/sys-libs/libcxx/libcxx-13.0.0_rc4.ebuild
34 new file mode 100644
35 index 00000000000..f342357254b
36 --- /dev/null
37 +++ b/sys-libs/libcxx/libcxx-13.0.0_rc4.ebuild
38 @@ -0,0 +1,213 @@
39 +# Copyright 1999-2021 Gentoo Authors
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=7
43 +
44 +CMAKE_ECLASS=cmake
45 +PYTHON_COMPAT=( python3_{8..10} )
46 +inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs
47 +
48 +DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
49 +HOMEPAGE="https://libcxx.llvm.org/"
50 +
51 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
52 +SLOT="0"
53 +KEYWORDS=""
54 +IUSE="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test"
55 +REQUIRED_USE="libunwind? ( libcxxabi )"
56 +RESTRICT="!test? ( test )"
57 +
58 +RDEPEND="
59 + libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
60 + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )"
61 +# llvm-6 for new lit options
62 +# clang-3.9.0 installs necessary target symlinks unconditionally
63 +# which removes the need for MULTILIB_USEDEP
64 +DEPEND="${RDEPEND}
65 + >=sys-devel/llvm-6"
66 +BDEPEND="
67 + test? (
68 + >=dev-util/cmake-3.16
69 + >=sys-devel/clang-3.9.0
70 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
71 + )"
72 +
73 +DOCS=( CREDITS.TXT )
74 +
75 +LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} )
76 +LLVM_PATCHSET=${PV/_/-}
77 +llvm.org_set_globals
78 +
79 +python_check_deps() {
80 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
81 +}
82 +
83 +pkg_setup() {
84 + # Darwin Prefix builds do not have llvm installed yet, so rely on
85 + # bootstrap-prefix to set the appropriate path vars to LLVM instead
86 + # of using llvm_pkg_setup.
87 + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
88 + llvm_pkg_setup
89 + fi
90 + use test && python-any-r1_pkg_setup
91 +
92 + if ! use libcxxabi && ! tc-is-gcc ; then
93 + eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
94 + eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
95 + eerror "and try again."
96 + die
97 + fi
98 +}
99 +
100 +test_compiler() {
101 + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
102 + <<<'int main() { return 0; }' &>/dev/null
103 +}
104 +
105 +src_configure() {
106 + # note: we need to do this before multilib kicks in since it will
107 + # alter the CHOST
108 + local cxxabi cxxabi_incs
109 + if use libcxxabi; then
110 + cxxabi=libcxxabi
111 + cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
112 + else
113 + local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
114 + cxxabi=libsupc++
115 + cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
116 + fi
117 +
118 + multilib-minimal_src_configure
119 +}
120 +
121 +multilib_src_configure() {
122 + # we want -lgcc_s for unwinder, and for compiler runtime when using
123 + # gcc, clang with gcc runtime (or any unknown compiler)
124 + local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
125 + if use libunwind; then
126 + # work-around missing -lunwind upstream
127 + extra_libs+=( -lunwind )
128 + # if we're using libunwind and clang with compiler-rt, we want
129 + # to link to compiler-rt instead of -lgcc_s
130 + if tc-is-clang; then
131 + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
132 + ${LDFLAGS} -print-libgcc-file-name)
133 + if [[ ${compiler_rt} == *libclang_rt* ]]; then
134 + want_gcc_s=OFF
135 + want_compiler_rt=ON
136 + extra_libs+=( "${compiler_rt}" )
137 + fi
138 + fi
139 + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
140 + # clang-based darwin prefix disables libunwind useflag during
141 + # bootstrap, because libunwind is not in the prefix yet.
142 + # override the default, though, because clang based libcxx
143 + # should never use gcc_s on Darwin.
144 + want_gcc_s=OFF
145 + # compiler_rt is not available in EPREFIX during bootstrap,
146 + # so we cannot link to it yet anyway, so keep the defaults
147 + # of want_compiler_rt=OFF and extra_libs=()
148 + fi
149 +
150 + # bootstrap: cmake is unhappy if compiler can't link to stdlib
151 + local nolib_flags=( -nodefaultlibs -lc )
152 + if ! test_compiler; then
153 + if test_compiler "${nolib_flags[@]}"; then
154 + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
155 + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}"
156 + fi
157 + fi
158 +
159 + local libdir=$(get_libdir)
160 + local mycmakeargs=(
161 + -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
162 + -DLIBCXX_ENABLE_SHARED=ON
163 + -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
164 + -DLIBCXX_CXX_ABI=${cxxabi}
165 + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
166 + # we're using our own mechanism for generating linker scripts
167 + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
168 + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
169 + -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
170 + -DLIBCXX_INCLUDE_TESTS=$(usex test)
171 + -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
172 + -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s}
173 + -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
174 + )
175 +
176 + if use test; then
177 + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
178 + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
179 +
180 + mycmakeargs+=(
181 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
182 + -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
183 + -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON
184 + -DPython3_EXECUTABLE="${PYTHON}"
185 + )
186 + fi
187 + cmake_src_configure
188 +}
189 +
190 +multilib_src_test() {
191 + local -x LIT_PRESERVES_TMP=1
192 + cmake_build check-cxx
193 +}
194 +
195 +# Usage: deps
196 +gen_ldscript() {
197 + local output_format
198 + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
199 + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
200 +
201 + cat <<-END_LDSCRIPT
202 +/* GNU ld script
203 + Include missing dependencies
204 +*/
205 +${output_format}
206 +GROUP ( $@ )
207 +END_LDSCRIPT
208 +}
209 +
210 +gen_static_ldscript() {
211 + local libdir=$(get_libdir)
212 + local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a")
213 +
214 + # Move it first.
215 + mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
216 + # Generate libc++.a ldscript for inclusion of its dependencies so that
217 + # clang++ -stdlib=libc++ -static works out of the box.
218 + local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
219 + # On Linux/glibc it does not link without libpthread or libdl. It is
220 + # fine on FreeBSD.
221 + use elibc_glibc && deps+=" libpthread.a libdl.a"
222 +
223 + gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
224 +}
225 +
226 +gen_shared_ldscript() {
227 + local libdir=$(get_libdir)
228 + # libsupc++ doesn't have a shared version
229 + local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a")
230 +
231 + mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
232 + local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
233 +
234 + gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
235 +}
236 +
237 +multilib_src_install() {
238 + cmake_src_install
239 + if [[ ${CHOST} != *-darwin* ]] ; then
240 + gen_shared_ldscript
241 + use static-libs && gen_static_ldscript
242 + fi
243 +}
244 +
245 +pkg_postinst() {
246 + elog "This package (${PN}) is mainly intended as a replacement for the C++"
247 + elog "standard library when using clang."
248 + elog "To use it, instead of libstdc++, use:"
249 + elog " clang++ -stdlib=libc++"
250 + elog "to compile your C++ programs."
251 +}