llvm-runtimes/libgcc: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-04-01 18:55:21 +02:00
parent 79e8486b4a
commit 202dcf761e
4 changed files with 0 additions and 524 deletions
-4
View File
@@ -1,15 +1,11 @@
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-1f9b32ba061e7d5f7173a6a7150faf31964c2974.tar.gz 264557724 BLAKE2B 58b583abbee8d0cfc50c7a3bc1bd526b8c29946dc0bf225fddbd403a157687c557654a7b65e08ac19d5df427f5622d9f699d97adce9ef79b7a5ab571ab4f87ea SHA512 68d27c9cf9f3a0efcbbb51539ce441139b63f79aa799de0c46eadba2abb8f895f78ad42507b4f7191ae361d559bb7597555214e68266dc6b8bcae89efeed21db
DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b912ade3191c5d77f3979d5a80d5f6ce52f56a7d1c448bd257398390bf10838f02faa6f3ece37a7327cced69d165ec2e2e699316 SHA512 f330e72e6a1da468569049437cc0ba7a41abb816ccece7367189344f7ebfef730f4788ac7af2bef0aa8a49341c15ab1d31e941ffa782f264d11fe0dc05470773
DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
DIST llvm-project-21.1.8.src.tar.xz 158958576 BLAKE2B 0d3d4ee920f8e5db50e98152616f16004c74df0e7313cc86d893428fb7b1c875109988a5e40ea6f2e5d0fef53c7bfe2fc2b69e84807f6eb440b03afa1b228a36 SHA512 cae4c44e7bf678071723da63ad5839491d717a7233e7f4791aa408207f3ea42f52de939ad15189b112c02a0770f1bb8d59bae6ad31ef53417a6eea7770fe52ab
DIST llvm-project-21.1.8.src.tar.xz.sig 119 BLAKE2B cffc1825f5778a3e3c128ec3e856ff6ee50687319d621cdf42e895abf67e05cc51cb7493308e2b506ab60dbdbaca7aa75eb9f78d91d42c81f9682a36f4042e9d SHA512 10f58eff58ed6e701d0f123b15e68c82ab8cbdf99b1c86c0d83e3b8553e90ea51055e30327e8e442ded57c8f503e2a2de9ee075e9c28b5ba815a0f8922f8671c
DIST llvm-project-22.1.0.src.tar.xz 167040408 BLAKE2B c5e9971dd17f4b0508b85c9f247bebfcf9a9b4e282f65b09105549e7aef529ed25104458b83f5d7b152c4308df8ea2f8fdb7f479f4928d9b4360a3c326255647 SHA512 588753a26742cfc76ca179398eaac6a31e68b1fa5bfaf7300ce710a89bba1dc9bfe41229bb9277663a3cde4468e74922153e5d1529eb7c6fe4de5ba3cb62ba45
DIST llvm-project-22.1.0.src.tar.xz.sig 119 BLAKE2B d3190d9dbacedf9de0c6b3d5c7711ae3c57dd4dc8cd136bc27fe4901253ffbd6d21060c046d7bf69d3a9489b5704ab5337e6d26da8236966c609b2d0eb54db97 SHA512 6145bf769640a9c6546cb63fa82450b2985ab74b2180a735f709ed909998cfbc6781116354b8b819cefa0e87cd11d470ecc64cd758b4a703aa10ee7880315f42
DIST llvm-project-22.1.1.src.tar.xz 167029452 BLAKE2B 5d02e03ed943904e8e45d5a522ee37720540b80f79f449bdc50ac87c1703d0129aa853384a63782eabf8f6d375e123709d73167f9f708bde4e0118d10837f2b0 SHA512 dddf09651c0e77caa83284788765016b023a9e239cfe35820bab7be64b68218e86bcf39bb07ee14dcddf7b0974b551344d2bff0e109cc9458b0394a3c940917c
DIST llvm-project-22.1.1.src.tar.xz.sig 119 BLAKE2B 02dd014936c4bac983ad6822a3ca084ddc94beeb4f4ccc6afae0031c7c563b10f7b962ef5a1a3d573330725c590f7e3b2eef2c21100063e68e32a1015b733c3d SHA512 592d603d610e121e7466a342bbf6b95c9a5f689268fad778befbf9e5663b53717c50daab9db07288020e3dcc2ec2bf38d611761a9ff6c3ce10a4340cfc2593c7
DIST llvm-project-22.1.2.src.tar.xz 167026580 BLAKE2B f838277e2bb47c273e8c709940aff5e21b88ad8216a4c6813d783f6041ac4b624c954bedd4c572c117d308ccafedca80ea95fcd73675c00ebfa998057e522f7b SHA512 d5adfbb8e5026b845f8251f5f490b4646ccd2ecaf81a2b80091d1c71044f5c7726f2df6680a95589f2dedc614bdd9cdd88febcce6d5fc92f638f616d503b8066
DIST llvm-project-22.1.2.src.tar.xz.sig 119 BLAKE2B 4ca084feb2d99ca6d763048244305408400fd9e1fb08a4314112d4d0318e4a2f3337858217c6d09fc136e0dd48f5bed7e88ecd3510116a3777dedec013f915f3 SHA512 dba272f935aa5ff3e93e538ac8877a79fdd3d2bf0efa61266c3caa85ac3aab167213a76759ed9531b539cdfd57c96a9c890807c4a04ba65a4d80b0c3dff044f2
DIST llvm-project-704c87bb948aff1bec718d56ad52b9b5d9c49cfb.tar.gz 264313048 BLAKE2B 68a42c37c44be743f1b584e97fbc9633cb2f679d8b2a733c31eb1f6805591a3b817e5c41dcc2d5a7bcf399e822fab3b020f8f2126918ef2e96f7a231b2b2a08f SHA512 dbcbc3b988c60e9a9cd3a03c339d53722f3a854ff05c53f88a9dad2c52db16453a34bd481ce90d063eae93428e438cf397bc5c60194e14ca9c65b0459c2a91d7
DIST llvm-project-df9eb79970c012990e829d174d181d575d414efe.tar.gz 265149781 BLAKE2B ab7a87dad369685fc26a054c065dee6ef2754b6446d5a6e15ed7f5bb52d7d433b519cac0522063ba222600f6f40dc40f7bf27930c74031cc40fff5372308a097 SHA512 7c63bf1360902e6a55c7f4c15d08a716d54476875744e6f40ec51157de6c18bf75d8fdb921f26831017151e87649bd1a48041e007edd9a0afc5e9f9066bfd79d
-174
View File
@@ -1,174 +0,0 @@
# 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"
}
@@ -1,173 +0,0 @@
# 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"
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"
}
@@ -1,173 +0,0 @@
# 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"
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"
}