commit: bf70fbf7b0dc97fbc97af579954ea81a8df36113 Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com> AuthorDate: Thu May 1 17:27:57 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri May 2 04:37:27 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf70fbf7
dev-util/bpftool: always build bpf bits with std=gnu11, remove py3.10 The bpf-toolchain-15 compiler defaults to C23, which fails to compile various kernel headers due to their use of a custom 'bool' type. Explicitly using -std=gnu11 works with both clang and bpf-toolchain. Closes: https://bugs.gentoo.org/955156 Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com> Part-of: https://github.com/gentoo/gentoo/pull/41884 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-util/bpftool/bpftool-7.5.0.ebuild | 5 ++++- dev-util/bpftool/bpftool-9999.ebuild | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dev-util/bpftool/bpftool-7.5.0.ebuild b/dev-util/bpftool/bpftool-7.5.0.ebuild index 7b4453ce8657..5100e685f01d 100644 --- a/dev-util/bpftool/bpftool-7.5.0.ebuild +++ b/dev-util/bpftool/bpftool-7.5.0.ebuild @@ -5,7 +5,7 @@ EAPI=8 LLVM_COMPAT=( {15..20} ) LLVM_OPTIONAL=1 -PYTHON_COMPAT=( python3_{10..13} ) +PYTHON_COMPAT=( python3_{11..13} ) inherit bash-completion-r1 linux-info llvm-r1 python-any-r1 toolchain-funcs @@ -88,6 +88,9 @@ src_prepare() { # remove hardcoded/unhelpful flags from bpftool sed -i -e '/CFLAGS += -O2/d' -e 's/-W //g' -e 's/-Wextra //g' src/Makefile || die + # always build bpf bits with std=gnu11 for kernel compatibility (bug 955156) + sed -i 's/-fno-stack-protector/& -std=gnu11/g' src/Makefile || die + if ! use clang; then # remove bpf target & add assembly annotations to fix CO-RE feature detection sed -i -e 's/-target bpf/-dA/' src/Makefile.feature || die diff --git a/dev-util/bpftool/bpftool-9999.ebuild b/dev-util/bpftool/bpftool-9999.ebuild index fd1c3aebd4c6..9f08e4d48071 100644 --- a/dev-util/bpftool/bpftool-9999.ebuild +++ b/dev-util/bpftool/bpftool-9999.ebuild @@ -1,11 +1,11 @@ -# Copyright 2021-2024 Gentoo Authors +# Copyright 2021-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 LLVM_COMPAT=( {15..20} ) LLVM_OPTIONAL=1 -PYTHON_COMPAT=( python3_{10..13} ) +PYTHON_COMPAT=( python3_{11..13} ) inherit bash-completion-r1 linux-info llvm-r1 python-any-r1 toolchain-funcs @@ -88,6 +88,9 @@ src_prepare() { # remove hardcoded/unhelpful flags from bpftool sed -i -e '/CFLAGS += -O2/d' -e 's/-W //g' -e 's/-Wextra //g' src/Makefile || die + # always build bpf bits with std=gnu11 for kernel compatibility (bug 955156) + sed -i 's/-fno-stack-protector/& -std=gnu11/g' src/Makefile || die + if ! use clang; then # remove bpf target & add assembly annotations to fix CO-RE feature detection sed -i -e 's/-target bpf/-dA/' src/Makefile.feature || die
