llvm-runtimes/compiler-rt: Add 22.0.0_pre20251108 snapshot

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-11-08 11:36:10 +01:00
parent a5e823740f
commit 2ed0acc26a
2 changed files with 191 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
DIST llvm-gentoo-patchset-15.0.7-r8.tar.xz 27904 BLAKE2B 1fc5df0dc44484ea0225438f3d861ab23739773df58eaf2b531966baeeb5e717b2a3c03f62b1cfb8bb5e316393e8b295d4fbd8be3246381723f905304f005e12 SHA512 7f0ba8ef4291de87cc3220e63ad0ac088a81491d4a46b1053dd51d9725ca6c87d3d7720c2440908b10b1ace406f7ed1c523ca28b199a7a29ed06d0973a0829a2
DIST llvm-gentoo-patchset-16.0.6-r6.tar.xz 21672 BLAKE2B b52c29a7c19b60ccd076c01014e374e35aa5da061917cdc6a9d321f9386ce4e9286d5a7cccfffc23e0f6737c6eeb32ef4ab030b9d3165f528d1c657b53b6ab17 SHA512 f8a6cdaded545219107505c57b194b3f4df8ee7a2f1f0756b8e8884633e389ad7462445e1522414615210c0a4407a0358c84882366a475441f681a2ba75dc985
DIST llvm-gentoo-patchset-17.0.6-r4.tar.xz 6636 BLAKE2B 7b53f4b19e19b3493878ae9db925bfd07e81564e2ef01b10e6d7aa774a64928fd8d991a734ae5eca6a984489e18c288240187d2fe94f3b855643553e5fdaf024 SHA512 feffdd99b80f53c562ff2664b9b8a886132e400f1bc378e52d5f4559ee6a4139c5e7c4faee4fe015ce93ed4cff3a4b03844321254f3102b1f70f066ea84f7c10
DIST llvm-project-0875755f5275dc7a84b1aeb526b7822b47a733c9.tar.gz 254111698 BLAKE2B 16bd787e9af46837e6e2962d2f9bdd2a1d13b1ab6f4dcb1a428914cc2502b6430f79ee163b0d8ad5b6a9124162f262fa394265f8c52950100b543b7027df310c SHA512 de107dd50b078d9f7e0f838b3e439e2012d6e4e14fcdd2438de344a11dd6b2542ee1efd029067fddf05b8eb9d97786f214ff199d1b6aabfd2e3459f9840bc497
DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7

View File

@@ -0,0 +1,190 @@
# 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 (built-in part)"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="${LLVM_MAJOR}"
IUSE="+abi_x86_32 abi_x86_64 +atomic-builtins +clang +debug test"
REQUIRED_USE="atomic-builtins? ( clang )"
RESTRICT="!test? ( test ) !clang? ( test )"
DEPEND="
llvm-core/llvm:${LLVM_MAJOR}
"
BDEPEND="
clang? (
llvm-core/clang:${LLVM_MAJOR}
llvm-core/clang-linker-config:${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 third-party/siphash )
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_pretend() {
if ! use clang && ! tc-is-clang; then
ewarn "Building using a compiler other than clang may result in broken atomics"
ewarn "library. Enable USE=clang unless you have a very good reason not to."
fi
}
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
}
test_compiler() {
target_is_not_host && return
$(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
<<<'int main() { return 0; }' &>/dev/null
}
src_configure() {
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"
# pre-set since we need to pass it to cmake
BUILD_DIR=${WORKDIR}/${P}_build
if use clang && ! is_crosspkg; then
# Only do this conditionally to allow overriding with
# e.g. CC=clang-13 in case of breakage
if ! tc-is-clang ; then
local -x CC=${CHOST}-clang-${LLVM_MAJOR}
local -x CXX=${CHOST}-clang++-${LLVM_MAJOR}
fi
strip-unsupported-flags
# The full clang configuration might not be ready yet. Given that compiler-rt
# require runtime, use only the linker configuration.
local flags=(
--config="${ESYSROOT}"/etc/clang/"${LLVM_MAJOR}"/gentoo-linker.cfg
)
local -x CFLAGS="${CFLAGS} ${flags[@]}"
local -x CXXFLAGS="${CXXFLAGS} ${flags[@]}"
local -x LDFLAGS="${LDFLAGS} ${flags[@]}"
fi
if ! is_crosspkg && ! test_compiler ; then
local nolib_flags=( -nodefaultlibs -lc )
if test_compiler "${nolib_flags[@]}"; then
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
elif test_compiler "${nolib_flags[@]}" -nostartfiles; then
# Avoiding -nostartfiles earlier on for bug #862540,
# and set available entry symbol for bug #862798.
nolib_flags+=( -nostartfiles -e main )
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
fi
fi
local mycmakeargs=(
-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
-DLLVM_ROOT="${ESYSROOT}/usr/lib/llvm/${LLVM_MAJOR}"
-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=$(usex !atomic-builtins)
-DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
-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
-DPython3_EXECUTABLE="${PYTHON}"
)
if use amd64 && ! target_is_not_host; then
mycmakeargs+=(
-DCAN_TARGET_i386=$(usex abi_x86_32)
-DCAN_TARGET_x86_64=$(usex abi_x86_64)
)
fi
if is_crosspkg; then
# Needed to target built libc headers
export CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include"
mycmakeargs+=(
# Without this, the compiler will compile a test program
# and fail due to no builtins.
-DCMAKE_C_COMPILER_WORKS=1
-DCMAKE_CXX_COMPILER_WORKS=1
# Without this, compiler-rt install location is not unique
# to target triples, only to architecture.
# Needed if you want to target multiple libcs for one arch.
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
-DCMAKE_ASM_COMPILER_TARGET="${CTARGET}"
-DCMAKE_C_COMPILER_TARGET="${CTARGET}"
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
)
fi
if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
mycmakeargs+=(
# setting -isysroot is disabled with compiler-rt-prefix-paths.patch
# this allows adding arm64 support using SDK in EPREFIX
-DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
# Set version based on the SDK in EPREFIX.
# This disables i386 for SDK >= 10.15
-DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath "${EPREFIX}/MacOSX.sdk" | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
# Use our libtool instead of looking it up with xcrun
-DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
)
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
}
src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
cmake_build check-builtins
}