commit:     b52a9cfccb5802cf61590169f997238bf7221f81
Author:     Michal Rostecki <vadorovsky <AT> protonmail <DOT> com>
AuthorDate: Mon Aug  4 08:07:26 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep  2 13:59:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b52a9cfc

llvm-core/clang-runtime: Use the partial configuration files

In the last changes, we introduced new packages which provide partial
configuration files of each runtime component:

* llvm-core/clang-linker-config
* llvm-runtimes/clang-rtlib-config
* llvm-runtimes/clang-unwindlib-config
* llvm-runtimes/clang-stdlib-config

Use these packages as dependencies. Include their configuration files in
the `/etc/clang/${LLVM_VERSION}/gentoo-runtime.cfg` file.

Signed-off-by: Michal Rostecki <vadorovsky <AT> protonmail.com>
Closes: https://bugs.gentoo.org/951445
Part-of: https://github.com/gentoo/gentoo/pull/42663
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/42663
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ....9999.ebuild => clang-runtime-20.1.8-r1.ebuild} | 25 ++++++++++------------
 ....9999.ebuild => clang-runtime-21.1.0-r1.ebuild} | 25 ++++++++++------------
 .../clang-runtime/clang-runtime-22.0.0.9999.ebuild | 24 +++++++++------------
 .../clang-runtime-22.0.0_pre20250831.ebuild        | 16 ++++++--------
 4 files changed, 38 insertions(+), 52 deletions(-)

diff --git a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild 
b/llvm-core/clang-runtime/clang-runtime-20.1.8-r1.ebuild
similarity index 82%
copy from llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
copy to llvm-core/clang-runtime/clang-runtime-20.1.8-r1.ebuild
index 870cfbfed8fd..08fd48cb4422 100644
--- a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
+++ b/llvm-core/clang-runtime/clang-runtime-20.1.8-r1.ebuild
@@ -11,6 +11,7 @@ S=${WORKDIR}
 
 LICENSE="metapackage"
 SLOT="${PV%%.*}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 
~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
        +compiler-rt libcxx offload openmp +sanitize
        default-compiler-rt default-libcxx default-lld llvm-libunwind polly
@@ -35,16 +36,12 @@ RDEPEND="
        )
 
        llvm-core/clang-common
-       default-compiler-rt? (
-               
~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-               llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
-               !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
-       )
-       !default-compiler-rt? ( sys-devel/gcc )
-       default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
-       !default-libcxx? ( sys-devel/gcc )
-       default-lld? ( ~llvm-core/lld-${PV} )
-       !default-lld? ( sys-devel/binutils )
+
+       ~llvm-core/clang-linker-config-${SLOT}[default-lld(-)?]
+       ~llvm-runtimes/clang-rtlib-config-${SLOT}[default-compiler-rt(-)?]
+       
~llvm-runtimes/clang-unwindlib-config-${SLOT}[default-compiler-rt(-)?,llvm-libunwind(-)?]
+       ~llvm-runtimes/clang-stdlib-config-${SLOT}[default-libcxx(-)?]
+
        polly? ( ~llvm-core/polly-${PV} )
 "
 
@@ -111,10 +108,10 @@ src_install() {
                # 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)
+               @gentoo-rtlib.cfg
+               @gentoo-unwindlib.cfg
+               @gentoo-stdlib.cfg
+               @gentoo-linker.cfg
        EOF
        newins - gentoo-plugins.cfg <<-EOF
                # This file is used to load optional LLVM plugins.

diff --git a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild 
b/llvm-core/clang-runtime/clang-runtime-21.1.0-r1.ebuild
similarity index 82%
copy from llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
copy to llvm-core/clang-runtime/clang-runtime-21.1.0-r1.ebuild
index 870cfbfed8fd..08fd48cb4422 100644
--- a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
+++ b/llvm-core/clang-runtime/clang-runtime-21.1.0-r1.ebuild
@@ -11,6 +11,7 @@ S=${WORKDIR}
 
 LICENSE="metapackage"
 SLOT="${PV%%.*}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 
~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
        +compiler-rt libcxx offload openmp +sanitize
        default-compiler-rt default-libcxx default-lld llvm-libunwind polly
@@ -35,16 +36,12 @@ RDEPEND="
        )
 
        llvm-core/clang-common
-       default-compiler-rt? (
-               
~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-               llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
-               !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
-       )
-       !default-compiler-rt? ( sys-devel/gcc )
-       default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
-       !default-libcxx? ( sys-devel/gcc )
-       default-lld? ( ~llvm-core/lld-${PV} )
-       !default-lld? ( sys-devel/binutils )
+
+       ~llvm-core/clang-linker-config-${SLOT}[default-lld(-)?]
+       ~llvm-runtimes/clang-rtlib-config-${SLOT}[default-compiler-rt(-)?]
+       
~llvm-runtimes/clang-unwindlib-config-${SLOT}[default-compiler-rt(-)?,llvm-libunwind(-)?]
+       ~llvm-runtimes/clang-stdlib-config-${SLOT}[default-libcxx(-)?]
+
        polly? ( ~llvm-core/polly-${PV} )
 "
 
@@ -111,10 +108,10 @@ src_install() {
                # 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)
+               @gentoo-rtlib.cfg
+               @gentoo-unwindlib.cfg
+               @gentoo-stdlib.cfg
+               @gentoo-linker.cfg
        EOF
        newins - gentoo-plugins.cfg <<-EOF
                # This file is used to load optional LLVM plugins.

diff --git a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild 
b/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
index 870cfbfed8fd..6e386516474c 100644
--- a/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
+++ b/llvm-core/clang-runtime/clang-runtime-22.0.0.9999.ebuild
@@ -35,16 +35,12 @@ RDEPEND="
        )
 
        llvm-core/clang-common
-       default-compiler-rt? (
-               
~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-               llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
-               !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
-       )
-       !default-compiler-rt? ( sys-devel/gcc )
-       default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
-       !default-libcxx? ( sys-devel/gcc )
-       default-lld? ( ~llvm-core/lld-${PV} )
-       !default-lld? ( sys-devel/binutils )
+
+       ~llvm-core/clang-linker-config-${SLOT}[default-lld(-)?]
+       ~llvm-runtimes/clang-rtlib-config-${SLOT}[default-compiler-rt(-)?]
+       
~llvm-runtimes/clang-unwindlib-config-${SLOT}[default-compiler-rt(-)?,llvm-libunwind(-)?]
+       ~llvm-runtimes/clang-stdlib-config-${SLOT}[default-libcxx(-)?]
+
        polly? ( ~llvm-core/polly-${PV} )
 "
 
@@ -111,10 +107,10 @@ src_install() {
                # 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)
+               @gentoo-rtlib.cfg
+               @gentoo-unwindlib.cfg
+               @gentoo-stdlib.cfg
+               @gentoo-linker.cfg
        EOF
        newins - gentoo-plugins.cfg <<-EOF
                # This file is used to load optional LLVM plugins.

diff --git a/llvm-core/clang-runtime/clang-runtime-22.0.0_pre20250831.ebuild 
b/llvm-core/clang-runtime/clang-runtime-22.0.0_pre20250831.ebuild
index 870cfbfed8fd..74a7ad0e1186 100644
--- a/llvm-core/clang-runtime/clang-runtime-22.0.0_pre20250831.ebuild
+++ b/llvm-core/clang-runtime/clang-runtime-22.0.0_pre20250831.ebuild
@@ -35,16 +35,12 @@ RDEPEND="
        )
 
        llvm-core/clang-common
-       default-compiler-rt? (
-               
~llvm-runtimes/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
-               llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
-               !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
-       )
-       !default-compiler-rt? ( sys-devel/gcc )
-       default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
-       !default-libcxx? ( sys-devel/gcc )
-       default-lld? ( ~llvm-core/lld-${PV} )
-       !default-lld? ( sys-devel/binutils )
+
+       ~llvm-core/clang-linker-config-${SLOT}[default-lld(-)?]
+       ~llvm-runtimes/clang-rtlib-config-${SLOT}[default-compiler-rt(-)?]
+       
~llvm-runtimes/clang-unwindlib-config-${SLOT}[default-compiler-rt(-)?,llvm-libunwind(-)?]
+       ~llvm-runtimes/clang-stdlib-config-${SLOT}[default-libcxx(-)?]
+
        polly? ( ~llvm-core/polly-${PV} )
 "
 

Reply via email to