From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
Date: Mon, 10 Jul 2023 05:30:27 +0000 (UTC) [thread overview]
Message-ID: <1688967016.5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0.sam@gentoo> (raw)
commit: 5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Jul 8 11:14:18 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 10 05:30:16 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e7d98bc
net-libs/xdp-tools: bump to 1.4.0, add toolchain fixes
Bug: https://bugs.gentoo.org/899742
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/31801
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/xdp-tools/Manifest | 1 +
net-libs/xdp-tools/files/1.4.0-toolchain.patch | 57 +++++++++++++++++
net-libs/xdp-tools/xdp-tools-1.4.0.ebuild | 87 ++++++++++++++++++++++++++
3 files changed, 145 insertions(+)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 7cba3df6937e..7cbae12d5e78 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1,2 +1,3 @@
DIST xdp-tools-1.2.8.tar.gz 253786 BLAKE2B f745085b73da5193c3cdaf60c20dfa5de62f3d83487413c87b4c3d07b755dcf91cfbeb4ba970b4e04eef74b4cec4238057f4462074f49b7139d7652cb0f22998 SHA512 6ada9e433fcbefd13cebdffe93c3ce9159e9e09f1498d1615918ca6ecc4f11f03fcd9096980e8ceb7de126d4d8b953fa64917e777d54b5a3dfd1a9556de81626
DIST xdp-tools-1.3.1.tar.gz 330516 BLAKE2B 89a61f47ba26efe6d0630d971e913e034d111d05c896e5af1bb28e6cb4e94133e6ecd827a10ee12a935ae2e6856f04556ac564ded1bcc65182766d656f8d0c5f SHA512 9dd434095a043158d14fb6829fa632fc4a0714dc0b6e08c219dfb55cb9f34005300db750115e08bd54210e90142bd499904616da077b8aa827e4de28c31be637
+DIST xdp-tools-1.4.0.tar.gz 337221 BLAKE2B 008dda0fcfd403e47ab2b8c801fc0a5c4e103fb3b9869f1d1bf5af258fc646dd5a0285d3126c012c9b81805408b9669da886b9fcf2fdf33b256f74bbf898222a SHA512 c17bd6e9e6e4cf59c33f4b9ae4e3e0434863d147abf80f87b425215261b96d4574898fa09cc2b201a427a5e9d49ad64d0c70e50e3f72e3a18c6fbdf7f4cd4a3a
diff --git a/net-libs/xdp-tools/files/1.4.0-toolchain.patch b/net-libs/xdp-tools/files/1.4.0-toolchain.patch
new file mode 100644
index 000000000000..d4bcb511310f
--- /dev/null
+++ b/net-libs/xdp-tools/files/1.4.0-toolchain.patch
@@ -0,0 +1,57 @@
+
+Patch from: https://github.com/xdp-project/xdp-tools/pull/341
+
+From b1377b35cd05daf4d3afc3d59839e9889a642ffb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
+Date: Sat, 8 Jul 2023 12:34:20 +0200
+Subject: [PATCH] libxdp: don't use direct call to readelf for symbol table
+ comparison
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gentoo CI previously reported symbol mismatches in libxdp
+(see #302 and https://bugs.gentoo.org/899742). This was
+caused by a direct call to 'readelf' instead of using the
+command injected by the environment/toolchain.
+The fix is simple: use $(READELF).
+
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+---
+ lib/libxdp/Makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
+index 43de3e8a..532e0687 100644
+--- a/lib/libxdp/Makefile
++++ b/lib/libxdp/Makefile
+@@ -93,12 +93,12 @@ $(SHARED_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(SHARED_OBJDIR)
+
+ XDP_IN_SHARED := $(SHARED_OBJDIR)/libxdp.o $(SHARED_OBJDIR)/xsk.o
+
+-GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(XDP_IN_SHARED) | \
++GLOBAL_SYM_COUNT = $(shell $(READELF) -s --wide $(XDP_IN_SHARED) | \
+ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
+ sed 's/\[.*\]//' | \
+ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
+ sort -u | wc -l)
+-VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OBJDIR)/libxdp.so | \
++VERSIONED_SYM_COUNT = $(shell $(READELF) --dyn-syms --wide $(OBJDIR)/libxdp.so | \
+ grep -Eo '[^ ]+@LIBXDP_' | cut -d@ -f1 | sort -u | wc -l)
+
+ check: $(CHECK_RULES)
+@@ -110,12 +110,12 @@ check_abi: $(OBJDIR)/libxdp.so
+ "versioned symbols in $^ ($(VERSIONED_SYM_COUNT))." \
+ "Please make sure all symbols are" \
+ "versioned in $(VERSION_SCRIPT)." >&2; \
+- readelf -s --wide $(XDP_IN_SHARED) | \
++ $(READELF) -s --wide $(XDP_IN_SHARED) | \
+ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
+ sed 's/\[.*\]//' | \
+ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \
+ sort -u > $(OUTPUT)libxdp_global_syms.tmp; \
+- readelf --dyn-syms --wide $(OUTPUT)libxdp.so | \
++ $(READELF) --dyn-syms --wide $(OUTPUT)libxdp.so | \
+ grep -Eo '[^ ]+@LIBXDP_' | cut -d@ -f1 | \
+ sort -u > $(OUTPUT)libxdp_versioned_syms.tmp; \
+ diff -u $(OUTPUT)libxdp_global_syms.tmp \
diff --git a/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild b/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
new file mode 100644
index 000000000000..9df2ff21f8ae
--- /dev/null
+++ b/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
@@ -0,0 +1,87 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+DESCRIPTION="The libxdp library and various tools for use with XDP"
+HOMEPAGE="https://github.com/xdp-project/xdp-tools"
+SRC_URI="https://github.com/xdp-project/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="+tools"
+
+DEPEND="
+ dev-libs/libbpf:=
+ dev-util/bpftool
+ net-libs/libpcap
+ sys-libs/zlib
+ virtual/libelf
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ sys-apps/grep[pcre]
+ >=sys-devel/clang-11.0.0
+"
+
+# Not prebuilt -- we build them -- but they're not ordinary ELF objects either.
+QA_PREBUILT="usr/lib/bpf/*.o"
+
+MAKEOPTS+=" V=1"
+
+PATCHES=(
+ "${FILESDIR}"/1.3.1-no-Werror.patch
+ "${FILESDIR}"/${PV}-toolchain.patch
+)
+
+src_configure() {
+ export CC="$(tc-getCC)"
+ export LD="$(tc-getLD)"
+ export PREFIX="${EPREFIX}/usr"
+ export LIBDIR="${PREFIX}/$(get_libdir)"
+ export BPF_OBJECT_DIR="${PREFIX}/lib/bpf"
+ export PRODUCTION=1
+ export DYNAMIC_LIBXDP=1
+ export FORCE_SYSTEM_LIBBPF=1
+
+ # bug 861587
+ filter-lto
+
+ default
+}
+
+src_test() { :; }
+
+src_install() {
+ default
+
+ # To remove the scripts/testing files that are installed.
+ rm -r "${ED}/usr/share/xdp-tools" || die
+ # We can't control static archive generation yet.
+ rm "${ED}/usr/$(get_libdir)/libxdp.a" || die
+
+ use tools || { rm "${ED}/usr/sbin"/* || die; }
+
+ # These are ELF objects but BPF ones.
+ dostrip -x /usr/lib/bpf
+}
+
+pkg_postinst() {
+ elog
+ elog "Many BPF utilities need access to a mounted bpffs virtual file system."
+ elog "Either mount it manually like this:"
+ elog
+ elog " mount bpffs /sys/fs/bpf -t bpf -o nosuid,nodev,noexec,relatime,mode=700"
+ elog
+ elog "or add the following line to your /etc/fstab to always mount it at boot time:"
+ elog
+ elog " bpffs /sys/fs/bpf bpf nosuid,nodev,noexec,relatime,mode=700 0 0"
+ elog
+ elog "You can verify that bpffs is mounted with:"
+ elog
+ elog " mount | grep /sys/fs/bpf"
+ elog
+}
next reply other threads:[~2023-07-10 5:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 5:30 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-09 14:39 [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/ Arthur Zamarin
2024-03-21 2:41 Sam James
2023-11-22 12:02 Sam James
2023-10-27 2:59 Sam James
2023-10-27 2:59 Sam James
2023-10-27 2:59 Sam James
2023-03-10 12:06 Sam James
2022-09-20 22:53 Jason A. Donenfeld
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=1688967016.5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0.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