sys-libs/libcap-ng: check for BTF kernel info with USE=bpf

Closes: https://bugs.gentoo.org/972898
Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/681
Merges: https://codeberg.org/gentoo/gentoo/pulls/681
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Holger Hoffstätte
2026-04-20 22:03:51 +02:00
committed by Sam James
parent 54385759ea
commit e4dce9e787

View File

@@ -42,6 +42,18 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.9.3-audit-out-of-source-build.patch
)
pkg_pretend() {
# bug 972898
if use bpf && [[ ${MERGE_TYPE} != binary ]] ; then
if [[ ! -f /sys/kernel/btf/vmlinux ]] ; then
local err="Cannot read /sys/kernel/btf/vmlinux, which is required by bpftool.\n"
err+=" Typically this means that your kernel is missing the DEBUG_INFO_BTF option,\n"
err+=" without which BPF cannot work. Please build with USE=-bpf or reconfigure your kernel."
die "${err}"
fi
fi
}
src_prepare() {
default