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@applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/31801
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Holger Hoffstätte
2023-07-10 06:30:16 +01:00
committed by Sam James
parent 64bf0f1a08
commit 5e7d98bc4a
3 changed files with 145 additions and 0 deletions
+1
View File
@@ -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
@@ -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 \
+87
View File
@@ -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
}