summaryrefslogtreecommitdiff
path: root/net-libs/xdp-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-10 18:05:22 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-10 18:05:22 +0000
commit17dcfeba22240edb3c54d96e319edf6c4bc008c3 (patch)
treebf7e044eef048853420208d083f77f7cd820e881 /net-libs/xdp-tools
parentf95eeaf7db6ca1bfbb34c05fdad9ed9bb603b1c8 (diff)
gentoo auto-resync : 10:03:2023 - 18:05:22
Diffstat (limited to 'net-libs/xdp-tools')
-rw-r--r--net-libs/xdp-tools/Manifest4
-rw-r--r--net-libs/xdp-tools/files/1.3.1-no-Werror.patch97
-rw-r--r--net-libs/xdp-tools/files/1.3.1-xdpdump-clang.patch36
-rw-r--r--net-libs/xdp-tools/xdp-tools-1.3.1-r2.ebuild (renamed from net-libs/xdp-tools/xdp-tools-1.3.1-r1.ebuild)25
4 files changed, 161 insertions, 1 deletions
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index debc5707450c..41a864e9c462 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1,7 +1,9 @@
AUX 1.3.1-disable-stack-protector.patch 1085 BLAKE2B 2afb9ae8f79c2aa9c65d07a509c60b2377b949edd61703652c38bf30fa0fe12357d9cbb4257bd7b421ebebdfab2f8c60e06ab915bd9595aa8a839bc7f23effa2 SHA512 cbfb776915f1606c79510a8a8bdd7681d53c544ee66de15dd879f22df0ff2fe1c5716ef3da4221641f76dac5549d3f8de0b643b9a6fa100f609ff0c9f33e2634
AUX 1.3.1-fix-btf__type_cnt-detection.patch 1750 BLAKE2B 7086a709a02f7ea00c709373242cede140ff268c395afb97cba4754182e74e72bfdd300afba4cdc273168f78e63ecda5c58e957d66fa826fcb8ff4615714eded SHA512 27e3b4fe413230471aaffdd9c105ad739351b87914e48b01ed2fefd95213a60fc1ec237921036ca8115f48367d4c965b61002b33037955ba1c6447a497e42912
+AUX 1.3.1-no-Werror.patch 3445 BLAKE2B 9965ad3b07c789594a129178ed844b10f5c70dab713f204f99b520f4303481f27377ceb0ba4d30f19d747dba1ad9dd354604e632b6cf43697b90d51223ccc7b9 SHA512 81b2f9221fe40a2515d62866f8c207fb7f3e60b6cb4fe8da5df8477b5753d50cbbb259a537be41100344995e327411b32341031756bbd4ac7409a18b8bb7a773
+AUX 1.3.1-xdpdump-clang.patch 1381 BLAKE2B 860f505dbef740aded6440d53e864cb82714ccd2ca0d475f0c0faab7228c0f9ccc88ee627b4708732f49016fcc2507cf1d2470d17864a521218e4111332a420f SHA512 d380f948fdca80a5816432f39f54263c11a6d4589af10e85a9f25d8de1d0b8d1fb0f6c8fe0c424fbee9fb43b8bf8000f7d1fea1a0d5418bacc62c2321780d7f2
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
EBUILD xdp-tools-1.2.8.ebuild 1261 BLAKE2B 800efd8b697d0fe6e2e5fae5c34deb9b299aec42a4aa437b43a63cce77356c0d71107728a369287910f2d5948a24cf467518c3ce7809edbdf2baee27338b5d69 SHA512 40847494eeac46981c8a5beb41ea321a31656d37fd94b0cdeb010c1f084a6bd06d1bf61f3bc7ce319ba59b27eb82781e2922b4f33f317f4a26e42fcfca7a0faf
-EBUILD xdp-tools-1.3.1-r1.ebuild 1424 BLAKE2B 0321e811841b9c08abf2b40288656544996e694d3953358bdc0acc380e3401ad8cc27a54f49ed717ae71afee53d3c499fb3a0999ab514814b7a242838914a3d9 SHA512 9f1ab01780a8a9f803bdc6eac5235d717e515b7d7c83efedec2e297b9324ba59b2ba7c3f30554c1bf442f76c942f44b5490047681f17894d58a3cbb8ba707c12
+EBUILD xdp-tools-1.3.1-r2.ebuild 2069 BLAKE2B 761dfd0222493a2597e2feba7bd2f6e0d4e269ba72e8b70b35c99b8818af6f380ba3ac3e8cb6f5f31e5606abccb1d3ad0eb7580cb446370be0b556395fd1f83e SHA512 f7f4eb70db2e26a2e61677f3e6cf7852d3dc3812893e47bf29fdd5c3dd9c125db97d5438e36b2754596c1ea83790d2989fd1f3c951174d1dbcb97b937212a5a1
MISC metadata.xml 448 BLAKE2B 5e76000a49c2578dc872010907deab803bf25d58e5383b81f8953f3ac8549f017895c7afa39a2b8c3eb47efb66c5c322177032542cdffec41de733502da41ce4 SHA512 4010fb44ad655a9c58e3328623652d2f6c10aee934daeaaa2c5738c44b086cc2674e011e5de0b6e6a058c24131a16be679e971a692800458492cf3addbd761c2
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
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
+}