diff --git a/dev-util/bpftool/bpftool-7.5.0.ebuild b/dev-util/bpftool/bpftool-7.5.0.ebuild index 7b4453ce8657d..5100e685f01d5 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 fd1c3aebd4c69..9f08e4d48071f 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