public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-25 14:03 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-25 14:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d5459368fb2edc9e131c8283de14b80ea7634842
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 25 12:50:09 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb 25 14:03:05 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5459368

llvm-core/clang-common: Add 21.0.0_pre20250225 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250225.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index f14cc7e05032..8a453d62c389 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,3 +15,4 @@ DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5
 DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
 DIST llvm-project-581599096e8a1a89ccd3e053a1209c69a9079083.tar.gz 227830555 BLAKE2B 28a04dd5ce96716d389fe049c4b877f55d6e5cad5c77d8867dd7e3a448213ef413e4f4d7d5f77b0702b26a8eb25f53e08d90e2a5a97eaa3f89245531d9f6626d SHA512 d775aea9bf71d60673e966a689ff6b933afecab2c133a1f64a158551ba9db049221148eab5087bab0ce0ff917456b85fb4ea4d7284886326f54617d167a385a5
 DIST llvm-project-c30a7f459452d5766da244564bc1d5888346c364.tar.gz 227560986 BLAKE2B c1c833aa6d488530826d96db81ca8be2fcf842ccf5b10a65ff18269fdfa32fa2742fb0a547eb315c2a9ee383e1b6b6cce4a78136e1740e04d322c79fb6a66a86 SHA512 0b68d3462e5eac89f50cff5e64603758ab74c701ff2de88c8569dd45b7e702b5d13b26c2745615c0c355d46d13765f47e4d43e61cde735240c6f386c0090becb
+DIST llvm-project-d254fa877f419e61e54709f0a6f2e891da893a60.tar.gz 228028122 BLAKE2B 3321f3b205dfcd672d52122d7ba8e4e737916e01f5041a0dc140722f64359476632e036da0e0692cd366b080a073292cfdb4963e973bf800afabc20d06a2e86b SHA512 135c4864973b682cf41953d43d977eaa219a4a898fceb4b4a8cacbbc6a5dd271d26010b1db6c6c90e761bf3495036f3e7528ab259d48c9c4dc4a064332c0326f

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250225.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250225.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250225.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-10-08 17:28 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-10-08 17:28 UTC (permalink / raw
  To: gentoo-commits

commit:     4d33573a02d908aabc569a084d4dadf388703c43
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  8 13:19:49 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Oct  8 17:28:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d33573a

llvm-core/clang-common: Add 21.1.3

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-21.1.3.ebuild | 339 ++++++++++++++++++++++
 2 files changed, 341 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 51e1a7d3dd8a..255a9b68beec 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,5 +12,7 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.2.src.tar.xz 158926856 BLAKE2B 1b5684586297ad637c6da0976854b24d746679e9d125a19e321dc28fa7f83949cc431f4b630e4976496660389e7abac09962c21e45b88dff7d0900ee1bda51d7 SHA512 f810ba8706872257715c05f80c304ceb396cf38b3a8e0bfb50e474e8d0a3417740b9afea170a7c06a33927037753a190471917e83d6740cb18bc50fd50cf4f3d
 DIST llvm-project-21.1.2.src.tar.xz.sig 566 BLAKE2B 6209caf851c681e6f63ed1bd9589ac139c104d6ee21f463aacda472e30a847c32f3bd74a04208af05bb6203d8fa31bdc0028c0e72736a3037940e75eda615415 SHA512 dd8aa57451752a9207c276117a4b8a86f41263ea3ccc4fa198cd40d6fec79acd0ba126c4b84a1acbb52bbb2bce029fbc336deac8131be94747dd04e4a0f69331
+DIST llvm-project-21.1.3.src.tar.xz 158943752 BLAKE2B ad9ee083584cb72fea3722feb518f6c933c3a34ba91b1ca8b724f461aa744475a783512dd6f0ab60d533c73b37e42b32a06f905d4869f770a68180649656df44 SHA512 d3058e7c18ada2a6a6192c7e75970406520e0d2ba390dba3b89e99f05959198fd2976d38c200f8e6af37fb569d866b6367bf6e0e249fe4b340dfab74499e5723
+DIST llvm-project-21.1.3.src.tar.xz.sig 119 BLAKE2B 675873fb6ce9a6b682d0ecdc5ec6ca8691d7f8f6bc72e6039a90c21f99d753a4b595f06676f9b5c1a23ebce872320cc67bd1687e8324f163ecbc4f22032bdf52 SHA512 d218a4071451e32a77890dd2e7de7a3b8a310ca85c7e6d90b88d85bad128979cf6866c9d772b880b50da2ec117832e77ba162049478c1deb7b0299cae008151a
 DIST llvm-project-89ed5255b9ee88119e409a6d986eb1ad0e8f08e3.tar.gz 248431210 BLAKE2B b98dfe5ae46190a5a2460c965f0ec51d2f65a9d1d14f82afa19a10f00a2c29520c52309ee66d71efed6361aa675abcc9bd1b5e61e1c3b1aa9bac4984050c2bc2 SHA512 f860f529f4eb67f4a5875d9931accae2f48b88486dd6715a2ca2add7d5aa1541a30e323612394162e65597054d61a879a9ba94e4dbf417c3fb5f8ff069c2d924
 DIST llvm-project-b1e29ec3b73b9dd06656c7e30ace597ff72cde70.tar.gz 248630276 BLAKE2B ea1532ba05661de37f3d6bac6643f2f3000710f4c4b8c508c9b980da64964e60cd46d0b8e18d666b75089f8ad8e2f653ac6098b4054ce8adf7cb0c36220cdf29 SHA512 36471abffd9202c637aa89c53072f0f286beffad2d3908ad50bb4c395a1be0c8138ddcbd67e0c764f59842bcc6c6c31f04a14986c7145c369217a156885ac506

diff --git a/llvm-core/clang-common/clang-common-21.1.3.ebuild b/llvm-core/clang-common/clang-common-21.1.3.ebuild
new file mode 100644
index 000000000000..668afb0e71de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.3.ebuild
@@ -0,0 +1,339 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 elisp-common llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet emacs hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
+
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
+llvm.org_set_globals
+
+SITEFILE="50clang-gentoo.el"
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
+src_install() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-10-04  9:16 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-10-04  9:16 UTC (permalink / raw
  To: gentoo-commits

commit:     0aa321876d0986adaa2f8b618addcb2ec8d26d03
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  4 08:52:52 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct  4 08:52:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0aa32187

llvm-core/clang-common: Add 22.0.0_pre20251004 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20251004.ebuild         | 338 +++++++++++++++++++++
 2 files changed, 339 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 877d4c3d80d5..51e1a7d3dd8a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,3 +13,4 @@ DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9
 DIST llvm-project-21.1.2.src.tar.xz 158926856 BLAKE2B 1b5684586297ad637c6da0976854b24d746679e9d125a19e321dc28fa7f83949cc431f4b630e4976496660389e7abac09962c21e45b88dff7d0900ee1bda51d7 SHA512 f810ba8706872257715c05f80c304ceb396cf38b3a8e0bfb50e474e8d0a3417740b9afea170a7c06a33927037753a190471917e83d6740cb18bc50fd50cf4f3d
 DIST llvm-project-21.1.2.src.tar.xz.sig 566 BLAKE2B 6209caf851c681e6f63ed1bd9589ac139c104d6ee21f463aacda472e30a847c32f3bd74a04208af05bb6203d8fa31bdc0028c0e72736a3037940e75eda615415 SHA512 dd8aa57451752a9207c276117a4b8a86f41263ea3ccc4fa198cd40d6fec79acd0ba126c4b84a1acbb52bbb2bce029fbc336deac8131be94747dd04e4a0f69331
 DIST llvm-project-89ed5255b9ee88119e409a6d986eb1ad0e8f08e3.tar.gz 248431210 BLAKE2B b98dfe5ae46190a5a2460c965f0ec51d2f65a9d1d14f82afa19a10f00a2c29520c52309ee66d71efed6361aa675abcc9bd1b5e61e1c3b1aa9bac4984050c2bc2 SHA512 f860f529f4eb67f4a5875d9931accae2f48b88486dd6715a2ca2add7d5aa1541a30e323612394162e65597054d61a879a9ba94e4dbf417c3fb5f8ff069c2d924
+DIST llvm-project-b1e29ec3b73b9dd06656c7e30ace597ff72cde70.tar.gz 248630276 BLAKE2B ea1532ba05661de37f3d6bac6643f2f3000710f4c4b8c508c9b980da64964e60cd46d0b8e18d666b75089f8ad8e2f653ac6098b4054ce8adf7cb0c36220cdf29 SHA512 36471abffd9202c637aa89c53072f0f286beffad2d3908ad50bb4c395a1be0c8138ddcbd67e0c764f59842bcc6c6c31f04a14986c7145c369217a156885ac506

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20251004.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20251004.ebuild
new file mode 100644
index 000000000000..163c1c4f6814
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20251004.ebuild
@@ -0,0 +1,338 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 elisp-common llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet emacs hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
+
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
+llvm.org_set_globals
+
+SITEFILE="50clang-gentoo.el"
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
+src_install() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-10-03 11:43 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-10-03 11:43 UTC (permalink / raw
  To: gentoo-commits

commit:     7277e8af3ac9e7a71403b1c3a3f88873e858a3f1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  3 11:40:58 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct  3 11:40:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7277e8af

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   4 -
 llvm-core/clang-common/clang-common-21.1.1.ebuild  | 315 ---------------------
 .../clang-common-22.0.0_pre20250910.ebuild         | 314 --------------------
 .../clang-common-22.0.0_pre20250923.ebuild         | 314 --------------------
 4 files changed, 947 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 1fca96741050..877d4c3d80d5 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,10 +10,6 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 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.1.src.tar.xz 158891056 BLAKE2B 5801ba4ea64e9c55fd1e6a83e1ea463cfb1d2b12c1f25a488ca63fd88254f20388c5e986492e413d795306bc37782487b80485240939227f3beeea860091825c SHA512 a120895e75942d848cc763fd1cb4aeb184e9d4509d69064e8e3f5679fbeb09c73bf916e33d04b842778537d2331067ec9190e0ad75d591d3ba57871770e19bce
-DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef94893b8e4914e855fa96fc3a4a0a4ac916d646758be1c1c9a74028acd776d5d93b77f678d29dc75179ae95909d525d263c85 SHA512 1b9a2c51feaca75ef2f82a89c8e8d741a0b5f05f0dd8ca244d6997deb00f8ded3c37a5cbc6012a4ba8632004383ab4677756d9defe8855fff458e02380d77bd5
 DIST llvm-project-21.1.2.src.tar.xz 158926856 BLAKE2B 1b5684586297ad637c6da0976854b24d746679e9d125a19e321dc28fa7f83949cc431f4b630e4976496660389e7abac09962c21e45b88dff7d0900ee1bda51d7 SHA512 f810ba8706872257715c05f80c304ceb396cf38b3a8e0bfb50e474e8d0a3417740b9afea170a7c06a33927037753a190471917e83d6740cb18bc50fd50cf4f3d
 DIST llvm-project-21.1.2.src.tar.xz.sig 566 BLAKE2B 6209caf851c681e6f63ed1bd9589ac139c104d6ee21f463aacda472e30a847c32f3bd74a04208af05bb6203d8fa31bdc0028c0e72736a3037940e75eda615415 SHA512 dd8aa57451752a9207c276117a4b8a86f41263ea3ccc4fa198cd40d6fec79acd0ba126c4b84a1acbb52bbb2bce029fbc336deac8131be94747dd04e4a0f69331
-DIST llvm-project-70bd610e43853d575e22be1cda46614fe9f0072f.tar.gz 247904536 BLAKE2B f0ae7bd39d921ce28adb6e2aadd8b2b94ba7a48ba344ea6ea236b2507430fb1a0e23cd6186d79d445de31d46580e2ac9ec400fc686cd9a7513e0ae2d0f479c1d SHA512 1201acbcec20d00979e7f06075756926161123cfb11da146a3bfa5c81d607b61d94c645d0abba839614cbe5d44cacb0b1c754e1ae49fa871cb86d9f6d7c70e26
 DIST llvm-project-89ed5255b9ee88119e409a6d986eb1ad0e8f08e3.tar.gz 248431210 BLAKE2B b98dfe5ae46190a5a2460c965f0ec51d2f65a9d1d14f82afa19a10f00a2c29520c52309ee66d71efed6361aa675abcc9bd1b5e61e1c3b1aa9bac4984050c2bc2 SHA512 f860f529f4eb67f4a5875d9931accae2f48b88486dd6715a2ca2add7d5aa1541a30e323612394162e65597054d61a879a9ba94e4dbf417c3fb5f8ff069c2d924
-DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-21.1.1.ebuild b/llvm-core/clang-common/clang-common-21.1.1.ebuild
deleted file mode 100644
index 6ff3220636e5..000000000000
--- a/llvm-core/clang-common/clang-common-21.1.1.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	newins - gentoo-runtimes.cfg <<-EOF
-		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250910.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250910.ebuild
deleted file mode 100644
index 4f0d35918328..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250910.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	newins - gentoo-runtimes.cfg <<-EOF
-		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild
deleted file mode 100644
index 4f0d35918328..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	newins - gentoo-runtimes.cfg <<-EOF
-		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-10-03 11:39 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-10-03 11:39 UTC (permalink / raw
  To: gentoo-commits

commit:     260bf947a8e105471d97f9c921540bdee968d8a0
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Tue Sep 23 21:00:47 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct  3 11:39:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=260bf947

llvm-core/clang-common: install clang-format.el with IUSE=emacs

Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Part-of: https://github.com/gentoo/gentoo/pull/43898
Closes: https://github.com/gentoo/gentoo/pull/43898
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...21.1.2.ebuild => clang-common-20.1.8-r1.ebuild} | 30 +++++++++++++++++++---
 llvm-core/clang-common/clang-common-21.1.2.ebuild  | 30 +++++++++++++++++++---
 .../clang-common/clang-common-22.0.0.9999.ebuild   | 30 +++++++++++++++++++---
 .../clang-common-22.0.0_pre20251001.ebuild         | 30 +++++++++++++++++++---
 4 files changed, 108 insertions(+), 12 deletions(-)

diff --git a/llvm-core/clang-common/clang-common-21.1.2.ebuild b/llvm-core/clang-common/clang-common-20.1.8-r1.ebuild
similarity index 93%
copy from llvm-core/clang-common/clang-common-21.1.2.ebuild
copy to llvm-core/clang-common/clang-common-20.1.8-r1.ebuild
index 6ff3220636e5..668afb0e71de 100644
--- a/llvm-core/clang-common/clang-common-21.1.2.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.8-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit bash-completion-r1 llvm.org multilib
+inherit bash-completion-r1 elisp-common llvm.org multilib
 
 DESCRIPTION="Common files shared between multiple slots of clang"
 HOMEPAGE="https://llvm.org/"
@@ -13,7 +13,7 @@ SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
+	bootstrap-prefix cet emacs hardened llvm-libunwind
 "
 
 PDEPEND="
@@ -31,15 +31,21 @@ PDEPEND="
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
 	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )
 "
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
 
-LLVM_COMPONENTS=( clang/utils )
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
 llvm.org_set_globals
 
+SITEFILE="50clang-gentoo.el"
+
 pkg_pretend() {
 	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
 
@@ -143,6 +149,11 @@ doclang_cfg() {
 	esac
 }
 
+src_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
 src_install() {
 	newbashcomp bash-autocomplete.sh clang
 
@@ -300,6 +311,11 @@ src_install() {
 			-isysroot ${EPREFIX}/MacOSX.sdk
 		EOF
 	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
 }
 
 pkg_preinst() {
@@ -313,3 +329,11 @@ pkg_preinst() {
 		fi
 	fi
 }
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}

diff --git a/llvm-core/clang-common/clang-common-21.1.2.ebuild b/llvm-core/clang-common/clang-common-21.1.2.ebuild
index 6ff3220636e5..668afb0e71de 100644
--- a/llvm-core/clang-common/clang-common-21.1.2.ebuild
+++ b/llvm-core/clang-common/clang-common-21.1.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit bash-completion-r1 llvm.org multilib
+inherit bash-completion-r1 elisp-common llvm.org multilib
 
 DESCRIPTION="Common files shared between multiple slots of clang"
 HOMEPAGE="https://llvm.org/"
@@ -13,7 +13,7 @@ SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
+	bootstrap-prefix cet emacs hardened llvm-libunwind
 "
 
 PDEPEND="
@@ -31,15 +31,21 @@ PDEPEND="
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
 	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )
 "
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
 
-LLVM_COMPONENTS=( clang/utils )
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
 llvm.org_set_globals
 
+SITEFILE="50clang-gentoo.el"
+
 pkg_pretend() {
 	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
 
@@ -143,6 +149,11 @@ doclang_cfg() {
 	esac
 }
 
+src_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
 src_install() {
 	newbashcomp bash-autocomplete.sh clang
 
@@ -300,6 +311,11 @@ src_install() {
 			-isysroot ${EPREFIX}/MacOSX.sdk
 		EOF
 	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
 }
 
 pkg_preinst() {
@@ -313,3 +329,11 @@ pkg_preinst() {
 		fi
 	fi
 }
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}

diff --git a/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
index 4f0d35918328..163c1c4f6814 100644
--- a/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
+++ b/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit bash-completion-r1 llvm.org multilib
+inherit bash-completion-r1 elisp-common llvm.org multilib
 
 DESCRIPTION="Common files shared between multiple slots of clang"
 HOMEPAGE="https://llvm.org/"
@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
+	bootstrap-prefix cet emacs hardened llvm-libunwind
 "
 
 PDEPEND="
@@ -30,15 +30,21 @@ PDEPEND="
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
 	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )
 "
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
 
-LLVM_COMPONENTS=( clang/utils )
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
 llvm.org_set_globals
 
+SITEFILE="50clang-gentoo.el"
+
 pkg_pretend() {
 	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
 
@@ -142,6 +148,11 @@ doclang_cfg() {
 	esac
 }
 
+src_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
 src_install() {
 	newbashcomp bash-autocomplete.sh clang
 
@@ -299,6 +310,11 @@ src_install() {
 			-isysroot ${EPREFIX}/MacOSX.sdk
 		EOF
 	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
 }
 
 pkg_preinst() {
@@ -312,3 +328,11 @@ pkg_preinst() {
 		fi
 	fi
 }
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild
index 4f0d35918328..163c1c4f6814 100644
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit bash-completion-r1 llvm.org multilib
+inherit bash-completion-r1 elisp-common llvm.org multilib
 
 DESCRIPTION="Common files shared between multiple slots of clang"
 HOMEPAGE="https://llvm.org/"
@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
+	bootstrap-prefix cet emacs hardened llvm-libunwind
 "
 
 PDEPEND="
@@ -30,15 +30,21 @@ PDEPEND="
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
 	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+	emacs? ( >=app-editors/emacs-26.3:* )
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )
 "
+BDEPEND="
+	emacs? ( >=app-editors/emacs-26.3:* )
+"
 
-LLVM_COMPONENTS=( clang/utils )
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
 llvm.org_set_globals
 
+SITEFILE="50clang-gentoo.el"
+
 pkg_pretend() {
 	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
 
@@ -142,6 +148,11 @@ doclang_cfg() {
 	esac
 }
 
+src_compile() {
+	default
+	use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
 src_install() {
 	newbashcomp bash-autocomplete.sh clang
 
@@ -299,6 +310,11 @@ src_install() {
 			-isysroot ${EPREFIX}/MacOSX.sdk
 		EOF
 	fi
+
+	if use emacs ; then
+		elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+		elisp-make-site-file "${SITEFILE}" clang
+	fi
 }
 
 pkg_preinst() {
@@ -312,3 +328,11 @@ pkg_preinst() {
 		fi
 	fi
 }
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-10-01  6:35 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-10-01  6:35 UTC (permalink / raw
  To: gentoo-commits

commit:     c667f43b3259492c1f032c8ef55d1a5da1805f3b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  1 06:21:29 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Oct  1 06:21:29 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c667f43b

llvm-core/clang-common: Add 22.0.0_pre20251001 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20251001.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index e3c6add151f6..1fca96741050 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,4 +15,5 @@ DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef
 DIST llvm-project-21.1.2.src.tar.xz 158926856 BLAKE2B 1b5684586297ad637c6da0976854b24d746679e9d125a19e321dc28fa7f83949cc431f4b630e4976496660389e7abac09962c21e45b88dff7d0900ee1bda51d7 SHA512 f810ba8706872257715c05f80c304ceb396cf38b3a8e0bfb50e474e8d0a3417740b9afea170a7c06a33927037753a190471917e83d6740cb18bc50fd50cf4f3d
 DIST llvm-project-21.1.2.src.tar.xz.sig 566 BLAKE2B 6209caf851c681e6f63ed1bd9589ac139c104d6ee21f463aacda472e30a847c32f3bd74a04208af05bb6203d8fa31bdc0028c0e72736a3037940e75eda615415 SHA512 dd8aa57451752a9207c276117a4b8a86f41263ea3ccc4fa198cd40d6fec79acd0ba126c4b84a1acbb52bbb2bce029fbc336deac8131be94747dd04e4a0f69331
 DIST llvm-project-70bd610e43853d575e22be1cda46614fe9f0072f.tar.gz 247904536 BLAKE2B f0ae7bd39d921ce28adb6e2aadd8b2b94ba7a48ba344ea6ea236b2507430fb1a0e23cd6186d79d445de31d46580e2ac9ec400fc686cd9a7513e0ae2d0f479c1d SHA512 1201acbcec20d00979e7f06075756926161123cfb11da146a3bfa5c81d607b61d94c645d0abba839614cbe5d44cacb0b1c754e1ae49fa871cb86d9f6d7c70e26
+DIST llvm-project-89ed5255b9ee88119e409a6d986eb1ad0e8f08e3.tar.gz 248431210 BLAKE2B b98dfe5ae46190a5a2460c965f0ec51d2f65a9d1d14f82afa19a10f00a2c29520c52309ee66d71efed6361aa675abcc9bd1b5e61e1c3b1aa9bac4984050c2bc2 SHA512 f860f529f4eb67f4a5875d9931accae2f48b88486dd6715a2ca2add7d5aa1541a30e323612394162e65597054d61a879a9ba94e4dbf417c3fb5f8ff069c2d924
 DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild
new file mode 100644
index 000000000000..4f0d35918328
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20251001.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-09-24 16:18 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-09-24 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     c4a8ff920e1f63488bed074e04e6a9082b1ea5f1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 24 02:30:04 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 24 16:18:01 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4a8ff92

llvm-core/clang-common: Add 21.1.2

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-21.1.2.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 682f09184db1..e3c6add151f6 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,5 +12,7 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.1.src.tar.xz 158891056 BLAKE2B 5801ba4ea64e9c55fd1e6a83e1ea463cfb1d2b12c1f25a488ca63fd88254f20388c5e986492e413d795306bc37782487b80485240939227f3beeea860091825c SHA512 a120895e75942d848cc763fd1cb4aeb184e9d4509d69064e8e3f5679fbeb09c73bf916e33d04b842778537d2331067ec9190e0ad75d591d3ba57871770e19bce
 DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef94893b8e4914e855fa96fc3a4a0a4ac916d646758be1c1c9a74028acd776d5d93b77f678d29dc75179ae95909d525d263c85 SHA512 1b9a2c51feaca75ef2f82a89c8e8d741a0b5f05f0dd8ca244d6997deb00f8ded3c37a5cbc6012a4ba8632004383ab4677756d9defe8855fff458e02380d77bd5
+DIST llvm-project-21.1.2.src.tar.xz 158926856 BLAKE2B 1b5684586297ad637c6da0976854b24d746679e9d125a19e321dc28fa7f83949cc431f4b630e4976496660389e7abac09962c21e45b88dff7d0900ee1bda51d7 SHA512 f810ba8706872257715c05f80c304ceb396cf38b3a8e0bfb50e474e8d0a3417740b9afea170a7c06a33927037753a190471917e83d6740cb18bc50fd50cf4f3d
+DIST llvm-project-21.1.2.src.tar.xz.sig 566 BLAKE2B 6209caf851c681e6f63ed1bd9589ac139c104d6ee21f463aacda472e30a847c32f3bd74a04208af05bb6203d8fa31bdc0028c0e72736a3037940e75eda615415 SHA512 dd8aa57451752a9207c276117a4b8a86f41263ea3ccc4fa198cd40d6fec79acd0ba126c4b84a1acbb52bbb2bce029fbc336deac8131be94747dd04e4a0f69331
 DIST llvm-project-70bd610e43853d575e22be1cda46614fe9f0072f.tar.gz 247904536 BLAKE2B f0ae7bd39d921ce28adb6e2aadd8b2b94ba7a48ba344ea6ea236b2507430fb1a0e23cd6186d79d445de31d46580e2ac9ec400fc686cd9a7513e0ae2d0f479c1d SHA512 1201acbcec20d00979e7f06075756926161123cfb11da146a3bfa5c81d607b61d94c645d0abba839614cbe5d44cacb0b1c754e1ae49fa871cb86d9f6d7c70e26
 DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-21.1.2.ebuild b/llvm-core/clang-common/clang-common-21.1.2.ebuild
new file mode 100644
index 000000000000..6ff3220636e5
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.2.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-09-24  2:27 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-09-24  2:27 UTC (permalink / raw
  To: gentoo-commits

commit:     f66c58c6c60bb0f15b6915c3e07676902c9275f7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 24 02:25:07 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 24 02:25:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f66c58c6

llvm-core/clang-common: Add 22.0.0_pre20250923 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250923.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index ae2e24f76d37..682f09184db1 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,4 +12,5 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.1.src.tar.xz 158891056 BLAKE2B 5801ba4ea64e9c55fd1e6a83e1ea463cfb1d2b12c1f25a488ca63fd88254f20388c5e986492e413d795306bc37782487b80485240939227f3beeea860091825c SHA512 a120895e75942d848cc763fd1cb4aeb184e9d4509d69064e8e3f5679fbeb09c73bf916e33d04b842778537d2331067ec9190e0ad75d591d3ba57871770e19bce
 DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef94893b8e4914e855fa96fc3a4a0a4ac916d646758be1c1c9a74028acd776d5d93b77f678d29dc75179ae95909d525d263c85 SHA512 1b9a2c51feaca75ef2f82a89c8e8d741a0b5f05f0dd8ca244d6997deb00f8ded3c37a5cbc6012a4ba8632004383ab4677756d9defe8855fff458e02380d77bd5
+DIST llvm-project-70bd610e43853d575e22be1cda46614fe9f0072f.tar.gz 247904536 BLAKE2B f0ae7bd39d921ce28adb6e2aadd8b2b94ba7a48ba344ea6ea236b2507430fb1a0e23cd6186d79d445de31d46580e2ac9ec400fc686cd9a7513e0ae2d0f479c1d SHA512 1201acbcec20d00979e7f06075756926161123cfb11da146a3bfa5c81d607b61d94c645d0abba839614cbe5d44cacb0b1c754e1ae49fa871cb86d9f6d7c70e26
 DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild
new file mode 100644
index 000000000000..4f0d35918328
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250923.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-09-21  2:44 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-09-21  2:44 UTC (permalink / raw
  To: gentoo-commits

commit:     e25cb20ea0024d2e1e3782c4770b63dc177184fb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 21 01:28:41 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep 21 01:28:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e25cb20e

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   3 -
 llvm-core/clang-common/clang-common-21.1.0.ebuild  | 315 ---------------------
 .../clang-common-22.0.0_pre20250907.ebuild         | 314 --------------------
 3 files changed, 632 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index e2ee62a7108c..ae2e24f76d37 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,9 +10,6 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 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.0.src.tar.xz 158971856 BLAKE2B ac8c3cc8d2c986abcaa523acc872b01311ec118a738654f9cc53a1d5fdba70ba10cfe829e23f3913557e460403ed6a2df81cb5e9a435c8e1ce08e7ead3511bf0 SHA512 1487dcdc041dd6cdcffa6cc95a565e18a9fce2a73215671e366a9601cecce6c8bf70065df5564de5998d1841c3d8d829a9fbd2cad72e3aab4db279e8885ff446
-DIST llvm-project-21.1.0.src.tar.xz.sig 438 BLAKE2B c5731350bc7454867da18887628c0e87bf404589097034c7ddfffbeec277b900bd1fa49daabd41d4f8800a8ab76105bf7e910a99dd970819ab987373d4ed4ed9 SHA512 c3cd0a759e22a24f4307d8747b7986f966f4fa3c413092efc73ccca252476f1b59878dc65b444884515bcce3d3bfab902f585cc1d08e2aeb55aa8e588128aeb6
 DIST llvm-project-21.1.1.src.tar.xz 158891056 BLAKE2B 5801ba4ea64e9c55fd1e6a83e1ea463cfb1d2b12c1f25a488ca63fd88254f20388c5e986492e413d795306bc37782487b80485240939227f3beeea860091825c SHA512 a120895e75942d848cc763fd1cb4aeb184e9d4509d69064e8e3f5679fbeb09c73bf916e33d04b842778537d2331067ec9190e0ad75d591d3ba57871770e19bce
 DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef94893b8e4914e855fa96fc3a4a0a4ac916d646758be1c1c9a74028acd776d5d93b77f678d29dc75179ae95909d525d263c85 SHA512 1b9a2c51feaca75ef2f82a89c8e8d741a0b5f05f0dd8ca244d6997deb00f8ded3c37a5cbc6012a4ba8632004383ab4677756d9defe8855fff458e02380d77bd5
-DIST llvm-project-645dd324d1b7d028745c2a4045b69e745df2ae6a.tar.gz 247443586 BLAKE2B dd3229c32768e42fd2f311638f1e63f5503fabee3fa414bc3300313b36bbfa062d90900319e4fdbbafae17947537fba699fe5940e1b6553a2d9a716c0ce7b59c SHA512 659dc22e2fd1fd0bced13f941127797dc7703b8d810eeb7a0fc51cf55c274e69e2d6660867c191d5d90615ddee3a1faff7f7cd357ff2eb88d715762be50098c3
 DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-21.1.0.ebuild b/llvm-core/clang-common/clang-common-21.1.0.ebuild
deleted file mode 100644
index 6ff3220636e5..000000000000
--- a/llvm-core/clang-common/clang-common-21.1.0.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	newins - gentoo-runtimes.cfg <<-EOF
-		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild
deleted file mode 100644
index 4f0d35918328..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	newins - gentoo-runtimes.cfg <<-EOF
-		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-09-10 11:47 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-09-10 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     c95865fcb0f92c36e97bd25b1b4df8fed14d3c11
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 10 08:57:07 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 10 11:47:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c95865fc

llvm-core/clang-common: Add 21.1.1

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-21.1.1.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d66bffd1faca..e2ee62a7108c 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,5 +12,7 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0.src.tar.xz 158971856 BLAKE2B ac8c3cc8d2c986abcaa523acc872b01311ec118a738654f9cc53a1d5fdba70ba10cfe829e23f3913557e460403ed6a2df81cb5e9a435c8e1ce08e7ead3511bf0 SHA512 1487dcdc041dd6cdcffa6cc95a565e18a9fce2a73215671e366a9601cecce6c8bf70065df5564de5998d1841c3d8d829a9fbd2cad72e3aab4db279e8885ff446
 DIST llvm-project-21.1.0.src.tar.xz.sig 438 BLAKE2B c5731350bc7454867da18887628c0e87bf404589097034c7ddfffbeec277b900bd1fa49daabd41d4f8800a8ab76105bf7e910a99dd970819ab987373d4ed4ed9 SHA512 c3cd0a759e22a24f4307d8747b7986f966f4fa3c413092efc73ccca252476f1b59878dc65b444884515bcce3d3bfab902f585cc1d08e2aeb55aa8e588128aeb6
+DIST llvm-project-21.1.1.src.tar.xz 158891056 BLAKE2B 5801ba4ea64e9c55fd1e6a83e1ea463cfb1d2b12c1f25a488ca63fd88254f20388c5e986492e413d795306bc37782487b80485240939227f3beeea860091825c SHA512 a120895e75942d848cc763fd1cb4aeb184e9d4509d69064e8e3f5679fbeb09c73bf916e33d04b842778537d2331067ec9190e0ad75d591d3ba57871770e19bce
+DIST llvm-project-21.1.1.src.tar.xz.sig 438 BLAKE2B 8fdf614e67e31382c65d70a551ef94893b8e4914e855fa96fc3a4a0a4ac916d646758be1c1c9a74028acd776d5d93b77f678d29dc75179ae95909d525d263c85 SHA512 1b9a2c51feaca75ef2f82a89c8e8d741a0b5f05f0dd8ca244d6997deb00f8ded3c37a5cbc6012a4ba8632004383ab4677756d9defe8855fff458e02380d77bd5
 DIST llvm-project-645dd324d1b7d028745c2a4045b69e745df2ae6a.tar.gz 247443586 BLAKE2B dd3229c32768e42fd2f311638f1e63f5503fabee3fa414bc3300313b36bbfa062d90900319e4fdbbafae17947537fba699fe5940e1b6553a2d9a716c0ce7b59c SHA512 659dc22e2fd1fd0bced13f941127797dc7703b8d810eeb7a0fc51cf55c274e69e2d6660867c191d5d90615ddee3a1faff7f7cd357ff2eb88d715762be50098c3
 DIST llvm-project-f059d2bac034acca39ad60a1b13aaec6afa0a3d6.tar.gz 248627883 BLAKE2B e1603ba38fcf70e7f3794a30a42057d0052a422bd0aaf423c65d1fd8f9ec7d3981cd651f309dc3ab5c28183291241732373b9bdb75fc2a11fc8d9f238388b8c3 SHA512 63a1627a8b3cc8f240cefe2066d7e306cab5091317f97dd808b9ad887d4e6eb2d21af3f79bccfdb9387f5f7a5ed0b772013b0261a647c8d50ffaa55914362dfb

diff --git a/llvm-core/clang-common/clang-common-21.1.1.ebuild b/llvm-core/clang-common/clang-common-21.1.1.ebuild
new file mode 100644
index 000000000000..6ff3220636e5
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.1.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-09-07 19:47 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-09-07 19:47 UTC (permalink / raw
  To: gentoo-commits

commit:     121edb3815fc76e69407e1d2f441b17f5b823f02
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  7 19:15:53 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep  7 19:47:18 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=121edb38

llvm-core/clang-common: Add 22.0.0_pre20250907 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250907.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index a4bbd921e419..f5d097498587 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,4 +13,5 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0.src.tar.xz 158971856 BLAKE2B ac8c3cc8d2c986abcaa523acc872b01311ec118a738654f9cc53a1d5fdba70ba10cfe829e23f3913557e460403ed6a2df81cb5e9a435c8e1ce08e7ead3511bf0 SHA512 1487dcdc041dd6cdcffa6cc95a565e18a9fce2a73215671e366a9601cecce6c8bf70065df5564de5998d1841c3d8d829a9fbd2cad72e3aab4db279e8885ff446
 DIST llvm-project-21.1.0.src.tar.xz.sig 438 BLAKE2B c5731350bc7454867da18887628c0e87bf404589097034c7ddfffbeec277b900bd1fa49daabd41d4f8800a8ab76105bf7e910a99dd970819ab987373d4ed4ed9 SHA512 c3cd0a759e22a24f4307d8747b7986f966f4fa3c413092efc73ccca252476f1b59878dc65b444884515bcce3d3bfab902f585cc1d08e2aeb55aa8e588128aeb6
+DIST llvm-project-645dd324d1b7d028745c2a4045b69e745df2ae6a.tar.gz 247443586 BLAKE2B dd3229c32768e42fd2f311638f1e63f5503fabee3fa414bc3300313b36bbfa062d90900319e4fdbbafae17947537fba699fe5940e1b6553a2d9a716c0ce7b59c SHA512 659dc22e2fd1fd0bced13f941127797dc7703b8d810eeb7a0fc51cf55c274e69e2d6660867c191d5d90615ddee3a1faff7f7cd357ff2eb88d715762be50098c3
 DIST llvm-project-d76bb2bb894a4641ed62447327b40a347a6ae883.tar.gz 245754836 BLAKE2B 487e6396f1b381743dfbbd13e8f55728f1f915c042c717433e498127ecdeb4405a67e998059f5eb1f84e851437b805ba9e9c0e390c61092c7ee336a801d6f342 SHA512 42e38f917357918e8d62d8893a1ba34b431cd8aabf924b89e5352013bb8984c10c0b2796fa9a725bab71e52f99216604b75606bde3b795d20082d97d0f7a82ad

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild
new file mode 100644
index 000000000000..4f0d35918328
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250907.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	newins - gentoo-runtimes.cfg <<-EOF
+		# This file is initially generated by llvm-runtimes/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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-31 13:28 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-31 13:28 UTC (permalink / raw
  To: gentoo-commits

commit:     04e3602922aeba571debd86c58bcc9c461e756d5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 31 13:26:00 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 13:26:00 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04e36029

llvm-core/clang-common: Add 22.0.0_pre20250831 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250831.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 38b747e0bd0a..a4bbd921e419 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,6 +8,7 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-1d8fdda7b0a9f47c443600bca6af2bc141e4abf7.tar.gz 246773192 BLAKE2B a61c1607586dd6f130c62a78a1f36d0e49d66d47d1244c3fe26df774131b3717cdbb2ab726428bd89d420190125dea5968d11b8094131c3214ab00e00a3ccd3b SHA512 3a1d83b6f016fa677da1eb18836b819e042d67a7a922cba83016147520eb2f44493c0cbc12015c4222804a641f410915efd0bb833a08c24efced7fc26801933b
 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.0.src.tar.xz 158971856 BLAKE2B ac8c3cc8d2c986abcaa523acc872b01311ec118a738654f9cc53a1d5fdba70ba10cfe829e23f3913557e460403ed6a2df81cb5e9a435c8e1ce08e7ead3511bf0 SHA512 1487dcdc041dd6cdcffa6cc95a565e18a9fce2a73215671e366a9601cecce6c8bf70065df5564de5998d1841c3d8d829a9fbd2cad72e3aab4db279e8885ff446

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250831.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250831.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250831.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-27 12:28 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-27 12:28 UTC (permalink / raw
  To: gentoo-commits

commit:     f82657647675507ba52086b611ee75315b286cb1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 27 12:25:53 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug 27 12:28:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8265764

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                   |   2 -
 llvm-core/clang-common/clang-common-20.1.7.ebuild | 315 ----------------------
 2 files changed, 317 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d8d351cc6422..38b747e0bd0a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,8 +8,6 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
-DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 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.0.src.tar.xz 158971856 BLAKE2B ac8c3cc8d2c986abcaa523acc872b01311ec118a738654f9cc53a1d5fdba70ba10cfe829e23f3913557e460403ed6a2df81cb5e9a435c8e1ce08e7ead3511bf0 SHA512 1487dcdc041dd6cdcffa6cc95a565e18a9fce2a73215671e366a9601cecce6c8bf70065df5564de5998d1841c3d8d829a9fbd2cad72e3aab4db279e8885ff446

diff --git a/llvm-core/clang-common/clang-common-20.1.7.ebuild b/llvm-core/clang-common/clang-common-20.1.7.ebuild
deleted file mode 100644
index b2b38d2721f7..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.7.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-26 19:38 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-26 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     a82ddcaf58fde5db78ec18d617751a09872f93a5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 26 19:24:23 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 26 19:38:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a82ddcaf

llvm-core/clang-common: Keyword 21.1.0

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

 llvm-core/clang-common/clang-common-21.1.0.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm-core/clang-common/clang-common-21.1.0.ebuild b/llvm-core/clang-common/clang-common-21.1.0.ebuild
index af6e46af4529..00fc8b0e151f 100644
--- a/llvm-core/clang-common/clang-common-21.1.0.ebuild
+++ b/llvm-core/clang-common/clang-common-21.1.0.ebuild
@@ -10,6 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-24 19:02 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-08-24 19:02 UTC (permalink / raw
  To: gentoo-commits

commit:     ba8477238b017f289073290fb01bc5e6c0942169
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 24 18:54:02 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 24 19:02:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba847723

llvm-core/clang-common: Stabilize 20.1.8 amd64, #960372

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.8.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.8.ebuild b/llvm-core/clang-common/clang-common-20.1.8.ebuild
index bdc027440963..4b109f3c428b 100644
--- a/llvm-core/clang-common/clang-common-20.1.8.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.8.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 arm arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-24 18:51 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-08-24 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b579561b463c5d847fe5eefeb560c057c1c46708
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 24 18:50:23 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 24 18:50:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b579561b

llvm-core/clang-common: Stabilize 20.1.8 arm64, #960372

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.8.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.8.ebuild b/llvm-core/clang-common/clang-common-20.1.8.ebuild
index 782cd33ee715..bdc027440963 100644
--- a/llvm-core/clang-common/clang-common-20.1.8.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.8.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="~amd64 arm arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-24 18:51 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-08-24 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b21bb235f45c6b7ac99732df4d3fd53dcea81c16
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 24 18:50:12 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 24 18:50:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b21bb235

llvm-core/clang-common: Stabilize 20.1.8 arm, #960372

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.8.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.8.ebuild b/llvm-core/clang-common/clang-common-20.1.8.ebuild
index 8aac6c904992..782cd33ee715 100644
--- a/llvm-core/clang-common/clang-common-20.1.8.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.8.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="~amd64 arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-21  8:22 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-21  8:22 UTC (permalink / raw
  To: gentoo-commits

commit:     051c1f291bcd09ca5441da7e3066dc173a0cb4e0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 21 08:20:03 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 21 08:20:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=051c1f29

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 .../clang-common/clang-common-21.1.0_rc2.ebuild    | 314 ---------------------
 .../clang-common-22.0.0_pre20250726.ebuild         | 314 ---------------------
 .../clang-common-22.0.0_pre20250802.ebuild         | 314 ---------------------
 .../clang-common-22.0.0_pre20250809.ebuild         | 314 ---------------------
 5 files changed, 1261 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index c4708ba2bfd9..056de9245d7f 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,16 +8,11 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-190fcc28af585cb06480b026afd14ed87b18adb8.tar.gz 243483242 BLAKE2B f53d743ca332dfffe1f98d51f0528e14b61e4c11904ec20c4b4c9b285f8ca7eb25eb2ce8549e21566e63ab393697c74acd4a41fddc7bab282535aa8ccf9195da SHA512 b6bcf8647f35fee209fbd8a8c297f7d89f1aac9cac4e3c62abd73171350c4c7a98572ccd175ca0a8fce8d2fe00bf5cfbeea329689b687ab6261586e894397150
 DIST llvm-project-1c7720ef78dc5eb9196d6c178afe03b60f201b78.tar.gz 245239122 BLAKE2B 74342ef3a8105915201f6260aa8c633ccd67821894d33605d82ca0f02d0d0766fe3198e834c4c5cae8123d911b5a20849c04ea02aea52f57f8d1a09e17c18199 SHA512 10a63bdf7d790c5964274414dc01b480a976318f27b5807ca47d9149b97106530264a75930c689ca7cc417de3df44142280cd92559ff7873190f1045d79e7856
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 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.0-rc2.src.tar.xz 158947868 BLAKE2B 8de20b0bf5219de12240561c3049de09a3253e1ebe33f84533d3f1f2ee9794b09fe2b6aca0b2fb15542b37b901be7bd3e00306cfd266ab59e2703046bcbcaf3d SHA512 0599cbe3d11d9135c355d5c60fdfda98a9689768f41baba0b8981769cc836eba8d226364d601031413c5f43ae1c4dda080ab910d60c983367b438fa32903d173
-DIST llvm-project-21.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 7090c7a98e01e7bf600e4fbb23ad28d2e3bd8e72938863b59c7be8be0de2e1b3e3e2a981955165b833a95992ee086fd525919af7bcd7761073800486b3be3363 SHA512 dbe6cdd544b84d18b51f187e612de8ec05eeb9f1b462b7c4921697aaf6c6b0a00a6f4d3cf320a61cf57a886f11d47049bb5fa817f8bf835991a01b5e4a2d8c0a
 DIST llvm-project-21.1.0-rc3.src.tar.xz 158924056 BLAKE2B 5f3f46a499120c810a944361468cdea64cc29fa41a1c1f4549b1a845e6a36c891cd4af0a9fafda00663f73de61ef2658bf0640b68020cdebb7cb8446ba1cbf09 SHA512 3b84b2c9d8b164983890f797301591b5e20a54adc035b196db9a7f6a19e6ac13fe24d1c7816fe62ac87f853e5b4b9decf177046c43caed8e62ab8e8df574a2ef
 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-core/clang-common/clang-common-21.1.0_rc2.ebuild b/llvm-core/clang-common/clang-common-21.1.0_rc2.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.1.0_rc2.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-21  8:18 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-21  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     04ed5eb8a6ababec2310bac0970f484956ca696f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 21 08:12:47 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 21 08:13:34 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04ed5eb8

llvm-core/clang-common: Add 22.0.0_pre20250820 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250820.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index c91e92b1bccb..c4708ba2bfd9 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -20,3 +20,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-core/clang-common/clang-common-22.0.0_pre20250820.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250820.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250820.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-16 13:51 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-16 13:51 UTC (permalink / raw
  To: gentoo-commits

commit:     e3351a839a5a6e379054888bed8bb5b5d91b3107
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 16 13:04:58 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug 16 13:50:43 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3351a83

llvm-core/clang-common: Add 22.0.0_pre20250815 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250815.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 1ffefab8f9a6..c91e92b1bccb 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -9,6 +9,7 @@ DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b8577
 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-190fcc28af585cb06480b026afd14ed87b18adb8.tar.gz 243483242 BLAKE2B f53d743ca332dfffe1f98d51f0528e14b61e4c11904ec20c4b4c9b285f8ca7eb25eb2ce8549e21566e63ab393697c74acd4a41fddc7bab282535aa8ccf9195da SHA512 b6bcf8647f35fee209fbd8a8c297f7d89f1aac9cac4e3c62abd73171350c4c7a98572ccd175ca0a8fce8d2fe00bf5cfbeea329689b687ab6261586e894397150
+DIST llvm-project-1c7720ef78dc5eb9196d6c178afe03b60f201b78.tar.gz 245239122 BLAKE2B 74342ef3a8105915201f6260aa8c633ccd67821894d33605d82ca0f02d0d0766fe3198e834c4c5cae8123d911b5a20849c04ea02aea52f57f8d1a09e17c18199 SHA512 10a63bdf7d790c5964274414dc01b480a976318f27b5807ca47d9149b97106530264a75930c689ca7cc417de3df44142280cd92559ff7873190f1045d79e7856
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b912ade3191c5d77f3979d5a80d5f6ce52f56a7d1c448bd257398390bf10838f02faa6f3ece37a7327cced69d165ec2e2e699316 SHA512 f330e72e6a1da468569049437cc0ba7a41abb816ccece7367189344f7ebfef730f4788ac7af2bef0aa8a49341c15ab1d31e941ffa782f264d11fe0dc05470773

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250815.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250815.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250815.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-12 17:09 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-12 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     3b5659c128897b4f551de3318b7a175a2adfdc07
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 12:23:09 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 12 17:08:47 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b5659c1

llvm-core/clang-common: Add 21.1.0_rc3

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-21.1.0_rc3.ebuild    | 314 +++++++++++++++++++++
 2 files changed, 316 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 142d02c620ca..1ffefab8f9a6 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,5 +15,7 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0-rc2.src.tar.xz 158947868 BLAKE2B 8de20b0bf5219de12240561c3049de09a3253e1ebe33f84533d3f1f2ee9794b09fe2b6aca0b2fb15542b37b901be7bd3e00306cfd266ab59e2703046bcbcaf3d SHA512 0599cbe3d11d9135c355d5c60fdfda98a9689768f41baba0b8981769cc836eba8d226364d601031413c5f43ae1c4dda080ab910d60c983367b438fa32903d173
 DIST llvm-project-21.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 7090c7a98e01e7bf600e4fbb23ad28d2e3bd8e72938863b59c7be8be0de2e1b3e3e2a981955165b833a95992ee086fd525919af7bcd7761073800486b3be3363 SHA512 dbe6cdd544b84d18b51f187e612de8ec05eeb9f1b462b7c4921697aaf6c6b0a00a6f4d3cf320a61cf57a886f11d47049bb5fa817f8bf835991a01b5e4a2d8c0a
+DIST llvm-project-21.1.0-rc3.src.tar.xz 158924056 BLAKE2B 5f3f46a499120c810a944361468cdea64cc29fa41a1c1f4549b1a845e6a36c891cd4af0a9fafda00663f73de61ef2658bf0640b68020cdebb7cb8446ba1cbf09 SHA512 3b84b2c9d8b164983890f797301591b5e20a54adc035b196db9a7f6a19e6ac13fe24d1c7816fe62ac87f853e5b4b9decf177046c43caed8e62ab8e8df574a2ef
+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

diff --git a/llvm-core/clang-common/clang-common-21.1.0_rc3.ebuild b/llvm-core/clang-common/clang-common-21.1.0_rc3.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.0_rc3.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-09  9:47 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-09  9:47 UTC (permalink / raw
  To: gentoo-commits

commit:     14642797312271c57b99182ccb8741d323e3909b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  9 09:45:11 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug  9 09:46:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14642797

llvm-core/clang-common: Add 22.0.0_pre20250809 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250809.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d2a2ae32e592..142d02c620ca 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,4 +15,5 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0-rc2.src.tar.xz 158947868 BLAKE2B 8de20b0bf5219de12240561c3049de09a3253e1ebe33f84533d3f1f2ee9794b09fe2b6aca0b2fb15542b37b901be7bd3e00306cfd266ab59e2703046bcbcaf3d SHA512 0599cbe3d11d9135c355d5c60fdfda98a9689768f41baba0b8981769cc836eba8d226364d601031413c5f43ae1c4dda080ab910d60c983367b438fa32903d173
 DIST llvm-project-21.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 7090c7a98e01e7bf600e4fbb23ad28d2e3bd8e72938863b59c7be8be0de2e1b3e3e2a981955165b833a95992ee086fd525919af7bcd7761073800486b3be3363 SHA512 dbe6cdd544b84d18b51f187e612de8ec05eeb9f1b462b7c4921697aaf6c6b0a00a6f4d3cf320a61cf57a886f11d47049bb5fa817f8bf835991a01b5e4a2d8c0a
+DIST llvm-project-92164faf17d553359418b9f49c1a41d680d0de49.tar.gz 245033829 BLAKE2B 7bf707e6455259417864a40c53beba4c4a9f6e4cf983671075016b95e537d2c249f97444089734718b5f2c989a2614028bd22142ccadae9c382e66b28758ecab SHA512 bf4105173144e6bb9cdc99ae67b7350228b37eae248c15aae2ce29877a8ee4cb76781a6beff366961fa366d31683b43421d684d019e25f0280735ccd6c22a432
 DIST llvm-project-b075dadbd3e0e928bdeddb3d36af64e8a383e305.tar.gz 244584834 BLAKE2B e6924d5fcc90431bdf859c3d728e44c348fa8ec336967c95fa9d253519c7bf9b3b200048ff8910eea78e5481a11704330ad72960fe753930036f75bca5b163b7 SHA512 80232cd00a2981392cf9fb22daceb164f965d5d5c9edb431226713a5e2f75ba5aaf747329ae5f4b852fd5e7f0be62ad978529080b4dce1bac7af480905b61c3b

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250809.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-08-02 10:29 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-08-02 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     822a9334137e6ca001504ea5f69937b98b58ecbb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  2 10:25:21 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug  2 10:28:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=822a9334

llvm-core/clang-common: Add 22.0.0_pre20250802 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250802.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 6fd004d834dd..d2a2ae32e592 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,3 +15,4 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0-rc2.src.tar.xz 158947868 BLAKE2B 8de20b0bf5219de12240561c3049de09a3253e1ebe33f84533d3f1f2ee9794b09fe2b6aca0b2fb15542b37b901be7bd3e00306cfd266ab59e2703046bcbcaf3d SHA512 0599cbe3d11d9135c355d5c60fdfda98a9689768f41baba0b8981769cc836eba8d226364d601031413c5f43ae1c4dda080ab910d60c983367b438fa32903d173
 DIST llvm-project-21.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 7090c7a98e01e7bf600e4fbb23ad28d2e3bd8e72938863b59c7be8be0de2e1b3e3e2a981955165b833a95992ee086fd525919af7bcd7761073800486b3be3363 SHA512 dbe6cdd544b84d18b51f187e612de8ec05eeb9f1b462b7c4921697aaf6c6b0a00a6f4d3cf320a61cf57a886f11d47049bb5fa817f8bf835991a01b5e4a2d8c0a
+DIST llvm-project-b075dadbd3e0e928bdeddb3d36af64e8a383e305.tar.gz 244584834 BLAKE2B e6924d5fcc90431bdf859c3d728e44c348fa8ec336967c95fa9d253519c7bf9b3b200048ff8910eea78e5481a11704330ad72960fe753930036f75bca5b163b7 SHA512 80232cd00a2981392cf9fb22daceb164f965d5d5c9edb431226713a5e2f75ba5aaf747329ae5f4b852fd5e7f0be62ad978529080b4dce1bac7af480905b61c3b

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250802.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-29 19:04 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-29 19:04 UTC (permalink / raw
  To: gentoo-commits

commit:     c5cdf098220e6a426b35d1916f33a495bf51ad33
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 29 15:40:54 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul 29 19:03:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5cdf098

llvm-core/clang-common: Add 21.1.0_rc2

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-21.1.0_rc2.ebuild    | 314 +++++++++++++++++++++
 2 files changed, 316 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 3d6f3bbda1c0..68c91603377c 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,4 +15,6 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0-rc1.src.tar.xz 158955624 BLAKE2B 6a33d48f41f92cd8731011678afdf4c6f6a4581af04483626c511d1c9410d62788eb660e05cdfe418085509b576c29eec5bb07ae7ddc993e9931287657c11e03 SHA512 7ab3d1bb49bd3c5c9c1490cd865fdef027c25d64bb7f6a2a16c11c311670d08b7a214323ae4781aa0f49973deb0039ebea9d04887089df8dedf65080acdfc871
 DIST llvm-project-21.1.0-rc1.src.tar.xz.sig 438 BLAKE2B d3736b7f4bb6133e542fb3f52d1b76acc2920558e61bbbeeec6e5b7639ca54e229803b27baa4aedd2134c11fb4439064ac36e90c8c1831a503dd1754efee8da6 SHA512 6b9565f270fae4e534a160916bbd01ccd0e1295bf17df13f3be05bed4f058c0e935ba7385aba74a195d3a13868d81f2a0cf4be966b216fc6d7b56002f33eb4a0
+DIST llvm-project-21.1.0-rc2.src.tar.xz 158947868 BLAKE2B 8de20b0bf5219de12240561c3049de09a3253e1ebe33f84533d3f1f2ee9794b09fe2b6aca0b2fb15542b37b901be7bd3e00306cfd266ab59e2703046bcbcaf3d SHA512 0599cbe3d11d9135c355d5c60fdfda98a9689768f41baba0b8981769cc836eba8d226364d601031413c5f43ae1c4dda080ab910d60c983367b438fa32903d173
+DIST llvm-project-21.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 7090c7a98e01e7bf600e4fbb23ad28d2e3bd8e72938863b59c7be8be0de2e1b3e3e2a981955165b833a95992ee086fd525919af7bcd7761073800486b3be3363 SHA512 dbe6cdd544b84d18b51f187e612de8ec05eeb9f1b462b7c4921697aaf6c6b0a00a6f4d3cf320a61cf57a886f11d47049bb5fa817f8bf835991a01b5e4a2d8c0a
 DIST llvm-project-b956f049b186fafafebc88b861982644ec3f5291.tar.gz 243231046 BLAKE2B 473de217c29f168101976e0cd8b17f22c4a310c7f5bc7f8301a63d3abe1295fe75819178ff23bc22a475753cba097ef69042b0d40d1d9e3baef159aa9f8bea93 SHA512 0fb567ad5ea357c4aacfda4c256e78098017492a14998a409d4d5f5625384810a108420589ac22e700050fdd695bea870e64d18e7a6c8e8836a581aba263d40a

diff --git a/llvm-core/clang-common/clang-common-21.1.0_rc2.ebuild b/llvm-core/clang-common/clang-common-21.1.0_rc2.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.0_rc2.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-26 19:53 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-26 19:53 UTC (permalink / raw
  To: gentoo-commits

commit:     cb85654de88b96fc58c1b9df91724ecf44b6e0bf
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 26 19:22:09 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 26 19:22:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb85654d

llvm-core/clang-common: Add 22.0.0_pre20250726 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-22.0.0_pre20250726.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d273b27cf65a..3d6f3bbda1c0 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,6 +8,7 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-190fcc28af585cb06480b026afd14ed87b18adb8.tar.gz 243483242 BLAKE2B f53d743ca332dfffe1f98d51f0528e14b61e4c11904ec20c4b4c9b285f8ca7eb25eb2ce8549e21566e63ab393697c74acd4a41fddc7bab282535aa8ccf9195da SHA512 b6bcf8647f35fee209fbd8a8c297f7d89f1aac9cac4e3c62abd73171350c4c7a98572ccd175ca0a8fce8d2fe00bf5cfbeea329689b687ab6261586e894397150
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b912ade3191c5d77f3979d5a80d5f6ce52f56a7d1c448bd257398390bf10838f02faa6f3ece37a7327cced69d165ec2e2e699316 SHA512 f330e72e6a1da468569049437cc0ba7a41abb816ccece7367189344f7ebfef730f4788ac7af2bef0aa8a49341c15ab1d31e941ffa782f264d11fe0dc05470773

diff --git a/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild b/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-22.0.0_pre20250726.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-22  9:20 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-22  9:20 UTC (permalink / raw
  To: gentoo-commits

commit:     65ac75c0adbb3333fabcdbfde0dfeb48ff24610f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 22 09:15:26 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul 22 09:15:26 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65ac75c0

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   1 -
 .../clang-common-21.0.0_pre20250713.ebuild         | 314 ---------------------
 2 files changed, 315 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index c0966f6e1820..d273b27cf65a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -14,5 +14,4 @@ DIST llvm-project-20.1.8.src.tar.xz 147242952 BLAKE2B 7657ac0b26acc5affb1bfc91b9
 DIST llvm-project-20.1.8.src.tar.xz.sig 566 BLAKE2B 85beedfcff1195a974fab2c667b9efd4b715b3480c1b44b1b887fe32c69f72aca0d3b8fb276c03b6cc5a866622f669047aeee5ccb976640b4008ccd31dce77a4 SHA512 d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619
 DIST llvm-project-21.1.0-rc1.src.tar.xz 158955624 BLAKE2B 6a33d48f41f92cd8731011678afdf4c6f6a4581af04483626c511d1c9410d62788eb660e05cdfe418085509b576c29eec5bb07ae7ddc993e9931287657c11e03 SHA512 7ab3d1bb49bd3c5c9c1490cd865fdef027c25d64bb7f6a2a16c11c311670d08b7a214323ae4781aa0f49973deb0039ebea9d04887089df8dedf65080acdfc871
 DIST llvm-project-21.1.0-rc1.src.tar.xz.sig 438 BLAKE2B d3736b7f4bb6133e542fb3f52d1b76acc2920558e61bbbeeec6e5b7639ca54e229803b27baa4aedd2134c11fb4439064ac36e90c8c1831a503dd1754efee8da6 SHA512 6b9565f270fae4e534a160916bbd01ccd0e1295bf17df13f3be05bed4f058c0e935ba7385aba74a195d3a13868d81f2a0cf4be966b216fc6d7b56002f33eb4a0
-DIST llvm-project-b6313b381ac0e83012ea11b4549cd8cb39b686d2.tar.gz 242588863 BLAKE2B 81e7db20b849ce7a5c7c6b03d1e62a2e225eb68473509baf0adc9e74a2f759d251b61b018528d5db93f77b65ac355a71ede81bec7e97f9c71a41f34a5d8625bd SHA512 258b99ef79d7efd4ec58d6a5370969b8032149f05fea4dfa841398ed59a550219f4223cd79581bc6fc4428dd9b09f44abf9f5369348831f463b9eb401a614d61
 DIST llvm-project-b956f049b186fafafebc88b861982644ec3f5291.tar.gz 243231046 BLAKE2B 473de217c29f168101976e0cd8b17f22c4a310c7f5bc7f8301a63d3abe1295fe75819178ff23bc22a475753cba097ef69042b0d40d1d9e3baef159aa9f8bea93 SHA512 0fb567ad5ea357c4aacfda4c256e78098017492a14998a409d4d5f5625384810a108420589ac22e700050fdd695bea870e64d18e7a6c8e8836a581aba263d40a

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250713.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250713.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250713.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-20 14:15 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-20 14:15 UTC (permalink / raw
  To: gentoo-commits

commit:     de30ae6cd4761099dd808330c0efd330dfb54cd2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 19 17:54:50 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 20 14:14:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de30ae6c

llvm-core/clang-common: Bump to 21.1.0_rc1

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-21.1.0_rc1.ebuild    | 314 +++++++++++++++++++++
 2 files changed, 316 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index aaf62b13972c..c236d706a884 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,4 +12,6 @@ DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 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.0-rc1.src.tar.xz 158955624 BLAKE2B 6a33d48f41f92cd8731011678afdf4c6f6a4581af04483626c511d1c9410d62788eb660e05cdfe418085509b576c29eec5bb07ae7ddc993e9931287657c11e03 SHA512 7ab3d1bb49bd3c5c9c1490cd865fdef027c25d64bb7f6a2a16c11c311670d08b7a214323ae4781aa0f49973deb0039ebea9d04887089df8dedf65080acdfc871
+DIST llvm-project-21.1.0-rc1.src.tar.xz.sig 438 BLAKE2B d3736b7f4bb6133e542fb3f52d1b76acc2920558e61bbbeeec6e5b7639ca54e229803b27baa4aedd2134c11fb4439064ac36e90c8c1831a503dd1754efee8da6 SHA512 6b9565f270fae4e534a160916bbd01ccd0e1295bf17df13f3be05bed4f058c0e935ba7385aba74a195d3a13868d81f2a0cf4be966b216fc6d7b56002f33eb4a0
 DIST llvm-project-b6313b381ac0e83012ea11b4549cd8cb39b686d2.tar.gz 242588863 BLAKE2B 81e7db20b849ce7a5c7c6b03d1e62a2e225eb68473509baf0adc9e74a2f759d251b61b018528d5db93f77b65ac355a71ede81bec7e97f9c71a41f34a5d8625bd SHA512 258b99ef79d7efd4ec58d6a5370969b8032149f05fea4dfa841398ed59a550219f4223cd79581bc6fc4428dd9b09f44abf9f5369348831f463b9eb401a614d61

diff --git a/llvm-core/clang-common/clang-common-21.1.0_rc1.ebuild b/llvm-core/clang-common/clang-common-21.1.0_rc1.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.1.0_rc1.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-20  8:24 Sam James
  0 siblings, 0 replies; 97+ messages in thread
From: Sam James @ 2025-07-20  8:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ed3960f9a85ec2285a3a4481af1a43f0dbfe2ebb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 20 08:23:14 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 20 08:23:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed3960f9

llvm-core/clang-common: Stabilize 20.1.8 x86, #960372

Signed-off-by: Sam James <sam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.8.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.8.ebuild b/llvm-core/clang-common/clang-common-20.1.8.ebuild
index 00fc8b0e151f..8aac6c904992 100644
--- a/llvm-core/clang-common/clang-common-20.1.8.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.8.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-19  6:50 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-19  6:50 UTC (permalink / raw
  To: gentoo-commits

commit:     e6ddf13f94744de69c7761daf419de59b6853caa
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 19 06:44:36 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 19 06:44:36 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6ddf13f

llvm-core/clang-common: 21.x live is now 21.1.0.9999

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

 .../{clang-common-21.0.0.9999.ebuild => clang-common-21.1.0.9999.ebuild}  | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-21.1.0.9999.ebuild
similarity index 100%
rename from llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
rename to llvm-core/clang-common/clang-common-21.1.0.9999.ebuild


^ permalink raw reply	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-13 20:03 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-13 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f7175418baa7cf7941ae2f2d187873087dc4dc23
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 13 19:58:50 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 13 20:03:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7175418

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   1 -
 .../clang-common-21.0.0_pre20250614.ebuild         | 314 ---------------------
 2 files changed, 315 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 49307d520668..9d354e4a17a9 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,6 +12,5 @@ DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 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-814ac2e3735e52c1162ac495c24158e0ac256520.tar.gz 237400805 BLAKE2B 59cbf2f7f5c3c1c2c187c72a40b94b05b2d3286678f78764bc7555d75ead40d2fd60b1807bbe6470f012a5958d0466b1f6b2bc842bba36731e7697a79307532b SHA512 63f31f28b7f01b840d88bfa3ffc4107ccffc623b26c7d0dc3e720a864ce7ca907dcbdcfaec7e31a1711220528a89175334518711a83824c82389343c2e4008d7
 DIST llvm-project-b6313b381ac0e83012ea11b4549cd8cb39b686d2.tar.gz 242588863 BLAKE2B 81e7db20b849ce7a5c7c6b03d1e62a2e225eb68473509baf0adc9e74a2f759d251b61b018528d5db93f77b65ac355a71ede81bec7e97f9c71a41f34a5d8625bd SHA512 258b99ef79d7efd4ec58d6a5370969b8032149f05fea4dfa841398ed59a550219f4223cd79581bc6fc4428dd9b09f44abf9f5369348831f463b9eb401a614d61
 DIST llvm-project-e34e02128ec5eb89e36a8f0f7307dcbcfecabbee.tar.gz 238210997 BLAKE2B 80ce4689e3c71a413e36645cdc83590f3492ac3ee39b8bf8844ec50d0b68f40da4c19a7f284625e3550eb78a90d433e74092b5639bcebadf0e0220c36b111cb3 SHA512 5c1ab21b242d1ba62172ae6268a126fd1b049f85b039434b4ff28b0411ec60d46e96e05560b9b85d0420494afdd573b4043999cb34ace508a48f763d4eb5b7aa

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250614.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250614.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250614.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-07-09 18:49 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-07-09 18:49 UTC (permalink / raw
  To: gentoo-commits

commit:     9ff2e6cd9b0802ef9fd125f940e3856b8745a037
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  9 14:39:26 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul  9 18:48:47 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ff2e6cd

llvm-core/clang-common: Bump to 20.1.8

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.8.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 7fb7391ae996..f2016a7cf308 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,7 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
+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-814ac2e3735e52c1162ac495c24158e0ac256520.tar.gz 237400805 BLAKE2B 59cbf2f7f5c3c1c2c187c72a40b94b05b2d3286678f78764bc7555d75ead40d2fd60b1807bbe6470f012a5958d0466b1f6b2bc842bba36731e7697a79307532b SHA512 63f31f28b7f01b840d88bfa3ffc4107ccffc623b26c7d0dc3e720a864ce7ca907dcbdcfaec7e31a1711220528a89175334518711a83824c82389343c2e4008d7
 DIST llvm-project-e34e02128ec5eb89e36a8f0f7307dcbcfecabbee.tar.gz 238210997 BLAKE2B 80ce4689e3c71a413e36645cdc83590f3492ac3ee39b8bf8844ec50d0b68f40da4c19a7f284625e3550eb78a90d433e74092b5639bcebadf0e0220c36b111cb3 SHA512 5c1ab21b242d1ba62172ae6268a126fd1b049f85b039434b4ff28b0411ec60d46e96e05560b9b85d0420494afdd573b4043999cb34ace508a48f763d4eb5b7aa

diff --git a/llvm-core/clang-common/clang-common-20.1.8.ebuild b/llvm-core/clang-common/clang-common-20.1.8.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.8.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-28 15:03 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-06-28 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     3cade73dc017b0cb7305fd71f79212de7c3c4d13
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 28 15:00:47 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 15:00:47 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cade73d

llvm-core/clang-common: Add 21.0.0_pre20250628 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250628.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 8b161c59327a..7fb7391ae996 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 DIST llvm-project-814ac2e3735e52c1162ac495c24158e0ac256520.tar.gz 237400805 BLAKE2B 59cbf2f7f5c3c1c2c187c72a40b94b05b2d3286678f78764bc7555d75ead40d2fd60b1807bbe6470f012a5958d0466b1f6b2bc842bba36731e7697a79307532b SHA512 63f31f28b7f01b840d88bfa3ffc4107ccffc623b26c7d0dc3e720a864ce7ca907dcbdcfaec7e31a1711220528a89175334518711a83824c82389343c2e4008d7
+DIST llvm-project-e34e02128ec5eb89e36a8f0f7307dcbcfecabbee.tar.gz 238210997 BLAKE2B 80ce4689e3c71a413e36645cdc83590f3492ac3ee39b8bf8844ec50d0b68f40da4c19a7f284625e3550eb78a90d433e74092b5639bcebadf0e0220c36b111cb3 SHA512 5c1ab21b242d1ba62172ae6268a126fd1b049f85b039434b4ff28b0411ec60d46e96e05560b9b85d0420494afdd573b4043999cb34ace508a48f763d4eb5b7aa

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250628.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250628.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250628.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-28 14:55 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-06-28 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     aa96808333b74c540e5d83799465b3c844a539a3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 28 14:53:11 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 14:54:57 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa968083

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   1 -
 .../clang-common-21.0.0_pre20250607.ebuild         | 314 ---------------------
 2 files changed, 315 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 6651246b5d52..8b161c59327a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,4 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
 DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
-DIST llvm-project-23d0c7348aacdfcb145a69e533a14131bae830cc.tar.gz 237123683 BLAKE2B 6713c82809a9793510615f54c3ad9b8b1d2449939b0c48ab10acd1a0db43b712b229356173c90b514bc91c08e9b2be7f8e54f797661b9743ae8c3aaa9acee15f SHA512 de94ab38f1d46124638d6e0650142a1612db27871ffa339c56224aba94a77f8ae6eb8c68ad0a5ed3fe000d7bff309d324cdb66a095be3c8211abfe600659bf1a
 DIST llvm-project-814ac2e3735e52c1162ac495c24158e0ac256520.tar.gz 237400805 BLAKE2B 59cbf2f7f5c3c1c2c187c72a40b94b05b2d3286678f78764bc7555d75ead40d2fd60b1807bbe6470f012a5958d0466b1f6b2bc842bba36731e7697a79307532b SHA512 63f31f28b7f01b840d88bfa3ffc4107ccffc623b26c7d0dc3e720a864ce7ca907dcbdcfaec7e31a1711220528a89175334518711a83824c82389343c2e4008d7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-14 14:24 Sam James
  0 siblings, 0 replies; 97+ messages in thread
From: Sam James @ 2025-06-14 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e991d29071afcbc1c9219ba26aa23ab575fd73ad
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 14:21:53 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 14:23:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e991d290

llvm-core/clang-common: Stabilize 20.1.7 x86, #958081

Signed-off-by: Sam James <sam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.7.ebuild b/llvm-core/clang-common/clang-common-20.1.7.ebuild
index 6505aa4bc457..b2b38d2721f7 100644
--- a/llvm-core/clang-common/clang-common-20.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-14 11:02 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-06-14 11:02 UTC (permalink / raw
  To: gentoo-commits

commit:     ff63028ce16e1576301a93a68d4bebe1ea27fd79
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 11:01:49 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 11:01:49 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff63028c

llvm-core/clang-common: Stabilize 20.1.7 arm64, #958081

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-20.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.7.ebuild b/llvm-core/clang-common/clang-common-20.1.7.ebuild
index 00fc8b0e151f..94bf687ed135 100644
--- a/llvm-core/clang-common/clang-common-20.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="~amd64 ~arm arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-14  7:15 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-06-14  7:15 UTC (permalink / raw
  To: gentoo-commits

commit:     94f028c4e69b26183f70875e95edfb6b1b251dfb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 03:37:33 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 07:15:32 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94f028c4

llvm-core/clang-common: Bump to 20.1.7

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.7.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 1024f7cb7e03..8dd0e990625e 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,7 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.6.src.tar.xz 147239668 BLAKE2B ccd86730fdea3dd40ebf054661b854b9332204389db2205e1e7b2a7f140fc187cacb34de68aa9a63c15c1e17b1d0976c080cfdee7e2cb6b0dd5570001d84be12 SHA512 aae652fdc61bda3f80b1340a3270b687355bfb6817f4bc05dac2268a2f8c5fc677eadb515cda7c8518005f1dc39e7ce5d1c34bbc5a25f106ef8e6c8f1ecfdf6d
 DIST llvm-project-20.1.6.src.tar.xz.sig 566 BLAKE2B b7c48cfc1f6c9f513dadb8837b150e22043c215bf4958a8036c4077aeebdcf7c18223b0ce0ffbcacb2c7ddfeb06611b1022528ee04d3efda1ee1aa58367a9203 SHA512 0884048ff164a1f5caed0f1aabec173630a08ece98cf793d21b77fc969501e4f03daec39ae0fb124ad34a3436ceae66452e36a42c309f19790b7a87652482691
+DIST llvm-project-20.1.7.src.tar.xz 147245448 BLAKE2B f7c57d1eba4e97e875b624dec3fb1b261a0203de7200366de5b3edcfbca2a170c41df46e91cd9cb78ae2af66120aef95334f5eb9628a1489e921c6bdf4cccfe8 SHA512 c2dbf6a468a8152409db7ff52902ecf8768a1d0328e386999f4f3672613903e1c10bddbba66b8553a6222952f8edb66266947f1fb21d0b09ae741e6249b6d1fa
+DIST llvm-project-20.1.7.src.tar.xz.sig 566 BLAKE2B 72ce2a18c211cfce9581a9e3e71f1c55cf18672aa355267581220e1a89e3327f9e16107970b69bb8f10f390baa5e286487bdc4cc0a7d9155ec13a4977cd3f472 SHA512 eff885059d547f57b98bda1fc9631f716ca6c650cd48203d9ed5443a6afb9a2d4d91d3f5c8618e307c0a44b3040bce61fdc6bce965073adc537655755d9f2112
 DIST llvm-project-23d0c7348aacdfcb145a69e533a14131bae830cc.tar.gz 237123683 BLAKE2B 6713c82809a9793510615f54c3ad9b8b1d2449939b0c48ab10acd1a0db43b712b229356173c90b514bc91c08e9b2be7f8e54f797661b9743ae8c3aaa9acee15f SHA512 de94ab38f1d46124638d6e0650142a1612db27871ffa339c56224aba94a77f8ae6eb8c68ad0a5ed3fe000d7bff309d324cdb66a095be3c8211abfe600659bf1a
 DIST llvm-project-f8ca9e59cb438bd35b29a6d7cf6d72f50673aec9.tar.gz 236069626 BLAKE2B 5547770a22e5fd0240c0e435d0b0af0ebd789aa72d6829250917f2df605f9a95c6756bc1afc9b611b176c1ba8394c757b94789511b98b38c6ade6cca4c9ce7f6 SHA512 b1fffd7d4f5ede9bcda759bc59cdd47373a44a3bbd31a50d1d213e438a59f1da3cc96780a1d17ecaeb14454822921476406a6c37493354169f72e1fab7b3a3be

diff --git a/llvm-core/clang-common/clang-common-20.1.7.ebuild b/llvm-core/clang-common/clang-common-20.1.7.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.7.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-06-07 18:05 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-06-07 18:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b02fe27835dc728bcc623d76aa674b0332e783bc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  7 17:36:33 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun  7 18:05:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b02fe278

llvm-core/clang-common: Add 21.0.0_pre20250607 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250607.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 6d49608c307a..1024f7cb7e03 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,4 +10,5 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.6.src.tar.xz 147239668 BLAKE2B ccd86730fdea3dd40ebf054661b854b9332204389db2205e1e7b2a7f140fc187cacb34de68aa9a63c15c1e17b1d0976c080cfdee7e2cb6b0dd5570001d84be12 SHA512 aae652fdc61bda3f80b1340a3270b687355bfb6817f4bc05dac2268a2f8c5fc677eadb515cda7c8518005f1dc39e7ce5d1c34bbc5a25f106ef8e6c8f1ecfdf6d
 DIST llvm-project-20.1.6.src.tar.xz.sig 566 BLAKE2B b7c48cfc1f6c9f513dadb8837b150e22043c215bf4958a8036c4077aeebdcf7c18223b0ce0ffbcacb2c7ddfeb06611b1022528ee04d3efda1ee1aa58367a9203 SHA512 0884048ff164a1f5caed0f1aabec173630a08ece98cf793d21b77fc969501e4f03daec39ae0fb124ad34a3436ceae66452e36a42c309f19790b7a87652482691
+DIST llvm-project-23d0c7348aacdfcb145a69e533a14131bae830cc.tar.gz 237123683 BLAKE2B 6713c82809a9793510615f54c3ad9b8b1d2449939b0c48ab10acd1a0db43b712b229356173c90b514bc91c08e9b2be7f8e54f797661b9743ae8c3aaa9acee15f SHA512 de94ab38f1d46124638d6e0650142a1612db27871ffa339c56224aba94a77f8ae6eb8c68ad0a5ed3fe000d7bff309d324cdb66a095be3c8211abfe600659bf1a
 DIST llvm-project-f8ca9e59cb438bd35b29a6d7cf6d72f50673aec9.tar.gz 236069626 BLAKE2B 5547770a22e5fd0240c0e435d0b0af0ebd789aa72d6829250917f2df605f9a95c6756bc1afc9b611b176c1ba8394c757b94789511b98b38c6ade6cca4c9ce7f6 SHA512 b1fffd7d4f5ede9bcda759bc59cdd47373a44a3bbd31a50d1d213e438a59f1da3cc96780a1d17ecaeb14454822921476406a6c37493354169f72e1fab7b3a3be

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250607.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-28 11:54 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-28 11:54 UTC (permalink / raw
  To: gentoo-commits

commit:     28869d7418a6051cacb9f80ead66502256ffe90a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 10:52:48 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 28 11:53:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28869d74

llvm-core/clang-common: Add 21.0.0_pre20250528 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250528.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 99a255186b5b..956f8fc3437d 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
 DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
 DIST llvm-project-7dc7c155251c0008d5d59b84f0c9056365740f11.tar.gz 235921149 BLAKE2B 2867e313cd25fee6975da9bf65365fa51ed8780f3f8fc95983fb6e8f5b2c38c6d7f75a386b0ec2d74bafad74472973f4e4e603a5a0754465ac2b75942b8e90c6 SHA512 f8bc383ff2a1af836357150efa5728c7df3cd862f56ffaf12b5fc56ef631f1048276ff00b89fcf4d224576fa1eda9811d971886aae0855a4d29178060eb89a49
+DIST llvm-project-f8ca9e59cb438bd35b29a6d7cf6d72f50673aec9.tar.gz 236069626 BLAKE2B 5547770a22e5fd0240c0e435d0b0af0ebd789aa72d6829250917f2df605f9a95c6756bc1afc9b611b176c1ba8394c757b94789511b98b38c6ade6cca4c9ce7f6 SHA512 b1fffd7d4f5ede9bcda759bc59cdd47373a44a3bbd31a50d1d213e438a59f1da3cc96780a1d17ecaeb14454822921476406a6c37493354169f72e1fab7b3a3be

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250528.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250528.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250528.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-28 10:50 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-28 10:50 UTC (permalink / raw
  To: gentoo-commits

commit:     814c0f2ff4069c9799a1c141593d5f9bd24f0b17
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 10:48:31 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 28 10:48:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=814c0f2f

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   2 -
 .../clang-common-21.0.0_pre20250510.ebuild         | 314 ---------------------
 .../clang-common-21.0.0_pre20250517.ebuild         | 314 ---------------------
 3 files changed, 630 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 2fc5f4eff653..99a255186b5b 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,5 +11,3 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
 DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
 DIST llvm-project-7dc7c155251c0008d5d59b84f0c9056365740f11.tar.gz 235921149 BLAKE2B 2867e313cd25fee6975da9bf65365fa51ed8780f3f8fc95983fb6e8f5b2c38c6d7f75a386b0ec2d74bafad74472973f4e4e603a5a0754465ac2b75942b8e90c6 SHA512 f8bc383ff2a1af836357150efa5728c7df3cd862f56ffaf12b5fc56ef631f1048276ff00b89fcf4d224576fa1eda9811d971886aae0855a4d29178060eb89a49
-DIST llvm-project-aaaae99663dbb220c6c27fa9cacf93fcb8f20e7c.tar.gz 235477577 BLAKE2B 46a3b7863cdfde75045dfcab95f8c9eee21f8ce80cee700284bc174adbb4038f23bba3b15635c88c2723ed0d20e6fddcf43c92b9e540c885af48e81bfa8c82aa SHA512 bf8e7f28622f91da57698220fca592105d109c38801b5e0312f5e290bca1ae32ef393179cfe912c194dbf85ece9bd6ee63b587157b0fcd6007bbaff3324e77ed
-DIST llvm-project-fcb4bda9dcfcdb64d8b069e8416c75d7a1a62e52.tar.gz 233149231 BLAKE2B 95a7a012a1e747afcf83ace3785c8ef6a3e10f6075e59eb1c5b077cc9edae244b648f341bc0ac6a45b2afc8f7ffe130a90a741a04465523f30f8322566386703 SHA512 b46f0c90a1c56750cada24183ca382b267a2d2faa0db7d77a8bdd4e94e6303e57d565cf85447b3c0e0efdd3750efef1e10e8ce6f1fe8f1ae10ee31d25ddf3fb7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-24 11:56 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-24 11:56 UTC (permalink / raw
  To: gentoo-commits

commit:     daa67bb70df6be6c74e891a8e1482b4727a94463
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 24 10:56:36 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May 24 11:56:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=daa67bb7

llvm-core/clang-common: Add 21.0.0_pre20250523 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250523.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 54ce25c1212d..2fc5f4eff653 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,6 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
 DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
+DIST llvm-project-7dc7c155251c0008d5d59b84f0c9056365740f11.tar.gz 235921149 BLAKE2B 2867e313cd25fee6975da9bf65365fa51ed8780f3f8fc95983fb6e8f5b2c38c6d7f75a386b0ec2d74bafad74472973f4e4e603a5a0754465ac2b75942b8e90c6 SHA512 f8bc383ff2a1af836357150efa5728c7df3cd862f56ffaf12b5fc56ef631f1048276ff00b89fcf4d224576fa1eda9811d971886aae0855a4d29178060eb89a49
 DIST llvm-project-aaaae99663dbb220c6c27fa9cacf93fcb8f20e7c.tar.gz 235477577 BLAKE2B 46a3b7863cdfde75045dfcab95f8c9eee21f8ce80cee700284bc174adbb4038f23bba3b15635c88c2723ed0d20e6fddcf43c92b9e540c885af48e81bfa8c82aa SHA512 bf8e7f28622f91da57698220fca592105d109c38801b5e0312f5e290bca1ae32ef393179cfe912c194dbf85ece9bd6ee63b587157b0fcd6007bbaff3324e77ed
 DIST llvm-project-fcb4bda9dcfcdb64d8b069e8416c75d7a1a62e52.tar.gz 233149231 BLAKE2B 95a7a012a1e747afcf83ace3785c8ef6a3e10f6075e59eb1c5b077cc9edae244b648f341bc0ac6a45b2afc8f7ffe130a90a741a04465523f30f8322566386703 SHA512 b46f0c90a1c56750cada24183ca382b267a2d2faa0db7d77a8bdd4e94e6303e57d565cf85447b3c0e0efdd3750efef1e10e8ce6f1fe8f1ae10ee31d25ddf3fb7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250523.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250523.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250523.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-17 12:59 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-17 12:59 UTC (permalink / raw
  To: gentoo-commits

commit:     59c347c960c5ce3979557779420272067c524f0e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 17 12:50:19 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May 17 12:58:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59c347c9

llvm-core/clang-common: Add 21.0.0_pre20250517 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250517.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 78598c6880e7..54ce25c1212d 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,4 +10,5 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
 DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
+DIST llvm-project-aaaae99663dbb220c6c27fa9cacf93fcb8f20e7c.tar.gz 235477577 BLAKE2B 46a3b7863cdfde75045dfcab95f8c9eee21f8ce80cee700284bc174adbb4038f23bba3b15635c88c2723ed0d20e6fddcf43c92b9e540c885af48e81bfa8c82aa SHA512 bf8e7f28622f91da57698220fca592105d109c38801b5e0312f5e290bca1ae32ef393179cfe912c194dbf85ece9bd6ee63b587157b0fcd6007bbaff3324e77ed
 DIST llvm-project-fcb4bda9dcfcdb64d8b069e8416c75d7a1a62e52.tar.gz 233149231 BLAKE2B 95a7a012a1e747afcf83ace3785c8ef6a3e10f6075e59eb1c5b077cc9edae244b648f341bc0ac6a45b2afc8f7ffe130a90a741a04465523f30f8322566386703 SHA512 b46f0c90a1c56750cada24183ca382b267a2d2faa0db7d77a8bdd4e94e6303e57d565cf85447b3c0e0efdd3750efef1e10e8ce6f1fe8f1ae10ee31d25ddf3fb7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250517.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-17  5:31 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-17  5:31 UTC (permalink / raw
  To: gentoo-commits

commit:     6b311e44fa4b0571b7dc12e96711526a202f749f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 17 05:28:03 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May 17 05:28:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b311e44

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   7 -
 llvm-core/clang-common/clang-common-20.1.3.ebuild  | 315 ---------------------
 llvm-core/clang-common/clang-common-20.1.4.ebuild  | 315 ---------------------
 .../clang-common-21.0.0_pre20250420.ebuild         | 314 --------------------
 .../clang-common-21.0.0_pre20250426.ebuild         | 314 --------------------
 .../clang-common-21.0.0_pre20250503.ebuild         | 314 --------------------
 6 files changed, 1579 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index be35f33ecf9a..78598c6880e7 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,13 +8,6 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-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-20.1.4.src.tar.xz 147228104 BLAKE2B 756799d104f94931a6bdca182c4b23983aad9c7ea5acf77f2f5519540137a8dc9a4ec227293c6ba7ddc7fb0fa10cc92e65808f1c07f04bea34a304bb0e2df612 SHA512 acace8175a5468c7e84a89d1564e147e81fe92b6d910f22b058edf72094b27176677c06dbe141fccfbabdad77165f957bbf1ec8aff7bffc85f0757c0103f7e59
-DIST llvm-project-20.1.4.src.tar.xz.sig 566 BLAKE2B 1f0f057dedf938190554ca1a51d9837da9faa38851edb7fe6f305769f3048b5507b010cb81b97550a13c9141e03480009602ff092ddd65b42483b0f79c1523e8 SHA512 634414ea877724ebdeeabe3bb1079d78938aa05dba2243d5458cf211c35444124dc01fa73a593548290196f8c0e40e1e6a4a72571dba4b716b5781c656c6f9b2
 DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
 DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
-DIST llvm-project-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
-DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163
-DIST llvm-project-d1e38eab95b07b422194427474521623916bbf29.tar.gz 232705423 BLAKE2B bf5200c2223d8cdf7c34c84876d8cfeb9429cb6535ced226b1bf9ab468b6401fe3da8759f0fc1ab3112927304c5f74db29b18be60fa961ce99471caa2c6a1f33 SHA512 8fae137725ad4eb0f5bab73895c65b34d1e36ea039c9fb3978c908ecc6023094d84919b97dc405b86e2dd32f585d87b29cee02293c8156d10a8371b516ca5e7a
 DIST llvm-project-fcb4bda9dcfcdb64d8b069e8416c75d7a1a62e52.tar.gz 233149231 BLAKE2B 95a7a012a1e747afcf83ace3785c8ef6a3e10f6075e59eb1c5b077cc9edae244b648f341bc0ac6a45b2afc8f7ffe130a90a741a04465523f30f8322566386703 SHA512 b46f0c90a1c56750cada24183ca382b267a2d2faa0db7d77a8bdd4e94e6303e57d565cf85447b3c0e0efdd3750efef1e10e8ce6f1fe8f1ae10ee31d25ddf3fb7

diff --git a/llvm-core/clang-common/clang-common-20.1.3.ebuild b/llvm-core/clang-common/clang-common-20.1.3.ebuild
deleted file mode 100644
index 00fc8b0e151f..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.3.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.1.4.ebuild b/llvm-core/clang-common/clang-common-20.1.4.ebuild
deleted file mode 100644
index 00fc8b0e151f..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.4.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-16  9:31 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-16  9:31 UTC (permalink / raw
  To: gentoo-commits

commit:     94defc5747496bdef2de4ad8b8b434a32d236ed3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu May 15 19:32:53 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 16 09:30:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94defc57

llvm-core/clang-common: Add 20.1.5

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.5.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d173631df2d3..be35f33ecf9a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,6 +12,8 @@ DIST llvm-project-20.1.3.src.tar.xz 147212776 BLAKE2B c738abb66dc82580a8f511829b
 DIST llvm-project-20.1.3.src.tar.xz.sig 566 BLAKE2B 1b584b61f773013f3964dbd0ee026c00e702cfe758acdacc7bffb6793c42eea638cc812bd1a3cddf210a9ad7d98f707d4f1e748d360b66427fded79f24d8610b SHA512 4fd3815cd94113234e66083f955993a95c888cbb89d5baf611b76765511e102af9f1e880cbacc709f0be8785abd5abbfb0ce391793308dfec3c248a9b348e492
 DIST llvm-project-20.1.4.src.tar.xz 147228104 BLAKE2B 756799d104f94931a6bdca182c4b23983aad9c7ea5acf77f2f5519540137a8dc9a4ec227293c6ba7ddc7fb0fa10cc92e65808f1c07f04bea34a304bb0e2df612 SHA512 acace8175a5468c7e84a89d1564e147e81fe92b6d910f22b058edf72094b27176677c06dbe141fccfbabdad77165f957bbf1ec8aff7bffc85f0757c0103f7e59
 DIST llvm-project-20.1.4.src.tar.xz.sig 566 BLAKE2B 1f0f057dedf938190554ca1a51d9837da9faa38851edb7fe6f305769f3048b5507b010cb81b97550a13c9141e03480009602ff092ddd65b42483b0f79c1523e8 SHA512 634414ea877724ebdeeabe3bb1079d78938aa05dba2243d5458cf211c35444124dc01fa73a593548290196f8c0e40e1e6a4a72571dba4b716b5781c656c6f9b2
+DIST llvm-project-20.1.5.src.tar.xz 147239812 BLAKE2B 992ebec16a11f32f234ba8b9f228f27939cdaeaaba474a08da2564ba3075bb10ab92a44be704666bdd77f8294321d43da40bb9245c411a86cd53cff88223a91f SHA512 3b7e657714fa9b943c75ec9eeb903018ab4713b1c3370746ba68893220729f178dabb971515741519f24e7ad0fa1dbce1345572bcf1d1fc1e5de97e4d2900a6b
+DIST llvm-project-20.1.5.src.tar.xz.sig 566 BLAKE2B c8be202b475726817893e1fe5fe2d3ab02ea1d3130ccfdf4c2c29b46e6aef79091de78e8a9aef59416ac1120bb3af6fdf47464db9b27b8fb4cb4194b0444e571 SHA512 c1bd30af5f7bfa6cac73994e9068d2791d9d27e86375fb15ad426422ad00cb43ade226c1b91ecc7daa950efae62c86300e4290d59649310f4e8fab5bdcb264fe
 DIST llvm-project-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
 DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163
 DIST llvm-project-d1e38eab95b07b422194427474521623916bbf29.tar.gz 232705423 BLAKE2B bf5200c2223d8cdf7c34c84876d8cfeb9429cb6535ced226b1bf9ab468b6401fe3da8759f0fc1ab3112927304c5f74db29b18be60fa961ce99471caa2c6a1f33 SHA512 8fae137725ad4eb0f5bab73895c65b34d1e36ea039c9fb3978c908ecc6023094d84919b97dc405b86e2dd32f585d87b29cee02293c8156d10a8371b516ca5e7a

diff --git a/llvm-core/clang-common/clang-common-20.1.5.ebuild b/llvm-core/clang-common/clang-common-20.1.5.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.5.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-10 13:03 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-10 13:03 UTC (permalink / raw
  To: gentoo-commits

commit:     23bb84b02029a19e86d8434816a3e3719451e3ad
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 10 13:00:50 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May 10 13:00:50 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23bb84b0

llvm-core/clang-common: Add 21.0.0_pre20250510 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250510.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 392493c200e0..d173631df2d3 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,3 +15,4 @@ DIST llvm-project-20.1.4.src.tar.xz.sig 566 BLAKE2B 1f0f057dedf938190554ca1a51d9
 DIST llvm-project-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
 DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163
 DIST llvm-project-d1e38eab95b07b422194427474521623916bbf29.tar.gz 232705423 BLAKE2B bf5200c2223d8cdf7c34c84876d8cfeb9429cb6535ced226b1bf9ab468b6401fe3da8759f0fc1ab3112927304c5f74db29b18be60fa961ce99471caa2c6a1f33 SHA512 8fae137725ad4eb0f5bab73895c65b34d1e36ea039c9fb3978c908ecc6023094d84919b97dc405b86e2dd32f585d87b29cee02293c8156d10a8371b516ca5e7a
+DIST llvm-project-fcb4bda9dcfcdb64d8b069e8416c75d7a1a62e52.tar.gz 233149231 BLAKE2B 95a7a012a1e747afcf83ace3785c8ef6a3e10f6075e59eb1c5b077cc9edae244b648f341bc0ac6a45b2afc8f7ffe130a90a741a04465523f30f8322566386703 SHA512 b46f0c90a1c56750cada24183ca382b267a2d2faa0db7d77a8bdd4e94e6303e57d565cf85447b3c0e0efdd3750efef1e10e8ce6f1fe8f1ae10ee31d25ddf3fb7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250510.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-03 19:42 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-03 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     e1f0f3737ebf0ff0ded7c8dd6ac8ff58be70fabd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May  3 19:30:41 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May  3 19:41:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1f0f373

llvm-core/clang-common: Add 21.0.0_pre20250503 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250503.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index dd22b3e8351b..392493c200e0 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -14,3 +14,4 @@ DIST llvm-project-20.1.4.src.tar.xz 147228104 BLAKE2B 756799d104f94931a6bdca182c
 DIST llvm-project-20.1.4.src.tar.xz.sig 566 BLAKE2B 1f0f057dedf938190554ca1a51d9837da9faa38851edb7fe6f305769f3048b5507b010cb81b97550a13c9141e03480009602ff092ddd65b42483b0f79c1523e8 SHA512 634414ea877724ebdeeabe3bb1079d78938aa05dba2243d5458cf211c35444124dc01fa73a593548290196f8c0e40e1e6a4a72571dba4b716b5781c656c6f9b2
 DIST llvm-project-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
 DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163
+DIST llvm-project-d1e38eab95b07b422194427474521623916bbf29.tar.gz 232705423 BLAKE2B bf5200c2223d8cdf7c34c84876d8cfeb9429cb6535ced226b1bf9ab468b6401fe3da8759f0fc1ab3112927304c5f74db29b18be60fa961ce99471caa2c6a1f33 SHA512 8fae137725ad4eb0f5bab73895c65b34d1e36ea039c9fb3978c908ecc6023094d84919b97dc405b86e2dd32f585d87b29cee02293c8156d10a8371b516ca5e7a

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250503.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-05-03 10:07 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-05-03 10:07 UTC (permalink / raw
  To: gentoo-commits

commit:     b1c6ff662c8f09fc943a6022e47ec140952267da
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May  3 06:24:01 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May  3 10:00:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1c6ff66

llvm-core/clang-common: Bump to 20.1.4

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.4.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 3406a662077f..dd22b3e8351b 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,7 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 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-20.1.4.src.tar.xz 147228104 BLAKE2B 756799d104f94931a6bdca182c4b23983aad9c7ea5acf77f2f5519540137a8dc9a4ec227293c6ba7ddc7fb0fa10cc92e65808f1c07f04bea34a304bb0e2df612 SHA512 acace8175a5468c7e84a89d1564e147e81fe92b6d910f22b058edf72094b27176677c06dbe141fccfbabdad77165f957bbf1ec8aff7bffc85f0757c0103f7e59
+DIST llvm-project-20.1.4.src.tar.xz.sig 566 BLAKE2B 1f0f057dedf938190554ca1a51d9837da9faa38851edb7fe6f305769f3048b5507b010cb81b97550a13c9141e03480009602ff092ddd65b42483b0f79c1523e8 SHA512 634414ea877724ebdeeabe3bb1079d78938aa05dba2243d5458cf211c35444124dc01fa73a593548290196f8c0e40e1e6a4a72571dba4b716b5781c656c6f9b2
 DIST llvm-project-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
 DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163

diff --git a/llvm-core/clang-common/clang-common-20.1.4.ebuild b/llvm-core/clang-common/clang-common-20.1.4.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.4.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-26 15:59 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-26 15:59 UTC (permalink / raw
  To: gentoo-commits

commit:     34b5921b2e9237295b60b5c704b49eeb6eb3eb1d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 26 13:11:27 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 26 15:59:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b5921b

llvm-core/clang-common: Add 21.0.0_pre20250426 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250426.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 0022567832ad..3406a662077f 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 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-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34
+DIST llvm-project-b9e32749d273a957e60170d6e7ef205fd1fb1834.tar.gz 232146799 BLAKE2B f7c02bf1e6b9958114f07827ff00264774a7ad54b51c6867d7e66d7c9a94a36fb84f371d7d30c2f094a0d539b565fb651786ed9e0641f2bea8d982073f1a8ac0 SHA512 2d81ead79c606e00549d5205584f1bd272e4d7adf4b376fdba19e7fb719710e80b00b22ee3500ab2b990178fa044ca9fcf45bd2063e62e6a217b11775bb3b163

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250426.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-20 11:50 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-20 11:50 UTC (permalink / raw
  To: gentoo-commits

commit:     bc54c95088947dbe7de94ed879e9562b113ffe6d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 20 11:49:25 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 20 11:49:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc54c950

llvm-core/clang-common: Add 21.0.0_pre20250420 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250420.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index fb1d574da0bd..926078c3d514 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ 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.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-ac8fc09688e10e983b99224b5dc5cbbeeedb1879.tar.gz 231567089 BLAKE2B f7878f114c908b21d179854bc693716b34b963612c6b5172789a37cd21fa316720d4e9498bc7679058db3e822ed240bfdafd85bfd00154914d747d0c0ed1cb48 SHA512 4c39db8b22fa087ca96c3b4541ec77ba8a826a126b4e93b0650e59b3622b22b329f60fa3780dd4572fdece409fd5833eda473046d7547f6ee3ac8aadb8f2fc34

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250420.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-19  6:29 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-19  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     8f1b38f4b7de7093288976a84a35bc4c06555847
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 19 06:26:08 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 19 06:26:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f1b38f4

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   4 -
 llvm-core/clang-common/clang-common-20.1.2.ebuild  | 315 ---------------------
 .../clang-common-21.0.0_pre20250405.ebuild         | 314 --------------------
 .../clang-common-21.0.0_pre20250412.ebuild         | 314 --------------------
 4 files changed, 947 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 4152b95d916b..fb1d574da0bd 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -9,9 +9,5 @@ DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b8577
 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-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-core/clang-common/clang-common-20.1.2.ebuild b/llvm-core/clang-common/clang-common-20.1.2.ebuild
deleted file mode 100644
index 00fc8b0e151f..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.2.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-16 18:34 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-16 18:34 UTC (permalink / raw
  To: gentoo-commits

commit:     7ca8bb1bc95b88f0a91b3e02439e75bd4f7d7331
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 16 12:07:10 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr 16 18:33:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ca8bb1b

llvm-core/clang-common: Add 20.1.3

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.3.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index ba49b66e1652..4152b95d916b 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,5 +11,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-core/clang-common/clang-common-20.1.3.ebuild b/llvm-core/clang-common/clang-common-20.1.3.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.3.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-15 10:15 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-15 10:15 UTC (permalink / raw
  To: gentoo-commits

commit:     3b9283a4cee1df198202c06eb48f0c8316323c54
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 15 10:04:45 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Apr 15 10:15:32 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b9283a4

llvm-core/clang-common: Add 21.0.0_pre20250415 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250415.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 48cb93750fdd..ba49b66e1652 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,6 +8,7 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 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-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-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250415.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250415.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250415.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-12 10:21 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-12 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     7741888757aa645a9880f171d78ea03c2267752d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 10:19:52 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 10:19:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77418887

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                   |   2 -
 llvm-core/clang-common/clang-common-19.1.4.ebuild | 310 ----------------------
 2 files changed, 312 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 2f61941caf84..48cb93750fdd 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -6,8 +6,6 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
 DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffef86468169ba2f211a9733ec2d4cf30040f7f277ef00f048bb44dee9f97d7d762f0f241f19e5a2a7b0b49217d3821ddfc8c354f SHA512 25eeee9984c8b4d0fbc240df90f33cbb000d3b0414baff5c8982beafcc5e59e7ef18f6f85d95b3a5f60cb3d4cd4f877c80487b5768bc21bc833f107698ad93db
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
-DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d2250268df36fb94fa0fd5b3611484094fbd7962051978334d2c623d2ff5a0209dbb2c6c6492be0146507ae982a7d3e9705a689c5 SHA512 a586f8a41dde5e0d9ca6d8c58e9ef2a2e59b70a86d2e2c46106dc31b5c096bb80af0cdbdb486179e9cc676a540099f49a1c2db9e5e84c50362db1f72e9af6906
-DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 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-20.1.2.src.tar.xz 147229028 BLAKE2B 90be4c8b69d44bc3a295f3f63081f999cf35d05e9157ab104d403a5d5b6c3ff97b57a89598d2ec0413988f93a23f97f485b2216bbf0630cade754e9830246621 SHA512 c95e088e471d49c6692c8af1a7e40924467e4c269dada019c44455687c9f0e6a213b9b3ac8afa4e3d20cb3e757afc3400152e7cd06981aeebd61591cac15580d

diff --git a/llvm-core/clang-common/clang-common-19.1.4.ebuild b/llvm-core/clang-common/clang-common-19.1.4.ebuild
deleted file mode 100644
index 09c980da55b4..000000000000
--- a/llvm-core/clang-common/clang-common-19.1.4.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
-	#  define __GENTOO_NOT_FREESTANDING 1
-	# else
-	#  define __GENTOO_NOT_FREESTANDING 0
-	# endif
-	#
-	# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
-	#  if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
-	#   define _FORTIFY_SOURCE ${fortify_level}
-	#  endif
-	# endif
-	# undef __GENTOO_HAS_FEATURE
-	# undef __GENTOO_NOT_FREESTANDING
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-12 10:19 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-04-12 10:19 UTC (permalink / raw
  To: gentoo-commits

commit:     735648423612dd06121218ffd870312f285f3dc3
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 10:17:51 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 10:17:51 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73564842

llvm-core/clang-common: Stabilize 19.1.7 sparc, #946879

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-19.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-19.1.7.ebuild b/llvm-core/clang-common/clang-common-19.1.7.ebuild
index e21258b2caf7..d9b6f6279839 100644
--- a/llvm-core/clang-common/clang-common-19.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-19.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-12  8:59 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-12  8:59 UTC (permalink / raw
  To: gentoo-commits

commit:     5c22a4fbd8a5fa12805eb9bb8ce1561af0aa33d1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 08:57:42 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 08:59:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c22a4fb

llvm-core/clang-common: Add 21.0.0_pre20250412 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250412.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 006cf927cda5..2f61941caf84 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,3 +13,4 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 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-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7
+DIST llvm-project-fa4ac19f0fc937e30fd7711dad98d0fcdb34f8ba.tar.gz 230556403 BLAKE2B 8fde662380b5a9889cb6399ceeffedf0b42a5b6c329768f2cad15338a4fd4650217057955014de53b56825a6f5770042f5678d8df4118b6310d4d1b12a19c888 SHA512 ef8a3ac7aed43f14b490d198de27f15bad0a63b89273d47daca0aa33a1edf79eecafb26f7f7ec64e6482b99fba5d7e9080c59887e33bb1ce18d8e3ae1938a1ae

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250412.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-12  4:57 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-12  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     19084068791bbfae7f828b635ca96d347d27ac30
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 04:55:38 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 04:55:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19084068

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 llvm-core/clang-common/clang-common-20.1.1.ebuild  | 315 ---------------------
 .../clang-common-21.0.0_pre20250317.ebuild         | 314 --------------------
 .../clang-common-21.0.0_pre20250322.ebuild         | 314 --------------------
 .../clang-common-21.0.0_pre20250329.ebuild         | 314 --------------------
 5 files changed, 1262 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 7e4f1f2606fb..006cf927cda5 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,11 +10,6 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 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-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAKE2B c1eacc2ed05c460f56cf83f16b982e3fa4ac530483d7cf003034239aff3b3dbffbdd3042a3f295a83ec94fcf32f802714e4937fd3761a5e03d4ed1b4093e81bf SHA512 98b7e9fa330a6fce33ca9757caf5d2e41d0b73117cb24b2aed880274c2d6f8a8c1a0028dd0e773fa42deb61dbe3b9dd4fb2f44e50814b966fcdeae8e5b417e6d
-DIST llvm-project-1d133420dc512487e2be0e9d86755f2a7c3497a7.tar.gz 229268288 BLAKE2B aca79bcca631deeab429a03cd2732d78d8ecf0c9615bce181445ed875436806609dc85a57d4f97109492833d620d060ea93fed450a4912c2d94597aeabf84974 SHA512 24ecadfccdf785bfbf27d5007afd2a4d5868493b2c5f48d6cf07c335bfbfef5cba4f12a639971e5f95877ae3b8c7b7fc0c210e404d21036af553de82a5059037
-DIST llvm-project-20.1.1.src.tar.xz 147215020 BLAKE2B d1774d060036b5340f765d68cc23cbd1e00730874cb3e65b7236303238d7922a7fa191b631c20c3bf17e54c933672a355d4424f2beea17cd25fcf9f5c4c625dd SHA512 b851d3e24a2775f6e789720614a8192d72956f447a39d75e5160a8acf6bd3a3386fab2cca5590b7e020b65e408ccf32432f8dc03519fd4cf60b4b5674fe0547e
-DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc1b5205d76b3b83d0f99aa2ac09a63b058478e08588dcfbfc728110172b639eeaf04a884f4e6d707b94cad0dbf2d0dcb30a4f SHA512 469b03f3ddbe56b074724375b09a45ee2730bee0ba4b25f64f93d93ef609c33d39136f051c216a74a35d98a70ffcd3d7507e38d19a20d5006c29a954ca32813b
 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-21eeca3db0341fef4ab4a6464ffe38b2eba5810c.tar.gz 229546432 BLAKE2B e783f08b93498b252741a07fd3aa3383ca93f66688f9bbdb2e11185c660dfff1020ab4a1ca803ab69ab28dc2fd8b5c3855f45c0b77851b8e6edeb0dc5bf6cbd4 SHA512 54420956b36f3bccabea2171a4103ca20d6b136e1d1f7f217e0ec735be4542bbd840ef228c55f3e9103ad2f9fb41393e611d5aaa1521d01fdd163b770b80ba0b
 DIST llvm-project-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7

diff --git a/llvm-core/clang-common/clang-common-20.1.1.ebuild b/llvm-core/clang-common/clang-common-20.1.1.ebuild
deleted file mode 100644
index 00fc8b0e151f..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.1.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250322.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250322.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250322.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-05 12:24 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-05 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     47737fc6427ee1446b67c0980ade4bbe2d974269
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  5 10:51:33 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr  5 12:23:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47737fc6

llvm-core/clang-common: Add 21.0.0_pre20250405 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250405.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 148419e3a6c1..7e4f1f2606fb 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -17,3 +17,4 @@ DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc
 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-21eeca3db0341fef4ab4a6464ffe38b2eba5810c.tar.gz 229546432 BLAKE2B e783f08b93498b252741a07fd3aa3383ca93f66688f9bbdb2e11185c660dfff1020ab4a1ca803ab69ab28dc2fd8b5c3855f45c0b77851b8e6edeb0dc5bf6cbd4 SHA512 54420956b36f3bccabea2171a4103ca20d6b136e1d1f7f217e0ec735be4542bbd840ef228c55f3e9103ad2f9fb41393e611d5aaa1521d01fdd163b770b80ba0b
+DIST llvm-project-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250405.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-04-03 11:29 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-04-03 11:29 UTC (permalink / raw
  To: gentoo-commits

commit:     4f60bdbc70fa478fb9b92b7609dc1d1205e7dc94
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  3 08:03:53 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr  3 11:29:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f60bdbc

llvm-core/clang-common: Bump to 20.1.2

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.2.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 518a294cf47a..148419e3a6c1 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -14,4 +14,6 @@ DIST llvm-project-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAK
 DIST llvm-project-1d133420dc512487e2be0e9d86755f2a7c3497a7.tar.gz 229268288 BLAKE2B aca79bcca631deeab429a03cd2732d78d8ecf0c9615bce181445ed875436806609dc85a57d4f97109492833d620d060ea93fed450a4912c2d94597aeabf84974 SHA512 24ecadfccdf785bfbf27d5007afd2a4d5868493b2c5f48d6cf07c335bfbfef5cba4f12a639971e5f95877ae3b8c7b7fc0c210e404d21036af553de82a5059037
 DIST llvm-project-20.1.1.src.tar.xz 147215020 BLAKE2B d1774d060036b5340f765d68cc23cbd1e00730874cb3e65b7236303238d7922a7fa191b631c20c3bf17e54c933672a355d4424f2beea17cd25fcf9f5c4c625dd SHA512 b851d3e24a2775f6e789720614a8192d72956f447a39d75e5160a8acf6bd3a3386fab2cca5590b7e020b65e408ccf32432f8dc03519fd4cf60b4b5674fe0547e
 DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc1b5205d76b3b83d0f99aa2ac09a63b058478e08588dcfbfc728110172b639eeaf04a884f4e6d707b94cad0dbf2d0dcb30a4f SHA512 469b03f3ddbe56b074724375b09a45ee2730bee0ba4b25f64f93d93ef609c33d39136f051c216a74a35d98a70ffcd3d7507e38d19a20d5006c29a954ca32813b
+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-21eeca3db0341fef4ab4a6464ffe38b2eba5810c.tar.gz 229546432 BLAKE2B e783f08b93498b252741a07fd3aa3383ca93f66688f9bbdb2e11185c660dfff1020ab4a1ca803ab69ab28dc2fd8b5c3855f45c0b77851b8e6edeb0dc5bf6cbd4 SHA512 54420956b36f3bccabea2171a4103ca20d6b136e1d1f7f217e0ec735be4542bbd840ef228c55f3e9103ad2f9fb41393e611d5aaa1521d01fdd163b770b80ba0b

diff --git a/llvm-core/clang-common/clang-common-20.1.2.ebuild b/llvm-core/clang-common/clang-common-20.1.2.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.2.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-29 10:27 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-29 10:27 UTC (permalink / raw
  To: gentoo-commits

commit:     b33a6d62832f66a6109367581ae394a036a6c810
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 29 10:25:35 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 29 10:25:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b33a6d62

llvm-core/clang-common: Add 21.0.0_pre20250329 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250329.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index bbde20022e78..518a294cf47a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -14,3 +14,4 @@ DIST llvm-project-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAK
 DIST llvm-project-1d133420dc512487e2be0e9d86755f2a7c3497a7.tar.gz 229268288 BLAKE2B aca79bcca631deeab429a03cd2732d78d8ecf0c9615bce181445ed875436806609dc85a57d4f97109492833d620d060ea93fed450a4912c2d94597aeabf84974 SHA512 24ecadfccdf785bfbf27d5007afd2a4d5868493b2c5f48d6cf07c335bfbfef5cba4f12a639971e5f95877ae3b8c7b7fc0c210e404d21036af553de82a5059037
 DIST llvm-project-20.1.1.src.tar.xz 147215020 BLAKE2B d1774d060036b5340f765d68cc23cbd1e00730874cb3e65b7236303238d7922a7fa191b631c20c3bf17e54c933672a355d4424f2beea17cd25fcf9f5c4c625dd SHA512 b851d3e24a2775f6e789720614a8192d72956f447a39d75e5160a8acf6bd3a3386fab2cca5590b7e020b65e408ccf32432f8dc03519fd4cf60b4b5674fe0547e
 DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc1b5205d76b3b83d0f99aa2ac09a63b058478e08588dcfbfc728110172b639eeaf04a884f4e6d707b94cad0dbf2d0dcb30a4f SHA512 469b03f3ddbe56b074724375b09a45ee2730bee0ba4b25f64f93d93ef609c33d39136f051c216a74a35d98a70ffcd3d7507e38d19a20d5006c29a954ca32813b
+DIST llvm-project-21eeca3db0341fef4ab4a6464ffe38b2eba5810c.tar.gz 229546432 BLAKE2B e783f08b93498b252741a07fd3aa3383ca93f66688f9bbdb2e11185c660dfff1020ab4a1ca803ab69ab28dc2fd8b5c3855f45c0b77851b8e6edeb0dc5bf6cbd4 SHA512 54420956b36f3bccabea2171a4103ca20d6b136e1d1f7f217e0ec735be4542bbd840ef228c55f3e9103ad2f9fb41393e611d5aaa1521d01fdd163b770b80ba0b

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250329.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-23 13:46 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-03-23 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     8bd30716585327bee183ad8e2a8f0b535fb0e4f1
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 23 13:32:39 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 23 13:46:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bd30716

llvm-core/clang-common: Stabilize 19.1.7 ppc64, #946879

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-19.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-19.1.7.ebuild b/llvm-core/clang-common/clang-common-19.1.7.ebuild
index 9e247c904230..e21258b2caf7 100644
--- a/llvm-core/clang-common/clang-common-19.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-19.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-23 13:46 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-03-23 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     f1fc2f4d306d447e5da4d6cdd676446f32f5fb95
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 23 13:32:32 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 23 13:46:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1fc2f4d

llvm-core/clang-common: Stabilize 19.1.7 arm, #946879

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-19.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-19.1.7.ebuild b/llvm-core/clang-common/clang-common-19.1.7.ebuild
index 6705ebfcd9aa..9e247c904230 100644
--- a/llvm-core/clang-common/clang-common-19.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-19.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ~loong ~mips ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-22 10:43 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-22 10:43 UTC (permalink / raw
  To: gentoo-commits

commit:     4038beaef3124e692daacb2ce475959eb9ad50fd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 22 10:41:37 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 22 10:41:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4038beae

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   3 -
 .../clang-common/clang-common-20.1.0-r1.ebuild     | 315 ---------------------
 .../clang-common-21.0.0_pre20250311.ebuild         | 314 --------------------
 3 files changed, 632 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index b2ae378dee29..bbde20022e78 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,8 +12,5 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAKE2B c1eacc2ed05c460f56cf83f16b982e3fa4ac530483d7cf003034239aff3b3dbffbdd3042a3f295a83ec94fcf32f802714e4937fd3761a5e03d4ed1b4093e81bf SHA512 98b7e9fa330a6fce33ca9757caf5d2e41d0b73117cb24b2aed880274c2d6f8a8c1a0028dd0e773fa42deb61dbe3b9dd4fb2f44e50814b966fcdeae8e5b417e6d
 DIST llvm-project-1d133420dc512487e2be0e9d86755f2a7c3497a7.tar.gz 229268288 BLAKE2B aca79bcca631deeab429a03cd2732d78d8ecf0c9615bce181445ed875436806609dc85a57d4f97109492833d620d060ea93fed450a4912c2d94597aeabf84974 SHA512 24ecadfccdf785bfbf27d5007afd2a4d5868493b2c5f48d6cf07c335bfbfef5cba4f12a639971e5f95877ae3b8c7b7fc0c210e404d21036af553de82a5059037
-DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
-DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
 DIST llvm-project-20.1.1.src.tar.xz 147215020 BLAKE2B d1774d060036b5340f765d68cc23cbd1e00730874cb3e65b7236303238d7922a7fa191b631c20c3bf17e54c933672a355d4424f2beea17cd25fcf9f5c4c625dd SHA512 b851d3e24a2775f6e789720614a8192d72956f447a39d75e5160a8acf6bd3a3386fab2cca5590b7e020b65e408ccf32432f8dc03519fd4cf60b4b5674fe0547e
 DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc1b5205d76b3b83d0f99aa2ac09a63b058478e08588dcfbfc728110172b639eeaf04a884f4e6d707b94cad0dbf2d0dcb30a4f SHA512 469b03f3ddbe56b074724375b09a45ee2730bee0ba4b25f64f93d93ef609c33d39136f051c216a74a35d98a70ffcd3d7507e38d19a20d5006c29a954ca32813b
-DIST llvm-project-cb7298f66d62a3548fcf3bd230304067ecf30d17.tar.gz 229200711 BLAKE2B 1910569812e7423cf566b0dec67269404ba8db8232ab293bc603a88914f2b756e3088bf2133c0fca612cc58d39691c7b813b3c5839a7ac9a3d177fe6bde766c6 SHA512 07c3f6ce34e7d32c5ebce1d2efb77e6a1dde49f9eedf7191733a20bdcb6ffd0c03f8fc8de85fd00bd9465b209f140639a68a367d2218c028bfa6e06067cc3e14

diff --git a/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild b/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
deleted file mode 100644
index 00fc8b0e151f..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
+++ /dev/null
@@ -1,315 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild
deleted file mode 100644
index af6e46af4529..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-# enforce flags on clang-runtime as well to aid transition
-PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-20 16:50 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-20 16:50 UTC (permalink / raw
  To: gentoo-commits

commit:     5e721fa6aab9480b586fa0bb19e36f27775e482c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 20 12:53:23 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Mar 20 16:50:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e721fa6

llvm-core/clang-common: Add 20.1.1

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.1.ebuild | 315 ++++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 7db2c60e30a4..2b62b7100d04 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,4 +13,6 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAKE2B c1eacc2ed05c460f56cf83f16b982e3fa4ac530483d7cf003034239aff3b3dbffbdd3042a3f295a83ec94fcf32f802714e4937fd3761a5e03d4ed1b4093e81bf SHA512 98b7e9fa330a6fce33ca9757caf5d2e41d0b73117cb24b2aed880274c2d6f8a8c1a0028dd0e773fa42deb61dbe3b9dd4fb2f44e50814b966fcdeae8e5b417e6d
 DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
 DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
+DIST llvm-project-20.1.1.src.tar.xz 147215020 BLAKE2B d1774d060036b5340f765d68cc23cbd1e00730874cb3e65b7236303238d7922a7fa191b631c20c3bf17e54c933672a355d4424f2beea17cd25fcf9f5c4c625dd SHA512 b851d3e24a2775f6e789720614a8192d72956f447a39d75e5160a8acf6bd3a3386fab2cca5590b7e020b65e408ccf32432f8dc03519fd4cf60b4b5674fe0547e
+DIST llvm-project-20.1.1.src.tar.xz.sig 566 BLAKE2B 76c49401d9b8e283fc29586c32fc1b5205d76b3b83d0f99aa2ac09a63b058478e08588dcfbfc728110172b639eeaf04a884f4e6d707b94cad0dbf2d0dcb30a4f SHA512 469b03f3ddbe56b074724375b09a45ee2730bee0ba4b25f64f93d93ef609c33d39136f051c216a74a35d98a70ffcd3d7507e38d19a20d5006c29a954ca32813b
 DIST llvm-project-cb7298f66d62a3548fcf3bd230304067ecf30d17.tar.gz 229200711 BLAKE2B 1910569812e7423cf566b0dec67269404ba8db8232ab293bc603a88914f2b756e3088bf2133c0fca612cc58d39691c7b813b3c5839a7ac9a3d177fe6bde766c6 SHA512 07c3f6ce34e7d32c5ebce1d2efb77e6a1dde49f9eedf7191733a20bdcb6ffd0c03f8fc8de85fd00bd9465b209f140639a68a367d2218c028bfa6e06067cc3e14

diff --git a/llvm-core/clang-common/clang-common-20.1.1.ebuild b/llvm-core/clang-common/clang-common-20.1.1.ebuild
new file mode 100644
index 000000000000..00fc8b0e151f
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.1.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-17 20:13 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-17 20:13 UTC (permalink / raw
  To: gentoo-commits

commit:     e54da5206901c161aaaacef5440ab8a66167fe73
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 17 17:57:24 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 17 20:13:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e54da520

llvm-core/clang-common: Add 21.0.0_pre20250317 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250317.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d3cf27d0ad4f..7db2c60e30a4 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,6 +10,7 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 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-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAKE2B c1eacc2ed05c460f56cf83f16b982e3fa4ac530483d7cf003034239aff3b3dbffbdd3042a3f295a83ec94fcf32f802714e4937fd3761a5e03d4ed1b4093e81bf SHA512 98b7e9fa330a6fce33ca9757caf5d2e41d0b73117cb24b2aed880274c2d6f8a8c1a0028dd0e773fa42deb61dbe3b9dd4fb2f44e50814b966fcdeae8e5b417e6d
 DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
 DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
 DIST llvm-project-cb7298f66d62a3548fcf3bd230304067ecf30d17.tar.gz 229200711 BLAKE2B 1910569812e7423cf566b0dec67269404ba8db8232ab293bc603a88914f2b756e3088bf2133c0fca612cc58d39691c7b813b3c5839a7ac9a3d177fe6bde766c6 SHA512 07c3f6ce34e7d32c5ebce1d2efb77e6a1dde49f9eedf7191733a20bdcb6ffd0c03f8fc8de85fd00bd9465b209f140639a68a367d2218c028bfa6e06067cc3e14

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250317.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-16 17:41 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-16 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     b334571567ba28720d1bc3f38888913adf58cadd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 17:30:45 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 17:30:45 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3345715

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   1 -
 .../clang-common-21.0.0_pre20250301.ebuild         | 310 ---------------------
 2 files changed, 311 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index c18c84ef8018..d3cf27d0ad4f 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,5 +12,4 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
 DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
-DIST llvm-project-7e8a06cfa4a2951b8ee77e19e34926e6e535b4d1.tar.gz 228792296 BLAKE2B cd9357bdca9342770820f9fadfbd0b129a83324847f18e2ebac1fed8df4afb101aba2dc19d90264ae1e2d5692e34149ca24ef82a4973e7aeddb157268bb411b6 SHA512 9821a34a559e1db596940d76ce9388360baea43c1a9de814f567bfcf1428a0c6e3ced61b1e07537058454785d9c3aa3f443cbcf742a01fb40dd20b476a906442
 DIST llvm-project-cb7298f66d62a3548fcf3bd230304067ecf30d17.tar.gz 229200711 BLAKE2B 1910569812e7423cf566b0dec67269404ba8db8232ab293bc603a88914f2b756e3088bf2133c0fca612cc58d39691c7b813b3c5839a7ac9a3d177fe6bde766c6 SHA512 07c3f6ce34e7d32c5ebce1d2efb77e6a1dde49f9eedf7191733a20bdcb6ffd0c03f8fc8de85fd00bd9465b209f140639a68a367d2218c028bfa6e06067cc3e14

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-11 14:56 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-11 14:56 UTC (permalink / raw
  To: gentoo-commits

commit:     e3281bbf9a46bf0da26bda0b7499c94301507d2c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 14:51:33 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Mar 11 14:56:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3281bbf

llvm-core/clang-common: Add 21.0.0_pre20250311 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250311.ebuild         | 314 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 0bb30d78e9c4..c18c84ef8018 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,3 +13,4 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
 DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
 DIST llvm-project-7e8a06cfa4a2951b8ee77e19e34926e6e535b4d1.tar.gz 228792296 BLAKE2B cd9357bdca9342770820f9fadfbd0b129a83324847f18e2ebac1fed8df4afb101aba2dc19d90264ae1e2d5692e34149ca24ef82a4973e7aeddb157268bb411b6 SHA512 9821a34a559e1db596940d76ce9388360baea43c1a9de814f567bfcf1428a0c6e3ced61b1e07537058454785d9c3aa3f443cbcf742a01fb40dd20b476a906442
+DIST llvm-project-cb7298f66d62a3548fcf3bd230304067ecf30d17.tar.gz 229200711 BLAKE2B 1910569812e7423cf566b0dec67269404ba8db8232ab293bc603a88914f2b756e3088bf2133c0fca612cc58d39691c7b813b3c5839a7ac9a3d177fe6bde766c6 SHA512 07c3f6ce34e7d32c5ebce1d2efb77e6a1dde49f9eedf7191733a20bdcb6ffd0c03f8fc8de85fd00bd9465b209f140639a68a367d2218c028bfa6e06067cc3e14

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild
new file mode 100644
index 000000000000..af6e46af4529
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250311.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-05 13:30 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-05 13:30 UTC (permalink / raw
  To: gentoo-commits

commit:     8754ad9e0648c3e36971f6d34394a2c5b535c839
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 13:30:15 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 13:30:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8754ad9e

llvm-core/clang-common: Add USE-defaults for clang-runtime deps

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

 llvm-core/clang-common/clang-common-20.1.0-r1.ebuild   | 2 +-
 llvm-core/clang-common/clang-common-21.0.0.9999.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild b/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
index 3bfc8992d3b2..00fc8b0e151f 100644
--- a/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
@@ -30,7 +30,7 @@ PDEPEND="
 "
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt?,default-libcxx?,default-lld?,llvm-libunwind?]
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )

diff --git a/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
index ed0619a9ba32..af6e46af4529 100644
--- a/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
+++ b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
@@ -29,7 +29,7 @@ PDEPEND="
 "
 # enforce flags on clang-runtime as well to aid transition
 PDEPEND+="
-	llvm-core/clang-runtime[default-compiler-rt?,default-libcxx?,default-lld?,llvm-libunwind?]
+	llvm-core/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
 "
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-05 13:24 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-05 13:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e2030457ee97e2aba42a7d5d99dbe75472b2c7cc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 13:14:10 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 13:14:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2030457

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

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

 .../{clang-common-20.1.0.ebuild => clang-common-20.1.0-r1.ebuild}     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm-core/clang-common/clang-common-20.1.0.ebuild b/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
similarity index 98%
rename from llvm-core/clang-common/clang-common-20.1.0.ebuild
rename to llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
index 75e1c18f7d3d..3bfc8992d3b2 100644
--- a/llvm-core/clang-common/clang-common-20.1.0.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.0-r1.ebuild
@@ -28,6 +28,10 @@ PDEPEND="
 	default-lld? ( >=llvm-core/lld-${PV} )
 	!default-lld? ( sys-devel/binutils )
 "
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt?,default-libcxx?,default-lld?,llvm-libunwind?]
+"
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-05 13:05 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-05 13:05 UTC (permalink / raw
  To: gentoo-commits

commit:     27ba83267d59df328e1ef409f96ef16844bd26a8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 18:38:56 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 13:05:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27ba8326

llvm-core/clang-common: Enforce matching flags on clang-runtimes

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

 llvm-core/clang-common/clang-common-21.0.0.9999.ebuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
index 1fde60b6b6de..ed0619a9ba32 100644
--- a/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
+++ b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
@@ -27,6 +27,10 @@ PDEPEND="
 	default-lld? ( >=llvm-core/lld-${PV} )
 	!default-lld? ( sys-devel/binutils )
 "
+# enforce flags on clang-runtime as well to aid transition
+PDEPEND+="
+	llvm-core/clang-runtime[default-compiler-rt?,default-libcxx?,default-lld?,llvm-libunwind?]
+"
 IDEPEND="
 	!default-compiler-rt? ( sys-devel/gcc-config )
 	!default-libcxx? ( sys-devel/gcc-config )


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-05 10:13 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-05 10:13 UTC (permalink / raw
  To: gentoo-commits

commit:     4bfb613114935f7603b6f4b4741594434d5e79f8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 10:01:27 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 10:12:50 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bfb6131

llvm-core/clang-common: Add keywords to 20.1.0

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

 llvm-core/clang-common/clang-common-20.1.0.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm-core/clang-common/clang-common-20.1.0.ebuild b/llvm-core/clang-common/clang-common-20.1.0.ebuild
index 1fde60b6b6de..75e1c18f7d3d 100644
--- a/llvm-core/clang-common/clang-common-20.1.0.ebuild
+++ b/llvm-core/clang-common/clang-common-20.1.0.ebuild
@@ -10,6 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-05  6:25 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-05  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     5216dff57b385c4fa95954a2779b4d68236cb473
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 06:13:16 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 06:13:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5216dff5

llvm-core/clang-common: Add 20.1.0 (unkeyworded)

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-20.1.0.ebuild | 310 ++++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index ac04024fa9ce..8a431bbbdf48 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,5 +12,7 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.0-rc3.src.tar.xz 147194560 BLAKE2B 888764927782b01e968c9ec326315375c6b1050d3852c7ebe7fbd06b3b4052307162f77a76f1e8976879178116ea909c581b8d1ee99dc7a4c5368b01d5597d23 SHA512 9de97104681de9c8039f03e94adc25fe1765280f826342fb4f616266aa0e4afe63db09a8cc3458252d8b2834e4efb2d17ed0226c62c7bb06d948ba8172ee078c
 DIST llvm-project-20.1.0-rc3.src.tar.xz.sig 566 BLAKE2B 411ad085c3ab83c1599d110d93a9279206885a01e4748b8ac015a9a94b89fe25c35eab38b213cafb7f733be03826ffc4a01eb52788e2742d44d41a487aff2e26 SHA512 53c5aaa963e883ff06ac7ec9b821dcc4476b79f5be0169667843b18cd8836e8993856a045f2aab23bc77faefc2983fd822cfb1219d5644cec67132d647c877d8
+DIST llvm-project-20.1.0.src.tar.xz 147206476 BLAKE2B 8e8bd8aa995a84d17ac7d634098a6b72a47c30f1752029b620f4541a2de4039edf09117286094ae7bc59c4e84374dcffb8e5ee6ef5feaf4ea7ddb58dd04ea803 SHA512 c90fbc43c40e148357912adc40d799a79cce3d3a929136c137421f6342ed7338659e651f1dedfa8e10b94b9f2897e25b2962e17709add02857f89f10615a2397
+DIST llvm-project-20.1.0.src.tar.xz.sig 566 BLAKE2B 98979ce89f3fe6e95eef6096066cf855245a585608e7d1fddb5bbb2c73077f3ee28204260e18d7e45e3051daae3639520c39bc3d0dc51524873ac213e2511456 SHA512 68da1c2a13aaa48a67bbb9e716f9f030cf372edc651bca2861453378a6a9172a207ff59e29b175001f042888bf1f9c118fbf938f757e1f4c966943baa7e2696a
 DIST llvm-project-7e8a06cfa4a2951b8ee77e19e34926e6e535b4d1.tar.gz 228792296 BLAKE2B cd9357bdca9342770820f9fadfbd0b129a83324847f18e2ebac1fed8df4afb101aba2dc19d90264ae1e2d5692e34149ca24ef82a4973e7aeddb157268bb411b6 SHA512 9821a34a559e1db596940d76ce9388360baea43c1a9de814f567bfcf1428a0c6e3ced61b1e07537058454785d9c3aa3f443cbcf742a01fb40dd20b476a906442
 DIST llvm-project-d254fa877f419e61e54709f0a6f2e891da893a60.tar.gz 228028122 BLAKE2B 3321f3b205dfcd672d52122d7ba8e4e737916e01f5041a0dc140722f64359476632e036da0e0692cd366b080a073292cfdb4963e973bf800afabc20d06a2e86b SHA512 135c4864973b682cf41953d43d977eaa219a4a898fceb4b4a8cacbbc6a5dd271d26010b1db6c6c90e761bf3495036f3e7528ab259d48c9c4dc4a064332c0326f

diff --git a/llvm-core/clang-common/clang-common-20.1.0.ebuild b/llvm-core/clang-common/clang-common-20.1.0.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.0.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-01 12:58 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-01 12:58 UTC (permalink / raw
  To: gentoo-commits

commit:     abfb2e6eaea73b3b2a0723dfacfa7882ccc35e07
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  1 12:56:12 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar  1 12:58:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abfb2e6e

llvm-core/clang-common: Add 21.0.0_pre20250301 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250301.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index a2f41e0a436d..ac04024fa9ce 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,4 +12,5 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.0-rc3.src.tar.xz 147194560 BLAKE2B 888764927782b01e968c9ec326315375c6b1050d3852c7ebe7fbd06b3b4052307162f77a76f1e8976879178116ea909c581b8d1ee99dc7a4c5368b01d5597d23 SHA512 9de97104681de9c8039f03e94adc25fe1765280f826342fb4f616266aa0e4afe63db09a8cc3458252d8b2834e4efb2d17ed0226c62c7bb06d948ba8172ee078c
 DIST llvm-project-20.1.0-rc3.src.tar.xz.sig 566 BLAKE2B 411ad085c3ab83c1599d110d93a9279206885a01e4748b8ac015a9a94b89fe25c35eab38b213cafb7f733be03826ffc4a01eb52788e2742d44d41a487aff2e26 SHA512 53c5aaa963e883ff06ac7ec9b821dcc4476b79f5be0169667843b18cd8836e8993856a045f2aab23bc77faefc2983fd822cfb1219d5644cec67132d647c877d8
+DIST llvm-project-7e8a06cfa4a2951b8ee77e19e34926e6e535b4d1.tar.gz 228792296 BLAKE2B cd9357bdca9342770820f9fadfbd0b129a83324847f18e2ebac1fed8df4afb101aba2dc19d90264ae1e2d5692e34149ca24ef82a4973e7aeddb157268bb411b6 SHA512 9821a34a559e1db596940d76ce9388360baea43c1a9de814f567bfcf1428a0c6e3ced61b1e07537058454785d9c3aa3f443cbcf742a01fb40dd20b476a906442
 DIST llvm-project-d254fa877f419e61e54709f0a6f2e891da893a60.tar.gz 228028122 BLAKE2B 3321f3b205dfcd672d52122d7ba8e4e737916e01f5041a0dc140722f64359476632e036da0e0692cd366b080a073292cfdb4963e973bf800afabc20d06a2e86b SHA512 135c4864973b682cf41953d43d977eaa219a4a898fceb4b4a8cacbbc6a5dd271d26010b1db6c6c90e761bf3495036f3e7528ab259d48c9c4dc4a064332c0326f

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250301.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-03-01  8:34 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-03-01  8:34 UTC (permalink / raw
  To: gentoo-commits

commit:     5774ecd3c4d3c30c28f59bcc07c4fc283822d054
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  1 08:32:39 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar  1 08:32:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5774ecd3

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 .../clang-common/clang-common-20.1.0_rc2.ebuild    | 310 ---------------------
 .../clang-common-21.0.0_pre20250211.ebuild         | 310 ---------------------
 .../clang-common-21.0.0_pre20250215.ebuild         | 310 ---------------------
 .../clang-common-21.0.0_pre20250221.ebuild         | 310 ---------------------
 5 files changed, 1245 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 45ff16194666..a2f41e0a436d 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,11 +10,6 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 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-20.1.0-rc2.src.tar.xz 147160684 BLAKE2B 6adc1226f022272d78fb0ed361c190d369a2afc53bf868409fe8f4e092d5ffb9894c71870f072bb68162610782f48088468b4a49cdb1bc731d6689c791a5b5e3 SHA512 f303deaec8f25e1b122a7e85df192b6ea10c51472b78a3d14ad9d0b976a533cfbb9164aff0bc99e447e30938cf43363552c5493b4693e1f23291ea7a9b824bbb
-DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5e0df173e3ddc90b6db4350a9008c2f8ba53220da6eef0c69778aecac3caecf918a0c54a0d910177ffe7643ad7fc5624a97262b7f SHA512 e5563a8a79b5e9ef26d62dc6d4385c1c86d12a652b4b1e7fc9ce45a2ea66e5118112746a61b439823bf99d65aea82285eabf5e07714eec77e6e5cd02feab82ce
 DIST llvm-project-20.1.0-rc3.src.tar.xz 147194560 BLAKE2B 888764927782b01e968c9ec326315375c6b1050d3852c7ebe7fbd06b3b4052307162f77a76f1e8976879178116ea909c581b8d1ee99dc7a4c5368b01d5597d23 SHA512 9de97104681de9c8039f03e94adc25fe1765280f826342fb4f616266aa0e4afe63db09a8cc3458252d8b2834e4efb2d17ed0226c62c7bb06d948ba8172ee078c
 DIST llvm-project-20.1.0-rc3.src.tar.xz.sig 566 BLAKE2B 411ad085c3ab83c1599d110d93a9279206885a01e4748b8ac015a9a94b89fe25c35eab38b213cafb7f733be03826ffc4a01eb52788e2742d44d41a487aff2e26 SHA512 53c5aaa963e883ff06ac7ec9b821dcc4476b79f5be0169667843b18cd8836e8993856a045f2aab23bc77faefc2983fd822cfb1219d5644cec67132d647c877d8
-DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
-DIST llvm-project-581599096e8a1a89ccd3e053a1209c69a9079083.tar.gz 227830555 BLAKE2B 28a04dd5ce96716d389fe049c4b877f55d6e5cad5c77d8867dd7e3a448213ef413e4f4d7d5f77b0702b26a8eb25f53e08d90e2a5a97eaa3f89245531d9f6626d SHA512 d775aea9bf71d60673e966a689ff6b933afecab2c133a1f64a158551ba9db049221148eab5087bab0ce0ff917456b85fb4ea4d7284886326f54617d167a385a5
-DIST llvm-project-c30a7f459452d5766da244564bc1d5888346c364.tar.gz 227560986 BLAKE2B c1c833aa6d488530826d96db81ca8be2fcf842ccf5b10a65ff18269fdfa32fa2742fb0a547eb315c2a9ee383e1b6b6cce4a78136e1740e04d322c79fb6a66a86 SHA512 0b68d3462e5eac89f50cff5e64603758ab74c701ff2de88c8569dd45b7e702b5d13b26c2745615c0c355d46d13765f47e4d43e61cde735240c6f386c0090becb
 DIST llvm-project-d254fa877f419e61e54709f0a6f2e891da893a60.tar.gz 228028122 BLAKE2B 3321f3b205dfcd672d52122d7ba8e4e737916e01f5041a0dc140722f64359476632e036da0e0692cd366b080a073292cfdb4963e973bf800afabc20d06a2e86b SHA512 135c4864973b682cf41953d43d977eaa219a4a898fceb4b4a8cacbbc6a5dd271d26010b1db6c6c90e761bf3495036f3e7528ab259d48c9c4dc4a064332c0326f

diff --git a/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild b/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250215.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250215.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250215.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-26 18:55 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-26 18:55 UTC (permalink / raw
  To: gentoo-commits

commit:     fc8481f042be70fe32f6f8a53e86b98720236ffc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 26 18:51:09 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 26 18:55:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc8481f0

llvm-core/clang-common: Add 20.1.0_rc3

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-20.1.0_rc3.ebuild    | 310 +++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 8a453d62c389..45ff16194666 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,6 +12,8 @@ DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818bef
 DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
 DIST llvm-project-20.1.0-rc2.src.tar.xz 147160684 BLAKE2B 6adc1226f022272d78fb0ed361c190d369a2afc53bf868409fe8f4e092d5ffb9894c71870f072bb68162610782f48088468b4a49cdb1bc731d6689c791a5b5e3 SHA512 f303deaec8f25e1b122a7e85df192b6ea10c51472b78a3d14ad9d0b976a533cfbb9164aff0bc99e447e30938cf43363552c5493b4693e1f23291ea7a9b824bbb
 DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5e0df173e3ddc90b6db4350a9008c2f8ba53220da6eef0c69778aecac3caecf918a0c54a0d910177ffe7643ad7fc5624a97262b7f SHA512 e5563a8a79b5e9ef26d62dc6d4385c1c86d12a652b4b1e7fc9ce45a2ea66e5118112746a61b439823bf99d65aea82285eabf5e07714eec77e6e5cd02feab82ce
+DIST llvm-project-20.1.0-rc3.src.tar.xz 147194560 BLAKE2B 888764927782b01e968c9ec326315375c6b1050d3852c7ebe7fbd06b3b4052307162f77a76f1e8976879178116ea909c581b8d1ee99dc7a4c5368b01d5597d23 SHA512 9de97104681de9c8039f03e94adc25fe1765280f826342fb4f616266aa0e4afe63db09a8cc3458252d8b2834e4efb2d17ed0226c62c7bb06d948ba8172ee078c
+DIST llvm-project-20.1.0-rc3.src.tar.xz.sig 566 BLAKE2B 411ad085c3ab83c1599d110d93a9279206885a01e4748b8ac015a9a94b89fe25c35eab38b213cafb7f733be03826ffc4a01eb52788e2742d44d41a487aff2e26 SHA512 53c5aaa963e883ff06ac7ec9b821dcc4476b79f5be0169667843b18cd8836e8993856a045f2aab23bc77faefc2983fd822cfb1219d5644cec67132d647c877d8
 DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
 DIST llvm-project-581599096e8a1a89ccd3e053a1209c69a9079083.tar.gz 227830555 BLAKE2B 28a04dd5ce96716d389fe049c4b877f55d6e5cad5c77d8867dd7e3a448213ef413e4f4d7d5f77b0702b26a8eb25f53e08d90e2a5a97eaa3f89245531d9f6626d SHA512 d775aea9bf71d60673e966a689ff6b933afecab2c133a1f64a158551ba9db049221148eab5087bab0ce0ff917456b85fb4ea4d7284886326f54617d167a385a5
 DIST llvm-project-c30a7f459452d5766da244564bc1d5888346c364.tar.gz 227560986 BLAKE2B c1c833aa6d488530826d96db81ca8be2fcf842ccf5b10a65ff18269fdfa32fa2742fb0a547eb315c2a9ee383e1b6b6cce4a78136e1740e04d322c79fb6a66a86 SHA512 0b68d3462e5eac89f50cff5e64603758ab74c701ff2de88c8569dd45b7e702b5d13b26c2745615c0c355d46d13765f47e4d43e61cde735240c6f386c0090becb

diff --git a/llvm-core/clang-common/clang-common-20.1.0_rc3.ebuild b/llvm-core/clang-common/clang-common-20.1.0_rc3.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.0_rc3.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-22 15:19 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-22 15:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f4a579aaacd39280984f159b88cc929db992693e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 22 15:09:57 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 22 15:19:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4a579aa

llvm-core/clang-common: Add 21.0.0_pre20250221 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250221.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 9755f1e011a6..f14cc7e05032 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,4 +13,5 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-20.1.0-rc2.src.tar.xz 147160684 BLAKE2B 6adc1226f022272d78fb0ed361c190d369a2afc53bf868409fe8f4e092d5ffb9894c71870f072bb68162610782f48088468b4a49cdb1bc731d6689c791a5b5e3 SHA512 f303deaec8f25e1b122a7e85df192b6ea10c51472b78a3d14ad9d0b976a533cfbb9164aff0bc99e447e30938cf43363552c5493b4693e1f23291ea7a9b824bbb
 DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5e0df173e3ddc90b6db4350a9008c2f8ba53220da6eef0c69778aecac3caecf918a0c54a0d910177ffe7643ad7fc5624a97262b7f SHA512 e5563a8a79b5e9ef26d62dc6d4385c1c86d12a652b4b1e7fc9ce45a2ea66e5118112746a61b439823bf99d65aea82285eabf5e07714eec77e6e5cd02feab82ce
 DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
+DIST llvm-project-581599096e8a1a89ccd3e053a1209c69a9079083.tar.gz 227830555 BLAKE2B 28a04dd5ce96716d389fe049c4b877f55d6e5cad5c77d8867dd7e3a448213ef413e4f4d7d5f77b0702b26a8eb25f53e08d90e2a5a97eaa3f89245531d9f6626d SHA512 d775aea9bf71d60673e966a689ff6b933afecab2c133a1f64a158551ba9db049221148eab5087bab0ce0ff917456b85fb4ea4d7284886326f54617d167a385a5
 DIST llvm-project-c30a7f459452d5766da244564bc1d5888346c364.tar.gz 227560986 BLAKE2B c1c833aa6d488530826d96db81ca8be2fcf842ccf5b10a65ff18269fdfa32fa2742fb0a547eb315c2a9ee383e1b6b6cce4a78136e1740e04d322c79fb6a66a86 SHA512 0b68d3462e5eac89f50cff5e64603758ab74c701ff2de88c8569dd45b7e702b5d13b26c2745615c0c355d46d13765f47e4d43e61cde735240c6f386c0090becb

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250221.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-15  7:19 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-15  7:19 UTC (permalink / raw
  To: gentoo-commits

commit:     41778dfdd4e5e429b8e9caac8971d276e148acf0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 15 07:18:07 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 15 07:18:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41778dfd

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 .../clang-common-20.0.0_pre20250125.ebuild         | 310 ---------------------
 .../clang-common/clang-common-20.1.0_rc1.ebuild    | 310 ---------------------
 .../clang-common-21.0.0_pre20250201.ebuild         | 310 ---------------------
 .../clang-common-21.0.0_pre20250208.ebuild         | 310 ---------------------
 5 files changed, 1245 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index e2345ea11956..8af079707d77 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,11 +10,6 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 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-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
-DIST llvm-project-20.1.0-rc1.src.tar.xz 147144668 BLAKE2B ea4733962f38ea5897c73e91840818921739909c3671749bc8a0b1d2798e5a0815bbe750ade3a2a7414836ab7158754818b2f9370a4ee1bbbd52c96b1e95ef9b SHA512 c23c4b1227b6b0b7c3059358e64a00ee98893236bb1a0a41d7e821bdf2aa8353aea8f9f7b9498899c6807b9b8e2ceb06c3cd62e32fd07a786a319135055541b4
-DIST llvm-project-20.1.0-rc1.src.tar.xz.sig 566 BLAKE2B 32eb278ec4ff1bb9d258b584922b0d227f4126a957ba75af44dcaa63b6a12ef73db56d6a86f24244af47803ddf6a243149d784f08137cbea60b49700be537705 SHA512 d7a334326201f8ca78284b33c325f180538667a0401bc30931e790aacc96dd78f6559c45929b6c335d40ef1dbe772738c0ce55d881ae3d7401733778b485408c
 DIST llvm-project-20.1.0-rc2.src.tar.xz 147160684 BLAKE2B 6adc1226f022272d78fb0ed361c190d369a2afc53bf868409fe8f4e092d5ffb9894c71870f072bb68162610782f48088468b4a49cdb1bc731d6689c791a5b5e3 SHA512 f303deaec8f25e1b122a7e85df192b6ea10c51472b78a3d14ad9d0b976a533cfbb9164aff0bc99e447e30938cf43363552c5493b4693e1f23291ea7a9b824bbb
 DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5e0df173e3ddc90b6db4350a9008c2f8ba53220da6eef0c69778aecac3caecf918a0c54a0d910177ffe7643ad7fc5624a97262b7f SHA512 e5563a8a79b5e9ef26d62dc6d4385c1c86d12a652b4b1e7fc9ce45a2ea66e5118112746a61b439823bf99d65aea82285eabf5e07714eec77e6e5cd02feab82ce
 DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
-DIST llvm-project-6f241e36831927e3aea113cfc017c34fdeda340a.tar.gz 227203285 BLAKE2B 8d5e424c1836acc82ea766cd2cef104593c44d197ebeb64f18dbe74b1b5baeb4bc84084f5b68bd87ac36f7df25689dd2522cb6674a97da4f96f4f10f7bae5b06 SHA512 2b6e4bd6445eabfa3ace9b45d20797c7afc23f4553a8938399aeba227e3b8ca6a53a7d7762925a845bfed031c37af692b9c08180fbab80db2f3166940e560077
-DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild b/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-13  7:53 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-13  7:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8f6e9ff8472bc95f476b5742c18d1b9570693218
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 13 07:47:56 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 13 07:52:53 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f6e9ff8

llvm-core/clang-common: Add 20.1.0_rc2

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-20.1.0_rc2.ebuild    | 310 +++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 04bfb25ffdfc..e2345ea11956 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,6 +13,8 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
 DIST llvm-project-20.1.0-rc1.src.tar.xz 147144668 BLAKE2B ea4733962f38ea5897c73e91840818921739909c3671749bc8a0b1d2798e5a0815bbe750ade3a2a7414836ab7158754818b2f9370a4ee1bbbd52c96b1e95ef9b SHA512 c23c4b1227b6b0b7c3059358e64a00ee98893236bb1a0a41d7e821bdf2aa8353aea8f9f7b9498899c6807b9b8e2ceb06c3cd62e32fd07a786a319135055541b4
 DIST llvm-project-20.1.0-rc1.src.tar.xz.sig 566 BLAKE2B 32eb278ec4ff1bb9d258b584922b0d227f4126a957ba75af44dcaa63b6a12ef73db56d6a86f24244af47803ddf6a243149d784f08137cbea60b49700be537705 SHA512 d7a334326201f8ca78284b33c325f180538667a0401bc30931e790aacc96dd78f6559c45929b6c335d40ef1dbe772738c0ce55d881ae3d7401733778b485408c
+DIST llvm-project-20.1.0-rc2.src.tar.xz 147160684 BLAKE2B 6adc1226f022272d78fb0ed361c190d369a2afc53bf868409fe8f4e092d5ffb9894c71870f072bb68162610782f48088468b4a49cdb1bc731d6689c791a5b5e3 SHA512 f303deaec8f25e1b122a7e85df192b6ea10c51472b78a3d14ad9d0b976a533cfbb9164aff0bc99e447e30938cf43363552c5493b4693e1f23291ea7a9b824bbb
+DIST llvm-project-20.1.0-rc2.src.tar.xz.sig 566 BLAKE2B aa91f7be228e51b0f2234bb5e0df173e3ddc90b6db4350a9008c2f8ba53220da6eef0c69778aecac3caecf918a0c54a0d910177ffe7643ad7fc5624a97262b7f SHA512 e5563a8a79b5e9ef26d62dc6d4385c1c86d12a652b4b1e7fc9ce45a2ea66e5118112746a61b439823bf99d65aea82285eabf5e07714eec77e6e5cd02feab82ce
 DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
 DIST llvm-project-6f241e36831927e3aea113cfc017c34fdeda340a.tar.gz 227203285 BLAKE2B 8d5e424c1836acc82ea766cd2cef104593c44d197ebeb64f18dbe74b1b5baeb4bc84084f5b68bd87ac36f7df25689dd2522cb6674a97da4f96f4f10f7bae5b06 SHA512 2b6e4bd6445eabfa3ace9b45d20797c7afc23f4553a8938399aeba227e3b8ca6a53a7d7762925a845bfed031c37af692b9c08180fbab80db2f3166940e560077
 DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild b/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.0_rc2.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-11 11:29 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-11 11:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a7b434fdedac58a52487d282ae72587fe87a89c8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 11 10:56:44 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb 11 11:29:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7b434fd

llvm-core/clang-common: Add 21.0.0_pre20250211 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250211.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index fb9676abc4b1..04bfb25ffdfc 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,5 +13,6 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
 DIST llvm-project-20.1.0-rc1.src.tar.xz 147144668 BLAKE2B ea4733962f38ea5897c73e91840818921739909c3671749bc8a0b1d2798e5a0815bbe750ade3a2a7414836ab7158754818b2f9370a4ee1bbbd52c96b1e95ef9b SHA512 c23c4b1227b6b0b7c3059358e64a00ee98893236bb1a0a41d7e821bdf2aa8353aea8f9f7b9498899c6807b9b8e2ceb06c3cd62e32fd07a786a319135055541b4
 DIST llvm-project-20.1.0-rc1.src.tar.xz.sig 566 BLAKE2B 32eb278ec4ff1bb9d258b584922b0d227f4126a957ba75af44dcaa63b6a12ef73db56d6a86f24244af47803ddf6a243149d784f08137cbea60b49700be537705 SHA512 d7a334326201f8ca78284b33c325f180538667a0401bc30931e790aacc96dd78f6559c45929b6c335d40ef1dbe772738c0ce55d881ae3d7401733778b485408c
+DIST llvm-project-2cd8207b26ea4269630feba661f68554d7ae3c15.tar.gz 227261597 BLAKE2B 51ce992b651fcf08b7fd520420040803b59f1260947953325400c50bec576c418b162d8ae2d2307e70b885b1185c302a97409bcfe48cdb14b8e1384f4e2dfa9e SHA512 a41749943508ea4a18b47c4e947917b5268544e64372c0c3347f9ab8172a2c229d8b1d813d1e842be1b98aedd624524857ed3bb23fe98ad5f36e7a71581abb4b
 DIST llvm-project-6f241e36831927e3aea113cfc017c34fdeda340a.tar.gz 227203285 BLAKE2B 8d5e424c1836acc82ea766cd2cef104593c44d197ebeb64f18dbe74b1b5baeb4bc84084f5b68bd87ac36f7df25689dd2522cb6674a97da4f96f4f10f7bae5b06 SHA512 2b6e4bd6445eabfa3ace9b45d20797c7afc23f4553a8938399aeba227e3b8ca6a53a7d7762925a845bfed031c37af692b9c08180fbab80db2f3166940e560077
 DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250211.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-08 11:51 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-08 11:51 UTC (permalink / raw
  To: gentoo-commits

commit:     9a5ebdb5e64fbac12bf2664f72ac49e618d8cfa7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 11:48:46 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 11:48:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5ebdb5

llvm-core/clang-common: Add 21.0.0_pre20250208 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250208.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 07b84607805e..fb9676abc4b1 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,4 +13,5 @@ DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf
 DIST llvm-project-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
 DIST llvm-project-20.1.0-rc1.src.tar.xz 147144668 BLAKE2B ea4733962f38ea5897c73e91840818921739909c3671749bc8a0b1d2798e5a0815bbe750ade3a2a7414836ab7158754818b2f9370a4ee1bbbd52c96b1e95ef9b SHA512 c23c4b1227b6b0b7c3059358e64a00ee98893236bb1a0a41d7e821bdf2aa8353aea8f9f7b9498899c6807b9b8e2ceb06c3cd62e32fd07a786a319135055541b4
 DIST llvm-project-20.1.0-rc1.src.tar.xz.sig 566 BLAKE2B 32eb278ec4ff1bb9d258b584922b0d227f4126a957ba75af44dcaa63b6a12ef73db56d6a86f24244af47803ddf6a243149d784f08137cbea60b49700be537705 SHA512 d7a334326201f8ca78284b33c325f180538667a0401bc30931e790aacc96dd78f6559c45929b6c335d40ef1dbe772738c0ce55d881ae3d7401733778b485408c
+DIST llvm-project-6f241e36831927e3aea113cfc017c34fdeda340a.tar.gz 227203285 BLAKE2B 8d5e424c1836acc82ea766cd2cef104593c44d197ebeb64f18dbe74b1b5baeb4bc84084f5b68bd87ac36f7df25689dd2522cb6674a97da4f96f4f10f7bae5b06 SHA512 2b6e4bd6445eabfa3ace9b45d20797c7afc23f4553a8938399aeba227e3b8ca6a53a7d7762925a845bfed031c37af692b9c08180fbab80db2f3166940e560077
 DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250208.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-07 20:08 Arthur Zamarin
  0 siblings, 0 replies; 97+ messages in thread
From: Arthur Zamarin @ 2025-02-07 20:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6407299b60da6c0452813df3414580e8e666cd5e
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  7 20:07:46 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Feb  7 20:07:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6407299b

llvm-core/clang-common: Stabilize 19.1.7 arm64, #946879

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 llvm-core/clang-common/clang-common-19.1.7.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-19.1.7.ebuild b/llvm-core/clang-common/clang-common-19.1.7.ebuild
index df9e15f205b8..73c6ae9644a5 100644
--- a/llvm-core/clang-common/clang-common-19.1.7.ebuild
+++ b/llvm-core/clang-common/clang-common-19.1.7.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 ~arm arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld
 	bootstrap-prefix cet hardened llvm-libunwind


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-02 18:25 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-02 18:25 UTC (permalink / raw
  To: gentoo-commits

commit:     bef187267308926834bc1e8882a17cd6a2d037fd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  2 15:58:44 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb  2 18:25:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bef18726

llvm-core/clang-common: Add 20.1.0_rc1

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

 llvm-core/clang-common/Manifest                    |   2 +
 .../clang-common/clang-common-20.1.0_rc1.ebuild    | 310 +++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 792d107b0e7e..07b84607805e 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,4 +11,6 @@ DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e2
 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-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
+DIST llvm-project-20.1.0-rc1.src.tar.xz 147144668 BLAKE2B ea4733962f38ea5897c73e91840818921739909c3671749bc8a0b1d2798e5a0815bbe750ade3a2a7414836ab7158754818b2f9370a4ee1bbbd52c96b1e95ef9b SHA512 c23c4b1227b6b0b7c3059358e64a00ee98893236bb1a0a41d7e821bdf2aa8353aea8f9f7b9498899c6807b9b8e2ceb06c3cd62e32fd07a786a319135055541b4
+DIST llvm-project-20.1.0-rc1.src.tar.xz.sig 566 BLAKE2B 32eb278ec4ff1bb9d258b584922b0d227f4126a957ba75af44dcaa63b6a12ef73db56d6a86f24244af47803ddf6a243149d784f08137cbea60b49700be537705 SHA512 d7a334326201f8ca78284b33c325f180538667a0401bc30931e790aacc96dd78f6559c45929b6c335d40ef1dbe772738c0ce55d881ae3d7401733778b485408c
 DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild b/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.1.0_rc1.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-01 13:15 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-01 13:15 UTC (permalink / raw
  To: gentoo-commits

commit:     164e0e14f19afca34d8ebb58165cea4ba61ba8e9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  1 13:12:40 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb  1 13:14:42 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=164e0e14

llvm-core/clang-common: Add 21.0.0_pre20250201 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-21.0.0_pre20250201.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 508a179f4fc9..792d107b0e7e 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e2
 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-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
+DIST llvm-project-bfa7edcc6652bdb37d53e0cec64926aab3f280eb.tar.gz 226735989 BLAKE2B 165837dc526e618b44c49d5fa3dceda373452e010a09746bff248903fe77874637d05ab9f5d2f63de7ebce5c14e3b19a131313a4a557adfd20fe9cb93ab60476 SHA512 e9e19176fcf1302727ee34d69eaa820b94959d64ceaf754d8a93ebd5e262cec7fe35e87b08f705b09e42c3ea26b671318eecf10e9137c635b12f481f80fbac23

diff --git a/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild b/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-21.0.0_pre20250201.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-01  8:05 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-02-01  8:05 UTC (permalink / raw
  To: gentoo-commits

commit:     9691b471210ae9f6254cc2c2d702f04418f619cf
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  1 07:59:10 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb  1 08:05:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9691b471

llvm-core/clang-common: main is now 21*

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

 ...{clang-common-20.0.0.9999.ebuild => clang-common-21.0.0.9999.ebuild} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/clang-common-20.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
similarity index 99%
rename from llvm-core/clang-common/clang-common-20.0.0.9999.ebuild
rename to llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
index 8e66cf2865d9..1fde60b6b6de 100644
--- a/llvm-core/clang-common/clang-common-20.0.0.9999.ebuild
+++ b/llvm-core/clang-common/clang-common-21.0.0.9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-31 21:51 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-31 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     c2b560db0f82d97c29cf8ee587038c4415115c58
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 31 19:51:49 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 31 21:50:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2b560db

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 llvm-core/clang-common/clang-common-19.1.6.ebuild  | 310 ---------------------
 .../clang-common-20.0.0_pre20250111.ebuild         | 310 ---------------------
 .../clang-common-20.0.0_pre20250118.ebuild         | 310 ---------------------
 .../clang-common-20.0.0_pre20250122.ebuild         | 310 ---------------------
 5 files changed, 1245 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index fd9193718801..508a179f4fc9 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,11 +8,6 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d2250268df36fb94fa0fd5b3611484094fbd7962051978334d2c623d2ff5a0209dbb2c6c6492be0146507ae982a7d3e9705a689c5 SHA512 a586f8a41dde5e0d9ca6d8c58e9ef2a2e59b70a86d2e2c46106dc31b5c096bb80af0cdbdb486179e9cc676a540099f49a1c2db9e5e84c50362db1f72e9af6906
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
-DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
-DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 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-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
-DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
-DIST llvm-project-97c3a990f05606cb807faf53bc41302fb62c7980.tar.gz 226261635 BLAKE2B 9dd0bdfaa6ee984747f2d9d8b9606cd8d2e75fa64d45fd7c87227ddca7cffe888a1d932d73c123b25360690fd687554cc333fb3d871ab0e72ddd2b1158bae2e0 SHA512 466ae8aea014fd396f3fd6b77055238a672f012b79f25ed0b215e01f968a56dd4eeaf148d03246701b1ac4cbb8f02a4325142d6e5503fb6231e330c2e49e28e7
-DIST llvm-project-c3a935e3f967f8f22f5db240d145459ee621c1e0.tar.gz 225133913 BLAKE2B ced922010bad14df6bce0dbbb9323ee3cc9d7bf2f764f8c982d134d7a97e38d84b0b81635bbb16031aa1899c744e7c036cec5d1957733bbed7a2f18f89db0b6f SHA512 0ea083defb3c0ecaa5d8d28682f140c68ec6b3ab6cbfc60fc38a9265a8eb88b618c075d6ae03170ed54c5e7dcb3b7003eaacea2fcb115e9864b64a17cea0013d

diff --git a/llvm-core/clang-common/clang-common-19.1.6.ebuild b/llvm-core/clang-common/clang-common-19.1.6.ebuild
deleted file mode 100644
index 01f58a6b11dc..000000000000
--- a/llvm-core/clang-common/clang-common-19.1.6.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
-	#  define __GENTOO_NOT_FREESTANDING 1
-	# else
-	#  define __GENTOO_NOT_FREESTANDING 0
-	# endif
-	#
-	# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
-	#  if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
-	#   define _FORTIFY_SOURCE ${fortify_level}
-	#  endif
-	# endif
-	# undef __GENTOO_HAS_FEATURE
-	# undef __GENTOO_NOT_FREESTANDING
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-29 21:28 Sam James
  0 siblings, 0 replies; 97+ messages in thread
From: Sam James @ 2025-01-29 21:28 UTC (permalink / raw
  To: gentoo-commits

commit:     4d481ef1b25ffa1869427d75fe30818f14e53a22
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 29 21:26:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 29 21:27:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d481ef1

llvm-core/clang-common: drop obsolete USE=stricter

We dropped it from newer Clangs already, there's no point in keeping
this here and may even confuse some people looking at `equery u` or
whatever. It served its purpose, as these things are default out
of the box now where appropriate.

We've also had some people asking about why it's gone etc so removing
it avoids that confusion.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../clang-common/clang-common-15.0.7-r10.ebuild      | 20 ++------------------
 llvm-core/clang-common/metadata.xml                  |  1 -
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/llvm-core/clang-common/clang-common-15.0.7-r10.ebuild b/llvm-core/clang-common/clang-common-15.0.7-r10.ebuild
index e0f714bebce1..50b8d4b18639 100644
--- a/llvm-core/clang-common/clang-common-15.0.7-r10.ebuild
+++ b/llvm-core/clang-common/clang-common-15.0.7-r10.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -13,7 +13,7 @@ SLOT="0"
 KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
 IUSE="
 	default-compiler-rt default-libcxx default-lld llvm-libunwind
-	hardened stricter
+	hardened
 "
 
 PDEPEND="
@@ -146,22 +146,6 @@ src_install() {
 		EOF
 	fi
 
-	if use stricter; then
-		newins - gentoo-stricter.cfg <<-EOF
-			# This file increases the strictness of older clang versions
-			# to match the newest upstream version.
-
-			# clang-16 defaults
-			-Werror=implicit-function-declaration
-			-Werror=implicit-int
-			-Werror=incompatible-function-pointer-types
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			@gentoo-stricter.cfg
-		EOF
-	fi
-
 	local tool
 	for tool in clang{,++,-cpp}; do
 		newins - "${tool}.cfg" <<-EOF

diff --git a/llvm-core/clang-common/metadata.xml b/llvm-core/clang-common/metadata.xml
index a4b5da44a19b..20d001720e1f 100644
--- a/llvm-core/clang-common/metadata.xml
+++ b/llvm-core/clang-common/metadata.xml
@@ -28,6 +28,5 @@
 			what you're doing.
 		</flag>
 		<flag name="default-lld">Use lld as the default linker for clang</flag>
-		<flag name="stricter">Default to stricter behavior known from newer clang versions, turning more warnings into errors</flag>
 	</use>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-29 21:25 Sam James
  0 siblings, 0 replies; 97+ messages in thread
From: Sam James @ 2025-01-29 21:25 UTC (permalink / raw
  To: gentoo-commits

commit:     34330ce1861e63a03e38f014ecee3bdb82914d80
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 29 21:24:08 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 29 21:24:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34330ce1

llvm-core/clang-common: make USE=default-libcxx description scary

Bug: https://bugs.gentoo.org/944478
Signed-off-by: Sam James <sam <AT> gentoo.org>

 llvm-core/clang-common/metadata.xml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/llvm-core/clang-common/metadata.xml b/llvm-core/clang-common/metadata.xml
index da45c87b0e27..a4b5da44a19b 100644
--- a/llvm-core/clang-common/metadata.xml
+++ b/llvm-core/clang-common/metadata.xml
@@ -20,7 +20,13 @@
 			but provides no benefit either.
 		</flag>
 		<flag name="default-compiler-rt">Use compiler-rt + libunwind instead of libgcc as the default rtlib for clang</flag>
-		<flag name="default-libcxx">Use libc++ instead of libstdc++ as the default stdlib for clang</flag>
+		<flag name="default-libcxx">
+			Use libc++ instead of libstdc++ as the default stdlib for clang.
+
+			Beware: this breaks ABI, producing binaries incompatible with those
+			built with GCC or Clang using libstdc++. Do not set unless you know
+			what you're doing.
+		</flag>
 		<flag name="default-lld">Use lld as the default linker for clang</flag>
 		<flag name="stricter">Default to stricter behavior known from newer clang versions, turning more warnings into errors</flag>
 	</use>


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-25 13:33 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-25 13:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e583495eb3faf985a3b98d806383ae87171a7454
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 25 13:07:56 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 25 13:32:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e583495e

llvm-core/clang-common: Add 20.0.0_pre20250125 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20250125.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 534a9e0fb12c..fd9193718801 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,6 +12,7 @@ DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee5
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 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-1f26ac10ca1bef40a80be8f81a6f109713bc586f.tar.gz 226424755 BLAKE2B 642befb8d6923f335d1d68129ebb7357f8ba22e110df494dd956c8097e4e5db4b2a88fcc069ab67184b03558f072c68e002bdaf90eba865e38b1473a0ef29eed SHA512 e9bb4fd31bbad5ec864c662515b5ec2e5511cce975040f9f3cd8f009c92f76077928feae0467fd9519a001a379c857f7539c506953d8d5a9209a9f358f414aac
 DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
 DIST llvm-project-97c3a990f05606cb807faf53bc41302fb62c7980.tar.gz 226261635 BLAKE2B 9dd0bdfaa6ee984747f2d9d8b9606cd8d2e75fa64d45fd7c87227ddca7cffe888a1d932d73c123b25360690fd687554cc333fb3d871ab0e72ddd2b1158bae2e0 SHA512 466ae8aea014fd396f3fd6b77055238a672f012b79f25ed0b215e01f968a56dd4eeaf148d03246701b1ac4cbb8f02a4325142d6e5503fb6231e330c2e49e28e7
 DIST llvm-project-c3a935e3f967f8f22f5db240d145459ee621c1e0.tar.gz 225133913 BLAKE2B ced922010bad14df6bce0dbbb9323ee3cc9d7bf2f764f8c982d134d7a97e38d84b0b81635bbb16031aa1899c744e7c036cec5d1957733bbed7a2f18f89db0b6f SHA512 0ea083defb3c0ecaa5d8d28682f140c68ec6b3ab6cbfc60fc38a9265a8eb88b618c075d6ae03170ed54c5e7dcb3b7003eaacea2fcb115e9864b64a17cea0013d

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20250125.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-22 19:15 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-22 19:15 UTC (permalink / raw
  To: gentoo-commits

commit:     7529b229a7bc4ca29d29df8e316496bf0ff93f12
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 16:33:24 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 19:15:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7529b229

llvm-core/clang-common: Add 20.0.0_pre20250122 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20250122.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index b7114fc7aeab..534a9e0fb12c 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,4 +13,5 @@ DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9
 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-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
+DIST llvm-project-97c3a990f05606cb807faf53bc41302fb62c7980.tar.gz 226261635 BLAKE2B 9dd0bdfaa6ee984747f2d9d8b9606cd8d2e75fa64d45fd7c87227ddca7cffe888a1d932d73c123b25360690fd687554cc333fb3d871ab0e72ddd2b1158bae2e0 SHA512 466ae8aea014fd396f3fd6b77055238a672f012b79f25ed0b215e01f968a56dd4eeaf148d03246701b1ac4cbb8f02a4325142d6e5503fb6231e330c2e49e28e7
 DIST llvm-project-c3a935e3f967f8f22f5db240d145459ee621c1e0.tar.gz 225133913 BLAKE2B ced922010bad14df6bce0dbbb9323ee3cc9d7bf2f764f8c982d134d7a97e38d84b0b81635bbb16031aa1899c744e7c036cec5d1957733bbed7a2f18f89db0b6f SHA512 0ea083defb3c0ecaa5d8d28682f140c68ec6b3ab6cbfc60fc38a9265a8eb88b618c075d6ae03170ed54c5e7dcb3b7003eaacea2fcb115e9864b64a17cea0013d

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20250122.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-18 15:09 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-18 15:09 UTC (permalink / raw
  To: gentoo-commits

commit:     60e7cf15fef0f08b1215fc1d375bcccc46c2e8c0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 18 15:00:36 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 18 15:02:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60e7cf15

llvm-core/clang-common: Add 20.0.0_pre20250118 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20250118.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 93916f0b1f70..b7114fc7aeab 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -13,3 +13,4 @@ DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9
 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-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
+DIST llvm-project-c3a935e3f967f8f22f5db240d145459ee621c1e0.tar.gz 225133913 BLAKE2B ced922010bad14df6bce0dbbb9323ee3cc9d7bf2f764f8c982d134d7a97e38d84b0b81635bbb16031aa1899c744e7c036cec5d1957733bbed7a2f18f89db0b6f SHA512 0ea083defb3c0ecaa5d8d28682f140c68ec6b3ab6cbfc60fc38a9265a8eb88b618c075d6ae03170ed54c5e7dcb3b7003eaacea2fcb115e9864b64a17cea0013d

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20250118.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-18  8:21 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-18  8:21 UTC (permalink / raw
  To: gentoo-commits

commit:     25ecfedba9629c54f7ae0a6500c7d9f4e86b24cd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 18 07:21:46 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 18 07:21:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25ecfedb

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   2 -
 .../clang-common-20.0.0_pre20241227.ebuild         | 310 ---------------------
 .../clang-common-20.0.0_pre20250104.ebuild         | 310 ---------------------
 3 files changed, 622 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index cb5f43e438ae..93916f0b1f70 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -12,6 +12,4 @@ DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee5
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 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-2529a8df53af9bc6cecfd6c83404ffa5e89e3370.tar.gz 224493461 BLAKE2B 0d3c757a8f34a9bf6b2ac0ad394cc1f8125cfee534c8bd0c5875eba56fe0171892586ec05b6f1e859e5962f81c76c9a315f60bcda012df73a3bd66709b265038 SHA512 a49fa1da2fd398b279a90292704e30d8ff7163219bfd91c4a80fa5123d957cdef52d2ee41710a8bcbfea3d9a5eec269dfc756584fcc27a495f7f381176de4e69
 DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
-DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild
deleted file mode 100644
index 8e66cf2865d9..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild
deleted file mode 100644
index 1fde60b6b6de..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-15  4:24 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-15  4:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e1c6ef9979202b7edf9424bec7503a98eaf07e0c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 14 20:01:25 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jan 15 04:23:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1c6ef99

llvm-core/clang-common: Add 19.1.7

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-19.1.7.ebuild | 310 ++++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index f83a59fdc6ff..cb5f43e438ae 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,6 +10,8 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
+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-2529a8df53af9bc6cecfd6c83404ffa5e89e3370.tar.gz 224493461 BLAKE2B 0d3c757a8f34a9bf6b2ac0ad394cc1f8125cfee534c8bd0c5875eba56fe0171892586ec05b6f1e859e5962f81c76c9a315f60bcda012df73a3bd66709b265038 SHA512 a49fa1da2fd398b279a90292704e30d8ff7163219bfd91c4a80fa5123d957cdef52d2ee41710a8bcbfea3d9a5eec269dfc756584fcc27a495f7f381176de4e69
 DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
 DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-19.1.7.ebuild b/llvm-core/clang-common/clang-common-19.1.7.ebuild
new file mode 100644
index 000000000000..1c56480336f7
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-19.1.7.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+	#  define __GENTOO_NOT_FREESTANDING 1
+	# else
+	#  define __GENTOO_NOT_FREESTANDING 0
+	# endif
+	#
+	# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+	#  if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+	#   define _FORTIFY_SOURCE ${fortify_level}
+	#  endif
+	# endif
+	# undef __GENTOO_HAS_FEATURE
+	# undef __GENTOO_NOT_FREESTANDING
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-11 18:12 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-11 18:12 UTC (permalink / raw
  To: gentoo-commits

commit:     02989264dd33e179a51fe79250dbe19cbe5fcf8b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 11 18:01:38 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 18:11:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02989264

llvm-core/clang-common: Add 20.0.0_pre20250111 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20250111.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index e960d60a57bd..f83a59fdc6ff 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,4 +11,5 @@ DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e2
 DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 DIST llvm-project-2529a8df53af9bc6cecfd6c83404ffa5e89e3370.tar.gz 224493461 BLAKE2B 0d3c757a8f34a9bf6b2ac0ad394cc1f8125cfee534c8bd0c5875eba56fe0171892586ec05b6f1e859e5962f81c76c9a315f60bcda012df73a3bd66709b265038 SHA512 a49fa1da2fd398b279a90292704e30d8ff7163219bfd91c4a80fa5123d957cdef52d2ee41710a8bcbfea3d9a5eec269dfc756584fcc27a495f7f381176de4e69
+DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
 DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20250111.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-01-04 15:28 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2025-01-04 15:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ab3f33e935394a051fc056db567566784741b0c1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  4 15:07:40 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan  4 15:27:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab3f33e9

llvm-core/clang-common: Add 20.0.0_pre20250104 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20250104.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index fef409fa0e6a..e960d60a57bd 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,4 +10,5 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
+DIST llvm-project-2529a8df53af9bc6cecfd6c83404ffa5e89e3370.tar.gz 224493461 BLAKE2B 0d3c757a8f34a9bf6b2ac0ad394cc1f8125cfee534c8bd0c5875eba56fe0171892586ec05b6f1e859e5962f81c76c9a315f60bcda012df73a3bd66709b265038 SHA512 a49fa1da2fd398b279a90292704e30d8ff7163219bfd91c4a80fa5123d957cdef52d2ee41710a8bcbfea3d9a5eec269dfc756584fcc27a495f7f381176de4e69
 DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild
new file mode 100644
index 000000000000..1fde60b6b6de
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20250104.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-28 19:35 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2024-12-28 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     93227eac8481bda97284da05d7bbbded0522accc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 19:33:21 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 19:33:21 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93227eac

llvm-core/clang-common: Remove old

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

 llvm-core/clang-common/Manifest                    |   5 -
 llvm-core/clang-common/clang-common-19.1.5.ebuild  | 310 ---------------------
 .../clang-common-20.0.0_pre20241207.ebuild         | 310 ---------------------
 .../clang-common-20.0.0_pre20241215.ebuild         | 310 ---------------------
 .../clang-common-20.0.0_pre20241221.ebuild         | 310 ---------------------
 5 files changed, 1245 deletions(-)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 9d341938dab4..fef409fa0e6a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -8,11 +8,6 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe
 DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
 DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d2250268df36fb94fa0fd5b3611484094fbd7962051978334d2c623d2ff5a0209dbb2c6c6492be0146507ae982a7d3e9705a689c5 SHA512 a586f8a41dde5e0d9ca6d8c58e9ef2a2e59b70a86d2e2c46106dc31b5c096bb80af0cdbdb486179e9cc676a540099f49a1c2db9e5e84c50362db1f72e9af6906
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
-DIST llvm-project-19.1.5.src.tar.xz 141243716 BLAKE2B 228fc66ab688abfc16f31b2cd83163b81ef61604ace21eab69a1776f0dc88cbe8fa831162205849e5be3975a214136399572b4ad1b908986e37b2d38a1a7fa5d SHA512 648854e9c91fdcc5c677ce3800e046f2060b998a45cf9f7eebe02898431b3924f9348b6fc366102cd4fdda72dcb8f32076f98aa69927e0e20b3f1007fba10b22
-DIST llvm-project-19.1.5.src.tar.xz.sig 438 BLAKE2B 1d40a5c5405f99ef86e3360f9ea153afd1ae4001697210fd799a988113e8a3cef39e2c4794edd9332f384d8490f4ce2ab6bee6d98f794f84775807f833b81c0a SHA512 a438c86ce882eb1ac3e50842937068794ed162bb1b7ded68a2fe3ec2ab4f57cc38aee667cfb46afe6da22eef7ed1cb65820a473f63bd5a0dc6aad41df7bfad54
 DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
-DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba
-DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a
-DIST llvm-project-665d79f2e967a5eee6fff93685e45f50cf24cab2.tar.gz 224186302 BLAKE2B 6d4a02b6cfaf53324161c43ed02024f0fea0e7de25a9150cc0168602d7dff3f618026fa8318aa6e03904a9424afa1f12c5eb33bfdfa82e72210f34e5829a7804 SHA512 7482e176b1e2389b0dd0e67271cdb0489e9db0595874408156a034b40d336ecd960c63b89c237ca22eee3650880b0f08a97de14f8a17c918245915d422e568c9
 DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-19.1.5.ebuild b/llvm-core/clang-common/clang-common-19.1.5.ebuild
deleted file mode 100644
index 01f58a6b11dc..000000000000
--- a/llvm-core/clang-common/clang-common-19.1.5.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
-	#  define __GENTOO_NOT_FREESTANDING 1
-	# else
-	#  define __GENTOO_NOT_FREESTANDING 0
-	# endif
-	#
-	# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
-	#  if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
-	#   define _FORTIFY_SOURCE ${fortify_level}
-	#  endif
-	# endif
-	# undef __GENTOO_HAS_FEATURE
-	# undef __GENTOO_NOT_FREESTANDING
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241207.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241207.ebuild
deleted file mode 100644
index 8e66cf2865d9..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20241207.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild
deleted file mode 100644
index 8e66cf2865d9..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild
deleted file mode 100644
index 8e66cf2865d9..000000000000
--- a/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 llvm.org multilib
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-IUSE="
-	default-compiler-rt default-libcxx default-lld
-	bootstrap-prefix cet hardened llvm-libunwind
-"
-
-PDEPEND="
-	default-compiler-rt? (
-		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
-		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 )
-"
-IDEPEND="
-	!default-compiler-rt? ( sys-devel/gcc-config )
-	!default-libcxx? ( sys-devel/gcc-config )
-"
-
-LLVM_COMPONENTS=( clang/utils )
-llvm.org_set_globals
-
-pkg_pretend() {
-	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
-
-	local flag missing_flags=()
-	for flag in default-{compiler-rt,libcxx,lld}; do
-		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
-			missing_flags+=( "${flag}" )
-		fi
-	done
-
-	if [[ ${missing_flags[@]} ]]; then
-		eerror "It seems that you have the following flags set on llvm-core/clang:"
-		eerror
-		eerror "  ${missing_flags[*]}"
-		eerror
-		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
-		eerror "The build is being aborted to prevent breakage.  Please either set"
-		eerror "the respective flags on this ebuild, e.g.:"
-		eerror
-		eerror "  llvm-core/clang-common ${missing_flags[*]}"
-		eerror
-		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
-		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
-	fi
-}
-
-_doclang_cfg() {
-	local triple="${1}"
-
-	local tool
-	for tool in ${triple}-clang{,++}; do
-		newins - "${tool}.cfg" <<-EOF
-			# This configuration file is used by ${tool} driver.
-			@gentoo-common.cfg
-			@gentoo-common-ld.cfg
-		EOF
-		if [[ ${triple} == x86_64* ]]; then
-			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
-				@gentoo-cet.cfg
-			EOF
-		fi
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
-			-lc++abi
-		EOF
-	fi
-
-	newins - "${triple}-clang-cpp.cfg" <<-EOF
-		# This configuration file is used by the ${triple}-clang-cpp driver.
-		@gentoo-common.cfg
-	EOF
-	if [[ ${triple} == x86_64* ]]; then
-		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
-			@gentoo-cet.cfg
-		EOF
-	fi
-
-	# 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/${vendor_triple}-${tool}.cfg" ]]; then
-				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
-			fi
-		done
-	done
-}
-
-doclang_cfg() {
-	local triple="${1}"
-
-	_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() {
-	newbashcomp bash-autocomplete.sh clang
-
-	insinto /etc/clang
-	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-gcc-install.cfg <<-EOF
-		# This file is maintained by gcc-config.
-		# It is used to specify the selected GCC installation.
-	EOF
-
-	newins - gentoo-common.cfg <<-EOF
-		# This file contains flags common to clang, clang++ and clang-cpp.
-		@gentoo-runtimes.cfg
-		@gentoo-gcc-install.cfg
-		@gentoo-hardened.cfg
-		# bug #870001
-		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
-	EOF
-
-	# clang-cpp does not like link args being passed to it when directly
-	# invoked, so use a separate configuration file.
-	newins - gentoo-common-ld.cfg <<-EOF
-		# This file contains flags common to clang and clang++
-		@gentoo-hardened-ld.cfg
-	EOF
-
-	# Baseline hardening (bug #851111)
-	newins - gentoo-hardened.cfg <<-EOF
-		# Some of these options are added unconditionally, regardless of
-		# USE=hardened, for parity with sys-devel/gcc.
-		-Xarch_host -fstack-clash-protection
-		-Xarch_host -fstack-protector-strong
-		-fPIE
-		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
-	EOF
-
-	newins - gentoo-cet.cfg <<-EOF
-		-Xarch_host -fcf-protection=$(usex cet full none)
-	EOF
-
-	if use kernel_Darwin; then
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# There was -Wl,-z,relro here, but it's not supported on Mac
-			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
-		EOF
-	else
-		newins - gentoo-hardened-ld.cfg <<-EOF
-			# Some of these options are added unconditionally, regardless of
-			# USE=hardened, for parity with sys-devel/gcc.
-			-Wl,-z,relro
-			-Wl,-z,now
-		EOF
-	fi
-
-	dodir /usr/include/gentoo
-
-	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
-	/* __has_include is an extension, but it's fine, because this is only
-	for Clang anyway. */
-	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
-	# include <stdc-predef.h>
-	#endif
-	EOF
-
-	local fortify_level=$(usex hardened 3 2)
-	# We have to do this because glibc's headers warn if F_S is set
-	# without optimization and that would at the very least be very noisy
-	# during builds and at worst trigger many -Werror builds.
-	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
-	#ifdef __clang__
-	# pragma clang system_header
-	#endif
-	#ifndef _FORTIFY_SOURCE
-	# if defined(__has_feature)
-	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
-	# else
-	#  define __GENTOO_HAS_FEATURE(x) 0
-	# endif
-	#
-	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
-	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
-	# elif defined(__SANITIZE_ADDRESS__)
-	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
-	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
-	# else
-	#  define _FORTIFY_SOURCE ${fortify_level}
-	# endif
-	#
-	# undef __GENTOO_HAS_FEATURE
-	#endif
-	EOF
-
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
-	if use hardened ; then
-		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-			-Xarch_host -D_GLIBCXX_ASSERTIONS
-
-			# Analogue to GLIBCXX_ASSERTIONS
-			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
-		EOF
-
-		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
-			# Options below are conditional on USE=hardened.
-		EOF
-	fi
-
-	# We only install config files for supported ABIs because unprefixed tools
-	# might be used for crosscompilation where e.g. PIE may not be supported.
-	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
-	local abi
-	for abi in $(get_all_abis); do
-		local abi_chost=$(get_abi_CHOST "${abi}")
-		doclang_cfg "${abi_chost}"
-	done
-
-	if use kernel_Darwin; then
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			# Gentoo Prefix on Darwin
-			-Wl,-search_paths_first
-		EOF
-		if use bootstrap-prefix ; then
-			# bootstrap-prefix is only set during stage2 of bootstrapping
-			# Prefix, where EPREFIX is set to EPREFIX/tmp.
-			# Here we need to point it at the future lib dir of the stage3's
-			# EPREFIX.
-			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-				-Wl,-rpath,${EPREFIX}/../usr/lib
-				-Wl,-L,${EPREFIX}/../usr/lib
-				-isystem ${EPREFIX}/../usr/include
-			EOF
-		fi
-		# Using -Wl,-L instead of -L to trick compiler driver to put it
-		# after -isysroot's internal -L
-		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-			-Wl,-rpath,${EPREFIX}/usr/lib
-			-Wl,-L,${EPREFIX}/usr/lib
-			-isystem ${EPREFIX}/usr/include
-			-isysroot ${EPREFIX}/MacOSX.sdk
-		EOF
-	fi
-}
-
-pkg_preinst() {
-	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
-	then
-		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
-		if [[ -n ${gcc_path} ]]; then
-			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
-				--gcc-install-dir="${gcc_path%%:*}"
-			EOF
-		fi
-	fi
-}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-27 21:25 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2024-12-27 21:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b6cfd4c21fdf1db5db860be692d6c82ab32ae2f7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 20:37:34 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec 27 21:24:54 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6cfd4c2

llvm-core/clang-common: Add 20.0.0_pre20241227 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20241227.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index d3298cd16243..9d341938dab4 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -15,3 +15,4 @@ DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9
 DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba
 DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a
 DIST llvm-project-665d79f2e967a5eee6fff93685e45f50cf24cab2.tar.gz 224186302 BLAKE2B 6d4a02b6cfaf53324161c43ed02024f0fea0e7de25a9150cc0168602d7dff3f618026fa8318aa6e03904a9424afa1f12c5eb33bfdfa82e72210f34e5829a7804 SHA512 7482e176b1e2389b0dd0e67271cdb0489e9db0595874408156a034b40d336ecd960c63b89c237ca22eee3650880b0f08a97de14f8a17c918245915d422e568c9
+DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild
new file mode 100644
index 000000000000..8e66cf2865d9
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20241227.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-21 10:28 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2024-12-21 10:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ed5309ab5be206087af7350ff2e61a4728666a4b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 21 10:10:43 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Dec 21 10:28:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed5309ab

llvm-core/clang-common: Add 20.0.0_pre20241221 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20241221.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 1c0f7dd4592d..d3298cd16243 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -14,3 +14,4 @@ DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee5
 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba
 DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a
+DIST llvm-project-665d79f2e967a5eee6fff93685e45f50cf24cab2.tar.gz 224186302 BLAKE2B 6d4a02b6cfaf53324161c43ed02024f0fea0e7de25a9150cc0168602d7dff3f618026fa8318aa6e03904a9424afa1f12c5eb33bfdfa82e72210f34e5829a7804 SHA512 7482e176b1e2389b0dd0e67271cdb0489e9db0595874408156a034b40d336ecd960c63b89c237ca22eee3650880b0f08a97de14f8a17c918245915d422e568c9

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild
new file mode 100644
index 000000000000..8e66cf2865d9
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20241221.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-17 21:37 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2024-12-17 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     aed2ccdf97c39a0156900a66ab19c975482b13a7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 17 21:34:27 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 17 21:37:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aed2ccdf

llvm-core/clang-common: Add 19.1.6

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

 llvm-core/clang-common/Manifest                   |   2 +
 llvm-core/clang-common/clang-common-19.1.6.ebuild | 310 ++++++++++++++++++++++
 2 files changed, 312 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index cf145cec2b7a..1c0f7dd4592d 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -10,5 +10,7 @@ DIST llvm-project-19.1.4.src.tar.xz 141255156 BLAKE2B b99cd8a96e38dbcfb582ee5d22
 DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e29430bc09ef2b81be763aa5c853793631d7b7fdd65eb4dae7a1e3b4daa15d189c24cd1e14f065f79fdbf75429fa34be9b330e SHA512 3fb4a6c7594cb43680860698dac47062dde30de60f515dcecdad63812ea1edfb2cb209d0a7ac2254589c245a95b7c0f571b582e0d4b97a6ae8242563483ea764
 DIST llvm-project-19.1.5.src.tar.xz 141243716 BLAKE2B 228fc66ab688abfc16f31b2cd83163b81ef61604ace21eab69a1776f0dc88cbe8fa831162205849e5be3975a214136399572b4ad1b908986e37b2d38a1a7fa5d SHA512 648854e9c91fdcc5c677ce3800e046f2060b998a45cf9f7eebe02898431b3924f9348b6fc366102cd4fdda72dcb8f32076f98aa69927e0e20b3f1007fba10b22
 DIST llvm-project-19.1.5.src.tar.xz.sig 438 BLAKE2B 1d40a5c5405f99ef86e3360f9ea153afd1ae4001697210fd799a988113e8a3cef39e2c4794edd9332f384d8490f4ce2ab6bee6d98f794f84775807f833b81c0a SHA512 a438c86ce882eb1ac3e50842937068794ed162bb1b7ded68a2fe3ec2ab4f57cc38aee667cfb46afe6da22eef7ed1cb65820a473f63bd5a0dc6aad41df7bfad54
+DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3
+DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4
 DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba
 DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a

diff --git a/llvm-core/clang-common/clang-common-19.1.6.ebuild b/llvm-core/clang-common/clang-common-19.1.6.ebuild
new file mode 100644
index 000000000000..01f58a6b11dc
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-19.1.6.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+	#  define __GENTOO_NOT_FREESTANDING 1
+	# else
+	#  define __GENTOO_NOT_FREESTANDING 0
+	# endif
+	#
+	# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+	#  if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+	#   define _FORTIFY_SOURCE ${fortify_level}
+	#  endif
+	# endif
+	# undef __GENTOO_HAS_FEATURE
+	# undef __GENTOO_NOT_FREESTANDING
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-16  5:57 Michał Górny
  0 siblings, 0 replies; 97+ messages in thread
From: Michał Górny @ 2024-12-16  5:57 UTC (permalink / raw
  To: gentoo-commits

commit:     84621f309ae0d2bbcc02a1fdfd7498452992327f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 20:12:09 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 16 05:55:45 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84621f30

llvm-core/clang-common: Add 20.0.0_pre20241215 snapshot

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

 llvm-core/clang-common/Manifest                    |   1 +
 .../clang-common-20.0.0_pre20241215.ebuild         | 310 +++++++++++++++++++++
 2 files changed, 311 insertions(+)

diff --git a/llvm-core/clang-common/Manifest b/llvm-core/clang-common/Manifest
index 808f097b416f..cf145cec2b7a 100644
--- a/llvm-core/clang-common/Manifest
+++ b/llvm-core/clang-common/Manifest
@@ -11,3 +11,4 @@ DIST llvm-project-19.1.4.src.tar.xz.sig 438 BLAKE2B b0925bdb761046d69779e0b035e2
 DIST llvm-project-19.1.5.src.tar.xz 141243716 BLAKE2B 228fc66ab688abfc16f31b2cd83163b81ef61604ace21eab69a1776f0dc88cbe8fa831162205849e5be3975a214136399572b4ad1b908986e37b2d38a1a7fa5d SHA512 648854e9c91fdcc5c677ce3800e046f2060b998a45cf9f7eebe02898431b3924f9348b6fc366102cd4fdda72dcb8f32076f98aa69927e0e20b3f1007fba10b22
 DIST llvm-project-19.1.5.src.tar.xz.sig 438 BLAKE2B 1d40a5c5405f99ef86e3360f9ea153afd1ae4001697210fd799a988113e8a3cef39e2c4794edd9332f384d8490f4ce2ab6bee6d98f794f84775807f833b81c0a SHA512 a438c86ce882eb1ac3e50842937068794ed162bb1b7ded68a2fe3ec2ab4f57cc38aee667cfb46afe6da22eef7ed1cb65820a473f63bd5a0dc6aad41df7bfad54
 DIST llvm-project-32f7f0010bca99ee4bd917f57272733fb2bf3bd9.tar.gz 223983502 BLAKE2B fd3e6b0b795abc42568ef98fa774d927029c18838a5d0f34eaa66c37976444a63f2fc5d883f3bf3a98533f51e387936f1c659230f31c757d26153425696a16cd SHA512 65a345ad5b77c627008f759947e5e9f28a62c8992d7146113e0446e5849feaf9088c15c8b22ca0824af5b927d6a417f5326258b489fb8ccea78ec9e0e0fe8fba
+DIST llvm-project-49a5ad8e5714fd404210279303acc97b495d66d0.tar.gz 224456065 BLAKE2B 0077b9d37c479ac6190cc4b897cc35d6f1f3e6a772cd0620bcb1006afc19377e9968e38fb9d9adffe316e85290c9045deecbf9bf62b440c55968634b442edb31 SHA512 45d779eb27c230f656fda47c85127381cab8c8f7f75d77411c6960269f8aad5fa3c99c024a98ab8a349da1c88ad9d892cc82f91a6f344b791b281449031ae49a

diff --git a/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild b/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild
new file mode 100644
index 000000000000..8e66cf2865d9
--- /dev/null
+++ b/llvm-core/clang-common/clang-common-20.0.0_pre20241215.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+	default-compiler-rt default-libcxx default-lld
+	bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+	default-compiler-rt? (
+		llvm-core/clang-runtime:${LLVM_MAJOR}[compiler-rt]
+		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 )
+"
+IDEPEND="
+	!default-compiler-rt? ( sys-devel/gcc-config )
+	!default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+	[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+	local flag missing_flags=()
+	for flag in default-{compiler-rt,libcxx,lld}; do
+		if ! use "${flag}" && has_version "llvm-core/clang[${flag}]"; then
+			missing_flags+=( "${flag}" )
+		fi
+	done
+
+	if [[ ${missing_flags[@]} ]]; then
+		eerror "It seems that you have the following flags set on llvm-core/clang:"
+		eerror
+		eerror "  ${missing_flags[*]}"
+		eerror
+		eerror "The default runtimes are now set via flags on llvm-core/clang-common."
+		eerror "The build is being aborted to prevent breakage.  Please either set"
+		eerror "the respective flags on this ebuild, e.g.:"
+		eerror
+		eerror "  llvm-core/clang-common ${missing_flags[*]}"
+		eerror
+		eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+		die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
+	fi
+}
+
+_doclang_cfg() {
+	local triple="${1}"
+
+	local tool
+	for tool in ${triple}-clang{,++}; do
+		newins - "${tool}.cfg" <<-EOF
+			# This configuration file is used by ${tool} driver.
+			@gentoo-common.cfg
+			@gentoo-common-ld.cfg
+		EOF
+		if [[ ${triple} == x86_64* ]]; then
+			cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+				@gentoo-cet.cfg
+			EOF
+		fi
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+			-lc++abi
+		EOF
+	fi
+
+	newins - "${triple}-clang-cpp.cfg" <<-EOF
+		# This configuration file is used by the ${triple}-clang-cpp driver.
+		@gentoo-common.cfg
+	EOF
+	if [[ ${triple} == x86_64* ]]; then
+		cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+			@gentoo-cet.cfg
+		EOF
+	fi
+
+	# 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/${vendor_triple}-${tool}.cfg" ]]; then
+				dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+			fi
+		done
+	done
+}
+
+doclang_cfg() {
+	local triple="${1}"
+
+	_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() {
+	newbashcomp bash-autocomplete.sh clang
+
+	insinto /etc/clang
+	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-gcc-install.cfg <<-EOF
+		# This file is maintained by gcc-config.
+		# It is used to specify the selected GCC installation.
+	EOF
+
+	newins - gentoo-common.cfg <<-EOF
+		# This file contains flags common to clang, clang++ and clang-cpp.
+		@gentoo-runtimes.cfg
+		@gentoo-gcc-install.cfg
+		@gentoo-hardened.cfg
+		# bug #870001
+		-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+	EOF
+
+	# clang-cpp does not like link args being passed to it when directly
+	# invoked, so use a separate configuration file.
+	newins - gentoo-common-ld.cfg <<-EOF
+		# This file contains flags common to clang and clang++
+		@gentoo-hardened-ld.cfg
+	EOF
+
+	# Baseline hardening (bug #851111)
+	newins - gentoo-hardened.cfg <<-EOF
+		# Some of these options are added unconditionally, regardless of
+		# USE=hardened, for parity with sys-devel/gcc.
+		-Xarch_host -fstack-clash-protection
+		-Xarch_host -fstack-protector-strong
+		-fPIE
+		-include "${EPREFIX}/usr/include/gentoo/fortify.h"
+	EOF
+
+	newins - gentoo-cet.cfg <<-EOF
+		-Xarch_host -fcf-protection=$(usex cet full none)
+	EOF
+
+	if use kernel_Darwin; then
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# There was -Wl,-z,relro here, but it's not supported on Mac
+			# TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+		EOF
+	else
+		newins - gentoo-hardened-ld.cfg <<-EOF
+			# Some of these options are added unconditionally, regardless of
+			# USE=hardened, for parity with sys-devel/gcc.
+			-Wl,-z,relro
+			-Wl,-z,now
+		EOF
+	fi
+
+	dodir /usr/include/gentoo
+
+	cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+	/* __has_include is an extension, but it's fine, because this is only
+	for Clang anyway. */
+	#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+	# include <stdc-predef.h>
+	#endif
+	EOF
+
+	local fortify_level=$(usex hardened 3 2)
+	# We have to do this because glibc's headers warn if F_S is set
+	# without optimization and that would at the very least be very noisy
+	# during builds and at worst trigger many -Werror builds.
+	cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+	#ifdef __clang__
+	# pragma clang system_header
+	#endif
+	#ifndef _FORTIFY_SOURCE
+	# if defined(__has_feature)
+	#  define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+	# else
+	#  define __GENTOO_HAS_FEATURE(x) 0
+	# endif
+	#
+	# if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0
+	# elif !defined(__STDC_HOSTED__) || __STDC_HOSTED__ != 1
+	# elif defined(__SANITIZE_ADDRESS__)
+	# elif __GENTOO_HAS_FEATURE(address_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(hwaddress_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(memory_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(numerical_stability_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(realtime_sanitizer)
+	# elif __GENTOO_HAS_FEATURE(thread_sanitizer)
+	# else
+	#  define _FORTIFY_SOURCE ${fortify_level}
+	# endif
+	#
+	# undef __GENTOO_HAS_FEATURE
+	#endif
+	EOF
+
+	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+	# non-hardened?
+	if use hardened ; then
+		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
+
+			# Analogue to GLIBCXX_ASSERTIONS
+			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+		EOF
+
+		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+			# Options below are conditional on USE=hardened.
+		EOF
+	fi
+
+	# We only install config files for supported ABIs because unprefixed tools
+	# might be used for crosscompilation where e.g. PIE may not be supported.
+	# See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+	local abi
+	for abi in $(get_all_abis); do
+		local abi_chost=$(get_abi_CHOST "${abi}")
+		doclang_cfg "${abi_chost}"
+	done
+
+	if use kernel_Darwin; then
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			# Gentoo Prefix on Darwin
+			-Wl,-search_paths_first
+		EOF
+		if use bootstrap-prefix ; then
+			# bootstrap-prefix is only set during stage2 of bootstrapping
+			# Prefix, where EPREFIX is set to EPREFIX/tmp.
+			# Here we need to point it at the future lib dir of the stage3's
+			# EPREFIX.
+			cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+				-Wl,-rpath,${EPREFIX}/../usr/lib
+				-Wl,-L,${EPREFIX}/../usr/lib
+				-isystem ${EPREFIX}/../usr/include
+			EOF
+		fi
+		# Using -Wl,-L instead of -L to trick compiler driver to put it
+		# after -isysroot's internal -L
+		cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+			-Wl,-rpath,${EPREFIX}/usr/lib
+			-Wl,-L,${EPREFIX}/usr/lib
+			-isystem ${EPREFIX}/usr/include
+			-isysroot ${EPREFIX}/MacOSX.sdk
+		EOF
+	fi
+}
+
+pkg_preinst() {
+	if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+	then
+		local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+		if [[ -n ${gcc_path} ]]; then
+			cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+				--gcc-install-dir="${gcc_path%%:*}"
+			EOF
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 97+ messages in thread

end of thread, other threads:[~2025-10-08 17:29 UTC | newest]

Thread overview: 97+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 14:03 [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2025-10-08 17:28 Michał Górny
2025-10-04  9:16 Michał Górny
2025-10-03 11:43 Michał Górny
2025-10-03 11:39 Michał Górny
2025-10-01  6:35 Michał Górny
2025-09-24 16:18 Michał Górny
2025-09-24  2:27 Michał Górny
2025-09-21  2:44 Michał Górny
2025-09-10 11:47 Michał Górny
2025-09-07 19:47 Michał Górny
2025-08-31 13:28 Michał Górny
2025-08-27 12:28 Michał Górny
2025-08-26 19:38 Michał Górny
2025-08-24 19:02 Arthur Zamarin
2025-08-24 18:51 Arthur Zamarin
2025-08-24 18:51 Arthur Zamarin
2025-08-21  8:22 Michał Górny
2025-08-21  8:18 Michał Górny
2025-08-16 13:51 Michał Górny
2025-08-12 17:09 Michał Górny
2025-08-09  9:47 Michał Górny
2025-08-02 10:29 Michał Górny
2025-07-29 19:04 Michał Górny
2025-07-26 19:53 Michał Górny
2025-07-22  9:20 Michał Górny
2025-07-20 14:15 Michał Górny
2025-07-20  8:24 Sam James
2025-07-19  6:50 Michał Górny
2025-07-13 20:03 Michał Górny
2025-07-09 18:49 Michał Górny
2025-06-28 15:03 Michał Górny
2025-06-28 14:55 Michał Górny
2025-06-14 14:24 Sam James
2025-06-14 11:02 Arthur Zamarin
2025-06-14  7:15 Michał Górny
2025-06-07 18:05 Michał Górny
2025-05-28 11:54 Michał Górny
2025-05-28 10:50 Michał Górny
2025-05-24 11:56 Michał Górny
2025-05-17 12:59 Michał Górny
2025-05-17  5:31 Michał Górny
2025-05-16  9:31 Michał Górny
2025-05-10 13:03 Michał Górny
2025-05-03 19:42 Michał Górny
2025-05-03 10:07 Michał Górny
2025-04-26 15:59 Michał Górny
2025-04-20 11:50 Michał Górny
2025-04-19  6:29 Michał Górny
2025-04-16 18:34 Michał Górny
2025-04-15 10:15 Michał Górny
2025-04-12 10:21 Michał Górny
2025-04-12 10:19 Arthur Zamarin
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-05 13:30 Michał Górny
2025-03-05 13:24 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-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-29 21:28 Sam James
2025-01-29 21:25 Sam James
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-21 10:28 Michał Górny
2024-12-17 21:37 Michał Górny
2024-12-16  5:57 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox