From 240b57012ace855bbfd9934b07642416ceeeb5b8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Jul 2023 22:29:02 +0100 Subject: gentoo auto-resync : 25:07:2023 - 22:29:01 --- sys-libs/libcxx/Manifest | 5 +- sys-libs/libcxx/libcxx-17.0.0_pre20230705.ebuild | 204 ----------------------- sys-libs/libcxx/libcxx-17.0.0_pre20230717.ebuild | 204 ----------------------- sys-libs/libcxx/libcxx-18.0.0.9999.ebuild | 204 +++++++++++++++++++++++ 4 files changed, 205 insertions(+), 412 deletions(-) delete mode 100644 sys-libs/libcxx/libcxx-17.0.0_pre20230705.ebuild delete mode 100644 sys-libs/libcxx/libcxx-17.0.0_pre20230717.ebuild create mode 100644 sys-libs/libcxx/libcxx-18.0.0.9999.ebuild (limited to 'sys-libs/libcxx') diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest index 3158ae58956b..ad89b4c184c6 100644 --- a/sys-libs/libcxx/Manifest +++ b/sys-libs/libcxx/Manifest @@ -7,15 +7,12 @@ DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 -DIST llvm-project-3cd3f11c174baa001b337b88c7a6507eb5705cf2.tar.gz 194446197 BLAKE2B ba2ac8334f90fddfd9b8f97abd2f77bd1f1ad00c97f2b7daf6b799fe49755a9bd07e017e93cc634163ad7499e70d886556715e26e9d7ed9017018861c3522735 SHA512 b12d02a7b4df08e8decf99ac86875bef72ff2fa546699e7a94bfd2b2ad1e1256aec66185f9e2f7c2f5d06b1eeb3faae44a2c457b33e5c7416d3bd9921759b39d -DIST llvm-project-5ae7fde004cbc640c2f60207791ac36574e5f5c6.tar.gz 193410766 BLAKE2B 50287f1ad41a895040934f8f19fd8aa2e91065b930ab14125dbbc3977273655d11482b6229577c11a8ad2bdd854ca109449b603bbc2e30cee20e95e4fe11e8b7 SHA512 f24f7a3b0661d2d4533b24c295c114817aff22c8f1d473ffa639cee547d31502719f8e1be4f25b970d450ecb9dcaa809c0e12b1bb380774f52cda82a4769d7bc DIST llvm-project-5f1a388a11ae67c2e5d7a4d1fe45e369a393c572.tar.gz 194911977 BLAKE2B d7277591ddca0046dcc244f591732440a6c63c06557d96d18792c2544797a3bcea4af241ad1e9c0106a9751f52bfbcec0544020cc20874e8c64a31a8055d07d0 SHA512 b38aed6a21a3dd4325faf45475b843dcebab89d8ad9683e0f7699701f9645fa9467e032b822473c53a3242930d681caba9dd9530560636cf093108640470bbbe EBUILD libcxx-14.0.6.ebuild 6950 BLAKE2B f4f8068f1b9dd1a8c22abd4acb4206da1dd7bb4eb029723a2edfe8c5db3a6ed74a677ba00c508ff54806a33b60b131ffd4b9729ed0d6d0bf5296a1e53e2ababf SHA512 a602e45046d931f28d2656bd733823d3289a993acd7399c5cd29915e65eb9ae0cb601f2774dad34534299366ecd9c038488e037b13af8b732f254e561f56c592 EBUILD libcxx-15.0.7-r1.ebuild 5308 BLAKE2B aeeee8aab5d3aa09f6165186eafe5bd2802105f763295d4160d81563779999fa03aca891474cd8eae9755ee43ec73bfb7ae3d9fa6d32c7c01040cc46f85858af SHA512 7780ac83f357ffc9d4fc72d2649b2996b7ba5f9473d75ab56e04ccff99a8811c4d14f69de4024fe6472794dc0ed267ee2f34b9430f4d8ed054c65b018abd1778 EBUILD libcxx-15.0.7.ebuild 5283 BLAKE2B 09c43241bab7e5015d3dae5466e49fb24337b87a6925116056d4ad9baa048c3f23c61a5e93403addfa97676f733a04ef33cc9238fbed9a4abcf985ad8d939965 SHA512 d90583d3fe5724ed15a91c70241457e9120d848e9cbcce2bfb3f3932d9d36ef726830d76601af530e2e28e552d7ad2049dd74713eb54f6eca55206cb4f35f8e2 EBUILD libcxx-16.0.6.ebuild 5313 BLAKE2B 37f077d523482df9e4949dbd3a9957593e88c4ea82f30fce213c1847b2559fd4dd91ea88c8d5810c08c841e9c7102a6a188d8fea3a63cd63b9cf0b76c9a423e0 SHA512 c34aeb5f1579c83e40eae1c56fe2c370f75976daf9f8ccf25f9129b9a238736b8f180758f453e137e6c6ddd6950cee448c97e814e334ad9b0d22918d680ff466 EBUILD libcxx-17.0.0.9999.ebuild 5241 BLAKE2B d2cefdfde25f1f87a3a1419268aa0600dba7a3eb7a62a508b8be403134ab9398e881ba8344753fc5ead6c3eac198eebea07d3554a1d6ee3a5676377b5830729b SHA512 e96c1769afd4927dca8ed02a1add344cfb137d0072651524d4077558b31e9dfd70b6179c86c5aa2cb3c80e5864c5ccdaf867350d3f8f9bf696f92e059db71591 -EBUILD libcxx-17.0.0_pre20230705.ebuild 5241 BLAKE2B d2cefdfde25f1f87a3a1419268aa0600dba7a3eb7a62a508b8be403134ab9398e881ba8344753fc5ead6c3eac198eebea07d3554a1d6ee3a5676377b5830729b SHA512 e96c1769afd4927dca8ed02a1add344cfb137d0072651524d4077558b31e9dfd70b6179c86c5aa2cb3c80e5864c5ccdaf867350d3f8f9bf696f92e059db71591 -EBUILD libcxx-17.0.0_pre20230717.ebuild 5241 BLAKE2B d2cefdfde25f1f87a3a1419268aa0600dba7a3eb7a62a508b8be403134ab9398e881ba8344753fc5ead6c3eac198eebea07d3554a1d6ee3a5676377b5830729b SHA512 e96c1769afd4927dca8ed02a1add344cfb137d0072651524d4077558b31e9dfd70b6179c86c5aa2cb3c80e5864c5ccdaf867350d3f8f9bf696f92e059db71591 EBUILD libcxx-17.0.0_pre20230722.ebuild 5241 BLAKE2B d2cefdfde25f1f87a3a1419268aa0600dba7a3eb7a62a508b8be403134ab9398e881ba8344753fc5ead6c3eac198eebea07d3554a1d6ee3a5676377b5830729b SHA512 e96c1769afd4927dca8ed02a1add344cfb137d0072651524d4077558b31e9dfd70b6179c86c5aa2cb3c80e5864c5ccdaf867350d3f8f9bf696f92e059db71591 +EBUILD libcxx-18.0.0.9999.ebuild 5241 BLAKE2B d2cefdfde25f1f87a3a1419268aa0600dba7a3eb7a62a508b8be403134ab9398e881ba8344753fc5ead6c3eac198eebea07d3554a1d6ee3a5676377b5830729b SHA512 e96c1769afd4927dca8ed02a1add344cfb137d0072651524d4077558b31e9dfd70b6179c86c5aa2cb3c80e5864c5ccdaf867350d3f8f9bf696f92e059db71591 MISC metadata.xml 718 BLAKE2B 3cc1e43a6f1ada368cfc0bf8aaf49007f6792062b684ab9299b5180d778b158325b6931169b52dd14e85ae9ad6dc1a03be323b814fb920fe8434ad86425d699c SHA512 c2cef3e481c0c3db7de6de8c0a5aff42a1e7fe81155d99f1f0f0988f6d5ca041f787a27a2dde0073037d59e082e2f6da7eefe1303f1c1837ebc12e8e0d28729f diff --git a/sys-libs/libcxx/libcxx-17.0.0_pre20230705.ebuild b/sys-libs/libcxx/libcxx-17.0.0_pre20230705.ebuild deleted file mode 100644 index bb005b4d8ec8..000000000000 --- a/sys-libs/libcxx/libcxx-17.0.0_pre20230705.ebuild +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ - toolchain-funcs - -DESCRIPTION="New implementation of the C++ standard library, targeting C++11" -HOMEPAGE="https://libcxx.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -KEYWORDS="" -IUSE="+clang +libcxxabi +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( - ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] - ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) -" -DEPEND=" - ${RDEPEND} - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - >=dev-util/cmake-3.16 - sys-devel/gdb[python] - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - # Darwin Prefix builds do not have llvm installed yet, so rely on - # bootstrap-prefix to set the appropriate path vars to LLVM instead - # of using llvm_pkg_setup. - if [[ ${CHOST} != *-darwin* ]] || has_version sys-devel/llvm; then - LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup - fi - python-any-r1_pkg_setup - - if ! use libcxxabi && ! tc-is-gcc ; then - eerror "To build ${PN} against libsupc++, you have to use gcc. Other" - eerror "compilers are not supported. Please set CC=gcc and CXX=g++" - eerror "and try again." - die - fi -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - # note: we need to do this before multilib kicks in since it will - # alter the CHOST - local cxxabi cxxabi_incs - if use libcxxabi; then - cxxabi=system-libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/c++/v1" - else - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" - cxxabi=libsupc++ - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # bootstrap: cmake is unhappy if compiler can't link to stdlib - local nolib_flags=( -nodefaultlibs -lc ) - if ! test_compiler; then - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES=libcxx - -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DLIBCXX_ENABLE_SHARED=ON - -DLIBCXX_ENABLE_STATIC=$(usex static-libs) - -DLIBCXX_CXX_ABI=${cxxabi} - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} - # we're using our own mechanism for generating linker scripts - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} - ) - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_compile() { - cmake_src_compile - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -multilib_src_install() { - cmake_src_install - # since we've replaced libc++.{a,so} with ldscripts, now we have to - # install the extra symlinks - if [[ ${CHOST} != *-darwin* ]] ; then - dolib.so lib/libc++_shared.so - use static-libs && dolib.a lib/libc++_static.a - fi -} - -# Usage: deps -gen_ldscript() { - local output_format - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" - - cat <<-END_LDSCRIPT -/* GNU ld script - Include missing dependencies -*/ -${output_format} -GROUP ( $@ ) -END_LDSCRIPT -} - -gen_static_ldscript() { - # Move it first. - mv lib/libc++{,_static}.a || die - # Generate libc++.a ldscript for inclusion of its dependencies so that - # clang++ -stdlib=libc++ -static works out of the box. - local deps=( - libc++_static.a - $(usex libcxxabi libc++abi.a libsupc++.a) - ) - # On Linux/glibc it does not link without libpthread or libdl. It is - # fine on FreeBSD. - use elibc_glibc && deps+=( libpthread.a libdl.a ) - - gen_ldscript "${deps[*]}" > lib/libc++.a || die -} - -gen_shared_ldscript() { - # Move it first. - mv lib/libc++{,_shared}.so || die - local deps=( - libc++_shared.so - # libsupc++ doesn't have a shared version - $(usex libcxxabi libc++abi.so libsupc++.a) - ) - - gen_ldscript "${deps[*]}" > lib/libc++.so || die -} diff --git a/sys-libs/libcxx/libcxx-17.0.0_pre20230717.ebuild b/sys-libs/libcxx/libcxx-17.0.0_pre20230717.ebuild deleted file mode 100644 index bb005b4d8ec8..000000000000 --- a/sys-libs/libcxx/libcxx-17.0.0_pre20230717.ebuild +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ - toolchain-funcs - -DESCRIPTION="New implementation of the C++ standard library, targeting C++11" -HOMEPAGE="https://libcxx.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -KEYWORDS="" -IUSE="+clang +libcxxabi +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( - ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] - ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) -" -DEPEND=" - ${RDEPEND} - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - >=dev-util/cmake-3.16 - sys-devel/gdb[python] - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - # Darwin Prefix builds do not have llvm installed yet, so rely on - # bootstrap-prefix to set the appropriate path vars to LLVM instead - # of using llvm_pkg_setup. - if [[ ${CHOST} != *-darwin* ]] || has_version sys-devel/llvm; then - LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup - fi - python-any-r1_pkg_setup - - if ! use libcxxabi && ! tc-is-gcc ; then - eerror "To build ${PN} against libsupc++, you have to use gcc. Other" - eerror "compilers are not supported. Please set CC=gcc and CXX=g++" - eerror "and try again." - die - fi -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - # note: we need to do this before multilib kicks in since it will - # alter the CHOST - local cxxabi cxxabi_incs - if use libcxxabi; then - cxxabi=system-libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/c++/v1" - else - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" - cxxabi=libsupc++ - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # bootstrap: cmake is unhappy if compiler can't link to stdlib - local nolib_flags=( -nodefaultlibs -lc ) - if ! test_compiler; then - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES=libcxx - -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DLIBCXX_ENABLE_SHARED=ON - -DLIBCXX_ENABLE_STATIC=$(usex static-libs) - -DLIBCXX_CXX_ABI=${cxxabi} - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} - # we're using our own mechanism for generating linker scripts - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} - ) - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_compile() { - cmake_src_compile - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -multilib_src_install() { - cmake_src_install - # since we've replaced libc++.{a,so} with ldscripts, now we have to - # install the extra symlinks - if [[ ${CHOST} != *-darwin* ]] ; then - dolib.so lib/libc++_shared.so - use static-libs && dolib.a lib/libc++_static.a - fi -} - -# Usage: deps -gen_ldscript() { - local output_format - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" - - cat <<-END_LDSCRIPT -/* GNU ld script - Include missing dependencies -*/ -${output_format} -GROUP ( $@ ) -END_LDSCRIPT -} - -gen_static_ldscript() { - # Move it first. - mv lib/libc++{,_static}.a || die - # Generate libc++.a ldscript for inclusion of its dependencies so that - # clang++ -stdlib=libc++ -static works out of the box. - local deps=( - libc++_static.a - $(usex libcxxabi libc++abi.a libsupc++.a) - ) - # On Linux/glibc it does not link without libpthread or libdl. It is - # fine on FreeBSD. - use elibc_glibc && deps+=( libpthread.a libdl.a ) - - gen_ldscript "${deps[*]}" > lib/libc++.a || die -} - -gen_shared_ldscript() { - # Move it first. - mv lib/libc++{,_shared}.so || die - local deps=( - libc++_shared.so - # libsupc++ doesn't have a shared version - $(usex libcxxabi libc++abi.so libsupc++.a) - ) - - gen_ldscript "${deps[*]}" > lib/libc++.so || die -} diff --git a/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild new file mode 100644 index 000000000000..bb005b4d8ec8 --- /dev/null +++ b/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ + toolchain-funcs + +DESCRIPTION="New implementation of the C++ standard library, targeting C++11" +HOMEPAGE="https://libcxx.llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="0" +KEYWORDS="" +IUSE="+clang +libcxxabi +static-libs test" +REQUIRED_USE="test? ( clang )" +RESTRICT="!test? ( test )" + +RDEPEND=" + libcxxabi? ( + ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] + ) + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) +" +DEPEND=" + ${RDEPEND} + sys-devel/llvm:${LLVM_MAJOR} +" +BDEPEND=" + clang? ( + sys-devel/clang:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) + test? ( + >=dev-util/cmake-3.16 + sys-devel/gdb[python] + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + ) +" + +LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + # Darwin Prefix builds do not have llvm installed yet, so rely on + # bootstrap-prefix to set the appropriate path vars to LLVM instead + # of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version sys-devel/llvm; then + LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup + fi + python-any-r1_pkg_setup + + if ! use libcxxabi && ! tc-is-gcc ; then + eerror "To build ${PN} against libsupc++, you have to use gcc. Other" + eerror "compilers are not supported. Please set CC=gcc and CXX=g++" + eerror "and try again." + die + fi +} + +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + +src_configure() { + # note: we need to do this before multilib kicks in since it will + # alter the CHOST + local cxxabi cxxabi_incs + if use libcxxabi; then + cxxabi=system-libcxxabi + cxxabi_incs="${EPREFIX}/usr/include/c++/v1" + else + local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" + cxxabi=libsupc++ + cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" + fi + + multilib-minimal_src_configure +} + +multilib_src_configure() { + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + # link to compiler-rt + local use_compiler_rt=OFF + [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON + + # bootstrap: cmake is unhappy if compiler can't link to stdlib + local nolib_flags=( -nodefaultlibs -lc ) + if ! test_compiler; then + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + + local libdir=$(get_libdir) + local mycmakeargs=( + -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" + -DPython3_EXECUTABLE="${PYTHON}" + -DLLVM_ENABLE_RUNTIMES=libcxx + -DLLVM_INCLUDE_TESTS=OFF + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=$(usex static-libs) + -DLIBCXX_CXX_ABI=${cxxabi} + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} + # we're using our own mechanism for generating linker scripts + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_INCLUDE_BENCHMARKS=OFF + -DLIBCXX_INCLUDE_TESTS=$(usex test) + -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} + ) + + if use test; then + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + -DPython3_EXECUTABLE="${PYTHON}" + ) + fi + cmake_src_configure +} + +multilib_src_compile() { + cmake_src_compile + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-cxx +} + +multilib_src_install() { + cmake_src_install + # since we've replaced libc++.{a,so} with ldscripts, now we have to + # install the extra symlinks + if [[ ${CHOST} != *-darwin* ]] ; then + dolib.so lib/libc++_shared.so + use static-libs && dolib.a lib/libc++_static.a + fi +} + +# Usage: deps +gen_ldscript() { + local output_format + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" + + cat <<-END_LDSCRIPT +/* GNU ld script + Include missing dependencies +*/ +${output_format} +GROUP ( $@ ) +END_LDSCRIPT +} + +gen_static_ldscript() { + # Move it first. + mv lib/libc++{,_static}.a || die + # Generate libc++.a ldscript for inclusion of its dependencies so that + # clang++ -stdlib=libc++ -static works out of the box. + local deps=( + libc++_static.a + $(usex libcxxabi libc++abi.a libsupc++.a) + ) + # On Linux/glibc it does not link without libpthread or libdl. It is + # fine on FreeBSD. + use elibc_glibc && deps+=( libpthread.a libdl.a ) + + gen_ldscript "${deps[*]}" > lib/libc++.a || die +} + +gen_shared_ldscript() { + # Move it first. + mv lib/libc++{,_shared}.so || die + local deps=( + libc++_shared.so + # libsupc++ doesn't have a shared version + $(usex libcxxabi libc++abi.so libsupc++.a) + ) + + gen_ldscript "${deps[*]}" > lib/libc++.so || die +} -- cgit v1.2.3