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-core/clang-runtime/
Date: Wed, 05 Mar 2025 13:24:04 +0000 (UTC)	[thread overview]
Message-ID: <1741180357.794989dde6847773df9b7d263656e76f8313c35b.mgorny@gentoo> (raw)

commit:     794989dde6847773df9b7d263656e76f8313c35b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 13:12:37 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 13:12:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=794989dd

llvm-core/clang-runtime: Backport per-slot configs to 20.1.0-r1

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

 .../clang-runtime/clang-runtime-20.1.0-r1.ebuild   | 124 +++++++++++++++++++++
 .../clang-runtime/clang-runtime-20.1.0.ebuild      |  31 ------
 2 files changed, 124 insertions(+), 31 deletions(-)

diff --git a/llvm-core/clang-runtime/clang-runtime-20.1.0-r1.ebuild b/llvm-core/clang-runtime/clang-runtime-20.1.0-r1.ebuild
new file mode 100644
index 000000000000..2168a04b6406
--- /dev/null
+++ b/llvm-core/clang-runtime/clang-runtime-20.1.0-r1.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+S=${WORKDIR}
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	+compiler-rt libcxx offload openmp +sanitize
+	default-compiler-rt default-libcxx default-lld llvm-libunwind
+"
+REQUIRED_USE="
+	sanitize? ( compiler-rt )
+"
+
+RDEPEND="
+	compiler-rt? (
+		~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+		sanitize? (
+			~llvm-runtimes/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+		)
+	)
+	libcxx? ( >=llvm-runtimes/libcxx-${PV}[${MULTILIB_USEDEP}] )
+	openmp? (
+		>=llvm-runtimes/openmp-${PV}[${MULTILIB_USEDEP}]
+		offload? (
+			>=llvm-runtimes/offload-${PV}
+		)
+	)
+
+	llvm-core/clang-common
+	default-compiler-rt? (
+		~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+		llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
+		!llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+	)
+	!default-compiler-rt? ( sys-devel/gcc )
+	default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
+	!default-libcxx? ( sys-devel/gcc )
+	default-lld? ( ~llvm-core/lld-${PV} )
+	!default-lld? ( sys-devel/binutils )
+"
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++,-cpp}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@../${tool}.cfg
+			@gentoo-plugins.cfg
+			@gentoo-runtimes.cfg
+		EOF
+	done
+
+	# Install symlinks for triples with other vendor strings since some
+	# programs insist on mangling the triple.
+	local vendor
+	for vendor in gentoo pc unknown; do
+		local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+		for tool in clang{,++,-cpp}; do
+			if [[ ! -f "${ED}/etc/clang/${SLOT}/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${SLOT}/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple=$(get_abi_CHOST "${abi}")
+
+	_doclang_cfg ${triple}
+
+	# LLVM may have different arch names in some cases. For example in x86
+	# profiles the triple uses i686, but llvm will prefer i386 if invoked
+	# with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+	# be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+	#
+	# To make sure the correct triples are installed,
+	# see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+	# and compare with CHOST values in profiles.
+
+	local abi=${triple%%-*}
+	case ${abi} in
+		armv4l|armv4t|armv5tel|armv6j|armv7a)
+			_doclang_cfg ${triple/${abi}/arm}
+			;;
+		i686)
+			_doclang_cfg ${triple/${abi}/i386}
+			;;
+		sparc)
+			_doclang_cfg ${triple/${abi}/sparcel}
+			;;
+		sparc64)
+			_doclang_cfg ${triple/${abi}/sparcv9}
+			;;
+	esac
+}
+
+src_install() {
+	insinto "/etc/clang/${SLOT}"
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-core/clang-runtime.
+		# It is used to control the default runtimes using by clang.
+
+		--rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+		--unwindlib=$(usex default-compiler-rt libunwind libgcc)
+		--stdlib=$(usex default-libcxx libc++ libstdc++)
+		-fuse-ld=$(usex default-lld lld bfd)
+	EOF
+	newins - gentoo-plugins.cfg <<-EOF
+		# This file is used to load optional LLVM plugins.
+	EOF
+
+	multilib_foreach_abi doclang_cfg
+}

diff --git a/llvm-core/clang-runtime/clang-runtime-20.1.0.ebuild b/llvm-core/clang-runtime/clang-runtime-20.1.0.ebuild
deleted file mode 100644
index da17e274d8da..000000000000
--- a/llvm-core/clang-runtime/clang-runtime-20.1.0.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-
-LICENSE="metapackage"
-SLOT="${PV%%.*}"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="+compiler-rt libcxx offload openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-
-RDEPEND="
-	compiler-rt? (
-		~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-		sanitize? (
-			~llvm-runtimes/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-		)
-	)
-	libcxx? ( >=llvm-runtimes/libcxx-${PV}[${MULTILIB_USEDEP}] )
-	openmp? (
-		>=llvm-runtimes/openmp-${PV}[${MULTILIB_USEDEP}]
-		offload? (
-			>=llvm-runtimes/offload-${PV}
-		)
-	)
-"


             reply	other threads:[~2025-03-05 13:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 13:24 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-20 16:50 [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-runtime/ 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-05 13:05 Michał Górny
2025-03-05 13:05 Michał Górny
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 11:30 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-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:06 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-16 10:08 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-29  3:21 Michał Górny
2024-12-28 19:35 Michał Górny
2024-12-27 21:25 Michał Górny
2024-12-21 10:28 Michał Górny
2024-12-17 21:37 Michał Górny
2024-12-16  5:57 Michał Górny

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=1741180357.794989dde6847773df9b7d263656e76f8313c35b.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