From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8732515827B for ; Thu, 21 Aug 2025 08:18:52 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 73B60340E58 for ; Thu, 21 Aug 2025 08:18:52 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 579D9110570; Thu, 21 Aug 2025 08:18:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 51F63110570 for ; Thu, 21 Aug 2025 08:18:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0ABC4340EC1 for ; Thu, 21 Aug 2025 08:18:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7C1DD34E2 for ; Thu, 21 Aug 2025 08:18:19 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1755764026.23066aee6b40756e001e8a14f217280f3ae047af.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: llvm-runtimes/libgcc/ X-VCS-Repository: repo/gentoo X-VCS-Files: llvm-runtimes/libgcc/Manifest llvm-runtimes/libgcc/libgcc-22.0.0_pre20250820.ebuild X-VCS-Directories: llvm-runtimes/libgcc/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 23066aee6b40756e001e8a14f217280f3ae047af X-VCS-Branch: master Date: Thu, 21 Aug 2025 08:18:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0482b10d-110a-47ba-b2af-5c9664214530 X-Archives-Hash: 45ea6eba3cf3994cabf3e33b5902440f commit: 23066aee6b40756e001e8a14f217280f3ae047af Author: Michał Górny gentoo org> AuthorDate: Thu Aug 21 08:13:02 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Aug 21 08:13:46 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23066aee llvm-runtimes/libgcc: Add 22.0.0_pre20250820 snapshot Signed-off-by: Michał Górny gentoo.org> llvm-runtimes/libgcc/Manifest | 1 + .../libgcc/libgcc-22.0.0_pre20250820.ebuild | 175 +++++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/llvm-runtimes/libgcc/Manifest b/llvm-runtimes/libgcc/Manifest index 778a77bcf5f3..8ed67887d0c2 100644 --- a/llvm-runtimes/libgcc/Manifest +++ b/llvm-runtimes/libgcc/Manifest @@ -12,3 +12,4 @@ DIST llvm-project-21.1.0-rc3.src.tar.xz 158924056 BLAKE2B 5f3f46a499120c810a9443 DIST llvm-project-21.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 1a339fe00c27cddc508b369c4007e501266df42fbe0f448df3eecbf853ffa2915a6beef26e69c38169d37c12edcf60ac7c8ca5c0ae671b4c593356ccc6f3e3d5 SHA512 df8b3f747858fbb8c662899e6ea792556405cee2318be125a04e7b94c6dcebbed3ff01890f5e0c52e13b251243cfd1194806cf5ef52b482ae67d68be585574ad DIST llvm-project-92164faf17d553359418b9f49c1a41d680d0de49.tar.gz 245033829 BLAKE2B 7bf707e6455259417864a40c53beba4c4a9f6e4cf983671075016b95e537d2c249f97444089734718b5f2c989a2614028bd22142ccadae9c382e66b28758ecab SHA512 bf4105173144e6bb9cdc99ae67b7350228b37eae248c15aae2ce29877a8ee4cb76781a6beff366961fa366d31683b43421d684d019e25f0280735ccd6c22a432 DIST llvm-project-b075dadbd3e0e928bdeddb3d36af64e8a383e305.tar.gz 244584834 BLAKE2B e6924d5fcc90431bdf859c3d728e44c348fa8ec336967c95fa9d253519c7bf9b3b200048ff8910eea78e5481a11704330ad72960fe753930036f75bca5b163b7 SHA512 80232cd00a2981392cf9fb22daceb164f965d5d5c9edb431226713a5e2f75ba5aaf747329ae5f4b852fd5e7f0be62ad978529080b4dce1bac7af480905b61c3b +DIST llvm-project-d76bb2bb894a4641ed62447327b40a347a6ae883.tar.gz 245754836 BLAKE2B 487e6396f1b381743dfbbd13e8f55728f1f915c042c717433e498127ecdeb4405a67e998059f5eb1f84e851437b805ba9e9c0e390c61092c7ee336a801d6f342 SHA512 42e38f917357918e8d62d8893a1ba34b431cd8aabf924b89e5352013bb8984c10c0b2796fa9a725bab71e52f99216604b75606bde3b795d20082d97d0f7a82ad diff --git a/llvm-runtimes/libgcc/libgcc-22.0.0_pre20250820.ebuild b/llvm-runtimes/libgcc/libgcc-22.0.0_pre20250820.ebuild new file mode 100644 index 000000000000..eebc5d612900 --- /dev/null +++ b/llvm-runtimes/libgcc/libgcc-22.0.0_pre20250820.ebuild @@ -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" +}