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: Fri, 21 Jan 2022 15:38:32
Message-Id: 1642779452.0bf8e4e3ac1b84208233ae679628c4526efbf2f2.mgorny@gentoo
1 commit: 0bf8e4e3ac1b84208233ae679628c4526efbf2f2
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 12:15:37 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 15:37:32 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bf8e4e3
7
8 sys-libs/libcxx: Remove 13.0.1-rc{1,2}
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/libcxx/Manifest | 4 -
13 sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild | 214 -------------------------------
14 sys-libs/libcxx/libcxx-13.0.1_rc2.ebuild | 214 -------------------------------
15 3 files changed, 432 deletions(-)
16
17 diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
18 index 429078f407a1..45e9d7a057c0 100644
19 --- a/sys-libs/libcxx/Manifest
20 +++ b/sys-libs/libcxx/Manifest
21 @@ -1,13 +1,9 @@
22 DIST llvm-gentoo-patchset-11.1.0-1.tar.xz 4032 BLAKE2B e69138a422e315b31a3d9c11faa4ae1ddf1bf9092cee2db0de4d2adef81fd802973488293aab48b764402b51996893b17ca03249ef4620848a576d1f6cdb9698 SHA512 e1c5504dab6c5db9fdf4addfeb12316f22d0258717ba551a9b7b3ba37919491fb6011ac5cca1e793b7509d5c1c186bc6bc4213f7d6155d190612492b216f979b
23 DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
24 DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
25 -DIST llvm-gentoo-patchset-13.0.1-rc1.tar.xz 5988 BLAKE2B 8f1d295d4b6937518d9e0cc00cc2ba9e12ff9773b35261f0985b2d2a4ed1e3363a7f961cb385728b5ae552d0e129d99d11e63958d32c3353b0a79a88ba5cc0d5 SHA512 8272c423a5e0e99d412bb449794ba2e8134aca69d09e90e93555dbd3b7549d6ce4d68617ca11074af0a35a6f6830bf0330cbc672c5a56054cfd824e3ac1900ea
26 -DIST llvm-gentoo-patchset-13.0.1-rc2.tar.xz 5192 BLAKE2B 4a129a3d0b7c1839d79c814ea57602f5e87aadb9050fc8e91868d2c3773ff7ae8e2137f785deeded6925a4368220767526c95790c9883f2031edc3ebae25b13c SHA512 2f384281d06f5378f7d1b2f036958c7db00d1c4d799406fd188fa8388f0cf18279dae36f2fb37bff26daa91419ab1bc1c2390be0f3af42359f1aef8de81b6ac8
27 DIST llvm-gentoo-patchset-13.0.1-rc3.tar.xz 4808 BLAKE2B d8ed3ae424914437413e2e8c029880072e93d79ca79b842ad59451df46594c9b0d73ee5d49d3b65c4c7a40c86b2e0d43501ef106aea7c481f22425a5245a3411 SHA512 10430a720b120a340a681fa435a7f050741c75270607e3f5214bf829313d274c11f019f1ac072857dc5d7f868e6eb013932d1c94446e8cb2e151ac818a081914
28 DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
29 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
30 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
31 DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
32 -DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
33 -DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
34 DIST llvmorg-13.0.1-rc3.tar.gz 147302323 BLAKE2B 9ac2f97568062d7dd618295a68d6e14898fcd69e2bb66290b999ceb8c12132371f4e9b59d8ba2b252e5e5cb249045676b24fc50c117b2afae20abab98f426582 SHA512 88a04ad02af2d41ec21c7a62bad21ee0e627b7276a16795875afd062ed29ac7fb4aadec5b5e48785a6502c9fd797a4b67d648a21f193c9f7602112870b10a3d1
35
36 diff --git a/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild b/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild
37 deleted file mode 100644
38 index 0e230df43a5d..000000000000
39 --- a/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild
40 +++ /dev/null
41 @@ -1,214 +0,0 @@
42 -# Copyright 1999-2022 Gentoo Authors
43 -# Distributed under the terms of the GNU General Public License v2
44 -
45 -EAPI=7
46 -
47 -CMAKE_ECLASS=cmake
48 -PYTHON_COMPAT=( python3_{8..10} )
49 -inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs
50 -
51 -DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
52 -HOMEPAGE="https://libcxx.llvm.org/"
53 -
54 -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
55 -SLOT="0"
56 -KEYWORDS=""
57 -IUSE="+libcxxabi +libunwind static-libs test"
58 -REQUIRED_USE="libunwind? ( libcxxabi )"
59 -RESTRICT="!test? ( test )"
60 -
61 -RDEPEND="
62 - libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
63 - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )"
64 -# llvm-6 for new lit options
65 -# clang-3.9.0 installs necessary target symlinks unconditionally
66 -# which removes the need for MULTILIB_USEDEP
67 -DEPEND="${RDEPEND}
68 - >=sys-devel/llvm-6"
69 -BDEPEND="
70 - test? (
71 - >=dev-util/cmake-3.16
72 - >=sys-devel/clang-3.9.0
73 - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
74 - )"
75 -
76 -DOCS=( CREDITS.TXT )
77 -
78 -LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} )
79 -LLVM_PATCHSET=${PV/_/-}
80 -llvm.org_set_globals
81 -
82 -python_check_deps() {
83 - has_version "dev-python/lit[${PYTHON_USEDEP}]"
84 -}
85 -
86 -pkg_setup() {
87 - # Darwin Prefix builds do not have llvm installed yet, so rely on
88 - # bootstrap-prefix to set the appropriate path vars to LLVM instead
89 - # of using llvm_pkg_setup.
90 - if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
91 - llvm_pkg_setup
92 - fi
93 - use test && python-any-r1_pkg_setup
94 -
95 - if ! use libcxxabi && ! tc-is-gcc ; then
96 - eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
97 - eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
98 - eerror "and try again."
99 - die
100 - fi
101 -}
102 -
103 -test_compiler() {
104 - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
105 - <<<'int main() { return 0; }' &>/dev/null
106 -}
107 -
108 -src_configure() {
109 - # note: we need to do this before multilib kicks in since it will
110 - # alter the CHOST
111 - local cxxabi cxxabi_incs
112 - if use libcxxabi; then
113 - cxxabi=libcxxabi
114 - cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
115 - else
116 - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
117 - cxxabi=libsupc++
118 - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
119 - fi
120 -
121 - multilib-minimal_src_configure
122 -}
123 -
124 -multilib_src_configure() {
125 - # we want -lgcc_s for unwinder, and for compiler runtime when using
126 - # gcc, clang with gcc runtime (or any unknown compiler)
127 - local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
128 - if use libunwind; then
129 - # work-around missing -lunwind upstream
130 - extra_libs+=( -lunwind )
131 - # if we're using libunwind and clang with compiler-rt, we want
132 - # to link to compiler-rt instead of -lgcc_s
133 - if tc-is-clang; then
134 - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
135 - ${LDFLAGS} -print-libgcc-file-name)
136 - if [[ ${compiler_rt} == *libclang_rt* ]]; then
137 - want_gcc_s=OFF
138 - want_compiler_rt=ON
139 - extra_libs+=( "${compiler_rt}" )
140 - fi
141 - fi
142 - elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
143 - # clang-based darwin prefix disables libunwind useflag during
144 - # bootstrap, because libunwind is not in the prefix yet.
145 - # override the default, though, because clang based libcxx
146 - # should never use gcc_s on Darwin.
147 - want_gcc_s=OFF
148 - # compiler_rt is not available in EPREFIX during bootstrap,
149 - # so we cannot link to it yet anyway, so keep the defaults
150 - # of want_compiler_rt=OFF and extra_libs=()
151 - fi
152 -
153 - # bootstrap: cmake is unhappy if compiler can't link to stdlib
154 - local nolib_flags=( -nodefaultlibs -lc )
155 - if ! test_compiler; then
156 - if test_compiler "${nolib_flags[@]}"; then
157 - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
158 - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}"
159 - fi
160 - fi
161 -
162 - local libdir=$(get_libdir)
163 - local mycmakeargs=(
164 - -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
165 - -DLIBCXX_ENABLE_SHARED=ON
166 - -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
167 - -DLIBCXX_CXX_ABI=${cxxabi}
168 - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
169 - # we're using our own mechanism for generating linker scripts
170 - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
171 - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
172 - -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
173 - -DLIBCXX_INCLUDE_TESTS=$(usex test)
174 - -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
175 - -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s}
176 - -DLIBCXX_TARGET_TRIPLE="${CHOST}"
177 - -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
178 - )
179 -
180 - if use test; then
181 - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
182 - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
183 -
184 - mycmakeargs+=(
185 - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
186 - -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
187 - -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON
188 - -DPython3_EXECUTABLE="${PYTHON}"
189 - )
190 - fi
191 - cmake_src_configure
192 -}
193 -
194 -multilib_src_test() {
195 - local -x LIT_PRESERVES_TMP=1
196 - cmake_build check-cxx
197 -}
198 -
199 -# Usage: deps
200 -gen_ldscript() {
201 - local output_format
202 - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
203 - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
204 -
205 - cat <<-END_LDSCRIPT
206 -/* GNU ld script
207 - Include missing dependencies
208 -*/
209 -${output_format}
210 -GROUP ( $@ )
211 -END_LDSCRIPT
212 -}
213 -
214 -gen_static_ldscript() {
215 - local libdir=$(get_libdir)
216 - local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a")
217 -
218 - # Move it first.
219 - mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
220 - # Generate libc++.a ldscript for inclusion of its dependencies so that
221 - # clang++ -stdlib=libc++ -static works out of the box.
222 - local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
223 - # On Linux/glibc it does not link without libpthread or libdl. It is
224 - # fine on FreeBSD.
225 - use elibc_glibc && deps+=" libpthread.a libdl.a"
226 -
227 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
228 -}
229 -
230 -gen_shared_ldscript() {
231 - local libdir=$(get_libdir)
232 - # libsupc++ doesn't have a shared version
233 - local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a")
234 -
235 - mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
236 - local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
237 -
238 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
239 -}
240 -
241 -multilib_src_install() {
242 - cmake_src_install
243 - if [[ ${CHOST} != *-darwin* ]] ; then
244 - gen_shared_ldscript
245 - use static-libs && gen_static_ldscript
246 - fi
247 -}
248 -
249 -pkg_postinst() {
250 - elog "This package (${PN}) is mainly intended as a replacement for the C++"
251 - elog "standard library when using clang."
252 - elog "To use it, instead of libstdc++, use:"
253 - elog " clang++ -stdlib=libc++"
254 - elog "to compile your C++ programs."
255 -}
256
257 diff --git a/sys-libs/libcxx/libcxx-13.0.1_rc2.ebuild b/sys-libs/libcxx/libcxx-13.0.1_rc2.ebuild
258 deleted file mode 100644
259 index 0e230df43a5d..000000000000
260 --- a/sys-libs/libcxx/libcxx-13.0.1_rc2.ebuild
261 +++ /dev/null
262 @@ -1,214 +0,0 @@
263 -# Copyright 1999-2022 Gentoo Authors
264 -# Distributed under the terms of the GNU General Public License v2
265 -
266 -EAPI=7
267 -
268 -CMAKE_ECLASS=cmake
269 -PYTHON_COMPAT=( python3_{8..10} )
270 -inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs
271 -
272 -DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
273 -HOMEPAGE="https://libcxx.llvm.org/"
274 -
275 -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
276 -SLOT="0"
277 -KEYWORDS=""
278 -IUSE="+libcxxabi +libunwind static-libs test"
279 -REQUIRED_USE="libunwind? ( libcxxabi )"
280 -RESTRICT="!test? ( test )"
281 -
282 -RDEPEND="
283 - libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
284 - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )"
285 -# llvm-6 for new lit options
286 -# clang-3.9.0 installs necessary target symlinks unconditionally
287 -# which removes the need for MULTILIB_USEDEP
288 -DEPEND="${RDEPEND}
289 - >=sys-devel/llvm-6"
290 -BDEPEND="
291 - test? (
292 - >=dev-util/cmake-3.16
293 - >=sys-devel/clang-3.9.0
294 - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
295 - )"
296 -
297 -DOCS=( CREDITS.TXT )
298 -
299 -LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} )
300 -LLVM_PATCHSET=${PV/_/-}
301 -llvm.org_set_globals
302 -
303 -python_check_deps() {
304 - has_version "dev-python/lit[${PYTHON_USEDEP}]"
305 -}
306 -
307 -pkg_setup() {
308 - # Darwin Prefix builds do not have llvm installed yet, so rely on
309 - # bootstrap-prefix to set the appropriate path vars to LLVM instead
310 - # of using llvm_pkg_setup.
311 - if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
312 - llvm_pkg_setup
313 - fi
314 - use test && python-any-r1_pkg_setup
315 -
316 - if ! use libcxxabi && ! tc-is-gcc ; then
317 - eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
318 - eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
319 - eerror "and try again."
320 - die
321 - fi
322 -}
323 -
324 -test_compiler() {
325 - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
326 - <<<'int main() { return 0; }' &>/dev/null
327 -}
328 -
329 -src_configure() {
330 - # note: we need to do this before multilib kicks in since it will
331 - # alter the CHOST
332 - local cxxabi cxxabi_incs
333 - if use libcxxabi; then
334 - cxxabi=libcxxabi
335 - cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
336 - else
337 - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
338 - cxxabi=libsupc++
339 - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
340 - fi
341 -
342 - multilib-minimal_src_configure
343 -}
344 -
345 -multilib_src_configure() {
346 - # we want -lgcc_s for unwinder, and for compiler runtime when using
347 - # gcc, clang with gcc runtime (or any unknown compiler)
348 - local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
349 - if use libunwind; then
350 - # work-around missing -lunwind upstream
351 - extra_libs+=( -lunwind )
352 - # if we're using libunwind and clang with compiler-rt, we want
353 - # to link to compiler-rt instead of -lgcc_s
354 - if tc-is-clang; then
355 - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
356 - ${LDFLAGS} -print-libgcc-file-name)
357 - if [[ ${compiler_rt} == *libclang_rt* ]]; then
358 - want_gcc_s=OFF
359 - want_compiler_rt=ON
360 - extra_libs+=( "${compiler_rt}" )
361 - fi
362 - fi
363 - elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
364 - # clang-based darwin prefix disables libunwind useflag during
365 - # bootstrap, because libunwind is not in the prefix yet.
366 - # override the default, though, because clang based libcxx
367 - # should never use gcc_s on Darwin.
368 - want_gcc_s=OFF
369 - # compiler_rt is not available in EPREFIX during bootstrap,
370 - # so we cannot link to it yet anyway, so keep the defaults
371 - # of want_compiler_rt=OFF and extra_libs=()
372 - fi
373 -
374 - # bootstrap: cmake is unhappy if compiler can't link to stdlib
375 - local nolib_flags=( -nodefaultlibs -lc )
376 - if ! test_compiler; then
377 - if test_compiler "${nolib_flags[@]}"; then
378 - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
379 - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}"
380 - fi
381 - fi
382 -
383 - local libdir=$(get_libdir)
384 - local mycmakeargs=(
385 - -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
386 - -DLIBCXX_ENABLE_SHARED=ON
387 - -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
388 - -DLIBCXX_CXX_ABI=${cxxabi}
389 - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
390 - # we're using our own mechanism for generating linker scripts
391 - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
392 - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
393 - -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
394 - -DLIBCXX_INCLUDE_TESTS=$(usex test)
395 - -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
396 - -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s}
397 - -DLIBCXX_TARGET_TRIPLE="${CHOST}"
398 - -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
399 - )
400 -
401 - if use test; then
402 - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
403 - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
404 -
405 - mycmakeargs+=(
406 - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
407 - -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
408 - -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON
409 - -DPython3_EXECUTABLE="${PYTHON}"
410 - )
411 - fi
412 - cmake_src_configure
413 -}
414 -
415 -multilib_src_test() {
416 - local -x LIT_PRESERVES_TMP=1
417 - cmake_build check-cxx
418 -}
419 -
420 -# Usage: deps
421 -gen_ldscript() {
422 - local output_format
423 - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
424 - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
425 -
426 - cat <<-END_LDSCRIPT
427 -/* GNU ld script
428 - Include missing dependencies
429 -*/
430 -${output_format}
431 -GROUP ( $@ )
432 -END_LDSCRIPT
433 -}
434 -
435 -gen_static_ldscript() {
436 - local libdir=$(get_libdir)
437 - local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a")
438 -
439 - # Move it first.
440 - mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
441 - # Generate libc++.a ldscript for inclusion of its dependencies so that
442 - # clang++ -stdlib=libc++ -static works out of the box.
443 - local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
444 - # On Linux/glibc it does not link without libpthread or libdl. It is
445 - # fine on FreeBSD.
446 - use elibc_glibc && deps+=" libpthread.a libdl.a"
447 -
448 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
449 -}
450 -
451 -gen_shared_ldscript() {
452 - local libdir=$(get_libdir)
453 - # libsupc++ doesn't have a shared version
454 - local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a")
455 -
456 - mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
457 - local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
458 -
459 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
460 -}
461 -
462 -multilib_src_install() {
463 - cmake_src_install
464 - if [[ ${CHOST} != *-darwin* ]] ; then
465 - gen_shared_ldscript
466 - use static-libs && gen_static_ldscript
467 - fi
468 -}
469 -
470 -pkg_postinst() {
471 - elog "This package (${PN}) is mainly intended as a replacement for the C++"
472 - elog "standard library when using clang."
473 - elog "To use it, instead of libstdc++, use:"
474 - elog " clang++ -stdlib=libc++"
475 - elog "to compile your C++ programs."
476 -}