* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2022-09-20 22:53 Jason A. Donenfeld
0 siblings, 0 replies; 9+ messages in thread
From: Jason A. Donenfeld @ 2022-09-20 22:53 UTC (permalink / raw
To: gentoo-commits
commit: 92e472251bcceb07300ab3cd9f1eeb51ce81d159
Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 20 22:48:32 2022 +0000
Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Tue Sep 20 22:53:40 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92e47225
net-libs/xdp-tools: bump to 1.2.8
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>
net-libs/xdp-tools/Manifest | 2 +-
.../files/xdp-tools-1.2.3-no-werror.patch | 73 ----------------------
...p-tools-1.2.3.ebuild => xdp-tools-1.2.8.ebuild} | 4 --
3 files changed, 1 insertion(+), 78 deletions(-)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 9336fa35d31d..9e3d03e1cffd 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1 +1 @@
-DIST xdp-tools-1.2.3.tar.gz 252515 BLAKE2B 26c1bfd5b6c3457794801db64d020b8d6eb254661a0a44fa89dde6a1ff7c04dec1207d38a755029c8caaa955cabec70f196e37257f337cf484b8e3525261119e SHA512 588cda7010592f34ac600993ea528b76be4a8786c1b4e4599c92c5683a80848a11ae90db825f56b67adec60bd8c684bb4ced21dc1bc1b750cbd5d0704d67390d
+DIST xdp-tools-1.2.8.tar.gz 253786 BLAKE2B f745085b73da5193c3cdaf60c20dfa5de62f3d83487413c87b4c3d07b755dcf91cfbeb4ba970b4e04eef74b4cec4238057f4462074f49b7139d7652cb0f22998 SHA512 6ada9e433fcbefd13cebdffe93c3ce9159e9e09f1498d1615918ca6ecc4f11f03fcd9096980e8ceb7de126d4d8b953fa64917e777d54b5a3dfd1a9556de81626
diff --git a/net-libs/xdp-tools/files/xdp-tools-1.2.3-no-werror.patch b/net-libs/xdp-tools/files/xdp-tools-1.2.3-no-werror.patch
deleted file mode 100644
index 6d7d7fd955a3..000000000000
--- a/net-libs/xdp-tools/files/xdp-tools-1.2.3-no-werror.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-https://bugs.gentoo.org/831339
-https://bugs.gentoo.org/846938
---- a/lib/Makefile
-+++ b/lib/Makefile
-@@ -1,5 +1,5 @@
-
--LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Werror -Wall) -fPIC
-+LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Wall) -fPIC
-
- LIB_DIR = .
- include defines.mk
---- a/lib/common.mk
-+++ b/lib/common.mk
-@@ -113,7 +113,6 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
---- a/lib/defines.mk
-+++ b/lib/defines.mk
-@@ -39,7 +39,7 @@ endif
-
- DEFINES += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
--CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES)
-+CFLAGS += -std=gnu11 -Wextra $(DEFINES)
- BPF_CFLAGS += $(DEFINES)
-
- CONFIGMK := $(LIB_DIR)/../config.mk
---- a/lib/libxdp/Makefile
-+++ b/lib/libxdp/Makefile
-@@ -19,7 +19,7 @@ MAN_OBJ := ${MAN_PAGE:.3=.man}
- MAN_FILES := $(MAN_PAGE)
- TEST_DIR := tests
- TEST_FILE := $(TEST_DIR)/test-libxdp.sh
--TEST_CFLAGS := $(CFLAGS) -I$(realpath $(HEADER_DIR)) -L$(realpath $(OBJDIR)) -Wall -Werror $(LDFLAGS)
-+TEST_CFLAGS := $(CFLAGS) -I$(realpath $(HEADER_DIR)) -L$(realpath $(OBJDIR)) -Wall $(LDFLAGS)
- TEST_LDLIBS := $(LDLIBS)
-
- SHARED_CFLAGS += -fPIC -DSHARED
-@@ -144,7 +144,6 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
-diff --git a/configure b/configure
-index 0a17eae..fd251b7 100755
---- a/configure
-+++ b/configure
-@@ -186,7 +186,7 @@ int main(int argc, char **argv) {
- return 0;
- }
- EOF
-- libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
-+ libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
- if [ "$?" -eq "0" ]; then
- echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG"
- echo "yes"
-@@ -254,7 +254,7 @@ int main(int argc, char **argv) {
- }
- EOF
-
-- libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
-+ libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
- if [ "$?" -eq "0" ]; then
- echo "SYSTEM_LIBBPF:=y" >>$CONFIG
- echo "LIBBPF_VERSION=$LIBBPF_VERSION" >>$CONFIG
diff --git a/net-libs/xdp-tools/xdp-tools-1.2.3.ebuild b/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
similarity index 95%
rename from net-libs/xdp-tools/xdp-tools-1.2.3.ebuild
rename to net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
index 4077d16404d0..0dd14f1dc39b 100644
--- a/net-libs/xdp-tools/xdp-tools-1.2.3.ebuild
+++ b/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
@@ -25,10 +25,6 @@ QA_PREBUILT="usr/lib/bpf/*.o"
MAKEOPTS+=" V=1"
-PATCHES=(
- "${FILESDIR}"/${PN}-1.2.3-no-werror.patch
-)
-
src_configure() {
export PRODUCTION=1
export DYNAMIC_LIBXDP=1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-03-10 12:06 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-03-10 12:06 UTC (permalink / raw
To: gentoo-commits
commit: 80fffaf8a1d422cbbb5d0984bc693128f8256a49
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Wed Mar 8 22:12:29 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 10 12:06:23 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80fffaf8
net-libs/xdp-tools: various build improvements
- disable LTO
- remove -Werror from Makefiles
- fix xdpdump build error with clang
- add hint about mounting bpffs
Bug: https://bugs.gentoo.org/861587
Bug: https://bugs.gentoo.org/880919
Bug: https://bugs.gentoo.org/899744
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/30005
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/xdp-tools/files/1.3.1-no-Werror.patch | 97 ++++++++++++++++++++++
net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch | 36 ++++++++
...s-1.3.1-r1.ebuild => xdp-tools-1.3.1-r2.ebuild} | 25 ++++++
3 files changed, 158 insertions(+)
diff --git a/net-libs/xdp-tools/files/1.3.1-no-Werror.patch b/net-libs/xdp-tools/files/1.3.1-no-Werror.patch
new file mode 100644
index 000000000000..7545c49b1c2e
--- /dev/null
+++ b/net-libs/xdp-tools/files/1.3.1-no-Werror.patch
@@ -0,0 +1,97 @@
+
+Bug: https://bugs.gentoo.org/899744
+
+diff --git a/configure b/configure
+index 62c2f88..230637f 100755
+--- a/configure
++++ b/configure
+@@ -249,7 +249,7 @@ int main(int argc, char **argv) {
+ return 0;
+ }
+ EOF
+- compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS"
++ compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS"
+ libbpf_err=$($compile_cmd 2>&1)
+ if [ "$?" -eq "0" ]; then
+ echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG"
+@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
+ }
+ EOF
+
+- libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
++ libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
+ if [ "$?" -eq "0" ]; then
+ echo "SYSTEM_LIBBPF:=y" >>$CONFIG
+ echo "LIBBPF_VERSION=$LIBBPF_VERSION" >>$CONFIG
+diff --git a/lib/Makefile b/lib/Makefile
+index 5ee035d..5342ab3 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -1,5 +1,5 @@
+
+-LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Werror -Wall) -fPIC
++LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Wall) -fPIC
+
+ LIB_DIR = .
+ include defines.mk
+diff --git a/lib/common.mk b/lib/common.mk
+index b680a75..8dbcb39 100644
+--- a/lib/common.mk
++++ b/lib/common.mk
+@@ -116,7 +116,6 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/defines.mk b/lib/defines.mk
+index 54b259f..ed246c0 100644
+--- a/lib/defines.mk
++++ b/lib/defines.mk
+@@ -40,7 +40,7 @@ endif
+
+ DEFINES += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+-CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES)
++CFLAGS += -std=gnu11 -Wextra $(DEFINES)
+ BPF_CFLAGS += $(DEFINES) $(filter -ffile-prefix-map=%,$(CFLAGS))
+
+ CONFIGMK := $(LIB_DIR)/../config.mk
+diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
+index 431932a..a0c625d 100644
+--- a/lib/libxdp/Makefile
++++ b/lib/libxdp/Makefile
+@@ -142,7 +142,6 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/libxdp/tests/Makefile b/lib/libxdp/tests/Makefile
+index 3c22901..a4463f3 100644
+--- a/lib/libxdp/tests/Makefile
++++ b/lib/libxdp/tests/Makefile
+@@ -72,7 +72,6 @@ $(BPF_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK) $(EXTRA_DEPS)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/util/Makefile b/lib/util/Makefile
+index 24070f0..37485b3 100644
+--- a/lib/util/Makefile
++++ b/lib/util/Makefile
+@@ -26,7 +26,6 @@ $(UTIL_BPF_OBJS): %.o: %.c $(KERN_USER_H) $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
diff --git a/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch b/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch
new file mode 100644
index 000000000000..3983c8c8f402
--- /dev/null
+++ b/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch
@@ -0,0 +1,36 @@
+
+From: https://github.com/xdp-project/xdp-tools/commit/344b241da22a5358c714d6db1ea6f225f951dbdb
+
+From 344b241da22a5358c714d6db1ea6f225f951dbdb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
+Date: Wed, 8 Mar 2023 18:50:56 +0100
+Subject: [PATCH] xdpdump: fix build with clang
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When building all of xdp-tools with clang, the xdp-dump build fails
+due to 'classic' use of variable-length arrays and -Werror.
+Disable the warning and leave a breadcrumb to the discussion.
+
+Fixes: #304
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+---
+ xdp-dump/Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/xdp-dump/Makefile b/xdp-dump/Makefile
+index 7ee1688e..a9ae0ae7 100644
+--- a/xdp-dump/Makefile
++++ b/xdp-dump/Makefile
+@@ -4,6 +4,10 @@ XDP_TARGETS := xdpdump_bpf xdpdump_xdp
+ USER_TARGETS := xdpdump
+ TEST_FILE := tests/test-xdpdump.sh
+
++# Disable warnings about VLAs not being at the end of a structure when building
++# with clang. The code is fine, but clang's complaint coupled with -Werror would
++# break the build. See https://github.com/xdp-project/xdp-tools/issues/304
++CFLAGS += "-Wno-gnu-variable-sized-type-not-at-end"
+ LIB_DIR = ../lib
+ USER_LIBS = -lpcap
+ MAN_PAGE := xdpdump.8
diff --git a/net-libs/xdp-tools/xdp-tools-1.3.1-r1.ebuild b/net-libs/xdp-tools/xdp-tools-1.3.1-r2.ebuild
similarity index 68%
rename from net-libs/xdp-tools/xdp-tools-1.3.1-r1.ebuild
rename to net-libs/xdp-tools/xdp-tools-1.3.1-r2.ebuild
index 95efd4e44792..9bc3e28993a8 100644
--- a/net-libs/xdp-tools/xdp-tools-1.3.1-r1.ebuild
+++ b/net-libs/xdp-tools/xdp-tools-1.3.1-r2.ebuild
@@ -3,6 +3,8 @@
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"
@@ -33,6 +35,8 @@ MAKEOPTS+=" V=1"
PATCHES=(
"${FILESDIR}"/1.3.1-disable-stack-protector.patch
"${FILESDIR}"/1.3.1-fix-btf__type_cnt-detection.patch
+ "${FILESDIR}"/1.3.1-no-Werror.patch
+ "${FILESDIR}"/1.3.1-xdpdump-clang.patch
)
src_configure() {
@@ -42,6 +46,10 @@ src_configure() {
export PRODUCTION=1
export DYNAMIC_LIBXDP=1
export FORCE_SYSTEM_LIBBPF=1
+
+ # bug 861587
+ filter-lto
+
default
}
@@ -60,3 +68,20 @@ src_install() {
# 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
+}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-07-10 5:30 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-07-10 5:30 UTC (permalink / raw
To: gentoo-commits
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
+}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-10-27 2:59 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-10-27 2:59 UTC (permalink / raw
To: gentoo-commits
commit: 330b58c14c48a1a3a5af2023a8afe83733536452
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Thu Oct 26 11:00:34 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:53:14 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=330b58c1
net-libs/xdp-tools: rename patches for 1.4.0
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../xdp-tools/files/{1.3.1-no-Werror.patch => 1.4.0-no-Werror.patch} | 0
net-libs/xdp-tools/xdp-tools-1.4.0.ebuild | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net-libs/xdp-tools/files/1.3.1-no-Werror.patch b/net-libs/xdp-tools/files/1.4.0-no-Werror.patch
similarity index 100%
rename from net-libs/xdp-tools/files/1.3.1-no-Werror.patch
rename to net-libs/xdp-tools/files/1.4.0-no-Werror.patch
diff --git a/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild b/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
index 1e5a994e83ad..400e2aa0f19e 100644
--- a/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
+++ b/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
@@ -33,8 +33,8 @@ QA_PREBUILT="usr/lib/bpf/*.o"
MAKEOPTS+=" V=1"
PATCHES=(
- "${FILESDIR}"/1.3.1-no-Werror.patch
- "${FILESDIR}"/${PV}-toolchain.patch
+ "${FILESDIR}"/1.4.0-no-Werror.patch
+ "${FILESDIR}"/1.4.0-toolchain.patch
)
src_configure() {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-10-27 2:59 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-10-27 2:59 UTC (permalink / raw
To: gentoo-commits
commit: 79fd37fcaf670fdcc399fa7e7ce2d6dc1b353b09
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Oct 21 08:54:26 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:53:15 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79fd37fc
net-libs/xdp-tools: add 1.4.1
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/33439
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/xdp-tools/Manifest | 1 +
net-libs/xdp-tools/files/1.4.1-no-Werror.patch | 75 ++++++++++++++++++++++
net-libs/xdp-tools/xdp-tools-1.4.1.ebuild | 86 ++++++++++++++++++++++++++
3 files changed, 162 insertions(+)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 766e3e9c5f3c..5f1d1649aacb 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1 +1,2 @@
DIST xdp-tools-1.4.0.tar.gz 337221 BLAKE2B 008dda0fcfd403e47ab2b8c801fc0a5c4e103fb3b9869f1d1bf5af258fc646dd5a0285d3126c012c9b81805408b9669da886b9fcf2fdf33b256f74bbf898222a SHA512 c17bd6e9e6e4cf59c33f4b9ae4e3e0434863d147abf80f87b425215261b96d4574898fa09cc2b201a427a5e9d49ad64d0c70e50e3f72e3a18c6fbdf7f4cd4a3a
+DIST xdp-tools-1.4.1.tar.gz 339878 BLAKE2B 30ed245dd0da8404cf67313ea4d5f9a148507d14bd7330bdac3b03c07d1cc0b38eb1a376636551cb8ea14c8a2e77d02527da363733a1059e1c2ebaee9ac90392 SHA512 9d2ad42713aa53c10ccbde2c344bf2696524e317544f3693114b343ab74240187699c3802cfc6efa05b3e9f9bfec80fd2537799aa3ae050717bb1f6aab435996
diff --git a/net-libs/xdp-tools/files/1.4.1-no-Werror.patch b/net-libs/xdp-tools/files/1.4.1-no-Werror.patch
new file mode 100644
index 000000000000..52c50261f5d8
--- /dev/null
+++ b/net-libs/xdp-tools/files/1.4.1-no-Werror.patch
@@ -0,0 +1,75 @@
+
+Bug: https://bugs.gentoo.org/899744
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 5ee035d..5342ab3 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -1,5 +1,5 @@
+
+-LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Werror -Wall) -fPIC
++LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Wall) -fPIC
+
+ LIB_DIR = .
+ include defines.mk
+diff --git a/lib/common.mk b/lib/common.mk
+index b680a75..8dbcb39 100644
+--- a/lib/common.mk
++++ b/lib/common.mk
+@@ -116,7 +116,6 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/defines.mk b/lib/defines.mk
+index 54b259f..ed246c0 100644
+--- a/lib/defines.mk
++++ b/lib/defines.mk
+@@ -40,7 +40,7 @@ endif
+
+ DEFINES += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+-CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES) $(ARCH_INCLUDES)
++CFLAGS += -std=gnu11 -Wextra $(DEFINES) $(ARCH_INCLUDES)
+ BPF_CFLAGS += $(DEFINES) $(filter -ffile-prefix-map=%,$(CFLAGS)) $(ARCH_INCLUDES)
+
+ CONFIGMK := $(LIB_DIR)/../config.mk
+diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
+index 431932a..a0c625d 100644
+--- a/lib/libxdp/Makefile
++++ b/lib/libxdp/Makefile
+@@ -142,7 +142,6 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/libxdp/tests/Makefile b/lib/libxdp/tests/Makefile
+index 3c22901..a4463f3 100644
+--- a/lib/libxdp/tests/Makefile
++++ b/lib/libxdp/tests/Makefile
+@@ -72,7 +72,6 @@ $(BPF_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK) $(EXTRA_DEPS)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
+diff --git a/lib/util/Makefile b/lib/util/Makefile
+index 24070f0..37485b3 100644
+--- a/lib/util/Makefile
++++ b/lib/util/Makefile
+@@ -26,7 +26,6 @@ $(UTIL_BPF_OBJS): %.o: %.c $(KERN_USER_H) $(BPF_HEADERS) $(LIBMK)
+ -Wno-unused-value \
+ -Wno-pointer-sign \
+ -Wno-compare-distinct-pointer-types \
+- -Werror \
+ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
+ $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
+
diff --git a/net-libs/xdp-tools/xdp-tools-1.4.1.ebuild b/net-libs/xdp-tools/xdp-tools-1.4.1.ebuild
new file mode 100644
index 000000000000..53974f63d493
--- /dev/null
+++ b/net-libs/xdp-tools/xdp-tools-1.4.1.ebuild
@@ -0,0 +1,86 @@
+# 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 ~riscv ~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.4.1-no-Werror.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
+}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-10-27 2:59 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-10-27 2:59 UTC (permalink / raw
To: gentoo-commits
commit: 954b98b84ca9d223f7ecbf807e08291e82d85aa9
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Oct 21 08:57:59 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:53:15 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=954b98b8
net-libs/xdp-tools: clean up obsolete versions
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/xdp-tools/Manifest | 2 -
.../files/1.3.1-disable-stack-protector.patch | 32 --------
.../files/1.3.1-fix-btf__type_cnt-detection.patch | 36 ---------
net-libs/xdp-tools/files/1.3.1-musl.patch | 28 -------
net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch | 36 ---------
net-libs/xdp-tools/xdp-tools-1.2.8.ebuild | 52 -------------
net-libs/xdp-tools/xdp-tools-1.3.1-r3.ebuild | 88 ----------------------
7 files changed, 274 deletions(-)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 7cbae12d5e78..766e3e9c5f3c 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1,3 +1 @@
-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.3.1-disable-stack-protector.patch b/net-libs/xdp-tools/files/1.3.1-disable-stack-protector.patch
deleted file mode 100644
index 3a37b26efa14..000000000000
--- a/net-libs/xdp-tools/files/1.3.1-disable-stack-protector.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-From: https://github.com/xdp-project/xdp-tools/commit/cb6d06219d1b49b07980b481a383e1dea74a0702
-Bug: https://bugs.gentoo.org/889842
-
-From cb6d06219d1b49b07980b481a383e1dea74a0702 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
-Date: Sat, 4 Mar 2023 20:08:25 +0100
-Subject: [PATCH] make: disable stack protector for BPF bits built by clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The clang toolchain might have stack-protection enabled by default
-(e.g. via platform configuration) and that won't work for BPF,
-so unconfitionally disable it via -fno-stack-protector.
-
-Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
----
- lib/defines.mk | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/defines.mk b/lib/defines.mk
-index f134c43b..54b259f2 100644
---- a/lib/defines.mk
-+++ b/lib/defines.mk
-@@ -1,5 +1,5 @@
- CFLAGS ?= -O2 -g
--BPF_CFLAGS ?= -Wno-visibility
-+BPF_CFLAGS ?= -Wno-visibility -fno-stack-protector
- BPF_TARGET ?= bpf
-
- HAVE_FEATURES :=
diff --git a/net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch b/net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch
deleted file mode 100644
index d805e1077c76..000000000000
--- a/net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-
-From https://github.com/xdp-project/xdp-tools/commit/a7df567634af77381832a2212c5f5099b07734f3
-
-From a7df567634af77381832a2212c5f5099b07734f3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
-Date: Sat, 4 Mar 2023 20:07:39 +0100
-Subject: [PATCH] configure: Fix function detection for btf__type_cnt()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The configure check for btf__type_cnt() swapped two arguments in the
-check_libbpf_function() call in the configure script, leading to the check
-failing if LIBBPF_CFLAGS is non-empty. Make sure the arguments are in the
-right order, and also pass a proper NULL parameter in the check instead of
-a 0.
-
-Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
-Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 016c5bbd..62c2f883 100755
---- a/configure
-+++ b/configure
-@@ -272,7 +272,7 @@ check_libbpf_functions()
-
- check_libbpf_function "perf_buffer__consume" "(NULL)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
- check_libbpf_function "btf__load_from_kernel_by_id" "(0)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
-- check_libbpf_function "btf__type_cnt" "(0)" "$LIBBPF_CFLAGS" "" "$LIBBPF_LDLIBS"
-+ check_libbpf_function "btf__type_cnt" "(NULL)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
- check_libbpf_function "bpf_object__next_map" "(NULL, NULL)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
- check_libbpf_function "bpf_object__next_program" "(NULL, NULL)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
- check_libbpf_function "bpf_program__insn_cnt" "(NULL)" "" "$LIBBPF_CFLAGS" "$LIBBPF_LDLIBS"
diff --git a/net-libs/xdp-tools/files/1.3.1-musl.patch b/net-libs/xdp-tools/files/1.3.1-musl.patch
deleted file mode 100644
index e3238871b262..000000000000
--- a/net-libs/xdp-tools/files/1.3.1-musl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-https://bugs.gentoo.org/836708
-https://github.com/xdp-project/xdp-tools/pull/309
-
-From c9956abbfbd238bd2eb98c67ea002bfce29063a4 Mon Sep 17 00:00:00 2001
-From: Stijn Tintel <stijn@linux-ipv6.be>
-Date: Wed, 29 Mar 2023 04:25:06 +0300
-Subject: [PATCH] libxdp: fix build on musl
-
-In musl, PATH_MAX is defined in limits.h. Include it in libxdp.c to fix
-building systems using musl libc.
-
-libxdp.c: In function 'find_bpffs':
-libxdp.c:406:33: error: 'PATH_MAX' undeclared (first use in this function)
- 406 | static char bpf_wrk_dir[PATH_MAX];
- | ^~~~~~~~
-
-Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---- a/lib/libxdp/libxdp.c
-+++ b/lib/libxdp/libxdp.c
-@@ -22,6 +22,7 @@
- #include <fcntl.h>
- #include <inttypes.h>
- #include <dirent.h>
-+#include <limits.h>
-
- #include <linux/err.h> /* ERR_PTR */
- #include <linux/if_link.h>
-
diff --git a/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch b/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch
deleted file mode 100644
index 3983c8c8f402..000000000000
--- a/net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-
-From: https://github.com/xdp-project/xdp-tools/commit/344b241da22a5358c714d6db1ea6f225f951dbdb
-
-From 344b241da22a5358c714d6db1ea6f225f951dbdb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
-Date: Wed, 8 Mar 2023 18:50:56 +0100
-Subject: [PATCH] xdpdump: fix build with clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When building all of xdp-tools with clang, the xdp-dump build fails
-due to 'classic' use of variable-length arrays and -Werror.
-Disable the warning and leave a breadcrumb to the discussion.
-
-Fixes: #304
-Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
----
- xdp-dump/Makefile | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/xdp-dump/Makefile b/xdp-dump/Makefile
-index 7ee1688e..a9ae0ae7 100644
---- a/xdp-dump/Makefile
-+++ b/xdp-dump/Makefile
-@@ -4,6 +4,10 @@ XDP_TARGETS := xdpdump_bpf xdpdump_xdp
- USER_TARGETS := xdpdump
- TEST_FILE := tests/test-xdpdump.sh
-
-+# Disable warnings about VLAs not being at the end of a structure when building
-+# with clang. The code is fine, but clang's complaint coupled with -Werror would
-+# break the build. See https://github.com/xdp-project/xdp-tools/issues/304
-+CFLAGS += "-Wno-gnu-variable-sized-type-not-at-end"
- LIB_DIR = ../lib
- USER_LIBS = -lpcap
- MAN_PAGE := xdpdump.8
diff --git a/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild b/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
deleted file mode 100644
index e881553d3eed..000000000000
--- a/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2021-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-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:=
- sys-libs/zlib
- net-libs/libpcap
- virtual/libelf"
-RDEPEND="${DEPEND}"
-BDEPEND=">=sys-devel/clang-10.0.0"
-
-# Not prebuilt -- we build them -- but they're not ordinary ELF objects either.
-QA_PREBUILT="usr/lib/bpf/*.o"
-
-MAKEOPTS+=" V=1"
-
-src_configure() {
- export PRODUCTION=1
- export DYNAMIC_LIBXDP=1
- export FORCE_SYSTEM_LIBBPF=1
- default
-}
-
-src_install() {
- export PREFIX="${EPREFIX}/usr"
- export LIBDIR="${PREFIX}/$(get_libdir)"
- export BPF_OBJECT_DIR="${PREFIX}/lib/bpf"
- 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
-}
-
-src_test() { :; }
diff --git a/net-libs/xdp-tools/xdp-tools-1.3.1-r3.ebuild b/net-libs/xdp-tools/xdp-tools-1.3.1-r3.ebuild
deleted file mode 100644
index 543536b75ae6..000000000000
--- a/net-libs/xdp-tools/xdp-tools-1.3.1-r3.ebuild
+++ /dev/null
@@ -1,88 +0,0 @@
-# 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-disable-stack-protector.patch
- "${FILESDIR}"/1.3.1-fix-btf__type_cnt-detection.patch
- "${FILESDIR}"/1.3.1-no-Werror.patch
- "${FILESDIR}"/1.3.1-xdpdump-clang.patch
- "${FILESDIR}"/1.3.1-musl.patch
-)
-
-src_configure() {
- 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
-}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2023-11-22 12:02 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-11-22 12:02 UTC (permalink / raw
To: gentoo-commits
commit: 9cc05971105585d9bcd9193b4373f3f806c3cb06
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Wed Nov 22 11:52:46 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 22 12:02:14 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cc05971
net-libs/xdp-tools: add fix for memory leak in libxdp
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/33647
Signed-off-by: Sam James <sam <AT> gentoo.org>
...4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch | 34 ++++++++++++++++++++++
...ools-1.4.1.ebuild => xdp-tools-1.4.1-r1.ebuild} | 5 ++--
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch b/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
new file mode 100644
index 000000000000..6c95a970f876
--- /dev/null
+++ b/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
@@ -0,0 +1,34 @@
+
+Patch from:
+https://github.com/xdp-project/xdp-tools/commit/cae9c91353cd3ed51753168203ed101905b9ac9e
+
+From cae9c91353cd3ed51753168203ed101905b9ac9e Mon Sep 17 00:00:00 2001
+From: Ric Li <ming3.li@intel.com>
+Date: Tue, 21 Nov 2023 15:36:57 +0800
+Subject: [PATCH] libxdp: Fix xdp prog memory leak in xsk_setup_xdp_prog
+
+In the xsk_setup_xdp_prog function, the xsk structure
+temporarily takes ownership of an xdp_prog and stores it in
+ctx->xdp_prog. However, the allocated memory is not freed
+in xsk_destroy_xsk_struct, leading to a memory leak. This
+commit addresses the issue by adding a call to
+xdp_program_close to properly release the allocated
+xdp_prog memory.
+
+Signed-off-by: Ric Li <ming3.li@intel.com>
+---
+ lib/libxdp/xsk.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/libxdp/xsk.c b/lib/libxdp/xsk.c
+index a854f771..b3527fb6 100644
+--- a/lib/libxdp/xsk.c
++++ b/lib/libxdp/xsk.c
+@@ -978,6 +978,7 @@ static struct xsk_ctx *xsk_create_ctx(struct xsk_socket *xsk,
+
+ static void xsk_destroy_xsk_struct(struct xsk_socket *xsk)
+ {
++ xdp_program__close(xsk->ctx->xdp_prog);
+ free(xsk->ctx);
+ free(xsk);
+ }
diff --git a/net-libs/xdp-tools/xdp-tools-1.4.1.ebuild b/net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild
similarity index 92%
rename from net-libs/xdp-tools/xdp-tools-1.4.1.ebuild
rename to net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild
index 520357d07664..a56fcf10ba5b 100644
--- a/net-libs/xdp-tools/xdp-tools-1.4.1.ebuild
+++ b/net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild
@@ -33,13 +33,14 @@ QA_PREBUILT="usr/lib/bpf/*.o"
MAKEOPTS+=" V=1"
PATCHES=(
+ "${FILESDIR}"/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
)
src_prepare() {
# remove -Werror: #899744
- sed -i 's/-Werror//g' lib/Makefile lib/defines.mk
+ sed -i 's/-Werror//g' lib/Makefile lib/defines.mk || die
sed -i '/-Werror/d' lib/common.mk lib/libxdp/Makefile \
- lib/libxdp/tests/Makefile lib/util/Makefile
+ lib/libxdp/tests/Makefile lib/util/Makefile || die
default
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2024-03-21 2:41 Sam James
0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2024-03-21 2:41 UTC (permalink / raw
To: gentoo-commits
commit: dac30da69c00eadca3981403b1ef3b31b151d1ba
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Tue Jan 30 17:47:43 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 21 02:39:30 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dac30da6
net-libs/xdp-tools: clean up old
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/35098
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/xdp-tools/files/1.4.0-no-Werror.patch | 75 ----------------------
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, 219 deletions(-)
diff --git a/net-libs/xdp-tools/files/1.4.0-no-Werror.patch b/net-libs/xdp-tools/files/1.4.0-no-Werror.patch
deleted file mode 100644
index fb086f5122b9..000000000000
--- a/net-libs/xdp-tools/files/1.4.0-no-Werror.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-
-Bug: https://bugs.gentoo.org/899744
-
-diff --git a/lib/Makefile b/lib/Makefile
-index 5ee035d..5342ab3 100644
---- a/lib/Makefile
-+++ b/lib/Makefile
-@@ -1,5 +1,5 @@
-
--LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Werror -Wall) -fPIC
-+LIBBPF_CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-g -O2 -Wall) -fPIC
-
- LIB_DIR = .
- include defines.mk
-diff --git a/lib/common.mk b/lib/common.mk
-index b680a75..8dbcb39 100644
---- a/lib/common.mk
-+++ b/lib/common.mk
-@@ -116,7 +116,6 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
-diff --git a/lib/defines.mk b/lib/defines.mk
-index 54b259f..ed246c0 100644
---- a/lib/defines.mk
-+++ b/lib/defines.mk
-@@ -40,7 +40,7 @@ endif
-
- DEFINES += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
--CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES)
-+CFLAGS += -std=gnu11 -Wextra $(DEFINES)
- BPF_CFLAGS += $(DEFINES) $(filter -ffile-prefix-map=%,$(CFLAGS))
-
- CONFIGMK := $(LIB_DIR)/../config.mk
-diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
-index 431932a..a0c625d 100644
---- a/lib/libxdp/Makefile
-+++ b/lib/libxdp/Makefile
-@@ -142,7 +142,6 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
-diff --git a/lib/libxdp/tests/Makefile b/lib/libxdp/tests/Makefile
-index 3c22901..a4463f3 100644
---- a/lib/libxdp/tests/Makefile
-+++ b/lib/libxdp/tests/Makefile
-@@ -72,7 +72,6 @@ $(BPF_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK) $(EXTRA_DEPS)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
-diff --git a/lib/util/Makefile b/lib/util/Makefile
-index 24070f0..37485b3 100644
---- a/lib/util/Makefile
-+++ b/lib/util/Makefile
-@@ -26,7 +26,6 @@ $(UTIL_BPF_OBJS): %.o: %.c $(KERN_USER_H) $(BPF_HEADERS) $(LIBMK)
- -Wno-unused-value \
- -Wno-pointer-sign \
- -Wno-compare-distinct-pointer-types \
-- -Werror \
- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
-
diff --git a/net-libs/xdp-tools/files/1.4.0-toolchain.patch b/net-libs/xdp-tools/files/1.4.0-toolchain.patch
deleted file mode 100644
index d4bcb511310f..000000000000
--- a/net-libs/xdp-tools/files/1.4.0-toolchain.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-
-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
deleted file mode 100644
index fb70b301ec4d..000000000000
--- a/net-libs/xdp-tools/xdp-tools-1.4.0.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 2021-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic toolchain-funcs
-
-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 ~riscv ~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.4.0-no-Werror.patch
- "${FILESDIR}"/1.4.0-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
-}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/
@ 2024-08-09 14:39 Arthur Zamarin
0 siblings, 0 replies; 9+ messages in thread
From: Arthur Zamarin @ 2024-08-09 14:39 UTC (permalink / raw
To: gentoo-commits
commit: 14b5874a544060ceaf2e85872a91597d0f2f1778
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Fri Aug 9 09:38:44 2024 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 14:39:28 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14b5874a
net-libs/xdp-tools: clean up old
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/38023
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
net-libs/xdp-tools/Manifest | 1 -
...4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch | 34 -------
net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild | 100 ---------------------
3 files changed, 135 deletions(-)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 523230544af1..99babe4eae1b 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1,3 +1,2 @@
-DIST xdp-tools-1.4.1.tar.gz 339878 BLAKE2B 30ed245dd0da8404cf67313ea4d5f9a148507d14bd7330bdac3b03c07d1cc0b38eb1a376636551cb8ea14c8a2e77d02527da363733a1059e1c2ebaee9ac90392 SHA512 9d2ad42713aa53c10ccbde2c344bf2696524e317544f3693114b343ab74240187699c3802cfc6efa05b3e9f9bfec80fd2537799aa3ae050717bb1f6aab435996
DIST xdp-tools-1.4.2.tar.gz 340864 BLAKE2B c5197330ff917043e03a16346823acab760db5fe903f2e039bd2c178ad34bb04d96a0d6b321fd3565256c39422f3f1f7b475970bd22ab487e30468c96e11c711 SHA512 aedf79859872523d514f18e7a6e8b7999bd1942021968dbba9a7e86cde1c193e31b328bc56d6bf2b3fbc7f266c9df8d942d90a70bbd9d514ce38d56c07cd18ca
DIST xdp-tools-1.4.3.tar.gz 339989 BLAKE2B 836eb66a2264e9d46124a009a8b3e039da23f28f83460fb3aa724c8ca4c37952979278e3041e9acca44acd68cc94423d73f381febc107c454db7da01f583ae41 SHA512 3ba176e573d02feefc1baf81570b514bc25a61d7be3256ce530128092f07b246b8731430289cdcd874f8846122a4451f0bcd06891565dd1b48beaa10b854c646
diff --git a/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch b/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
deleted file mode 100644
index 6c95a970f876..000000000000
--- a/net-libs/xdp-tools/files/1.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-
-Patch from:
-https://github.com/xdp-project/xdp-tools/commit/cae9c91353cd3ed51753168203ed101905b9ac9e
-
-From cae9c91353cd3ed51753168203ed101905b9ac9e Mon Sep 17 00:00:00 2001
-From: Ric Li <ming3.li@intel.com>
-Date: Tue, 21 Nov 2023 15:36:57 +0800
-Subject: [PATCH] libxdp: Fix xdp prog memory leak in xsk_setup_xdp_prog
-
-In the xsk_setup_xdp_prog function, the xsk structure
-temporarily takes ownership of an xdp_prog and stores it in
-ctx->xdp_prog. However, the allocated memory is not freed
-in xsk_destroy_xsk_struct, leading to a memory leak. This
-commit addresses the issue by adding a call to
-xdp_program_close to properly release the allocated
-xdp_prog memory.
-
-Signed-off-by: Ric Li <ming3.li@intel.com>
----
- lib/libxdp/xsk.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lib/libxdp/xsk.c b/lib/libxdp/xsk.c
-index a854f771..b3527fb6 100644
---- a/lib/libxdp/xsk.c
-+++ b/lib/libxdp/xsk.c
-@@ -978,6 +978,7 @@ static struct xsk_ctx *xsk_create_ctx(struct xsk_socket *xsk,
-
- static void xsk_destroy_xsk_struct(struct xsk_socket *xsk)
- {
-+ xdp_program__close(xsk->ctx->xdp_prog);
- free(xsk->ctx);
- free(xsk);
- }
diff --git a/net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild b/net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild
deleted file mode 100644
index 62df6baaace5..000000000000
--- a/net-libs/xdp-tools/xdp-tools-1.4.1-r1.ebuild
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 2021-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic toolchain-funcs
-
-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 ~loong ~ppc ~ppc64 ~riscv ~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.4.1-fix-memory-leak-in-xsk_setup_xdp_prog.patch
-)
-
-src_prepare() {
- # remove -Werror: #899744
- sed -i 's/-Werror//g' lib/Makefile lib/defines.mk || die
- sed -i '/-Werror/d' lib/common.mk lib/libxdp/Makefile \
- lib/libxdp/tests/Makefile lib/util/Makefile || die
-
- default
-}
-
-src_configure() {
- # filter LTO: #861587
- filter-lto
-
- # filter LDFLAGS some more: #916591
- filter-ldflags -Wl,--{icf,lto}*
-
- # force ld.bfd: #916591
- tc-ld-force-bfd
-
- export CC="$(tc-getCC)"
- 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
-
- 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
-}
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-08-09 14:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27 2:59 [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-08-09 14:39 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-07-10 5:30 Sam James
2023-03-10 12:06 Sam James
2022-09-20 22:53 Jason A. Donenfeld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox