From 1c33e521c460dc40899ce7bc919602b842ce27e2 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 5 Mar 2023 23:52:45 +0000 Subject: gentoo auto-resync : 05:03:2023 - 23:52:45 --- net-libs/xdp-tools/Manifest | 6 ++- .../files/1.3.1-disable-stack-protector.patch | 32 +++++++++++ .../files/1.3.1-fix-btf__type_cnt-detection.patch | 36 +++++++++++++ net-libs/xdp-tools/xdp-tools-1.2.8.ebuild | 2 +- net-libs/xdp-tools/xdp-tools-1.3.1.ebuild | 62 ++++++++++++++++++++++ 5 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 net-libs/xdp-tools/files/1.3.1-disable-stack-protector.patch create mode 100644 net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch create mode 100644 net-libs/xdp-tools/xdp-tools-1.3.1.ebuild (limited to 'net-libs/xdp-tools') diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest index 31102a0b4e3b..360dada9768e 100644 --- a/net-libs/xdp-tools/Manifest +++ b/net-libs/xdp-tools/Manifest @@ -1,3 +1,7 @@ +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 DIST xdp-tools-1.2.8.tar.gz 253786 BLAKE2B f745085b73da5193c3cdaf60c20dfa5de62f3d83487413c87b4c3d07b755dcf91cfbeb4ba970b4e04eef74b4cec4238057f4462074f49b7139d7652cb0f22998 SHA512 6ada9e433fcbefd13cebdffe93c3ce9159e9e09f1498d1615918ca6ecc4f11f03fcd9096980e8ceb7de126d4d8b953fa64917e777d54b5a3dfd1a9556de81626 -EBUILD xdp-tools-1.2.8.ebuild 1261 BLAKE2B 41ebbef1014c7730007c0765283cd8e34d66d75f99be846d762aada7045a5a72e23a0a02364eddd32f2d67b4baff54fdd97a70b585b3ced57cf3e3d91959bb1b SHA512 3cbbeae820d0cedfefc4c2b17f086dd86c55c39994606d6fe245c88e47eb6f9342474d3f0796db15b67d772e8734509cb900f202eb0cdcb618fecc040589294b +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.ebuild 1412 BLAKE2B 491376a06fe88e191c967eca92312db41c86ee4822512731844d1a1e6433b475db9cadcb55ae4681d159414704a50bc342201b1e579b82472140e05411450fe2 SHA512 23a58b82e721b734b517ee37748b18bb45a64b5293bcea2a42e78949ccec98864860e54f804b80258067d3b6583465d81102e60f227cae8066fbdde8c10be192 MISC metadata.xml 448 BLAKE2B 5e76000a49c2578dc872010907deab803bf25d58e5383b81f8953f3ac8549f017895c7afa39a2b8c3eb47efb66c5c322177032542cdffec41de733502da41ce4 SHA512 4010fb44ad655a9c58e3328623652d2f6c10aee934daeaaa2c5738c44b086cc2674e011e5de0b6e6a058c24131a16be679e971a692800458492cf3addbd761c2 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 new file mode 100644 index 000000000000..3a37b26efa14 --- /dev/null +++ b/net-libs/xdp-tools/files/1.3.1-disable-stack-protector.patch @@ -0,0 +1,32 @@ + +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?= +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 +--- + 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 new file mode 100644 index 000000000000..d805e1077c76 --- /dev/null +++ b/net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch @@ -0,0 +1,36 @@ + +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?= +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 +Signed-off-by: Toke Høiland-Jørgensen +--- + 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/xdp-tools-1.2.8.ebuild b/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild index 0dd14f1dc39b..e881553d3eed 100644 --- a/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild +++ b/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild @@ -1,4 +1,4 @@ -# Copyright 2021-2022 Gentoo Authors +# Copyright 2021-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 diff --git a/net-libs/xdp-tools/xdp-tools-1.3.1.ebuild b/net-libs/xdp-tools/xdp-tools-1.3.1.ebuild new file mode 100644 index 000000000000..99a0ac49879d --- /dev/null +++ b/net-libs/xdp-tools/xdp-tools-1.3.1.ebuild @@ -0,0 +1,62 @@ +# 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 ~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 +) + +src_configure() { + export PRODUCTION=1 + export DYNAMIC_LIBXDP=1 + export FORCE_SYSTEM_LIBBPF=1 + default +} + +src_test() { :; } + +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 +} -- cgit v1.2.3