public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: llvm-runtimes/compiler-rt/
Date: Wed, 16 Apr 2025 18:34:16 +0000 (UTC)	[thread overview]
Message-ID: <1744828443.ae12cab47031bd4d51d2de4ed2a72923ae4ac14e.mgorny@gentoo> (raw)

commit:     ae12cab47031bd4d51d2de4ed2a72923ae4ac14e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 16 12:07:19 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr 16 18:34:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae12cab4

llvm-runtimes/compiler-rt: Add 20.1.3

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 llvm-runtimes/compiler-rt/Manifest                 |   2 +
 .../compiler-rt/compiler-rt-20.1.3.ebuild          | 176 +++++++++++++++++++++
 2 files changed, 178 insertions(+)

diff --git a/llvm-runtimes/compiler-rt/Manifest b/llvm-runtimes/compiler-rt/Manifest
index d53cd940841b..54c3d1725ee8 100644
--- a/llvm-runtimes/compiler-rt/Manifest
+++ b/llvm-runtimes/compiler-rt/Manifest
@@ -14,5 +14,7 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-1cf9f764ac41fb3492e10c78640dd50e616388db.tar.gz 230651433 BLAKE2B b71d459de99a741f9eb5809fcb44e6d9a17d3295bf11755d2b04a83fff6257eb4e5856826581c000e3b2868ff1cfb155ee18c692654f8083af04574d414c8fa2 SHA512 5b8d1e493830b7838b3ca76148dfc2e2af1cbaa660bd80958777698210c3347a1308f0725d40b10f8f12877daf99c4ba4837e4fa857a781ae912ee167369bafd
 DIST llvm-project-20.1.2.src.tar.xz 147229028 BLAKE2B 90be4c8b69d44bc3a295f3f63081f999cf35d05e9157ab104d403a5d5b6c3ff97b57a89598d2ec0413988f93a23f97f485b2216bbf0630cade754e9830246621 SHA512 c95e088e471d49c6692c8af1a7e40924467e4c269dada019c44455687c9f0e6a213b9b3ac8afa4e3d20cb3e757afc3400152e7cd06981aeebd61591cac15580d
 DIST llvm-project-20.1.2.src.tar.xz.sig 566 BLAKE2B fa4637cd41bddb0425567b17bcb0ba4800ec9a689897610febfba7f49f8218d6aff7bb8f7ecf6bb927397096ca49c0c1817b243e5ba7fc0ba51993ef532dadeb SHA512 d3f6a350ebd9884878442ea202f58328f8e85c30cfb150371e4af7fa8dc560bb421cd0f49f49e6bc95f57de6c06543633f0b2799aab9590750f440e099424e01
+DIST llvm-project-20.1.3.src.tar.xz 147212776 BLAKE2B c738abb66dc82580a8f511829bcf87dd8deb8381bd073cd547e4eb02097c0190fa06488e5500cefce95953315432ee6ae3c103c491d08eca4b019e043691fc12 SHA512 79d6cfd10075ec9d05b9a359c09579e07a2caff9167518519457daee3e37a818100da6712804916880797ecb0b4891b18dc52a03b534e1b9d1d4bb5ba8d5ad1e
+DIST llvm-project-20.1.3.src.tar.xz.sig 566 BLAKE2B 1b584b61f773013f3964dbd0ee026c00e702cfe758acdacc7bffb6793c42eea638cc812bd1a3cddf210a9ad7d98f707d4f1e748d360b66427fded79f24d8610b SHA512 4fd3815cd94113234e66083f955993a95c888cbb89d5baf611b76765511e102af9f1e880cbacc709f0be8785abd5abbfb0ce391793308dfec3c248a9b348e492
 DIST llvm-project-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7
 DIST llvm-project-fa4ac19f0fc937e30fd7711dad98d0fcdb34f8ba.tar.gz 230556403 BLAKE2B 8fde662380b5a9889cb6399ceeffedf0b42a5b6c329768f2cad15338a4fd4650217057955014de53b56825a6f5770042f5678d8df4118b6310d4d1b12a19c888 SHA512 ef8a3ac7aed43f14b490d198de27f15bad0a63b89273d47daca0aa33a1edf79eecafb26f7f7ec64e6482b99fba5d7e9080c59887e33bb1ce18d8e3ae1938a1ae

diff --git a/llvm-runtimes/compiler-rt/compiler-rt-20.1.3.ebuild b/llvm-runtimes/compiler-rt/compiler-rt-20.1.3.ebuild
new file mode 100644
index 000000000000..5443ea12f1da
--- /dev/null
+++ b/llvm-runtimes/compiler-rt/compiler-rt-20.1.3.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+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}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+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} )
+	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_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() {
+	llvm_prepend_path "${LLVM_MAJOR}"
+
+	# 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
+			local -x CXX=${CHOST}-clang++
+		fi
+
+		strip-unsupported-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}"
+
+		-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
+}


             reply	other threads:[~2025-04-16 18:34 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 18:34 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-20 11:50 [gentoo-commits] repo/gentoo:master commit in: llvm-runtimes/compiler-rt/ Michał Górny
2025-04-19  6:29 Michał Górny
2025-04-15 10:15 Michał Górny
2025-04-12 10:21 Michał Górny
2025-04-12  8:59 Michał Górny
2025-04-12  4:57 Michał Górny
2025-04-05 12:24 Michał Górny
2025-04-03 11:29 Michał Górny
2025-03-29 10:27 Michał Górny
2025-03-23 13:46 Arthur Zamarin
2025-03-23 13:46 Arthur Zamarin
2025-03-22 10:43 Michał Górny
2025-03-20 16:50 Michał Górny
2025-03-17 20:13 Michał Górny
2025-03-16 17:41 Michał Górny
2025-03-11 14:56 Michał Górny
2025-03-08 16:42 Arthur Zamarin
2025-03-05 10:13 Michał Górny
2025-03-05  6:25 Michał Górny
2025-03-01 12:58 Michał Górny
2025-03-01  8:34 Michał Górny
2025-02-26 18:55 Michał Górny
2025-02-25 14:03 Michał Górny
2025-02-22 15:19 Michał Górny
2025-02-15  7:19 Michał Górny
2025-02-13  7:53 Michał Górny
2025-02-11 11:29 Michał Górny
2025-02-08 11:51 Michał Górny
2025-02-07 20:08 Arthur Zamarin
2025-02-02 18:25 Michał Górny
2025-02-01 13:15 Michał Górny
2025-02-01  8:05 Michał Górny
2025-01-31 21:51 Michał Górny
2025-01-25 13:33 Michał Górny
2025-01-22 19:15 Michał Górny
2025-01-18 15:09 Michał Górny
2025-01-18  8:21 Michał Górny
2025-01-15  4:24 Michał Górny
2025-01-11 18:12 Michał Górny
2025-01-04 15:28 Michał Górny
2024-12-28 19:35 Michał Górny
2024-12-27 21:25 Michał Górny
2024-12-24  7:38 Sam James
2024-12-21 10:28 Michał Górny
2024-12-17 21:37 Michał Górny
2024-12-16  5:57 Michał Górny
2024-12-12  5:03 Sam James
2024-12-12  5:03 Sam James
2024-12-11 20:31 Sam James
2024-12-11 20:31 Sam James
2024-12-11 20:31 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1744828443.ae12cab47031bd4d51d2de4ed2a72923ae4ac14e.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox