summaryrefslogtreecommitdiff
path: root/net-libs/xdp-tools/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-05 23:52:45 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-05 23:52:45 +0000
commit1c33e521c460dc40899ce7bc919602b842ce27e2 (patch)
tree580eefad4cce1e883e7504b93352a9029b53036d /net-libs/xdp-tools/files
parent65e4244e411c4f65f55f2aa91f39e228f4c0680b (diff)
gentoo auto-resync : 05:03:2023 - 23:52:45
Diffstat (limited to 'net-libs/xdp-tools/files')
-rw-r--r--net-libs/xdp-tools/files/1.3.1-disable-stack-protector.patch32
-rw-r--r--net-libs/xdp-tools/files/1.3.1-fix-btf__type_cnt-detection.patch36
2 files changed, 68 insertions, 0 deletions
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"