public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2024-12-16  5:57 Michał Górny
  0 siblings, 0 replies; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/
@ 2025-02-25 14:03 Michał Górny
  0 siblings, 0 replies; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ 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; 33+ 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] 33+ messages in thread

end of thread, other threads:[~2025-03-05 13:30 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 18:55 [gentoo-commits] repo/gentoo:master commit in: llvm-core/clang-common/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
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-25 14:03 Michał Górny
2025-02-22 15:19 Michał Górny
2025-02-15  7:19 Michał Górny
2025-02-13  7:53 Michał Górny
2025-02-11 11:29 Michał Górny
2025-02-08 11:51 Michał Górny
2025-02-07 20:08 Arthur Zamarin
2025-02-02 18:25 Michał Górny
2025-02-01 13:15 Michał Górny
2025-02-01  8:05 Michał Górny
2025-01-31 21:51 Michał Górny
2025-01-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