summaryrefslogtreecommitdiff
path: root/sys-libs/libcxx
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-13 19:12:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-13 19:12:15 +0000
commita7ec94f7d22ee22df2e424c1d3f842510b7993aa (patch)
treef35dc4a8ebf81ae4e8802aa6d4347ce28a1e25f5 /sys-libs/libcxx
parent7860ad41012a3808c645607818b64ad7dab025e9 (diff)
gentoo auto-resync : 13:01:2024 - 19:12:15
Diffstat (limited to 'sys-libs/libcxx')
-rw-r--r--sys-libs/libcxx/Manifest4
-rw-r--r--sys-libs/libcxx/libcxx-18.0.0.9999.ebuild2
-rw-r--r--sys-libs/libcxx/libcxx-18.0.0_pre20240113.ebuild213
3 files changed, 218 insertions, 1 deletions
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
index fd6ab5e8d5c5..ed47ee982cf5 100644
--- a/sys-libs/libcxx/Manifest
+++ b/sys-libs/libcxx/Manifest
@@ -6,10 +6,12 @@ DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db3659
DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-8d817f6479a5df874028a8b40fd30aecd3479005.tar.gz 204890108 BLAKE2B 8c57c556371b37d00cda753a40f1162e678d89fa40e8f2b90a38aab7e17f9debfb2ebad53a3a95aa530a9e3e2b4b735828e404e576c8f2738370ec41c28badce SHA512 a38ce082ca1b999888ee0a633b94a02258579591e6ce73ba4722eafb9f0610f9624887eca43e4a6ae567c07ffc014f4ea4137e905899407951265d7c93785f18
DIST llvm-project-a085402ef54379758e6c996dbaedfcb92ad222b5.tar.gz 204569231 BLAKE2B 75403225fbe54f0921b279b237a90f1922b16997d1538fa5f225e04451fa2fc4a28e886efb7460ef0c26a3a964f0c57084e331b0736fa223926259c76d873200 SHA512 b8c6b0c7c0a4c369ecfa7ac71cf96549a19853e14bdf061b6b54429ce7ed998b236bb9ed3adbd6bf1c70c7e975508f751ebd0031ac2ff474d32216048a1c5f2d
EBUILD libcxx-15.0.7-r1.ebuild 5283 BLAKE2B 4380fc5b851054a5ec226ee4c92a2b79511d73ac9b3f8bccc977211601eca36113fc0ae605854da53898507021f24a8b319197605c556244d84253bede7b84f4 SHA512 0a5859269422e794deb43ed960651a1dea830af28b5e395f32e28de8e67a1f399507340230af1c84248853f554e751709a60a9a78aeb0eb42804cb41907dbfce
EBUILD libcxx-16.0.6.ebuild 5287 BLAKE2B fc7ce91f80be1d635a4693fe44f9379701dc3d4241b2eaa701338f02ae580a402661ee60f6349119935a8fb1ce1667b83895a9da8f4da897cc12e8d2a6ed7e76 SHA512 69e9c4ed649f70fd5fd7d84049d095b9e65494749181b2a81f05b473b4303ebc3a353187039e1fc1d270fc39342bca2785b2a75a0025232bee57e2a2506c7ef0
EBUILD libcxx-17.0.6.ebuild 5269 BLAKE2B dbc9cfac07759943f456cf6919b66b74da69e6aec68f5342ee7e10051a7da835aa9b45752ca7832784f38643c7175ca0d6a978cd439d2ad93bd7d73f30c95e93 SHA512 0633e594869874a8ee47928e560d96c7db2094a5cd542b11e26b09eef593f4536c2e6e46c76cd0e8bb64e7b7ccc0c79a5d1fb8e52243f70aa0a923551043078b
-EBUILD libcxx-18.0.0.9999.ebuild 5501 BLAKE2B acd2a9e00abb864ca387c95bb7d2acce2b5b3086eba1a9b5cb4c89ea37774170ba39708c8e258d07e214f6166b6f2c4391c7b55e621326fa410346c5c3a32463 SHA512 8fc3dbe5f1798fd69742802396787fc05aee5bf1f9e41f1369e84b3b564b987f9f3a76b0091ad780a8648e54d14acaf404e8ad89b6bef35c890caad0d9e3d9d2
+EBUILD libcxx-18.0.0.9999.ebuild 5601 BLAKE2B c11cf57ef6b6c209473b69b0c95c1a656387d3d32494c2a65537c67127a9d9b15a3153609b64c9046f29f29bdd916b0f482ddfad705612f4cdb78ea8ec68621c SHA512 a611b6bf010e315d5d3dc4454c6baf85e33579258ce990fab523a3daffadc3dac1bd51d035a42ed711dac5c5314ff3615cc67347178ecb84437e787fce29ed7e
EBUILD libcxx-18.0.0_pre20240106.ebuild 5501 BLAKE2B acd2a9e00abb864ca387c95bb7d2acce2b5b3086eba1a9b5cb4c89ea37774170ba39708c8e258d07e214f6166b6f2c4391c7b55e621326fa410346c5c3a32463 SHA512 8fc3dbe5f1798fd69742802396787fc05aee5bf1f9e41f1369e84b3b564b987f9f3a76b0091ad780a8648e54d14acaf404e8ad89b6bef35c890caad0d9e3d9d2
+EBUILD libcxx-18.0.0_pre20240113.ebuild 5601 BLAKE2B c11cf57ef6b6c209473b69b0c95c1a656387d3d32494c2a65537c67127a9d9b15a3153609b64c9046f29f29bdd916b0f482ddfad705612f4cdb78ea8ec68621c SHA512 a611b6bf010e315d5d3dc4454c6baf85e33579258ce990fab523a3daffadc3dac1bd51d035a42ed711dac5c5314ff3615cc67347178ecb84437e787fce29ed7e
MISC metadata.xml 598 BLAKE2B b7a60449e0d8e4e7605ec203dfaa45b17a265b024e21a3bcfe05a3aeb6c3d19a1d2a218cb1f9ac9ed52296f0d6e723fed251f364341fb70cbd91b747962db580 SHA512 a23f912efff52c4687767023da826ace8c6e5dcd5e69ece86aabbea99da89e48ba81cdc292f03193e2e8a05743e62ebf4d4735d038e0cc4b42714fa277569335
diff --git a/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild
index cecc0698d6a7..a24b477a5ab8 100644
--- a/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild
+++ b/sys-libs/libcxx/libcxx-18.0.0.9999.ebuild
@@ -132,6 +132,8 @@ multilib_src_configure() {
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
-DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
+ # this is broken with standalone builds, and also meaningless
+ -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
)
if use test; then
diff --git a/sys-libs/libcxx/libcxx-18.0.0_pre20240113.ebuild b/sys-libs/libcxx/libcxx-18.0.0_pre20240113.ebuild
new file mode 100644
index 000000000000..a24b477a5ab8
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-18.0.0_pre20240113.ebuild
@@ -0,0 +1,213 @@
+# Copyright 1999-2024 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"
+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-debug/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
+}
+
+src_prepare() {
+ # hanging tests
+ # https://github.com/llvm/llvm-project/issues/73791
+ rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_* || die
+ rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.*_equals* || die
+
+ cmake_src_prepare
+}
+
+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}
+ # this is broken with standalone builds, and also meaningless
+ -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
+ )
+
+ 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
+}