1 |
commit: 124957cbf143bd2a255d1cce55160d276e63541e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 30 08:37:34 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 30 14:52:10 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=124957cb |
7 |
|
8 |
sys-libs/libcxx: Add 16.0.0_pre20220930 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_pre20220930.ebuild | 219 +++++++++++++++++++++++ |
14 |
2 files changed, 220 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest |
17 |
index 853521d69088..da24472f8b24 100644 |
18 |
--- a/sys-libs/libcxx/Manifest |
19 |
+++ b/sys-libs/libcxx/Manifest |
20 |
@@ -4,5 +4,6 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f |
21 |
DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6 |
22 |
DIST llvm-project-15.0.1.src.tar.xz 112068688 BLAKE2B 8fd6690445f7cbc8b47a7c1dd1f2c4fbc39f9a97f9d4a0015d466726454b090b0d1ff9b0d926eba7065e84782901687f74e6540a36dc6656a93f3c92c7bc7e06 SHA512 cef84bc173118a30db3ece5e5c6f874bf689c77afc40a4792fdcb7556555ac14a8e6de1dc811755405e5d162d63bc69abaecba30d220a42765160d69f0073fda |
23 |
DIST llvm-project-15.0.1.src.tar.xz.sig 438 BLAKE2B d8f634adab531bb19178fb27bc83b3a90c856e9402dd5af700f9af43813f68d20c21b9112dd95e9f6f10609ee51ed5aaf77edb96ca16fb93136b8aea432affd3 SHA512 cbf2570840d8dc12f6436c495a23cf9d439ee195755c01a6d1d5bcc20133599dc956dc43a0f5016698e3c9a960826f5f3c2840a73f993467e275856a67999fda |
24 |
+DIST llvm-project-215c9fa4deac9ec6b4e504843830551f03b60620.tar.gz 168942763 BLAKE2B 545c7c372c38667b7d811753464e91134aae600060d9054979eab8735d535a72d6bbb33a6008dc81f3b14513f58791ca3b8c3068e62ff146ccb14f32abb41a32 SHA512 d0c244357650ef5d56bc7afd836cd747cc2cce92d5f7fb4ddec3414e5bafe4e611acb2a7ff42343c184caad14a30fa9a6ced7e493df3ceb06fe8f9445aeb5a9b |
25 |
DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAKE2B 143c72c58517b3e40ee74c1a0df47bfd0d0f9e71926bc8c39a007e674a08df95d0ffe05f523f97e4409b248349e13719cabbc7ac6938feebe702959e84a07243 SHA512 9aa5c86de6c6be1d26c085eb29ea283429e41330e937e5fdbd545bb3f5b996ac82cd6268701fcbbd202e89ee35f2b67e595fc595bb7383778e9ad5fd52ca10a0 |
26 |
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f |
27 |
|
28 |
diff --git a/sys-libs/libcxx/libcxx-16.0.0_pre20220930.ebuild b/sys-libs/libcxx/libcxx-16.0.0_pre20220930.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..28c4cca66346 |
31 |
--- /dev/null |
32 |
+++ b/sys-libs/libcxx/libcxx-16.0.0_pre20220930.ebuild |
33 |
@@ -0,0 +1,219 @@ |
34 |
+# Copyright 1999-2022 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+PYTHON_COMPAT=( python3_{8..11} ) |
40 |
+inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ |
41 |
+ toolchain-funcs |
42 |
+ |
43 |
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
44 |
+HOMEPAGE="https://libcxx.llvm.org/" |
45 |
+ |
46 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="" |
49 |
+IUSE="+clang +libcxxabi static-libs test" |
50 |
+REQUIRED_USE="test? ( clang )" |
51 |
+RESTRICT="!test? ( test )" |
52 |
+ |
53 |
+RDEPEND=" |
54 |
+ libcxxabi? ( |
55 |
+ ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] |
56 |
+ ) |
57 |
+ !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) |
58 |
+" |
59 |
+LLVM_MAX_SLOT=${PV%%.*} |
60 |
+DEPEND=" |
61 |
+ ${RDEPEND} |
62 |
+ sys-devel/llvm:${LLVM_MAX_SLOT} |
63 |
+" |
64 |
+BDEPEND=" |
65 |
+ clang? ( |
66 |
+ sys-devel/clang:${LLVM_MAX_SLOT} |
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_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 against compiler-rt instead of libgcc if this is what clang does |
132 |
+ local want_compiler_rt=OFF |
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_compiler_rt=ON |
138 |
+ fi |
139 |
+ fi |
140 |
+ |
141 |
+ # bootstrap: cmake is unhappy if compiler can't link to stdlib |
142 |
+ local nolib_flags=( -nodefaultlibs -lc ) |
143 |
+ if ! test_compiler; then |
144 |
+ if test_compiler "${nolib_flags[@]}"; then |
145 |
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
146 |
+ ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" |
147 |
+ fi |
148 |
+ fi |
149 |
+ |
150 |
+ local libdir=$(get_libdir) |
151 |
+ local mycmakeargs=( |
152 |
+ -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" |
153 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
154 |
+ -DLLVM_ENABLE_RUNTIMES=libcxx |
155 |
+ -DLLVM_INCLUDE_TESTS=OFF |
156 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
157 |
+ |
158 |
+ -DLIBCXX_ENABLE_SHARED=ON |
159 |
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs) |
160 |
+ -DLIBCXX_CXX_ABI=${cxxabi} |
161 |
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} |
162 |
+ # we're using our own mechanism for generating linker scripts |
163 |
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
164 |
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
165 |
+ -DLIBCXX_INCLUDE_BENCHMARKS=OFF |
166 |
+ -DLIBCXX_INCLUDE_TESTS=$(usex test) |
167 |
+ -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} |
168 |
+ ) |
169 |
+ |
170 |
+ if use test; then |
171 |
+ mycmakeargs+=( |
172 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
173 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
174 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
175 |
+ ) |
176 |
+ fi |
177 |
+ cmake_src_configure |
178 |
+} |
179 |
+ |
180 |
+multilib_src_compile() { |
181 |
+ cmake_src_compile |
182 |
+ if [[ ${CHOST} != *-darwin* ]] ; then |
183 |
+ gen_shared_ldscript |
184 |
+ use static-libs && gen_static_ldscript |
185 |
+ fi |
186 |
+} |
187 |
+ |
188 |
+multilib_src_test() { |
189 |
+ local -x LIT_PRESERVES_TMP=1 |
190 |
+ cmake_build check-cxx |
191 |
+} |
192 |
+ |
193 |
+multilib_src_install() { |
194 |
+ cmake_src_install |
195 |
+ # since we've replaced libc++.{a,so} with ldscripts, now we have to |
196 |
+ # install the extra symlinks |
197 |
+ if [[ ${CHOST} != *-darwin* ]] ; then |
198 |
+ dolib.so lib/libc++_shared.so |
199 |
+ use static-libs && dolib.a lib/libc++_static.a |
200 |
+ fi |
201 |
+} |
202 |
+ |
203 |
+# Usage: deps |
204 |
+gen_ldscript() { |
205 |
+ local output_format |
206 |
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
207 |
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
208 |
+ |
209 |
+ cat <<-END_LDSCRIPT |
210 |
+/* GNU ld script |
211 |
+ Include missing dependencies |
212 |
+*/ |
213 |
+${output_format} |
214 |
+GROUP ( $@ ) |
215 |
+END_LDSCRIPT |
216 |
+} |
217 |
+ |
218 |
+gen_static_ldscript() { |
219 |
+ # Move it first. |
220 |
+ mv lib/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=( |
224 |
+ libc++_static.a |
225 |
+ $(usex libcxxabi libc++abi.a libsupc++.a) |
226 |
+ ) |
227 |
+ # On Linux/glibc it does not link without libpthread or libdl. It is |
228 |
+ # fine on FreeBSD. |
229 |
+ use elibc_glibc && deps+=( libpthread.a libdl.a ) |
230 |
+ |
231 |
+ gen_ldscript "${deps[*]}" > lib/libc++.a || die |
232 |
+} |
233 |
+ |
234 |
+gen_shared_ldscript() { |
235 |
+ # Move it first. |
236 |
+ mv lib/libc++{,_shared}.so || die |
237 |
+ local deps=( |
238 |
+ libc++_shared.so |
239 |
+ # libsupc++ doesn't have a shared version |
240 |
+ $(usex libcxxabi libc++abi.so libsupc++.a) |
241 |
+ ) |
242 |
+ |
243 |
+ gen_ldscript "${deps[*]}" > lib/libc++.so || die |
244 |
+} |
245 |
+ |
246 |
+pkg_postinst() { |
247 |
+ elog "This package (${PN}) is mainly intended as a replacement for the C++" |
248 |
+ elog "standard library when using clang." |
249 |
+ elog "To use it, instead of libstdc++, use:" |
250 |
+ elog " clang++ -stdlib=libc++" |
251 |
+ elog "to compile your C++ programs." |
252 |
+} |