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