commit:     8ac76c7f1c0b17a74750c0129cbebaa8608ea5f1
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Fri Nov  8 21:41:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov  9 09:25:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ac76c7f

dev-util/bpftool: fix clang dependency & always build CO-RE support

Making CO-RE support an optfeature causes way too many unintentional
problems, so for now just BDEPEND on clang and explicitly pass it to
the build.

Closes: https://bugs.gentoo.org/943029
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/39247
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/bpftool/bpftool-7.4.0.ebuild | 6 ++----
 dev-util/bpftool/bpftool-9999.ebuild  | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/dev-util/bpftool/bpftool-7.4.0.ebuild 
b/dev-util/bpftool/bpftool-7.4.0.ebuild
index 55a5c88923ff..b1481b3e2cbe 100644
--- a/dev-util/bpftool/bpftool-7.4.0.ebuild
+++ b/dev-util/bpftool/bpftool-7.4.0.ebuild
@@ -59,6 +59,7 @@ BDEPEND="
        ${PYTHON_DEPS}
        app-arch/tar
        dev-python/docutils
+       $(llvm_gen_dep 'sys-devel/clang:${LLVM_SLOT}[llvm_targets_BPF]')
 "
 
 CONFIG_CHECK="~DEBUG_INFO_BTF"
@@ -106,6 +107,7 @@ bpftool_make() {
 
        emake \
                ARCH="$(tc-arch-kernel)" \
+               CLANG="$(get_llvm_prefix -b)/bin/clang" \
                HOSTAR="$(tc-getBUILD_AR)" \
                HOSTCC="$(tc-getBUILD_CC)" \
                HOSTLD="$(tc-getBUILD_LD)" \
@@ -126,7 +128,3 @@ src_install() {
        bpftool_make DESTDIR="${D}" -C src install
        bpftool_make mandir="${ED}"/usr/share/man -C docs install
 }
-
-pkg_postinst() {
-       optfeature "clang-bpf-co-re support" sys-devel/clang[llvm_targets_BPF]
-}

diff --git a/dev-util/bpftool/bpftool-9999.ebuild 
b/dev-util/bpftool/bpftool-9999.ebuild
index 03f97becf881..4c6ef01a02a4 100644
--- a/dev-util/bpftool/bpftool-9999.ebuild
+++ b/dev-util/bpftool/bpftool-9999.ebuild
@@ -59,6 +59,7 @@ BDEPEND="
        ${PYTHON_DEPS}
        app-arch/tar
        dev-python/docutils
+       $(llvm_gen_dep 'sys-devel/clang:${LLVM_SLOT}[llvm_targets_BPF]')
 "
 
 CONFIG_CHECK="~DEBUG_INFO_BTF"
@@ -95,6 +96,7 @@ bpftool_make() {
 
        emake \
                ARCH="$(tc-arch-kernel)" \
+               CLANG="$(get_llvm_prefix -b)/bin/clang" \
                HOSTAR="$(tc-getBUILD_AR)" \
                HOSTCC="$(tc-getBUILD_CC)" \
                HOSTLD="$(tc-getBUILD_LD)" \
@@ -115,7 +117,3 @@ src_install() {
        bpftool_make DESTDIR="${D}" -C src install
        bpftool_make mandir="${ED}"/usr/share/man -C docs install
 }
-
-pkg_postinst() {
-       optfeature "clang-bpf-co-re support" sys-devel/clang[llvm_targets_BPF]
-}

Reply via email to