From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 19F6715800D for ; Mon, 10 Jul 2023 05:30:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 37167E0885; Mon, 10 Jul 2023 05:30:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1B1E9E0885 for ; Mon, 10 Jul 2023 05:30:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 35F77335D9E for ; Mon, 10 Jul 2023 05:30:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6FAF8A99 for ; Mon, 10 Jul 2023 05:30:27 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688967016.5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/, net-libs/xdp-tools/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-libs/xdp-tools/Manifest net-libs/xdp-tools/files/1.4.0-toolchain.patch net-libs/xdp-tools/xdp-tools-1.4.0.ebuild X-VCS-Directories: net-libs/xdp-tools/ net-libs/xdp-tools/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0 X-VCS-Branch: master Date: Mon, 10 Jul 2023 05:30:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 45e345a9-4aa6-4e64-9e9a-e78ccfa25a33 X-Archives-Hash: cdaf6f5e6da7f080e2cb067abd5ee1de commit: 5e7d98bc4aa5f3ffcb0e2aa2c15b76f3e309ddd0 Author: Holger Hoffstätte applied-asynchrony com> AuthorDate: Sat Jul 8 11:14:18 2023 +0000 Commit: Sam James gentoo 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 applied-asynchrony.com> Closes: https://github.com/gentoo/gentoo/pull/31801 Signed-off-by: Sam James 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?= +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 +--- + 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 +}