From 2771f79232c273bc2a57d23bf335dd81ccf6af28 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 5 Dec 2021 02:47:11 +0000 Subject: gentoo resync : 05.12.2021 --- sys-libs/libcxx/Manifest | 9 +- sys-libs/libcxx/libcxx-13.0.0.9999.ebuild | 213 ----------------------------- sys-libs/libcxx/libcxx-13.0.0.ebuild | 1 + sys-libs/libcxx/libcxx-13.0.1.9999.ebuild | 214 ++++++++++++++++++++++++++++++ sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild | 214 ++++++++++++++++++++++++++++++ sys-libs/libcxx/libcxx-14.0.0.9999.ebuild | 1 + 6 files changed, 436 insertions(+), 216 deletions(-) delete mode 100644 sys-libs/libcxx/libcxx-13.0.0.9999.ebuild create mode 100644 sys-libs/libcxx/libcxx-13.0.1.9999.ebuild create mode 100644 sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild (limited to 'sys-libs/libcxx') diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest index 76f35072f6a2..3710550d4fce 100644 --- a/sys-libs/libcxx/Manifest +++ b/sys-libs/libcxx/Manifest @@ -1,13 +1,16 @@ DIST llvm-gentoo-patchset-11.1.0-1.tar.xz 4032 BLAKE2B e69138a422e315b31a3d9c11faa4ae1ddf1bf9092cee2db0de4d2adef81fd802973488293aab48b764402b51996893b17ca03249ef4620848a576d1f6cdb9698 SHA512 e1c5504dab6c5db9fdf4addfeb12316f22d0258717ba551a9b7b3ba37919491fb6011ac5cca1e793b7509d5c1c186bc6bc4213f7d6155d190612492b216f979b DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249 DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6 +DIST llvm-gentoo-patchset-13.0.1-rc1.tar.xz 5988 BLAKE2B 8f1d295d4b6937518d9e0cc00cc2ba9e12ff9773b35261f0985b2d2a4ed1e3363a7f961cb385728b5ae552d0e129d99d11e63958d32c3353b0a79a88ba5cc0d5 SHA512 8272c423a5e0e99d412bb449794ba2e8134aca69d09e90e93555dbd3b7549d6ce4d68617ca11074af0a35a6f6830bf0330cbc672c5a56054cfd824e3ac1900ea DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1 DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2 +DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d EBUILD libcxx-11.1.0.ebuild 6661 BLAKE2B 93445de819484ea32a708d2ff616501d715e7fd3a3f4204f143e64c40bc89ebceb8e50c80215c6b54d7c8a3cce00fcecaac099298b41e010bf77655563d30a20 SHA512 ce56f24e7b4aed1405e682af6b3cb48bad6617d5b7e2ecf5b990fae4f7d6badc479a583ef24801e34b0155c12354a7b76a414402f89c31f228315eb92f279a62 EBUILD libcxx-12.0.1.ebuild 6700 BLAKE2B 95f0550dda3dc1b71a25dd2b3bf433f8fa92a12465a19558123dcf4704713af9c394544503eb1eed12251a392bf9ff91e69b994355a7f0fad5c00b5fa6457c26 SHA512 14c72df06a748c4788ad9e2f0e9de703e6ef3b9498f0ed8797ae2c31890754396cb2cdcb13b082b8f9a726929811cd421558a7867c9b1f5658827875fd2cf651 -EBUILD libcxx-13.0.0.9999.ebuild 6703 BLAKE2B e4988bec759918ae49a368a4b7c79918cfc99a6da325b04153f548f64c1d0de9698c9aa0f2c917a9a5fc75c96bac54771c2681f46a79bc698d175e29b7bcf3c4 SHA512 75408fcc8004065d88c5b114487107ed754e7fd7c4474f2b39d8956e704bc6889b7d5ad6159d593731d78c4fd1996468026827b21e2ae929eef6f9f0742466ba -EBUILD libcxx-13.0.0.ebuild 6743 BLAKE2B 967212bda63df969dc62008caa53086ae90e0f8002345a943513cfc33d87ff1c50ad081f0b42a018eb984773f99a37212fc320b91140a006a8a9505cb7ccea6b SHA512 3da33c128ed5fe983b81e5257c039648716082246028e9fbb2b8deef0679b1170eaded4629eb29df74eb1d3b22008a871aa3bdca2b284fc1bb452ab4f65cf507 -EBUILD libcxx-14.0.0.9999.ebuild 6703 BLAKE2B e4988bec759918ae49a368a4b7c79918cfc99a6da325b04153f548f64c1d0de9698c9aa0f2c917a9a5fc75c96bac54771c2681f46a79bc698d175e29b7bcf3c4 SHA512 75408fcc8004065d88c5b114487107ed754e7fd7c4474f2b39d8956e704bc6889b7d5ad6159d593731d78c4fd1996468026827b21e2ae929eef6f9f0742466ba +EBUILD libcxx-13.0.0.ebuild 6779 BLAKE2B d0e34a8ce5899d4cc3193ff38ade25eb1724b4f74eee947f8d1a6966bc2c2769ebfbdeef58759cb732da74d265305778a4023f4e7817afc0d015d79fb533af53 SHA512 107cb690a1f2492c968a402d7a9f6c3a22691c225f4167349a8b2b568f2aeeba8283ffff5956f5357a04d58a8ee7ad6fa2a3082c998a86bc4a05a8ab0489c05a +EBUILD libcxx-13.0.1.9999.ebuild 6739 BLAKE2B d3a64e3bd251a455f39a92cf02aa5ff6c3511b2306f6aaf47cb2605e17f3e2d0b22156fe1c0e5087a404936fabda41e32c8bbefd2e733a65366f8ef65cb214e0 SHA512 dff5e069025b4f9a35ae37a8d87199173c62a729042f35549653330eaea389bc9ff11aa55fb77d2c135829695a808be356b0806c1e2f83d43188e624632a6084 +EBUILD libcxx-13.0.1_rc1.ebuild 6742 BLAKE2B f429f6dd210e2dc12acccd74ec6428fe90a8fbaf50ef8975fd01c00eb5e3e1741785828e96c180e23dca382ed5ed779b8e696b4b13c758daee8fb51c4aab8457 SHA512 1d2541c6d2aca5d603bb9adc835b2a673831ec61a1f7653f676b543da187c7beb9a3bf9f7ec89c00d91bc46237eb9d50798eeb0b4f9386638ed4636f29849c3b +EBUILD libcxx-14.0.0.9999.ebuild 6739 BLAKE2B d3a64e3bd251a455f39a92cf02aa5ff6c3511b2306f6aaf47cb2605e17f3e2d0b22156fe1c0e5087a404936fabda41e32c8bbefd2e733a65366f8ef65cb214e0 SHA512 dff5e069025b4f9a35ae37a8d87199173c62a729042f35549653330eaea389bc9ff11aa55fb77d2c135829695a808be356b0806c1e2f83d43188e624632a6084 MISC metadata.xml 622 BLAKE2B 33ff3f89844694f08cdcdb12d7098ad937041c31aa6f453fbd887bfebec688bc05552f9a39431daccd2b309a58c2fb75b04a6350410f90beb96f32c14ab3ca95 SHA512 8b3d12f8904c336cc35f31352014ffe247dd4475f143921cdd56e5396590ebd64fb700df64f76e83aece127d8ed39af5f45da086fa75fca841c9a5ad767cbed2 diff --git a/sys-libs/libcxx/libcxx-13.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-13.0.0.9999.ebuild deleted file mode 100644 index 5dca7551438c..000000000000 --- a/sys-libs/libcxx/libcxx-13.0.0.9999.ebuild +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -CMAKE_ECLASS=cmake -PYTHON_COMPAT=( python3_{8..10} ) -inherit cmake-multilib 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="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" -REQUIRED_USE="libunwind? ( libcxxabi )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" -# llvm-6 for new lit options -# clang-3.9.0 installs necessary target symlinks unconditionally -# which removes the need for MULTILIB_USEDEP -DEPEND="${RDEPEND} - >=sys-devel/llvm-6" -BDEPEND=" - test? ( - >=dev-util/cmake-3.16 - >=sys-devel/clang-3.9.0 - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - )" - -DOCS=( CREDITS.TXT ) - -LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} ) -LLVM_PATCHSET=9999-1 -llvm.org_set_globals - -python_check_deps() { - 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 dev-lang/llvm; then - llvm_pkg_setup - fi - use test && 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=libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" - 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() { - # we want -lgcc_s for unwinder, and for compiler runtime when using - # gcc, clang with gcc runtime (or any unknown compiler) - local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF - if use libunwind; then - # work-around missing -lunwind upstream - extra_libs+=( -lunwind ) - # if we're using libunwind and clang with compiler-rt, we want - # to link to compiler-rt instead of -lgcc_s - if tc-is-clang; then - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ - ${LDFLAGS} -print-libgcc-file-name) - if [[ ${compiler_rt} == *libclang_rt* ]]; then - want_gcc_s=OFF - want_compiler_rt=ON - extra_libs+=( "${compiler_rt}" ) - fi - fi - elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then - # clang-based darwin prefix disables libunwind useflag during - # bootstrap, because libunwind is not in the prefix yet. - # override the default, though, because clang based libcxx - # should never use gcc_s on Darwin. - want_gcc_s=OFF - # compiler_rt is not available in EPREFIX during bootstrap, - # so we cannot link to it yet anyway, so keep the defaults - # of want_compiler_rt=OFF and extra_libs=() - fi - - # 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=( - -DLIBCXX_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_HAS_GCC_S_LIB=${want_gcc_s} - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} - -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s} - -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" - ) - - if use test; then - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" - - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" - -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -# 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() { - local libdir=$(get_libdir) - local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") - - # Move it first. - mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/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 ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.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}" > "${ED}/usr/${libdir}/libc++.a" || die -} - -gen_shared_ldscript() { - local libdir=$(get_libdir) - # libsupc++ doesn't have a shared version - local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") - - mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die - local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" - - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die -} - -multilib_src_install() { - cmake_src_install - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -pkg_postinst() { - elog "This package (${PN}) is mainly intended as a replacement for the C++" - elog "standard library when using clang." - elog "To use it, instead of libstdc++, use:" - elog " clang++ -stdlib=libc++" - elog "to compile your C++ programs." -} diff --git a/sys-libs/libcxx/libcxx-13.0.0.ebuild b/sys-libs/libcxx/libcxx-13.0.0.ebuild index a4f36e792e65..851870fd9e95 100644 --- a/sys-libs/libcxx/libcxx-13.0.0.ebuild +++ b/sys-libs/libcxx/libcxx-13.0.0.ebuild @@ -132,6 +132,7 @@ multilib_src_configure() { -DLIBCXX_INCLUDE_TESTS=$(usex test) -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s} + -DLIBCXX_TARGET_TRIPLE="${CHOST}" -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" ) diff --git a/sys-libs/libcxx/libcxx-13.0.1.9999.ebuild b/sys-libs/libcxx/libcxx-13.0.1.9999.ebuild new file mode 100644 index 000000000000..be5566afa3bf --- /dev/null +++ b/sys-libs/libcxx/libcxx-13.0.1.9999.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CMAKE_ECLASS=cmake +PYTHON_COMPAT=( python3_{8..10} ) +inherit cmake-multilib 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="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" +REQUIRED_USE="libunwind? ( libcxxabi )" +RESTRICT="!test? ( test )" + +RDEPEND=" + libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" +# llvm-6 for new lit options +# clang-3.9.0 installs necessary target symlinks unconditionally +# which removes the need for MULTILIB_USEDEP +DEPEND="${RDEPEND} + >=sys-devel/llvm-6" +BDEPEND=" + test? ( + >=dev-util/cmake-3.16 + >=sys-devel/clang-3.9.0 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + )" + +DOCS=( CREDITS.TXT ) + +LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} ) +LLVM_PATCHSET=9999-1 +llvm.org_set_globals + +python_check_deps() { + 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 dev-lang/llvm; then + llvm_pkg_setup + fi + use test && 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=libcxxabi + cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" + 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() { + # we want -lgcc_s for unwinder, and for compiler runtime when using + # gcc, clang with gcc runtime (or any unknown compiler) + local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF + if use libunwind; then + # work-around missing -lunwind upstream + extra_libs+=( -lunwind ) + # if we're using libunwind and clang with compiler-rt, we want + # to link to compiler-rt instead of -lgcc_s + if tc-is-clang; then + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ + ${LDFLAGS} -print-libgcc-file-name) + if [[ ${compiler_rt} == *libclang_rt* ]]; then + want_gcc_s=OFF + want_compiler_rt=ON + extra_libs+=( "${compiler_rt}" ) + fi + fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() + fi + + # 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=( + -DLIBCXX_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_HAS_GCC_S_LIB=${want_gcc_s} + -DLIBCXX_INCLUDE_TESTS=$(usex test) + -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} + -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s} + -DLIBCXX_TARGET_TRIPLE="${CHOST}" + -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" + ) + + if use test; then + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" + + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" + -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON + -DPython3_EXECUTABLE="${PYTHON}" + ) + fi + cmake_src_configure +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-cxx +} + +# 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() { + local libdir=$(get_libdir) + local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") + + # Move it first. + mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/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 ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.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}" > "${ED}/usr/${libdir}/libc++.a" || die +} + +gen_shared_ldscript() { + local libdir=$(get_libdir) + # libsupc++ doesn't have a shared version + local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") + + mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die + local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" + + gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die +} + +multilib_src_install() { + cmake_src_install + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi +} + +pkg_postinst() { + elog "This package (${PN}) is mainly intended as a replacement for the C++" + elog "standard library when using clang." + elog "To use it, instead of libstdc++, use:" + elog " clang++ -stdlib=libc++" + elog "to compile your C++ programs." +} diff --git a/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild b/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild new file mode 100644 index 000000000000..f8fd0e126832 --- /dev/null +++ b/sys-libs/libcxx/libcxx-13.0.1_rc1.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CMAKE_ECLASS=cmake +PYTHON_COMPAT=( python3_{8..10} ) +inherit cmake-multilib 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="elibc_glibc elibc_musl +libcxxabi +libunwind static-libs test" +REQUIRED_USE="libunwind? ( libcxxabi )" +RESTRICT="!test? ( test )" + +RDEPEND=" + libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] ) + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )" +# llvm-6 for new lit options +# clang-3.9.0 installs necessary target symlinks unconditionally +# which removes the need for MULTILIB_USEDEP +DEPEND="${RDEPEND} + >=sys-devel/llvm-6" +BDEPEND=" + test? ( + >=dev-util/cmake-3.16 + >=sys-devel/clang-3.9.0 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + )" + +DOCS=( CREDITS.TXT ) + +LLVM_COMPONENTS=( libcxx{,abi} llvm/{cmake,utils/llvm-lit} ) +LLVM_PATCHSET=${PV/_/-} +llvm.org_set_globals + +python_check_deps() { + 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 dev-lang/llvm; then + llvm_pkg_setup + fi + use test && 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=libcxxabi + cxxabi_incs="${EPREFIX}/usr/include/libcxxabi" + 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() { + # we want -lgcc_s for unwinder, and for compiler runtime when using + # gcc, clang with gcc runtime (or any unknown compiler) + local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF + if use libunwind; then + # work-around missing -lunwind upstream + extra_libs+=( -lunwind ) + # if we're using libunwind and clang with compiler-rt, we want + # to link to compiler-rt instead of -lgcc_s + if tc-is-clang; then + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ + ${LDFLAGS} -print-libgcc-file-name) + if [[ ${compiler_rt} == *libclang_rt* ]]; then + want_gcc_s=OFF + want_compiler_rt=ON + extra_libs+=( "${compiler_rt}" ) + fi + fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() + fi + + # 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=( + -DLIBCXX_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_HAS_GCC_S_LIB=${want_gcc_s} + -DLIBCXX_INCLUDE_TESTS=$(usex test) + -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} + -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s} + -DLIBCXX_TARGET_TRIPLE="${CHOST}" + -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" + ) + + if use test; then + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" + + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" + -DLIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI=ON + -DPython3_EXECUTABLE="${PYTHON}" + ) + fi + cmake_src_configure +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-cxx +} + +# 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() { + local libdir=$(get_libdir) + local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "libsupc++.a") + + # Move it first. + mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/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 ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.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}" > "${ED}/usr/${libdir}/libc++.a" || die +} + +gen_shared_ldscript() { + local libdir=$(get_libdir) + # libsupc++ doesn't have a shared version + local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "libsupc++.a") + + mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die + local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)" + + gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die +} + +multilib_src_install() { + cmake_src_install + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi +} + +pkg_postinst() { + elog "This package (${PN}) is mainly intended as a replacement for the C++" + elog "standard library when using clang." + elog "To use it, instead of libstdc++, use:" + elog " clang++ -stdlib=libc++" + elog "to compile your C++ programs." +} diff --git a/sys-libs/libcxx/libcxx-14.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-14.0.0.9999.ebuild index 5dca7551438c..be5566afa3bf 100644 --- a/sys-libs/libcxx/libcxx-14.0.0.9999.ebuild +++ b/sys-libs/libcxx/libcxx-14.0.0.9999.ebuild @@ -132,6 +132,7 @@ multilib_src_configure() { -DLIBCXX_INCLUDE_TESTS=$(usex test) -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt} -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s} + -DLIBCXX_TARGET_TRIPLE="${CHOST}" -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}" ) -- cgit v1.2.3