diff options
Diffstat (limited to 'llvm-runtimes/libcxx')
-rw-r--r-- | llvm-runtimes/libcxx/Manifest | 3 | ||||
-rw-r--r-- | llvm-runtimes/libcxx/libcxx-19.1.6.ebuild | 202 |
2 files changed, 205 insertions, 0 deletions
diff --git a/llvm-runtimes/libcxx/Manifest b/llvm-runtimes/libcxx/Manifest index 241a97826893..fc99443e07e9 100644 --- a/llvm-runtimes/libcxx/Manifest +++ b/llvm-runtimes/libcxx/Manifest @@ -12,6 +12,8 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764 DIST llvm-project-19.1.5.src.tar.xz 141243716 BLAKE2B 228fc66ab688abfc16f31b2cd83163b81ef61604ace21eab69a1776f0dc88cbe8fa831162205849e5be3975a214136399572b4ad1b908986e37b2d38a1a7fa5d SHA512 648854e9c91fdcc5c677ce3800e046f2060b998a45cf9f7eebe02898431b3924f9348b6fc366102cd4fdda72dcb8f32076f98aa69927e0e20b3f1007fba10b22 DIST llvm-project-19.1.5.src.tar.xz.sig 438 BLAKE2B 1d40a5c5405f99ef86e3360f9ea153afd1ae4001697210fd799a988113e8a3cef39e2c4794edd9332f384d8490f4ce2ab6bee6d98f794f84775807f833b81c0a SHA512 a438c86ce882eb1ac3e50842937068794ed162bb1b7ded68a2fe3ec2ab4f57cc38aee667cfb46afe6da22eef7ed1cb65820a473f63bd5a0dc6aad41df7bfad54 +DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3 +DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4 DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a EBUILD libcxx-15.0.7-r1.ebuild 5288 BLAKE2B 5c619de6d028fbce7abc50adec16c5c825ef39d7d7477b09aa02150e089b963928a54dcb5a9b7f02ddfa7827e1cccea35cfef7640561214bc16d0b81ea0d8e72 SHA512 410ae6f3ece045192cd6eb589c06f11a5b71d3e6fcfe882793d6a910ea0fa10ce5904874c7488280c5383b36954189255799a745be7aa98cfd27af6338dcfd66 @@ -20,6 +22,7 @@ EBUILD libcxx-17.0.6.ebuild 5285 BLAKE2B b435edac66c052e8d26b3d55dce6027d876c33b EBUILD libcxx-18.1.8.ebuild 5447 BLAKE2B 4c284f19f8bb907f2d91e8c98dca9f072e167c8a23787ffff3c3b006d40be2a5f45baa9c6b87b73929362d91007cbf2e8c46064abd3da9331f5ad0915eadbe41 SHA512 6cdf090d8a748318824c9604aa6ec89f3c8d1b741afc63dd202b7477885f0b3fe6fa2ffd52a1e13224ac23b72116d7e30ffafc6b4da1b4a4773e30e3cf04060c EBUILD libcxx-19.1.4.ebuild 5181 BLAKE2B 6a1dd56caaa53fd38d9ee3d10baf655f391470a5405d92717fbb20ba4ce52991fed5a535b5ace58745ed976a784e06d6c99d53245066579822ff704337e45dae SHA512 3b8071c5d4c010bac7a8417d0e06c3c1e8051a6512b3e276338dd4f840b6ae95ee36507a0c4d87d08d200ba6b8ec26806cfe66975538e6029528f094a3a310e8 EBUILD libcxx-19.1.5.ebuild 5186 BLAKE2B 932ffaac4d36b23bcf60f83601a1d4d969c828d3ca6bb53fcc930aa912d2264bb6d052c6da6343c2e894e697754d6fb7b04d3256b6b48888008d5e14927441e5 SHA512 a0f9ed34330ea4057e21ec663e30cf0e98efbeb09c6993f8316789dc47750dc3d5d29b147c09aebdb38f057c3ff727938c1a5b36ecedd9048a7371e272a408a6 +EBUILD libcxx-19.1.6.ebuild 5186 BLAKE2B 932ffaac4d36b23bcf60f83601a1d4d969c828d3ca6bb53fcc930aa912d2264bb6d052c6da6343c2e894e697754d6fb7b04d3256b6b48888008d5e14927441e5 SHA512 a0f9ed34330ea4057e21ec663e30cf0e98efbeb09c6993f8316789dc47750dc3d5d29b147c09aebdb38f057c3ff727938c1a5b36ecedd9048a7371e272a408a6 EBUILD libcxx-20.0.0.9999.ebuild 5363 BLAKE2B 5b31c35a16136e3d0459d5c3d2a0c2bf7fb1e20527442c0492b4731eff382d5f0e3f49eff8b561e39f0a86122762c481002fd64d1dcb415126d49759a4b0798c SHA512 f3c0c44fe38d292a2cddf1b901d40bee9fdb41627fa395d107a04ac55be04c86b2389e18c33cdab649eaa8db30f78c998da159393599fdf7b517984c332088f6 EBUILD libcxx-20.0.0_pre20241207.ebuild 5363 BLAKE2B 5b31c35a16136e3d0459d5c3d2a0c2bf7fb1e20527442c0492b4731eff382d5f0e3f49eff8b561e39f0a86122762c481002fd64d1dcb415126d49759a4b0798c SHA512 f3c0c44fe38d292a2cddf1b901d40bee9fdb41627fa395d107a04ac55be04c86b2389e18c33cdab649eaa8db30f78c998da159393599fdf7b517984c332088f6 EBUILD libcxx-20.0.0_pre20241215.ebuild 5363 BLAKE2B 5b31c35a16136e3d0459d5c3d2a0c2bf7fb1e20527442c0492b4731eff382d5f0e3f49eff8b561e39f0a86122762c481002fd64d1dcb415126d49759a4b0798c SHA512 f3c0c44fe38d292a2cddf1b901d40bee9fdb41627fa395d107a04ac55be04c86b2389e18c33cdab649eaa8db30f78c998da159393599fdf7b517984c332088f6 diff --git a/llvm-runtimes/libcxx/libcxx-19.1.6.ebuild b/llvm-runtimes/libcxx/libcxx-19.1.6.ebuild new file mode 100644 index 000000000000..ee2f2e316112 --- /dev/null +++ b/llvm-runtimes/libcxx/libcxx-19.1.6.ebuild @@ -0,0 +1,202 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 +inherit 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 ~loong ~riscv ~sparc ~x86 ~arm64-macos ~x64-macos" +IUSE="+clang +libcxxabi +static-libs test" +REQUIRED_USE="test? ( clang )" +RESTRICT="!test? ( test )" + +RDEPEND=" + libcxxabi? ( + ~llvm-runtimes/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] + ) + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) +" +DEPEND=" + ${RDEPEND} + llvm-core/llvm:${LLVM_MAJOR} +" +BDEPEND=" + clang? ( + llvm-core/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() { + 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() { + llvm_prepend_path "${LLVM_MAJOR}" + + # 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_INSTALL_MODULES=ON + -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 +} |