1 |
commit: 9e934604db6d32b00c4cf11539d1d9acc293791e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 1 11:58:00 2023 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 1 20:59:19 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e934604 |
7 |
|
8 |
sys-libs/libcxx: Add 16.0.0_pre20230101 snapshot |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libcxx/Manifest | 1 + |
13 |
sys-libs/libcxx/libcxx-16.0.0_pre20230101.ebuild | 204 +++++++++++++++++++++++ |
14 |
2 files changed, 205 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest |
17 |
index 60638138ce61..90966698a634 100644 |
18 |
--- a/sys-libs/libcxx/Manifest |
19 |
+++ b/sys-libs/libcxx/Manifest |
20 |
@@ -6,6 +6,7 @@ DIST llvm-project-15.0.5.src.tar.xz 110931004 BLAKE2B d751e3627ee26e60a1a037a4a6 |
21 |
DIST llvm-project-15.0.5.src.tar.xz.sig 566 BLAKE2B a6e7204abc912045346a36f2b349e0829a4d5b9efcb230fb0c97caa38d5159ca17ffb47ce0485cbab276a4938ff3a5c05ef9f8b0b75f4c2028d870ee33023431 SHA512 312bc09b54408a9265f8102241089b0f674be0832dd5cb1998ff13dbccbe19324d7060ba2680457118dee96a1ff390b16282677ad825d7230008014ecebe47d5 |
22 |
DIST llvm-project-15.0.6.src.tar.xz 112074576 BLAKE2B 74b1aa967c95191fa492f06b3a21930842da0ccbd9995dd33b4c2cf07852bbedcae97041fd5966209b16c63b90c87cc02fb2e858eda13dd9cc0641edcede0f75 SHA512 3311d85f4e02610af52f06e83c8c6d2b93950d24324b831b7afc47c39a20a546d39683a14e1a315da87d226379042de900a3f36a0351053547482af9035ab949 |
23 |
DIST llvm-project-15.0.6.src.tar.xz.sig 438 BLAKE2B 3c97dbd55667f52dad964ef71257c36e3075794f5616cfd46de8bf874867e861bf45c0d56cff2d0ad5d4f1b5a1c9b3a395aedcc40bce545ce7f3c84ac75ae3da SHA512 a184103d84f8197a709c6c067fa83ca9290cd06532c487ad2c1fefa423438a1ac3c7f88835a94e3c9f04876e8d5f09afabef15bd8605df38aec6a4118597090c |
24 |
+DIST llvm-project-b20dd2b186fdc76828219b705a2b58f5830f4b9d.tar.gz 175044630 BLAKE2B f9a955e8413b57067fb697792316fb0c1e3eac00b1af208ba5d29db01a9acc96b88c7edca12c43762b1425c71a716a7c74d5d7edad45a442f32ba73f88f548b6 SHA512 5133c32d7856c8280bfeb47c3e5a9c0d8c1c291aad29af93586523110f95b08e582ff416fc6be02241eabfe80c35ad4f0334de5ead2a41bc6504616b1c6fd15a |
25 |
DIST llvm-project-dfc20708bcdf7b4c4bea8595fc4ac8674634d5e6.tar.gz 174878013 BLAKE2B 9c37423ae2a85a9d4a17fba97733cf808ebc98fa1488fb02e8c3e23039511154a220184af1bc6950c857b7d3c528d01e3dde5441c18903f25a7d7b7781e08f9b SHA512 146d6ab53cce257c21ae202b887bbb77b017f883cf26337bd3af29289cd828aabf95c528c6c192473c3cafb7e803940261f32a8fab6130deca01ccd5576c78eb |
26 |
DIST llvm-project-fb792ebaf2114ad11d673cf891ae560e2e604711.tar.gz 174312496 BLAKE2B dd7f30b911ef5049e9e2bff7b2768e31b48b1f4c7acaf159f535fe3deb5aa6630fdf7857c83fffcda1119a38a52101490d2b6cb41cb295bb7dd85cde0445b7ee SHA512 bef15e7d82a2faf8be24f784d3d34ff9b21c8f17256879587ea5471011a32a1eb885e1b020da55aa096f2e0b5fe4bcf9fe8f0f5b5d34f5f386c48899c68fb7d1 |
27 |
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f |
28 |
|
29 |
diff --git a/sys-libs/libcxx/libcxx-16.0.0_pre20230101.ebuild b/sys-libs/libcxx/libcxx-16.0.0_pre20230101.ebuild |
30 |
new file mode 100644 |
31 |
index 000000000000..1b03c27cafcf |
32 |
--- /dev/null |
33 |
+++ b/sys-libs/libcxx/libcxx-16.0.0_pre20230101.ebuild |
34 |
@@ -0,0 +1,204 @@ |
35 |
+# Copyright 1999-2023 Gentoo Authors |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI=8 |
39 |
+ |
40 |
+PYTHON_COMPAT=( python3_{8..11} ) |
41 |
+inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ |
42 |
+ toolchain-funcs |
43 |
+ |
44 |
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
45 |
+HOMEPAGE="https://libcxx.llvm.org/" |
46 |
+ |
47 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="" |
50 |
+IUSE="+clang +libcxxabi static-libs test" |
51 |
+REQUIRED_USE="test? ( clang )" |
52 |
+RESTRICT="!test? ( test )" |
53 |
+ |
54 |
+RDEPEND=" |
55 |
+ libcxxabi? ( |
56 |
+ ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] |
57 |
+ ) |
58 |
+ !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) |
59 |
+" |
60 |
+DEPEND=" |
61 |
+ ${RDEPEND} |
62 |
+ sys-devel/llvm:${LLVM_MAJOR} |
63 |
+" |
64 |
+BDEPEND=" |
65 |
+ clang? ( |
66 |
+ sys-devel/clang:${LLVM_MAJOR} |
67 |
+ ) |
68 |
+ !test? ( |
69 |
+ ${PYTHON_DEPS} |
70 |
+ ) |
71 |
+ test? ( |
72 |
+ >=dev-util/cmake-3.16 |
73 |
+ sys-devel/gdb[python] |
74 |
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
75 |
+ ) |
76 |
+" |
77 |
+ |
78 |
+LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) |
79 |
+llvm.org_set_globals |
80 |
+ |
81 |
+python_check_deps() { |
82 |
+ use test || return 0 |
83 |
+ python_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_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
92 |
+ fi |
93 |
+ 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=system-libcxxabi |
114 |
+ cxxabi_incs="${EPREFIX}/usr/include/c++/v1" |
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 |
+ if use clang; then |
126 |
+ local -x CC=${CHOST}-clang |
127 |
+ local -x CXX=${CHOST}-clang++ |
128 |
+ strip-unsupported-flags |
129 |
+ fi |
130 |
+ |
131 |
+ # link to compiler-rt |
132 |
+ local use_compiler_rt=OFF |
133 |
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON |
134 |
+ |
135 |
+ # bootstrap: cmake is unhappy if compiler can't link to stdlib |
136 |
+ local nolib_flags=( -nodefaultlibs -lc ) |
137 |
+ if ! test_compiler; then |
138 |
+ if test_compiler "${nolib_flags[@]}"; then |
139 |
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
140 |
+ ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
141 |
+ fi |
142 |
+ fi |
143 |
+ |
144 |
+ local libdir=$(get_libdir) |
145 |
+ local mycmakeargs=( |
146 |
+ -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" |
147 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
148 |
+ -DLLVM_ENABLE_RUNTIMES=libcxx |
149 |
+ -DLLVM_INCLUDE_TESTS=OFF |
150 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
151 |
+ |
152 |
+ -DLIBCXX_ENABLE_SHARED=ON |
153 |
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
154 |
+ -DLIBCXX_CXX_ABI=${cxxabi} |
155 |
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
156 |
+ # we're using our own mechanism for generating linker scripts |
157 |
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
158 |
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
159 |
+ -DLIBCXX_INCLUDE_BENCHMARKS=OFF |
160 |
+ -DLIBCXX_INCLUDE_TESTS=$(usex test) |
161 |
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} |
162 |
+ ) |
163 |
+ |
164 |
+ if use test; then |
165 |
+ mycmakeargs+=( |
166 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
167 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
168 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
169 |
+ ) |
170 |
+ fi |
171 |
+ cmake_src_configure |
172 |
+} |
173 |
+ |
174 |
+multilib_src_compile() { |
175 |
+ cmake_src_compile |
176 |
+ if [[ ${CHOST} != *-darwin* ]] ; then |
177 |
+ gen_shared_ldscript |
178 |
+ use static-libs && gen_static_ldscript |
179 |
+ fi |
180 |
+} |
181 |
+ |
182 |
+multilib_src_test() { |
183 |
+ local -x LIT_PRESERVES_TMP=1 |
184 |
+ cmake_build check-cxx |
185 |
+} |
186 |
+ |
187 |
+multilib_src_install() { |
188 |
+ cmake_src_install |
189 |
+ # since we've replaced libc++.{a,so} with ldscripts, now we have to |
190 |
+ # install the extra symlinks |
191 |
+ if [[ ${CHOST} != *-darwin* ]] ; then |
192 |
+ dolib.so lib/libc++_shared.so |
193 |
+ use static-libs && dolib.a lib/libc++_static.a |
194 |
+ fi |
195 |
+} |
196 |
+ |
197 |
+# Usage: deps |
198 |
+gen_ldscript() { |
199 |
+ local output_format |
200 |
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
201 |
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
202 |
+ |
203 |
+ cat <<-END_LDSCRIPT |
204 |
+/* GNU ld script |
205 |
+ Include missing dependencies |
206 |
+*/ |
207 |
+${output_format} |
208 |
+GROUP ( $@ ) |
209 |
+END_LDSCRIPT |
210 |
+} |
211 |
+ |
212 |
+gen_static_ldscript() { |
213 |
+ # Move it first. |
214 |
+ mv lib/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=( |
218 |
+ libc++_static.a |
219 |
+ $(usex libcxxabi libc++abi.a libsupc++.a) |
220 |
+ ) |
221 |
+ # On Linux/glibc it does not link without libpthread or libdl. It is |
222 |
+ # fine on FreeBSD. |
223 |
+ use elibc_glibc && deps+=( libpthread.a libdl.a ) |
224 |
+ |
225 |
+ gen_ldscript "${deps[*]}" > lib/libc++.a || die |
226 |
+} |
227 |
+ |
228 |
+gen_shared_ldscript() { |
229 |
+ # Move it first. |
230 |
+ mv lib/libc++{,_shared}.so || die |
231 |
+ local deps=( |
232 |
+ libc++_shared.so |
233 |
+ # libsupc++ doesn't have a shared version |
234 |
+ $(usex libcxxabi libc++abi.so libsupc++.a) |
235 |
+ ) |
236 |
+ |
237 |
+ gen_ldscript "${deps[*]}" > lib/libc++.so || die |
238 |
+} |