public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftool/
Date: Fri, 25 Jul 2025 01:14:31 +0000 (UTC)	[thread overview]
Message-ID: <1753405968.59562ff709bac6eb61bafe8e3425c0f17a4853b3.sam@gentoo> (raw)

commit:     59562ff709bac6eb61bafe8e3425c0f17a4853b3
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Thu Jul 24 05:54:21 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 25 01:12:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59562ff7

dev-util/bpftool: add 7.6.0

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

 dev-util/bpftool/Manifest             |   1 +
 dev-util/bpftool/bpftool-7.6.0.ebuild | 150 ++++++++++++++++++++++++++++++++++
 2 files changed, 151 insertions(+)

diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest
index 2f0798f394c5..307d8b5b1716 100644
--- a/dev-util/bpftool/Manifest
+++ b/dev-util/bpftool/Manifest
@@ -1 +1,2 @@
 DIST bpftool-libbpf-v7.5.0-sources.tar.gz 1510032 BLAKE2B cc9beac4034317f89ae3c1088d1b1a1948778bcdb51d7ed7f566e4e5ab720c1128ca467d51d0bc3ffe7b1f69800249362baef5dfaf858275050f96b744fdbca6 SHA512 db12c305b77fea3689dbc1ce94527f0f21fa9de21fcdb36385e3fe492137335bb393f90e456c06601495ccc984230a531c432709db6514b545e0aeeda7ca3c99
+DIST bpftool-libbpf-v7.6.0-sources.tar.gz 1527883 BLAKE2B 5918519009b1ee258c33506cb52d216b08fbcd6365083a71d74b11e2c788fd4c6f7cfd78c84bb85074eb463dfa8d087b8e35c79d00f3a0810979640af6b334e6 SHA512 d443601227acd9a0db15896da186b0a47d426c44f2b6eaa822391594aa23d617a94ee94f284abb841529d41ef7c585a1087dd5ab1708ce068cc02b3c08b0a51b

diff --git a/dev-util/bpftool/bpftool-7.6.0.ebuild b/dev-util/bpftool/bpftool-7.6.0.ebuild
new file mode 100644
index 000000000000..b7516d18f9e3
--- /dev/null
+++ b/dev-util/bpftool/bpftool-7.6.0.ebuild
@@ -0,0 +1,150 @@
+# 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_{11..14} )
+
+inherit bash-completion-r1 linux-info llvm-r1 python-any-r1 toolchain-funcs
+
+DESCRIPTION="Tool for inspection and simple manipulation of eBPF programs and maps"
+HOMEPAGE="https://github.com/libbpf/bpftool"
+
+if [[ ${PV} == *9999* ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/libbpf/bpftool.git"
+	EGIT_SUBMODULES=(libbpf)
+else
+	# bpftool typically vendors whatever libbpf is current at the time
+	# of a release, while libbpf publishes minor updates more frequently.
+	# Uncomment the following to bundle an updated libbpf e.g. in case of
+	# security or crasher bugs in libbpf and to keep the two synchronized.
+	# This allows us to quickly update the vendored lib with a revbump.
+	# Currently bpftool-x.y vendors libbpf-1.y; DO NOT mix different y versions.
+	# See the libbpf repo (https://github.com/libbpf/libbpf) for possible updates.
+	# LIBBPF_VERSION=1.5.0
+
+	if [[ ! -z ${LIBBPF_VERSION} ]] ; then
+		SRC_URI="https://github.com/libbpf/bpftool/archive/refs/tags/v${PV}.tar.gz -> bpftool-${PV}.tar.gz
+			https://github.com/libbpf/libbpf/archive/refs/tags/v${LIBBPF_VERSION}.tar.gz
+			  -> libbpf-${LIBBPF_VERSION}.tar.gz"
+	else
+		# use tarball with bundled libbpf
+		SRC_URI="https://github.com/libbpf/bpftool/releases/download/v${PV}/bpftool-libbpf-v${PV}-sources.tar.gz"
+		S="${WORKDIR}/bpftool-libbpf-v${PV}-sources"
+	fi
+
+	KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+LICENSE="|| ( GPL-2 BSD-2 )"
+SLOT="0"
+IUSE="caps +clang llvm"
+REQUIRED_USE="llvm? ( ${LLVM_REQUIRED_USE} )"
+
+RDEPEND="
+	caps? ( sys-libs/libcap:= )
+	llvm? ( $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}') )
+	!llvm? ( sys-libs/binutils-libs:= )
+	sys-libs/zlib:=
+	virtual/libelf:=
+"
+DEPEND="
+	${RDEPEND}
+	>=sys-kernel/linux-headers-5.8
+"
+BDEPEND="
+	${PYTHON_DEPS}
+	app-arch/tar
+	dev-python/docutils
+	clang? ( $(llvm_gen_dep 'llvm-core/clang:${LLVM_SLOT}[llvm_targets_BPF]') )
+	!clang? ( sys-devel/bpf-toolchain )
+"
+
+CONFIG_CHECK="~DEBUG_INFO_BTF"
+
+pkg_setup() {
+	python-any-r1_pkg_setup
+	use llvm && llvm-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	# prepare libbpf if necessary
+	if [[ ! -z ${LIBBPF_VERSION} ]] ; then
+		rm -rf libbpf || die
+		ln -s "${WORKDIR}/libbpf-${LIBBPF_VERSION}" libbpf || die
+	fi
+
+	# remove -Werror from libbpf (bug 887981)
+	sed -i -e 's/\-Werror//g' libbpf/src/Makefile || die
+
+	# remove -Werror from bpftool feature detection
+	sed -i -e 's/-Werror//g' src/Makefile.feature || die
+
+	# 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
+		# make people aware of what they are doing
+		ewarn "Using bpf-toolchain instead of clang due to USE=-clang."
+		ewarn "Please report any odd behaviours you observe, since using gcc for BPF"
+		ewarn "is still under development in both the Linux kernel and gcc itself."
+
+		# prevent attribute warning about preserve_access_index
+		# since gcc does not support '#pragma clang attribute push':
+		# https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=675b4e2
+		sed -i 's/std=gnu11/& -DBPF_NO_PRESERVE_ACCESS_INDEX/g' src/Makefile || die
+
+		# remove bpf target & add assembly annotations to fix CO-RE feature detection
+		sed -i -e 's/-target bpf/-dA/' src/Makefile.feature || die
+
+		# remove bpf target from skeleton build
+		sed -i -e 's/--target=bpf//g' src/Makefile || die
+	fi
+
+	# Use rst2man or rst2man.py depending on which one exists (#930076)
+	type -P rst2man >/dev/null || sed -i -e 's/rst2man/rst2man.py/g' docs/Makefile || die
+}
+
+bpftool_make() {
+	# which BPF compiler should we use?
+	if use clang; then
+		export CLANG="$(get_llvm_prefix -b)/bin/clang"
+		export LLVM_STRIP="$(get_llvm_prefix -b)/bin/llvm-strip"
+	else
+		# use bpf-toolchain
+		export CLANG="bpf-unknown-none-gcc"
+		export LLVM_STRIP="bpf-unknown-none-strip"
+	fi
+
+	tc-export AR CC LD
+
+	emake \
+		ARCH="$(tc-arch-kernel)" \
+		HOSTAR="$(tc-getBUILD_AR)" \
+		HOSTCC="$(tc-getBUILD_CC)" \
+		HOSTLD="$(tc-getBUILD_LD)" \
+		bash_compdir="$(get_bashcompdir)" \
+		feature-libcap="$(usex caps 1 0)" \
+		feature-llvm="$(usex llvm 1 0)" \
+		prefix="${EPREFIX}"/usr \
+		V=1 \
+		"$@"
+}
+
+src_compile() {
+	bpftool_make -C src
+	bpftool_make -C docs
+}
+
+src_install() {
+	bpftool_make DESTDIR="${D}" -C src install
+	bpftool_make mandir="${ED}"/usr/share/man -C docs install
+}


             reply	other threads:[~2025-07-25  1:14 UTC|newest]

Thread overview: 171+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25  1:14 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-26 16:15 [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftool/ Arthur Zamarin
2025-09-23 19:29 Arthur Zamarin
2025-09-23 14:26 Sam James
2025-09-22 19:50 Arthur Zamarin
2025-09-22 19:11 Arthur Zamarin
2025-07-25  1:14 Sam James
2025-07-25  1:14 Sam James
2025-05-03 19:39 Sam James
2025-05-03 19:39 Sam James
2025-05-02  4:38 Sam James
2025-04-10 16:50 Sam James
2025-04-10 16:49 Sam James
2025-04-10 16:49 Sam James
2025-04-10 16:49 Sam James
2025-04-10 16:49 Sam James
2025-03-08  7:04 Arthur Zamarin
2025-01-06  9:22 Sam James
2024-12-07  6:28 Arthur Zamarin
2024-11-11 22:25 Sam James
2024-11-11 22:25 Sam James
2024-11-09  9:26 Sam James
2024-11-03 18:02 Sam James
2024-10-30 22:29 Sam James
2024-10-06 13:38 Jakov Smolić
2024-10-05  5:21 Sam James
2024-09-12  5:53 Joonas Niilola
2024-08-24 11:49 Sam James
2024-08-23 14:50 Sam James
2024-08-23 14:41 Sam James
2024-08-06 10:16 Guilherme Amadio
2024-08-06 10:16 Guilherme Amadio
2024-08-06 10:16 Guilherme Amadio
2024-07-21  7:30 Yixun Lan
2024-07-19 19:49 Jakov Smolić
2024-07-19 19:49 Jakov Smolić
2024-07-04 18:49 Arthur Zamarin
2024-07-04 18:49 Arthur Zamarin
2024-07-04 18:44 Arthur Zamarin
2024-07-04 18:44 Arthur Zamarin
2024-07-04 18:44 Arthur Zamarin
2024-07-04 18:43 Arthur Zamarin
2024-06-25 16:52 Jakov Smolić
2024-06-18 18:55 Jakov Smolić
2024-06-09 12:36 Arthur Zamarin
2024-06-09 12:28 Arthur Zamarin
2024-06-09 12:28 Arthur Zamarin
2024-06-09 11:27 Arthur Zamarin
2024-06-09 10:38 Jakov Smolić
2024-06-09 10:38 Jakov Smolić
2024-05-31 11:50 Guilherme Amadio
2024-05-29  7:28 Jakov Smolić
2024-04-30  7:16 Sam James
2024-04-29 18:55 Jakov Smolić
2024-04-29 18:49 Jakov Smolić
2024-04-29 18:49 Jakov Smolić
2024-04-29 18:49 Jakov Smolić
2024-03-13  4:48 Sam James
2024-03-10 23:21 Jakov Smolić
2024-03-10 20:00 Arthur Zamarin
2024-03-10 20:00 Arthur Zamarin
2024-03-10 19:52 Arthur Zamarin
2024-03-10 19:52 Arthur Zamarin
2024-02-24 21:30 Jakov Smolić
2024-02-24 19:25 Jakov Smolić
2024-02-24 19:25 Jakov Smolić
2024-02-24 12:40 Jakov Smolić
2023-12-27  0:20 Jakov Smolić
2023-11-22 17:10 Jakov Smolić
2023-11-17 12:07 Sam James
2023-10-11 21:07 Jakov Smolić
2023-07-11 11:03 WANG Xuerui
2023-07-05 21:41 Sam James
2023-07-05 21:41 Sam James
2023-06-10  5:22 Jakov Smolić
2023-06-09 17:39 Arthur Zamarin
2023-05-18 15:56 Jakov Smolić
2023-04-25 18:44 Jakov Smolić
2023-04-21  6:02 Jakov Smolić
2023-04-11 21:42 Jakov Smolić
2023-04-11 18:46 Arthur Zamarin
2023-03-06 19:19 Jakov Smolić
2023-03-06 19:19 Jakov Smolić
2023-03-06 13:44 Arthur Zamarin
2023-03-06 12:52 Arthur Zamarin
2023-03-04 22:22 Jakov Smolić
2023-01-25  6:44 Jakov Smolić
2023-01-18  0:46 Sam James
2023-01-13  5:51 Sam James
2023-01-08 17:06 Jakov Smolić
2023-01-08 17:00 Arthur Zamarin
2022-12-22 13:29 Jakov Smolić
2022-10-29 11:03 Jakov Smolić
2022-10-20 10:52 Jakov Smolić
2022-10-07 12:25 Jakov Smolić
2022-10-05 11:35 Sam James
2022-10-04 15:42 Jakov Smolić
2022-09-13 10:57 Jakov Smolić
2022-09-13 10:57 Jakov Smolić
2022-09-05  1:14 Sam James
2022-09-05  0:43 Sam James
2022-09-03 14:09 Jakov Smolić
2022-09-03 14:09 Jakov Smolić
2022-08-31  7:36 Jakov Smolić
2022-08-21 14:57 Jakov Smolić
2022-08-21 14:57 Jakov Smolić
2022-08-16 15:07 Sam James
2022-07-23 15:41 Jakov Smolić
2022-07-23 15:41 Jakov Smolić
2022-07-22 17:54 Sam James
2022-07-02 11:18 Jakov Smolić
2022-06-27 17:32 Jakov Smolić
2022-06-22 13:09 Jakov Smolić
2022-06-21 16:48 Jakov Smolić
2022-06-21 16:09 Jakov Smolić
2022-06-21 16:07 Jakov Smolić
2022-06-06  7:11 Jakov Smolić
2022-05-29 17:27 Jakov Smolić
2022-05-28 15:58 Jakov Smolić
2022-05-20 18:41 Jakov Smolić
2022-04-27 22:23 Jakov Smolić
2022-04-27 22:23 Jakov Smolić
2022-04-27 19:47 Jakov Smolić
2022-04-19  8:56 Jakov Smolić
2022-04-19  8:53 Jakov Smolić
2022-04-04 12:26 Jakov Smolić
2022-03-22 10:10 Jakov Smolić
2022-03-16 11:46 Jakov Smolić
2022-03-16 11:46 Jakov Smolić
2022-03-03 15:12 Jakov Smolić
2022-03-01 11:42 Jakov Smolić
2022-02-28 10:00 Jakov Smolić
2022-02-28 10:00 Jakov Smolić
2022-02-24 11:55 Jakov Smolić
2022-02-24 11:55 Jakov Smolić
2022-02-11 19:18 Jakov Smolić
2022-02-11 19:18 Jakov Smolić
2022-02-07  9:33 Jakov Smolić
2022-01-29 21:21 Jakov Smolić
2022-01-29 21:21 Jakov Smolić
2022-01-29 21:21 Jakov Smolić
2022-01-25 21:23 Sam James
2022-01-18 13:09 Jakov Smolić
2022-01-18 13:09 Jakov Smolić
2022-01-04 18:08 Jakov Smolić
2021-12-26  8:07 Agostino Sarubbo
2021-12-20 10:45 Jakov Smolić
2021-12-20 10:45 Jakov Smolić
2021-12-17 23:27 Jakov Smolić
2021-12-17 23:27 Jakov Smolić
2021-12-10  9:38 Jakov Smolić
2021-12-10  9:38 Jakov Smolić
2021-11-29 11:46 Jakov Smolić
2021-11-29 11:46 Jakov Smolić
2021-11-22 13:30 Jakov Smolić
2021-10-27  5:58 Jakov Smolić
2021-10-27  5:58 Jakov Smolić
2021-10-19 11:29 Jakov Smolić
2021-10-19 11:29 Jakov Smolić
2021-10-11 18:18 Jakov Smolić
2021-10-11 18:18 Jakov Smolić
2021-09-26 12:05 Jakov Smolić
2021-09-26 12:05 Jakov Smolić
2021-09-23  9:33 Jakov Smolić
2021-09-23  9:33 Jakov Smolić
2021-09-20  5:15 Jakov Smolić
2021-09-20  5:15 Jakov Smolić
2021-09-14 18:37 Jakov Smolić
2021-09-14 18:37 Jakov Smolić
2021-09-14  6:28 Jakov Smolić
2021-09-13 17:48 Jakov Smolić

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1753405968.59562ff709bac6eb61bafe8e3425c0f17a4853b3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox