commit:     226ffc22af6ceeb6b75416139e1578792be36806
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  1 12:36:39 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct  1 13:26:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=226ffc22

sys-libs/libcxx: Bump to 13.0.0 (final)

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libcxx/Manifest             |   2 +
 sys-libs/libcxx/libcxx-13.0.0.ebuild | 213 +++++++++++++++++++++++++++++++++++
 2 files changed, 215 insertions(+)

diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
index 7c09f04d292..d6bfb17462e 100644
--- a/sys-libs/libcxx/Manifest
+++ b/sys-libs/libcxx/Manifest
@@ -4,6 +4,7 @@ DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 
963d005bc7b636570be90eb841a
 DIST llvm-gentoo-patchset-13.0.0-rc2.tar.xz 5556 BLAKE2B 
e6c7ecfe8f842edc4d4f30a20c66973519182ecb46e21fb20b6c5fcb6d54cdef830fcb120a405b77f1332e3557acbbbbfa99170b20d17f137e0a63b2d0dc1258
 SHA512 
ddeaf1d07f0ba893ce93e5fe1eff1c0716769a7879fc503c397f4db7becb363f94747f59b6d53c204df73a93954fb0ca5aae6ad544ce55c964c4bf441a410cd2
 DIST llvm-gentoo-patchset-13.0.0-rc3.tar.xz 5012 BLAKE2B 
5399feeffe73e8fbd099c8058f1cc41e2fcb2feb446acc1394589c0397167786895d328d45ff481fb30605f215774b9e51e332124c0b071e969a2f01c5943c04
 SHA512 
d4fb2b08e253d9fa89070045282b4309ca9938011bf7f9b5364cc69c5030ff9353abb1624895b4bfeef2cd8e2f8c9b9f93fc8196f98dc0970457bca7787270c9
 DIST llvm-gentoo-patchset-13.0.0-rc4.tar.xz 5016 BLAKE2B 
021ba4e67904e4cf4dfdf1ecfc1cd1cc860c2f43db97e04c40ca7d95567f6235a27a2a919083c58b89b269eefa2d751cb9c324bda6518c22e9fc01007936a520
 SHA512 
dce61179dffafc5992fb0e18314bba2d5fbf2f0470a491bc1ffc036274b65d0a1de741b23e2de32e873250c856a53707e06f8c560bd29f8a54a6ae0c74267f43
+DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 
6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0
 SHA512 
7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
 DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B 
b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d
 SHA512 
e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
 DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 
30f19f56c4d1f6abcda5fec76256219d1e3c8a6ff1a1f152f94bfe362c07884339fe571ff7fe903ed3b3deb150b2fa868c387887a0dea2930dc08b81db71a5b1
 SHA512 
48078fff9293a87f1a973f3348f79506f04c3da774295f5eb67d74dd2d1aa94f0973f8ced3f4ab9e8339902071f82c603b43d5608ad7227046c4da769c5d2151
 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B 
ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985
 SHA512 
9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
@@ -11,3 +12,4 @@ DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B 
f41de787bc73ff2edfda1b22cc8602be6f6
 DIST llvmorg-13.0.0-rc2.tar.gz 147267736 BLAKE2B 
153bf7320f2aa911112d366ffc79f7110cb04f135c2a8b176c263f0a75eb768206d9bd462893d45504b0e58aa9e127fdcafb02300eab1666e4616aa654d457dd
 SHA512 
a01baf3eaa02f02af42bfcf6dcf24f166351bf1c09601495617c81e41def23210573bad40a344270f40c5deb881d06863536abac2a6481930766a6a56335fb44
 DIST llvmorg-13.0.0-rc3.tar.gz 147281901 BLAKE2B 
640065a2f32dc48edf084d776cb6b950fae86c2a204999e2eec67f93b57615df40adec19785099b0ef2fe11837c3304794ec3585289a5b5051a557618c63c749
 SHA512 
1401d5a4d6bb5c930d74b9cfbc8e792872f721aab7d7f0c819e2ba5cf47fb818d160c1f71784fba69827f3c9b7414aa91a585d2b813c1851b4799f9d62cebc46
 DIST llvmorg-13.0.0-rc4.tar.gz 147286367 BLAKE2B 
a43c54b8bb379b0374f99ae07066d7ba4ae2a83dfdb61390101c736f91dc44aa07a88778551aaaf903033562b2a0a863ea6b27392b700c9cddc74e2c7899cad1
 SHA512 
8ccaaea21ec4fe3c4b4446d3a7cae36a47ed196f407d341da45824bcefefffd3c412c0c5c27670ceaba1458bc53107273f9d3aec2de261b6b82c6d209b45b14d
+DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 
628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822
 SHA512 
8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2

diff --git a/sys-libs/libcxx/libcxx-13.0.0.ebuild 
b/sys-libs/libcxx/libcxx-13.0.0.ebuild
new file mode 100644
index 00000000000..62760143aef
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-13.0.0.ebuild
@@ -0,0 +1,213 @@
+# 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="~amd64 ~arm ~arm64 ~riscv ~x86 ~x64-macos"
+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}
+               -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."
+}

Reply via email to