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