mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
llvm-runtimes/libcxx: Add 21.0.0_pre20250607 snapshot
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -12,4 +12,5 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
|
||||
DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
|
||||
DIST llvm-project-20.1.6.src.tar.xz 147239668 BLAKE2B ccd86730fdea3dd40ebf054661b854b9332204389db2205e1e7b2a7f140fc187cacb34de68aa9a63c15c1e17b1d0976c080cfdee7e2cb6b0dd5570001d84be12 SHA512 aae652fdc61bda3f80b1340a3270b687355bfb6817f4bc05dac2268a2f8c5fc677eadb515cda7c8518005f1dc39e7ce5d1c34bbc5a25f106ef8e6c8f1ecfdf6d
|
||||
DIST llvm-project-20.1.6.src.tar.xz.sig 566 BLAKE2B b7c48cfc1f6c9f513dadb8837b150e22043c215bf4958a8036c4077aeebdcf7c18223b0ce0ffbcacb2c7ddfeb06611b1022528ee04d3efda1ee1aa58367a9203 SHA512 0884048ff164a1f5caed0f1aabec173630a08ece98cf793d21b77fc969501e4f03daec39ae0fb124ad34a3436ceae66452e36a42c309f19790b7a87652482691
|
||||
DIST llvm-project-23d0c7348aacdfcb145a69e533a14131bae830cc.tar.gz 237123683 BLAKE2B 6713c82809a9793510615f54c3ad9b8b1d2449939b0c48ab10acd1a0db43b712b229356173c90b514bc91c08e9b2be7f8e54f797661b9743ae8c3aaa9acee15f SHA512 de94ab38f1d46124638d6e0650142a1612db27871ffa339c56224aba94a77f8ae6eb8c68ad0a5ed3fe000d7bff309d324cdb66a095be3c8211abfe600659bf1a
|
||||
DIST llvm-project-f8ca9e59cb438bd35b29a6d7cf6d72f50673aec9.tar.gz 236069626 BLAKE2B 5547770a22e5fd0240c0e435d0b0af0ebd789aa72d6829250917f2df605f9a95c6756bc1afc9b611b176c1ba8394c757b94789511b98b38c6ade6cca4c9ce7f6 SHA512 b1fffd7d4f5ede9bcda759bc59cdd47373a44a3bbd31a50d1d213e438a59f1da3cc96780a1d17ecaeb14454822921476406a6c37493354169f72e1fab7b3a3be
|
||||
|
||||
210
llvm-runtimes/libcxx/libcxx-21.0.0_pre20250607.ebuild
Normal file
210
llvm-runtimes/libcxx/libcxx-21.0.0_pre20250607.ebuild
Normal file
@@ -0,0 +1,210 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..14} )
|
||||
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"
|
||||
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} libc 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=$(llvm_cmake_use_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_XFAIL="libcxx/gdb/gdb_pretty_printer_test.sh.cpp"
|
||||
|
||||
local -x LIT_PRESERVES_TMP=1
|
||||
cmake_build install-cxx-test-suite-prefix
|
||||
cp "${BUILD_DIR}"/{lib,libcxx/test-suite-install/$(get_libdir)}/libc++_shared.so || die
|
||||
if use static-libs; then
|
||||
cp "${BUILD_DIR}"/{lib,libcxx/test-suite-install/$(get_libdir)}/libc++_static.a || die
|
||||
fi
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user