From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/files/, net-libs/xdp-tools/
Date: Sun, 5 Mar 2023 11:19:43 +0000 (UTC) [thread overview]
Message-ID: <1678015159.8eea55ff639c63ce54f5feba1d3300e40d4814b9.sam@gentoo> (raw)
commit: 8eea55ff639c63ce54f5feba1d3300e40d4814b9
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Mar 4 15:16:10 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 5 11:19:19 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8eea55ff
net-libs/xdp-tools: bump to 1.3.1 & add build fixes
- fix configure to properly detect libbpf features
- fix clang build with default-enabled stack protector
Closes: https://bugs.gentoo.org/889842
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/29926
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 ++++++++++++++++++++++
...p-tools-1.2.8.ebuild => xdp-tools-1.3.1.ebuild} | 7 ++++-
4 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index 9e3d03e1cffd..2fda18e4cc09 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1 +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
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?= <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
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?= <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/xdp-tools-1.2.8.ebuild b/net-libs/xdp-tools/xdp-tools-1.3.1.ebuild
similarity index 88%
rename from net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
rename to net-libs/xdp-tools/xdp-tools-1.3.1.ebuild
index 0dd14f1dc39b..fdc4068a030e 100644
--- a/net-libs/xdp-tools/xdp-tools-1.2.8.ebuild
+++ b/net-libs/xdp-tools/xdp-tools-1.3.1.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
@@ -25,6 +25,11 @@ 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
next reply other threads:[~2023-03-05 11:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 11:19 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-11-22 12:02 [gentoo-commits] repo/gentoo:master commit in: net-libs/xdp-tools/files/, net-libs/xdp-tools/ Sam James
2023-04-16 6:56 Sam James
2023-03-29 1:32 Sam James
2022-06-11 5:36 Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1678015159.8eea55ff639c63ce54f5feba1d3300e40d4814b9.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox