llvm-runtimes/libgcc: Add 22.0.0_pre20250815 snapshot

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-08-16 15:05:12 +02:00
parent d10590883e
commit 190de1e8d7
2 changed files with 176 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818befdee20fd8bed4d2dc2c2c6f6f56451fd43d35ac03a0a5a406e142d22b25137999dc5b17471c196f8fcf79f20a8296832d900f6d SHA512 c7d63286d662707a9cd54758c9e3aaf52794a91900c484c4a6efa62d90bc719d5e7a345e4192feeb0c9fd11c82570d64677c781e5be1d645556b6aa018e47ec8
DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
DIST llvm-project-190fcc28af585cb06480b026afd14ed87b18adb8.tar.gz 243483242 BLAKE2B f53d743ca332dfffe1f98d51f0528e14b61e4c11904ec20c4b4c9b285f8ca7eb25eb2ce8549e21566e63ab393697c74acd4a41fddc7bab282535aa8ccf9195da SHA512 b6bcf8647f35fee209fbd8a8c297f7d89f1aac9cac4e3c62abd73171350c4c7a98572ccd175ca0a8fce8d2fe00bf5cfbeea329689b687ab6261586e894397150
DIST llvm-project-1c7720ef78dc5eb9196d6c178afe03b60f201b78.tar.gz 245239122 BLAKE2B 74342ef3a8105915201f6260aa8c633ccd67821894d33605d82ca0f02d0d0766fe3198e834c4c5cae8123d911b5a20849c04ea02aea52f57f8d1a09e17c18199 SHA512 10a63bdf7d790c5964274414dc01b480a976318f27b5807ca47d9149b97106530264a75930c689ca7cc417de3df44142280cd92559ff7873190f1045d79e7856
DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b912ade3191c5d77f3979d5a80d5f6ce52f56a7d1c448bd257398390bf10838f02faa6f3ece37a7327cced69d165ec2e2e699316 SHA512 f330e72e6a1da468569049437cc0ba7a41abb816ccece7367189344f7ebfef730f4788ac7af2bef0aa8a49341c15ab1d31e941ffa782f264d11fe0dc05470773

View File

@@ -0,0 +1,175 @@
# 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 crossdev flag-o-matic llvm.org llvm-utils python-any-r1
inherit toolchain-funcs
DESCRIPTION="Compiler runtime library for clang, compatible with libgcc_s"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0"
IUSE="debug test"
DEPEND="
~llvm-runtimes/libunwind-${PV}[static-libs]
"
RDEPEND="
${DEPEND}
!sys-devel/gcc
"
BDEPEND="
llvm-core/clang:${LLVM_MAJOR}
test? (
$(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]")
=llvm-core/clang-${LLVM_VERSION}*:${LLVM_MAJOR}
)
!test? (
${PYTHON_DEPS}
)
"
LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake llvm-libgcc )
LLVM_TEST_COMPONENTS=( llvm/include/llvm/TargetParser )
llvm.org_set_globals
python_check_deps() {
use test || return 0
python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]"
}
pkg_setup() {
if target_is_not_host || tc-is-cross-compiler ; then
# strips vars like CFLAGS="-march=x86_64-v3" for non-x86 architectures
CHOST=${CTARGET} strip-unsupported-flags
# overrides host docs otherwise
DOCS=()
fi
python-any-r1_pkg_setup
}
src_configure() {
# We need to build a separate copy of compiler-rt, because we need to disable the
# COMPILER_RT_BUILTINS_HIDE_SYMBOLS option - compatibility with libgcc requires
# visibility of all symbols.
if use clang || use test; then
llvm_prepend_path -b "${LLVM_MAJOR}"
fi
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
export CC=${CTARGET}-clang CXX=${CTARGET}-clang++
strip-unsupported-flags
local mycmakeargs=(
-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
-DLLVM_ROOT="${ESYSROOT}/usr/lib/llvm/${LLVM_MAJOR}"
-DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
-DCOMPILER_RT_BUILD_CRT=OFF
-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF
-DCOMPILER_RT_BUILD_MEMPROF=OFF
-DCOMPILER_RT_BUILD_ORC=OFF
-DCOMPILER_RT_BUILD_PROFILE=OFF
-DCOMPILER_RT_BUILD_SANITIZERS=OFF
-DCOMPILER_RT_BUILD_XRAY=OFF
-DCOMPILER_RT_BUILTINS_HIDE_SYMBOLS=OFF
-DPython3_EXECUTABLE="${PYTHON}"
)
# disable building non-native runtimes since we don't do multilib
if use amd64; then
mycmakeargs+=(
-DCAN_TARGET_i386=OFF
)
fi
if use test; then
mycmakeargs+=(
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang"
-DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++"
)
fi
cmake_src_configure
}
# 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
}
src_compile() {
cmake_src_compile
local rtlib=$(
"${CC}" -rtlib=compiler-rt -resource-dir="${BUILD_DIR}" \
-print-libgcc-file-name || die
)
# Use the llvm-libgcc's version script to produce libgcc.{a,so}, which
# combines compiler-rt and libunwind into a libgcc replacement.
#
# What we do here is similar to what upstream does[0], with the following
# differences:
#
# * We build the local copy of compiler-rt manually, to have a full control
# over CMake options.
# * Upstream links the locally built copy of libunwind statically. We link the
# system-wide libunwind dynamically.
#
# [0] https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/llvm-libgcc/CMakeLists.txt#L102-L120
"${CC}" -E -xc \
"${WORKDIR}/llvm-libgcc/gcc_s.ver.in" \
-o gcc_s.ver || die
"${CC}" -nostdlib \
${LDFLAGS} \
-Wl,--version-script,gcc_s.ver \
-Wl,--undefined-version \
-Wl,--whole-archive \
"${rtlib}" \
-Wl,-soname,libgcc_s.so.1.0 \
-lc -lunwind -shared \
-o libgcc_s.so.1.0 || die
# Generate libgcc_s.so ldscript for inclusion of libunwind as a
# dependency so that `clang -lgcc_s` works out of the box.
gen_ldscript libgcc_s.so.1.0 libunwind.so.1.0 > libgcc_s.so || die
cp "${rtlib}" libgcc.a || die
}
src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
cmake_build check-builtins
}
src_install() {
local libdir=$(get_libdir)
dolib.so libgcc_s.so.1.0 libgcc_s.so
dolib.a libgcc.a
dosym libgcc_s.so.1.0 "/usr/${libdir}/libgcc_s.so.1"
dosym libunwind.a "/usr/${libdir}/libgcc_eh.a"
}