mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-21 22:47:14 -08:00
llvm-runtimes/libgcc: Add 22.1.6
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -7,4 +7,6 @@ DIST llvm-project-21.1.8.src.tar.xz 158958576 BLAKE2B 0d3d4ee920f8e5db50e9815261
|
||||
DIST llvm-project-21.1.8.src.tar.xz.sig 119 BLAKE2B cffc1825f5778a3e3c128ec3e856ff6ee50687319d621cdf42e895abf67e05cc51cb7493308e2b506ab60dbdbaca7aa75eb9f78d91d42c81f9682a36f4042e9d SHA512 10f58eff58ed6e701d0f123b15e68c82ab8cbdf99b1c86c0d83e3b8553e90ea51055e30327e8e442ded57c8f503e2a2de9ee075e9c28b5ba815a0f8922f8671c
|
||||
DIST llvm-project-22.1.5.src.tar.xz 167058820 BLAKE2B b0d4bc4db8d03a2201620dec0fcf5c946d86ac152c0feef4252e211eec4542e2fc849e2bafc8bcb57982959d005d70e9a7bd81296fed04f819b7de3f2fc15c43 SHA512 68de113906ec0c843a9346ecd06bff352146869f1f28b5600ff907125d77202692b6f68bd169bcd74ae5b82e0ad5548ea99c2405540abea36880d80e373744ff
|
||||
DIST llvm-project-22.1.5.src.tar.xz.sig 119 BLAKE2B c756bb5d4ebc9fc3b61115495c75574312ad287dc4bdfc8408da7dcfc781f26c5804d8a4a46af32ad809db80a154aff6cad308742e1e04ca4a93249d6f1a55b4 SHA512 36baf347f79c26705136a7d342e8ee0a8a42939bb1db2d9ce91666b1edbbb04194ff63bc41899e4498cd819e6c2bd6944ea68d972e074e113f48d08e6544c368
|
||||
DIST llvm-project-22.1.6.src.tar.xz 167043464 BLAKE2B 86b5f0da9ced0ffc6e2c765f4d2c1537000062bd1bbfa6d060e192251c8e28d253924e1a164e76edef3ec05fa4447a75d554bc89f6ea7e33c6792a1f5d67f3a6 SHA512 39ee3a66b92abe4eed5f9db086f6279faa72d8a3fe1beee8897da2dcc8b6982d169054b394995090c9cc6519f50a03a7fc465905dda3c61eb1063b9ba4696b0c
|
||||
DIST llvm-project-22.1.6.src.tar.xz.sig 119 BLAKE2B faba6f95374bc9ffda950b7cb727246e3d05173a1b790f669722fe97aff5f5a7a840324b3f1721a424393e3dbf56d768868d65a1cfac107a49487e0111a8d87f SHA512 6aeaac226c3099ac1120e57daf9be4161855e17415df7117b9091a0c1a32022d27a842cdf208d17ee389b2be003577688565abbb18c78d94d56c3a38d56bb035
|
||||
DIST llvm-project-8789401c6f0b2c53ba348860c1b0c5df1fa40c8c.tar.gz 271359638 BLAKE2B 31d1c91b535f129cac4b1da7ce2e6f0765231ebe6a5b1cb83f00d56d68820cdd029f7d2fdf602148e37bc9a22d99b71e25284eab74b8d52fa87ed4636712171f SHA512 4ca908b0b5d7ae9a2b334d033d2c11b557dcc3305b9107017965ae612716beade09a0c73e1a5f5eab1c9794728558d4a981715bb9b01d5ba2c2c5c6c53d1a9b6
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
# Copyright 1999-2026 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"
|
||||
KEYWORDS="~amd64"
|
||||
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 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_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.
|
||||
|
||||
llvm_prepend_path -b "${LLVM_MAJOR}"
|
||||
|
||||
# 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"
|
||||
}
|
||||
Reference in New Issue
Block a user