1 |
commit: bf7c78c47bcba4f09998da99597d436179bad82e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 15 20:37:47 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 15 20:44:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf7c78c4 |
7 |
|
8 |
sys-libs/libcxx: Remove 12.0.0 RCs |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libcxx/Manifest | 4 - |
13 |
sys-libs/libcxx/libcxx-12.0.0_rc2.ebuild | 218 ------------------------------ |
14 |
sys-libs/libcxx/libcxx-12.0.0_rc3.ebuild | 223 ------------------------------- |
15 |
sys-libs/libcxx/libcxx-12.0.0_rc4.ebuild | 223 ------------------------------- |
16 |
sys-libs/libcxx/libcxx-12.0.0_rc5.ebuild | 223 ------------------------------- |
17 |
5 files changed, 891 deletions(-) |
18 |
|
19 |
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest |
20 |
index 087d75cb29b..09cfebc2769 100644 |
21 |
--- a/sys-libs/libcxx/Manifest |
22 |
+++ b/sys-libs/libcxx/Manifest |
23 |
@@ -2,8 +2,4 @@ DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3 |
24 |
DIST llvmorg-11.0.0.tar.gz 122743665 BLAKE2B 3f95570240789fd68ddb747df817f5c6cdc9da40911bbe9ee3531c15ada9165e5002b1c2f778cf8735858485ea05a8754e3d3a5f4b15bdd6cb33d64a14692984 SHA512 b6d38871ccce0e086e27d35e42887618d68e57d8274735c59e3eabc42dee352412489296293f8d5169fe0044936345915ee7da61ebdc64ec10f7737f6ecd90f2 |
25 |
DIST llvmorg-11.0.1.tar.gz 122790338 BLAKE2B 0130996b4a8c4d9f757136fd7fb318068c9bfdc565060dec0d4336480c4ab66c4ae3185a7fdb05f13cf9ee8fd4123b09df938881b75d6e5d3689595114b7e32a SHA512 f5e6ef0b3111aae08a89cd01adb2ff4abfa9ef779c68b9190421d0447efd25c2cc00e5aae9f4764805f5fa31434866043d1510ae7389817e28ae53a5442e2fdf |
26 |
DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81 |
27 |
-DIST llvmorg-12.0.0-rc2.tar.gz 134242619 BLAKE2B bb741a311db608fc2ba7eeaab71c5c9f2a430f7fee3f0c5c4334e5c14caa19738d18c87b568de963d57d9b53e808ac412cf8554eca7fcae9ecca65aa4442e197 SHA512 d8f9b3dfeb0fe9b91eb7f49da393784333044db2653373fbb168afd3c8d50f3e3ec7a7b8f44df522d0facafbfe4cfc4d9e2906d19f1e6feb0bdc569b6c10a17d |
28 |
-DIST llvmorg-12.0.0-rc3.tar.gz 134244008 BLAKE2B ed09aa361b264387711ba1ee2e4b01c0c78ad97391df95e2542d4edc31f657cc33c8a2a45de63eb421908d5dadd9392a736610fbb04b3ecbd336d6514a649da8 SHA512 1fae53c6f255160cf4be53848b8b92c8b162ddcfbddf1bf0017faf249859040c15c862c4b52bc3ba894149139afb814e0674da88793ddebfc0756ba3aa7626ce |
29 |
-DIST llvmorg-12.0.0-rc4.tar.gz 134245842 BLAKE2B 860a0551a42e2c6a28f213c151076c5ae64a9d85f7bfb2e2df4737acd5fe968f29d368a689d9a857e01038587e872722d216f044b3f665857d7ed71122fe334e SHA512 20e4440664227c9ea7af84df3643599cd7c96f5e2b6404c42be0ce0f0d7f989f5c7b8df1f1ba93d1473d3a30325cda5a53d3900c0229ccb042b365583b5aa846 |
30 |
-DIST llvmorg-12.0.0-rc5.tar.gz 134247991 BLAKE2B 9721e211d39611f9c48b57386fb57c1dcf964c39ff5f32c593a6390c06659fcd5a1f76063004d2ecd3d1af32281a69994c7478b7fdfacd9f50ebf5fbb2050a71 SHA512 a289fdc55c25454e8cbfd370387fdd11c7555d03b3c479213e37dd01189c077d67bd04b8cab62ce82f3746877f5f02619afb3a5110191048511efee38c191d16 |
31 |
DIST llvmorg-12.0.0.tar.gz 134226215 BLAKE2B f9c3ba8c58571855caa4f206fd285c9b5be66672fb0814cb8bc0964a051f57f5d35013aa1e27cbda502652b37df1ec23474129109e76a42066847860db441dbe SHA512 0cff02155c5ac0d6db2b72d60d9819d5b5dd859663b45f721b1c7540239c2fceb1f57d9173f6870c49de851c242ed8e85c5c6d6577a1f8092a7c5dcd12513b26 |
32 |
|
33 |
diff --git a/sys-libs/libcxx/libcxx-12.0.0_rc2.ebuild b/sys-libs/libcxx/libcxx-12.0.0_rc2.ebuild |
34 |
deleted file mode 100644 |
35 |
index 8ed99383fe0..00000000000 |
36 |
--- a/sys-libs/libcxx/libcxx-12.0.0_rc2.ebuild |
37 |
+++ /dev/null |
38 |
@@ -1,218 +0,0 @@ |
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_{7..9} ) |
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/modules,utils/llvm-lit} ) |
76 |
-llvm.org_set_globals |
77 |
- |
78 |
-python_check_deps() { |
79 |
- has_version "dev-python/lit[${PYTHON_USEDEP}]" |
80 |
-} |
81 |
- |
82 |
-pkg_setup() { |
83 |
- # Darwin Prefix builds do not have llvm installed yet, so rely on |
84 |
- # bootstrap-prefix to set the appropriate path vars to LLVM instead |
85 |
- # of using llvm_pkg_setup. |
86 |
- if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then |
87 |
- llvm_pkg_setup |
88 |
- fi |
89 |
- use test && python-any-r1_pkg_setup |
90 |
- |
91 |
- if ! use libcxxabi && ! tc-is-gcc ; then |
92 |
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other" |
93 |
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++" |
94 |
- eerror "and try again." |
95 |
- die |
96 |
- fi |
97 |
-} |
98 |
- |
99 |
-src_prepare() { |
100 |
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a |
101 |
- # out-of-tree build. |
102 |
- eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" |
103 |
- |
104 |
- llvm.org_src_prepare |
105 |
-} |
106 |
- |
107 |
-test_compiler() { |
108 |
- $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ |
109 |
- <<<'int main() { return 0; }' &>/dev/null |
110 |
-} |
111 |
- |
112 |
-src_configure() { |
113 |
- # note: we need to do this before multilib kicks in since it will |
114 |
- # alter the CHOST |
115 |
- local cxxabi cxxabi_incs |
116 |
- if use libcxxabi; then |
117 |
- cxxabi=libcxxabi |
118 |
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" |
119 |
- else |
120 |
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" |
121 |
- cxxabi=libsupc++ |
122 |
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" |
123 |
- fi |
124 |
- |
125 |
- multilib-minimal_src_configure |
126 |
-} |
127 |
- |
128 |
-multilib_src_configure() { |
129 |
- # we want -lgcc_s for unwinder, and for compiler runtime when using |
130 |
- # gcc, clang with gcc runtime (or any unknown compiler) |
131 |
- local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF |
132 |
- if use libunwind; then |
133 |
- # work-around missing -lunwind upstream |
134 |
- extra_libs+=( -lunwind ) |
135 |
- # if we're using libunwind and clang with compiler-rt, we want |
136 |
- # to link to compiler-rt instead of -lgcc_s |
137 |
- if tc-is-clang; then |
138 |
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
139 |
- ${LDFLAGS} -print-libgcc-file-name) |
140 |
- if [[ ${compiler_rt} == *libclang_rt* ]]; then |
141 |
- want_gcc_s=OFF |
142 |
- want_compiler_rt=ON |
143 |
- extra_libs+=( "${compiler_rt}" ) |
144 |
- fi |
145 |
- fi |
146 |
- elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then |
147 |
- # clang-based darwin prefix disables libunwind useflag during |
148 |
- # bootstrap, because libunwind is not in the prefix yet. |
149 |
- # override the default, though, because clang based libcxx |
150 |
- # should never use gcc_s on Darwin. |
151 |
- want_gcc_s=OFF |
152 |
- # compiler_rt is not available in EPREFIX during bootstrap, |
153 |
- # so we cannot link to it yet anyway, so keep the defaults |
154 |
- # of want_compiler_rt=OFF and extra_libs=() |
155 |
- fi |
156 |
- |
157 |
- # bootstrap: cmake is unhappy if compiler can't link to stdlib |
158 |
- local nolib_flags=( -nodefaultlibs -lc ) |
159 |
- if ! test_compiler; then |
160 |
- if test_compiler "${nolib_flags[@]}"; then |
161 |
- local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
162 |
- ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
163 |
- fi |
164 |
- fi |
165 |
- |
166 |
- local libdir=$(get_libdir) |
167 |
- local mycmakeargs=( |
168 |
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} |
169 |
- -DLIBCXX_ENABLE_SHARED=ON |
170 |
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
171 |
- -DLIBCXX_CXX_ABI=${cxxabi} |
172 |
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
173 |
- # we're using our own mechanism for generating linker scripts |
174 |
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
175 |
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
176 |
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s} |
177 |
- -DLIBCXX_INCLUDE_TESTS=$(usex test) |
178 |
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} |
179 |
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" |
180 |
- ) |
181 |
- |
182 |
- if use test; then |
183 |
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
184 |
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
185 |
- |
186 |
- mycmakeargs+=( |
187 |
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
188 |
- -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" |
189 |
- -DPython3_EXECUTABLE="${PYTHON}" |
190 |
- ) |
191 |
- fi |
192 |
- cmake_src_configure |
193 |
-} |
194 |
- |
195 |
-multilib_src_test() { |
196 |
- local -x LIT_PRESERVES_TMP=1 |
197 |
- cmake_build check-cxx |
198 |
-} |
199 |
- |
200 |
-# Usage: deps |
201 |
-gen_ldscript() { |
202 |
- local output_format |
203 |
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
204 |
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
205 |
- |
206 |
- cat <<-END_LDSCRIPT |
207 |
-/* GNU ld script |
208 |
- Include missing dependencies |
209 |
-*/ |
210 |
-${output_format} |
211 |
-GROUP ( $@ ) |
212 |
-END_LDSCRIPT |
213 |
-} |
214 |
- |
215 |
-gen_static_ldscript() { |
216 |
- local libdir=$(get_libdir) |
217 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") |
218 |
- |
219 |
- # Move it first. |
220 |
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die |
221 |
- # Generate libc++.a ldscript for inclusion of its dependencies so that |
222 |
- # clang++ -stdlib=libc++ -static works out of the box. |
223 |
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)" |
224 |
- # On Linux/glibc it does not link without libpthread or libdl. It is |
225 |
- # fine on FreeBSD. |
226 |
- use elibc_glibc && deps+=" libpthread.a libdl.a" |
227 |
- |
228 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die |
229 |
-} |
230 |
- |
231 |
-gen_shared_ldscript() { |
232 |
- local libdir=$(get_libdir) |
233 |
- # libsupc++ doesn't have a shared version |
234 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") |
235 |
- |
236 |
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die |
237 |
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" |
238 |
- |
239 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die |
240 |
-} |
241 |
- |
242 |
-multilib_src_install() { |
243 |
- cmake_src_install |
244 |
- if [[ ${CHOST} != *-darwin* ]] ; then |
245 |
- gen_shared_ldscript |
246 |
- use static-libs && gen_static_ldscript |
247 |
- fi |
248 |
-} |
249 |
- |
250 |
-pkg_postinst() { |
251 |
- elog "This package (${PN}) is mainly intended as a replacement for the C++" |
252 |
- elog "standard library when using clang." |
253 |
- elog "To use it, instead of libstdc++, use:" |
254 |
- elog " clang++ -stdlib=libc++" |
255 |
- elog "to compile your C++ programs." |
256 |
-} |
257 |
|
258 |
diff --git a/sys-libs/libcxx/libcxx-12.0.0_rc3.ebuild b/sys-libs/libcxx/libcxx-12.0.0_rc3.ebuild |
259 |
deleted file mode 100644 |
260 |
index 9887227800d..00000000000 |
261 |
--- a/sys-libs/libcxx/libcxx-12.0.0_rc3.ebuild |
262 |
+++ /dev/null |
263 |
@@ -1,223 +0,0 @@ |
264 |
-# Copyright 1999-2021 Gentoo Authors |
265 |
-# Distributed under the terms of the GNU General Public License v2 |
266 |
- |
267 |
-EAPI=7 |
268 |
- |
269 |
-CMAKE_ECLASS=cmake |
270 |
-PYTHON_COMPAT=( python3_{7..9} ) |
271 |
-inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
272 |
- |
273 |
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
274 |
-HOMEPAGE="https://libcxx.llvm.org/" |
275 |
- |
276 |
-LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
277 |
-SLOT="0" |
278 |
-KEYWORDS="" |
279 |
-IUSE="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" |
280 |
-REQUIRED_USE="libunwind? ( libcxxabi )" |
281 |
-RESTRICT="!test? ( test )" |
282 |
- |
283 |
-RDEPEND=" |
284 |
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) |
285 |
- !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" |
286 |
-# llvm-6 for new lit options |
287 |
-# clang-3.9.0 installs necessary target symlinks unconditionally |
288 |
-# which removes the need for MULTILIB_USEDEP |
289 |
-DEPEND="${RDEPEND} |
290 |
- >=sys-devel/llvm-6" |
291 |
-BDEPEND=" |
292 |
- test? ( |
293 |
- >=dev-util/cmake-3.16 |
294 |
- >=sys-devel/clang-3.9.0 |
295 |
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
296 |
- )" |
297 |
- |
298 |
-DOCS=( CREDITS.TXT ) |
299 |
- |
300 |
-LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake/modules,utils/llvm-lit} ) |
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 |
-src_prepare() { |
325 |
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a |
326 |
- # out-of-tree build. |
327 |
- eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" |
328 |
- |
329 |
- # Known failures. |
330 |
- rm test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp || die |
331 |
- rm test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp || die |
332 |
- rm test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp || die |
333 |
- |
334 |
- llvm.org_src_prepare |
335 |
-} |
336 |
- |
337 |
-test_compiler() { |
338 |
- $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ |
339 |
- <<<'int main() { return 0; }' &>/dev/null |
340 |
-} |
341 |
- |
342 |
-src_configure() { |
343 |
- # note: we need to do this before multilib kicks in since it will |
344 |
- # alter the CHOST |
345 |
- local cxxabi cxxabi_incs |
346 |
- if use libcxxabi; then |
347 |
- cxxabi=libcxxabi |
348 |
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" |
349 |
- else |
350 |
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" |
351 |
- cxxabi=libsupc++ |
352 |
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" |
353 |
- fi |
354 |
- |
355 |
- multilib-minimal_src_configure |
356 |
-} |
357 |
- |
358 |
-multilib_src_configure() { |
359 |
- # we want -lgcc_s for unwinder, and for compiler runtime when using |
360 |
- # gcc, clang with gcc runtime (or any unknown compiler) |
361 |
- local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF |
362 |
- if use libunwind; then |
363 |
- # work-around missing -lunwind upstream |
364 |
- extra_libs+=( -lunwind ) |
365 |
- # if we're using libunwind and clang with compiler-rt, we want |
366 |
- # to link to compiler-rt instead of -lgcc_s |
367 |
- if tc-is-clang; then |
368 |
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
369 |
- ${LDFLAGS} -print-libgcc-file-name) |
370 |
- if [[ ${compiler_rt} == *libclang_rt* ]]; then |
371 |
- want_gcc_s=OFF |
372 |
- want_compiler_rt=ON |
373 |
- extra_libs+=( "${compiler_rt}" ) |
374 |
- fi |
375 |
- fi |
376 |
- elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then |
377 |
- # clang-based darwin prefix disables libunwind useflag during |
378 |
- # bootstrap, because libunwind is not in the prefix yet. |
379 |
- # override the default, though, because clang based libcxx |
380 |
- # should never use gcc_s on Darwin. |
381 |
- want_gcc_s=OFF |
382 |
- # compiler_rt is not available in EPREFIX during bootstrap, |
383 |
- # so we cannot link to it yet anyway, so keep the defaults |
384 |
- # of want_compiler_rt=OFF and extra_libs=() |
385 |
- fi |
386 |
- |
387 |
- # bootstrap: cmake is unhappy if compiler can't link to stdlib |
388 |
- local nolib_flags=( -nodefaultlibs -lc ) |
389 |
- if ! test_compiler; then |
390 |
- if test_compiler "${nolib_flags[@]}"; then |
391 |
- local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
392 |
- ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
393 |
- fi |
394 |
- fi |
395 |
- |
396 |
- local libdir=$(get_libdir) |
397 |
- local mycmakeargs=( |
398 |
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} |
399 |
- -DLIBCXX_ENABLE_SHARED=ON |
400 |
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
401 |
- -DLIBCXX_CXX_ABI=${cxxabi} |
402 |
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
403 |
- # we're using our own mechanism for generating linker scripts |
404 |
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
405 |
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
406 |
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s} |
407 |
- -DLIBCXX_INCLUDE_TESTS=$(usex test) |
408 |
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} |
409 |
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" |
410 |
- ) |
411 |
- |
412 |
- if use test; then |
413 |
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
414 |
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
415 |
- |
416 |
- mycmakeargs+=( |
417 |
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
418 |
- -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" |
419 |
- -DPython3_EXECUTABLE="${PYTHON}" |
420 |
- ) |
421 |
- fi |
422 |
- cmake_src_configure |
423 |
-} |
424 |
- |
425 |
-multilib_src_test() { |
426 |
- local -x LIT_PRESERVES_TMP=1 |
427 |
- cmake_build check-cxx |
428 |
-} |
429 |
- |
430 |
-# Usage: deps |
431 |
-gen_ldscript() { |
432 |
- local output_format |
433 |
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
434 |
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
435 |
- |
436 |
- cat <<-END_LDSCRIPT |
437 |
-/* GNU ld script |
438 |
- Include missing dependencies |
439 |
-*/ |
440 |
-${output_format} |
441 |
-GROUP ( $@ ) |
442 |
-END_LDSCRIPT |
443 |
-} |
444 |
- |
445 |
-gen_static_ldscript() { |
446 |
- local libdir=$(get_libdir) |
447 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") |
448 |
- |
449 |
- # Move it first. |
450 |
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die |
451 |
- # Generate libc++.a ldscript for inclusion of its dependencies so that |
452 |
- # clang++ -stdlib=libc++ -static works out of the box. |
453 |
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)" |
454 |
- # On Linux/glibc it does not link without libpthread or libdl. It is |
455 |
- # fine on FreeBSD. |
456 |
- use elibc_glibc && deps+=" libpthread.a libdl.a" |
457 |
- |
458 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die |
459 |
-} |
460 |
- |
461 |
-gen_shared_ldscript() { |
462 |
- local libdir=$(get_libdir) |
463 |
- # libsupc++ doesn't have a shared version |
464 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") |
465 |
- |
466 |
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die |
467 |
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" |
468 |
- |
469 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die |
470 |
-} |
471 |
- |
472 |
-multilib_src_install() { |
473 |
- cmake_src_install |
474 |
- if [[ ${CHOST} != *-darwin* ]] ; then |
475 |
- gen_shared_ldscript |
476 |
- use static-libs && gen_static_ldscript |
477 |
- fi |
478 |
-} |
479 |
- |
480 |
-pkg_postinst() { |
481 |
- elog "This package (${PN}) is mainly intended as a replacement for the C++" |
482 |
- elog "standard library when using clang." |
483 |
- elog "To use it, instead of libstdc++, use:" |
484 |
- elog " clang++ -stdlib=libc++" |
485 |
- elog "to compile your C++ programs." |
486 |
-} |
487 |
|
488 |
diff --git a/sys-libs/libcxx/libcxx-12.0.0_rc4.ebuild b/sys-libs/libcxx/libcxx-12.0.0_rc4.ebuild |
489 |
deleted file mode 100644 |
490 |
index 9887227800d..00000000000 |
491 |
--- a/sys-libs/libcxx/libcxx-12.0.0_rc4.ebuild |
492 |
+++ /dev/null |
493 |
@@ -1,223 +0,0 @@ |
494 |
-# Copyright 1999-2021 Gentoo Authors |
495 |
-# Distributed under the terms of the GNU General Public License v2 |
496 |
- |
497 |
-EAPI=7 |
498 |
- |
499 |
-CMAKE_ECLASS=cmake |
500 |
-PYTHON_COMPAT=( python3_{7..9} ) |
501 |
-inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
502 |
- |
503 |
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
504 |
-HOMEPAGE="https://libcxx.llvm.org/" |
505 |
- |
506 |
-LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
507 |
-SLOT="0" |
508 |
-KEYWORDS="" |
509 |
-IUSE="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" |
510 |
-REQUIRED_USE="libunwind? ( libcxxabi )" |
511 |
-RESTRICT="!test? ( test )" |
512 |
- |
513 |
-RDEPEND=" |
514 |
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) |
515 |
- !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" |
516 |
-# llvm-6 for new lit options |
517 |
-# clang-3.9.0 installs necessary target symlinks unconditionally |
518 |
-# which removes the need for MULTILIB_USEDEP |
519 |
-DEPEND="${RDEPEND} |
520 |
- >=sys-devel/llvm-6" |
521 |
-BDEPEND=" |
522 |
- test? ( |
523 |
- >=dev-util/cmake-3.16 |
524 |
- >=sys-devel/clang-3.9.0 |
525 |
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
526 |
- )" |
527 |
- |
528 |
-DOCS=( CREDITS.TXT ) |
529 |
- |
530 |
-LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake/modules,utils/llvm-lit} ) |
531 |
-llvm.org_set_globals |
532 |
- |
533 |
-python_check_deps() { |
534 |
- has_version "dev-python/lit[${PYTHON_USEDEP}]" |
535 |
-} |
536 |
- |
537 |
-pkg_setup() { |
538 |
- # Darwin Prefix builds do not have llvm installed yet, so rely on |
539 |
- # bootstrap-prefix to set the appropriate path vars to LLVM instead |
540 |
- # of using llvm_pkg_setup. |
541 |
- if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then |
542 |
- llvm_pkg_setup |
543 |
- fi |
544 |
- use test && python-any-r1_pkg_setup |
545 |
- |
546 |
- if ! use libcxxabi && ! tc-is-gcc ; then |
547 |
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other" |
548 |
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++" |
549 |
- eerror "and try again." |
550 |
- die |
551 |
- fi |
552 |
-} |
553 |
- |
554 |
-src_prepare() { |
555 |
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a |
556 |
- # out-of-tree build. |
557 |
- eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" |
558 |
- |
559 |
- # Known failures. |
560 |
- rm test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp || die |
561 |
- rm test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp || die |
562 |
- rm test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp || die |
563 |
- |
564 |
- llvm.org_src_prepare |
565 |
-} |
566 |
- |
567 |
-test_compiler() { |
568 |
- $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ |
569 |
- <<<'int main() { return 0; }' &>/dev/null |
570 |
-} |
571 |
- |
572 |
-src_configure() { |
573 |
- # note: we need to do this before multilib kicks in since it will |
574 |
- # alter the CHOST |
575 |
- local cxxabi cxxabi_incs |
576 |
- if use libcxxabi; then |
577 |
- cxxabi=libcxxabi |
578 |
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" |
579 |
- else |
580 |
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" |
581 |
- cxxabi=libsupc++ |
582 |
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" |
583 |
- fi |
584 |
- |
585 |
- multilib-minimal_src_configure |
586 |
-} |
587 |
- |
588 |
-multilib_src_configure() { |
589 |
- # we want -lgcc_s for unwinder, and for compiler runtime when using |
590 |
- # gcc, clang with gcc runtime (or any unknown compiler) |
591 |
- local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF |
592 |
- if use libunwind; then |
593 |
- # work-around missing -lunwind upstream |
594 |
- extra_libs+=( -lunwind ) |
595 |
- # if we're using libunwind and clang with compiler-rt, we want |
596 |
- # to link to compiler-rt instead of -lgcc_s |
597 |
- if tc-is-clang; then |
598 |
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
599 |
- ${LDFLAGS} -print-libgcc-file-name) |
600 |
- if [[ ${compiler_rt} == *libclang_rt* ]]; then |
601 |
- want_gcc_s=OFF |
602 |
- want_compiler_rt=ON |
603 |
- extra_libs+=( "${compiler_rt}" ) |
604 |
- fi |
605 |
- fi |
606 |
- elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then |
607 |
- # clang-based darwin prefix disables libunwind useflag during |
608 |
- # bootstrap, because libunwind is not in the prefix yet. |
609 |
- # override the default, though, because clang based libcxx |
610 |
- # should never use gcc_s on Darwin. |
611 |
- want_gcc_s=OFF |
612 |
- # compiler_rt is not available in EPREFIX during bootstrap, |
613 |
- # so we cannot link to it yet anyway, so keep the defaults |
614 |
- # of want_compiler_rt=OFF and extra_libs=() |
615 |
- fi |
616 |
- |
617 |
- # bootstrap: cmake is unhappy if compiler can't link to stdlib |
618 |
- local nolib_flags=( -nodefaultlibs -lc ) |
619 |
- if ! test_compiler; then |
620 |
- if test_compiler "${nolib_flags[@]}"; then |
621 |
- local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
622 |
- ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
623 |
- fi |
624 |
- fi |
625 |
- |
626 |
- local libdir=$(get_libdir) |
627 |
- local mycmakeargs=( |
628 |
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} |
629 |
- -DLIBCXX_ENABLE_SHARED=ON |
630 |
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
631 |
- -DLIBCXX_CXX_ABI=${cxxabi} |
632 |
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
633 |
- # we're using our own mechanism for generating linker scripts |
634 |
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
635 |
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
636 |
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s} |
637 |
- -DLIBCXX_INCLUDE_TESTS=$(usex test) |
638 |
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} |
639 |
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" |
640 |
- ) |
641 |
- |
642 |
- if use test; then |
643 |
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
644 |
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
645 |
- |
646 |
- mycmakeargs+=( |
647 |
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
648 |
- -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" |
649 |
- -DPython3_EXECUTABLE="${PYTHON}" |
650 |
- ) |
651 |
- fi |
652 |
- cmake_src_configure |
653 |
-} |
654 |
- |
655 |
-multilib_src_test() { |
656 |
- local -x LIT_PRESERVES_TMP=1 |
657 |
- cmake_build check-cxx |
658 |
-} |
659 |
- |
660 |
-# Usage: deps |
661 |
-gen_ldscript() { |
662 |
- local output_format |
663 |
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
664 |
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
665 |
- |
666 |
- cat <<-END_LDSCRIPT |
667 |
-/* GNU ld script |
668 |
- Include missing dependencies |
669 |
-*/ |
670 |
-${output_format} |
671 |
-GROUP ( $@ ) |
672 |
-END_LDSCRIPT |
673 |
-} |
674 |
- |
675 |
-gen_static_ldscript() { |
676 |
- local libdir=$(get_libdir) |
677 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") |
678 |
- |
679 |
- # Move it first. |
680 |
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die |
681 |
- # Generate libc++.a ldscript for inclusion of its dependencies so that |
682 |
- # clang++ -stdlib=libc++ -static works out of the box. |
683 |
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)" |
684 |
- # On Linux/glibc it does not link without libpthread or libdl. It is |
685 |
- # fine on FreeBSD. |
686 |
- use elibc_glibc && deps+=" libpthread.a libdl.a" |
687 |
- |
688 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die |
689 |
-} |
690 |
- |
691 |
-gen_shared_ldscript() { |
692 |
- local libdir=$(get_libdir) |
693 |
- # libsupc++ doesn't have a shared version |
694 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") |
695 |
- |
696 |
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die |
697 |
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" |
698 |
- |
699 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die |
700 |
-} |
701 |
- |
702 |
-multilib_src_install() { |
703 |
- cmake_src_install |
704 |
- if [[ ${CHOST} != *-darwin* ]] ; then |
705 |
- gen_shared_ldscript |
706 |
- use static-libs && gen_static_ldscript |
707 |
- fi |
708 |
-} |
709 |
- |
710 |
-pkg_postinst() { |
711 |
- elog "This package (${PN}) is mainly intended as a replacement for the C++" |
712 |
- elog "standard library when using clang." |
713 |
- elog "To use it, instead of libstdc++, use:" |
714 |
- elog " clang++ -stdlib=libc++" |
715 |
- elog "to compile your C++ programs." |
716 |
-} |
717 |
|
718 |
diff --git a/sys-libs/libcxx/libcxx-12.0.0_rc5.ebuild b/sys-libs/libcxx/libcxx-12.0.0_rc5.ebuild |
719 |
deleted file mode 100644 |
720 |
index 9887227800d..00000000000 |
721 |
--- a/sys-libs/libcxx/libcxx-12.0.0_rc5.ebuild |
722 |
+++ /dev/null |
723 |
@@ -1,223 +0,0 @@ |
724 |
-# Copyright 1999-2021 Gentoo Authors |
725 |
-# Distributed under the terms of the GNU General Public License v2 |
726 |
- |
727 |
-EAPI=7 |
728 |
- |
729 |
-CMAKE_ECLASS=cmake |
730 |
-PYTHON_COMPAT=( python3_{7..9} ) |
731 |
-inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
732 |
- |
733 |
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
734 |
-HOMEPAGE="https://libcxx.llvm.org/" |
735 |
- |
736 |
-LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
737 |
-SLOT="0" |
738 |
-KEYWORDS="" |
739 |
-IUSE="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" |
740 |
-REQUIRED_USE="libunwind? ( libcxxabi )" |
741 |
-RESTRICT="!test? ( test )" |
742 |
- |
743 |
-RDEPEND=" |
744 |
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) |
745 |
- !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" |
746 |
-# llvm-6 for new lit options |
747 |
-# clang-3.9.0 installs necessary target symlinks unconditionally |
748 |
-# which removes the need for MULTILIB_USEDEP |
749 |
-DEPEND="${RDEPEND} |
750 |
- >=sys-devel/llvm-6" |
751 |
-BDEPEND=" |
752 |
- test? ( |
753 |
- >=dev-util/cmake-3.16 |
754 |
- >=sys-devel/clang-3.9.0 |
755 |
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
756 |
- )" |
757 |
- |
758 |
-DOCS=( CREDITS.TXT ) |
759 |
- |
760 |
-LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake/modules,utils/llvm-lit} ) |
761 |
-llvm.org_set_globals |
762 |
- |
763 |
-python_check_deps() { |
764 |
- has_version "dev-python/lit[${PYTHON_USEDEP}]" |
765 |
-} |
766 |
- |
767 |
-pkg_setup() { |
768 |
- # Darwin Prefix builds do not have llvm installed yet, so rely on |
769 |
- # bootstrap-prefix to set the appropriate path vars to LLVM instead |
770 |
- # of using llvm_pkg_setup. |
771 |
- if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then |
772 |
- llvm_pkg_setup |
773 |
- fi |
774 |
- use test && python-any-r1_pkg_setup |
775 |
- |
776 |
- if ! use libcxxabi && ! tc-is-gcc ; then |
777 |
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other" |
778 |
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++" |
779 |
- eerror "and try again." |
780 |
- die |
781 |
- fi |
782 |
-} |
783 |
- |
784 |
-src_prepare() { |
785 |
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a |
786 |
- # out-of-tree build. |
787 |
- eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" |
788 |
- |
789 |
- # Known failures. |
790 |
- rm test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp || die |
791 |
- rm test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp || die |
792 |
- rm test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp || die |
793 |
- |
794 |
- llvm.org_src_prepare |
795 |
-} |
796 |
- |
797 |
-test_compiler() { |
798 |
- $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ |
799 |
- <<<'int main() { return 0; }' &>/dev/null |
800 |
-} |
801 |
- |
802 |
-src_configure() { |
803 |
- # note: we need to do this before multilib kicks in since it will |
804 |
- # alter the CHOST |
805 |
- local cxxabi cxxabi_incs |
806 |
- if use libcxxabi; then |
807 |
- cxxabi=libcxxabi |
808 |
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" |
809 |
- else |
810 |
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" |
811 |
- cxxabi=libsupc++ |
812 |
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" |
813 |
- fi |
814 |
- |
815 |
- multilib-minimal_src_configure |
816 |
-} |
817 |
- |
818 |
-multilib_src_configure() { |
819 |
- # we want -lgcc_s for unwinder, and for compiler runtime when using |
820 |
- # gcc, clang with gcc runtime (or any unknown compiler) |
821 |
- local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF |
822 |
- if use libunwind; then |
823 |
- # work-around missing -lunwind upstream |
824 |
- extra_libs+=( -lunwind ) |
825 |
- # if we're using libunwind and clang with compiler-rt, we want |
826 |
- # to link to compiler-rt instead of -lgcc_s |
827 |
- if tc-is-clang; then |
828 |
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
829 |
- ${LDFLAGS} -print-libgcc-file-name) |
830 |
- if [[ ${compiler_rt} == *libclang_rt* ]]; then |
831 |
- want_gcc_s=OFF |
832 |
- want_compiler_rt=ON |
833 |
- extra_libs+=( "${compiler_rt}" ) |
834 |
- fi |
835 |
- fi |
836 |
- elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then |
837 |
- # clang-based darwin prefix disables libunwind useflag during |
838 |
- # bootstrap, because libunwind is not in the prefix yet. |
839 |
- # override the default, though, because clang based libcxx |
840 |
- # should never use gcc_s on Darwin. |
841 |
- want_gcc_s=OFF |
842 |
- # compiler_rt is not available in EPREFIX during bootstrap, |
843 |
- # so we cannot link to it yet anyway, so keep the defaults |
844 |
- # of want_compiler_rt=OFF and extra_libs=() |
845 |
- fi |
846 |
- |
847 |
- # bootstrap: cmake is unhappy if compiler can't link to stdlib |
848 |
- local nolib_flags=( -nodefaultlibs -lc ) |
849 |
- if ! test_compiler; then |
850 |
- if test_compiler "${nolib_flags[@]}"; then |
851 |
- local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
852 |
- ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
853 |
- fi |
854 |
- fi |
855 |
- |
856 |
- local libdir=$(get_libdir) |
857 |
- local mycmakeargs=( |
858 |
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} |
859 |
- -DLIBCXX_ENABLE_SHARED=ON |
860 |
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
861 |
- -DLIBCXX_CXX_ABI=${cxxabi} |
862 |
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
863 |
- # we're using our own mechanism for generating linker scripts |
864 |
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
865 |
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
866 |
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s} |
867 |
- -DLIBCXX_INCLUDE_TESTS=$(usex test) |
868 |
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} |
869 |
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" |
870 |
- ) |
871 |
- |
872 |
- if use test; then |
873 |
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
874 |
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
875 |
- |
876 |
- mycmakeargs+=( |
877 |
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
878 |
- -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" |
879 |
- -DPython3_EXECUTABLE="${PYTHON}" |
880 |
- ) |
881 |
- fi |
882 |
- cmake_src_configure |
883 |
-} |
884 |
- |
885 |
-multilib_src_test() { |
886 |
- local -x LIT_PRESERVES_TMP=1 |
887 |
- cmake_build check-cxx |
888 |
-} |
889 |
- |
890 |
-# Usage: deps |
891 |
-gen_ldscript() { |
892 |
- local output_format |
893 |
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
894 |
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
895 |
- |
896 |
- cat <<-END_LDSCRIPT |
897 |
-/* GNU ld script |
898 |
- Include missing dependencies |
899 |
-*/ |
900 |
-${output_format} |
901 |
-GROUP ( $@ ) |
902 |
-END_LDSCRIPT |
903 |
-} |
904 |
- |
905 |
-gen_static_ldscript() { |
906 |
- local libdir=$(get_libdir) |
907 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") |
908 |
- |
909 |
- # Move it first. |
910 |
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die |
911 |
- # Generate libc++.a ldscript for inclusion of its dependencies so that |
912 |
- # clang++ -stdlib=libc++ -static works out of the box. |
913 |
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)" |
914 |
- # On Linux/glibc it does not link without libpthread or libdl. It is |
915 |
- # fine on FreeBSD. |
916 |
- use elibc_glibc && deps+=" libpthread.a libdl.a" |
917 |
- |
918 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die |
919 |
-} |
920 |
- |
921 |
-gen_shared_ldscript() { |
922 |
- local libdir=$(get_libdir) |
923 |
- # libsupc++ doesn't have a shared version |
924 |
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") |
925 |
- |
926 |
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die |
927 |
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" |
928 |
- |
929 |
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die |
930 |
-} |
931 |
- |
932 |
-multilib_src_install() { |
933 |
- cmake_src_install |
934 |
- if [[ ${CHOST} != *-darwin* ]] ; then |
935 |
- gen_shared_ldscript |
936 |
- use static-libs && gen_static_ldscript |
937 |
- fi |
938 |
-} |
939 |
- |
940 |
-pkg_postinst() { |
941 |
- elog "This package (${PN}) is mainly intended as a replacement for the C++" |
942 |
- elog "standard library when using clang." |
943 |
- elog "To use it, instead of libstdc++, use:" |
944 |
- elog " clang++ -stdlib=libc++" |
945 |
- elog "to compile your C++ programs." |
946 |
-} |