commit:     1d81cec818a31ee21188cf7ea833e2c1cb535a4b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 11:44:24 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 13:05:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d81cec8

llvm-core/clang-runtime: Add USE=polly

Closes: https://bugs.gentoo.org/715612
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/39897
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 llvm-core/clang-runtime/clang-runtime-21.0.0.9999.ebuild | 13 ++++++++++++-
 llvm-core/clang-runtime/metadata.xml                     |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/llvm-core/clang-runtime/clang-runtime-21.0.0.9999.ebuild 
b/llvm-core/clang-runtime/clang-runtime-21.0.0.9999.ebuild
index 1cf7f46d4148..a28e9569b2e3 100644
--- a/llvm-core/clang-runtime/clang-runtime-21.0.0.9999.ebuild
+++ b/llvm-core/clang-runtime/clang-runtime-21.0.0.9999.ebuild
@@ -13,7 +13,7 @@ LICENSE="metapackage"
 SLOT="${PV%%.*}"
 IUSE="
        +compiler-rt libcxx offload openmp +sanitize
-       default-compiler-rt default-libcxx default-lld llvm-libunwind
+       default-compiler-rt default-libcxx default-lld llvm-libunwind polly
 "
 REQUIRED_USE="
        sanitize? ( compiler-rt )
@@ -45,6 +45,7 @@ RDEPEND="
        !default-libcxx? ( sys-devel/gcc )
        default-lld? ( ~llvm-core/lld-${PV} )
        !default-lld? ( sys-devel/binutils )
+       polly? ( ~llvm-core/polly-${PV} )
 "
 
 _doclang_cfg() {
@@ -55,6 +56,7 @@ _doclang_cfg() {
                newins - "${tool}.cfg" <<-EOF
                        # This configuration file is used by ${tool} driver.
                        @../${tool}.cfg
+                       @gentoo-plugins.cfg
                        @gentoo-runtimes.cfg
                EOF
        done
@@ -114,6 +116,15 @@ src_install() {
                --stdlib=$(usex default-libcxx libc++ libstdc++)
                -fuse-ld=$(usex default-lld lld bfd)
        EOF
+       newins - gentoo-plugins.cfg <<-EOF
+               # This file is used to load optional LLVM plugins.
+       EOF
+       if use polly; then
+               cat >> "${ED}/etc/clang/${SLOT}/gentoo-plugins.cfg" <<-EOF || 
die
+                       -fpass-plugin=LLVMPolly.so
+                       -fplugin=LLVMPolly.so
+               EOF
+       fi
 
        multilib_foreach_abi doclang_cfg
 }

diff --git a/llvm-core/clang-runtime/metadata.xml 
b/llvm-core/clang-runtime/metadata.xml
index e7a356772fe4..b2327e075049 100644
--- a/llvm-core/clang-runtime/metadata.xml
+++ b/llvm-core/clang-runtime/metadata.xml
@@ -14,6 +14,7 @@
                <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-lld">Use lld as the default linker for 
clang</flag>
+               <flag name="polly">Load Polly plugin (you still need -mllvm 
-polly to use it)</flag>
        </use>
        <upstream>
                <remote-id type="github">llvm/llvm-project</remote-id>

Reply via email to