diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-03-15 14:33:59 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-03-19 07:30:06 +0100 |
commit | 00cbf6f6ab1d5c45a40c68167af897c9526542e8 (patch) | |
tree | f34380b7668b3ed2263ca5793546c447a49e2cf8 /package/network/utils/bpftools/patches | |
parent | 9c8cd1462d939bdd7f01f4daa3cb86f512d0e75f (diff) | |
download | upstream-00cbf6f6ab1d5c45a40c68167af897c9526542e8.tar.gz upstream-00cbf6f6ab1d5c45a40c68167af897c9526542e8.tar.bz2 upstream-00cbf6f6ab1d5c45a40c68167af897c9526542e8.zip |
bpftools: update to standalone bpftools + libbpf, use the latest version
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/utils/bpftools/patches')
4 files changed, 36 insertions, 71 deletions
diff --git a/package/network/utils/bpftools/patches/001-cflags.patch b/package/network/utils/bpftools/patches/001-cflags.patch new file mode 100644 index 0000000000..48617e302b --- /dev/null +++ b/package/network/utils/bpftools/patches/001-cflags.patch @@ -0,0 +1,10 @@ +--- a/libbpf/src/Makefile ++++ b/libbpf/src/Makefile +@@ -25,6 +25,7 @@ ALL_CFLAGS := $(INCLUDES) + + SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED + ++CFLAGS = $(EXTRA_CFLAGS) + CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 + ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + ALL_LDFLAGS += $(LDFLAGS) diff --git a/package/network/utils/bpftools/patches/002-includes.patch b/package/network/utils/bpftools/patches/002-includes.patch new file mode 100644 index 0000000000..589d71c31e --- /dev/null +++ b/package/network/utils/bpftools/patches/002-includes.patch @@ -0,0 +1,26 @@ +--- a/libbpf/include/linux/list.h ++++ b/libbpf/include/linux/list.h +@@ -3,6 +3,8 @@ + #ifndef __LINUX_LIST_H + #define __LINUX_LIST_H + ++#include <linux/types.h> ++ + #define LIST_HEAD_INIT(name) { &(name), &(name) } + #define LIST_HEAD(name) \ + struct list_head name = LIST_HEAD_INIT(name) +--- a/src/Makefile ++++ b/src/Makefile +@@ -73,10 +73,10 @@ CFLAGS += -W -Wall -Wextra -Wno-unused-p + CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS)) + CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ + -I$(if $(OUTPUT),$(OUTPUT),.) \ +- -I$(LIBBPF_INCLUDE) \ + -I$(srctree)/src/kernel/bpf/ \ + -I$(srctree)/include \ +- -I$(srctree)/include/uapi ++ -I$(srctree)/include/uapi \ ++ -I$(LIBBPF_INCLUDE) + ifneq ($(BPFTOOL_VERSION),) + CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"' + endif diff --git a/package/network/utils/bpftools/patches/005-tools-arch-powerpc-fix-EDEADLOCK-redefinition-errors.patch b/package/network/utils/bpftools/patches/005-tools-arch-powerpc-fix-EDEADLOCK-redefinition-errors.patch deleted file mode 100644 index 996ffc43ee..0000000000 --- a/package/network/utils/bpftools/patches/005-tools-arch-powerpc-fix-EDEADLOCK-redefinition-errors.patch +++ /dev/null @@ -1,51 +0,0 @@ -From afe3f4c765b17ced23811fe652c7f7adf7a0c0cf Mon Sep 17 00:00:00 2001 -From: Tony Ambardar <Tony.Ambardar@gmail.com> -Date: Mon, 14 Sep 2020 23:05:26 -0700 -Subject: [PATCH] tools/arch/powerpc: fix EDEADLOCK redefinition errors in - errno.h - -A few archs like powerpc have different errno.h values for macros -EDEADLOCK and EDEADLK. In code including both libc and linux versions of -errno.h, this can result in multiple definitions of EDEADLOCK in the -include chain. Definitions to the same value (e.g. seen with mips) do -not raise warnings, but on powerpc there are redefinitions changing the -value, which raise warnings and errors (with "-Werror"). - -Guard against these redefinitions to avoid build errors like the following, -first seen cross-compiling libbpf v5.8.9 for powerpc using GCC 8.4.0 with -musl 1.1.24: - - In file included from ../../arch/powerpc/include/uapi/asm/errno.h:5, - from ../../include/linux/err.h:8, - from libbpf.c:29: - ../../include/uapi/asm-generic/errno.h:40: error: "EDEADLOCK" redefined [-Werror] - #define EDEADLOCK EDEADLK - - In file included from toolchain-powerpc_8540_gcc-8.4.0_musl/include/errno.h:10, - from libbpf.c:26: - toolchain-powerpc_8540_gcc-8.4.0_musl/include/bits/errno.h:58: note: this is the location of the previous definition - #define EDEADLOCK 58 - - cc1: all warnings being treated as errors - make[5]: *** [target-powerpc_8540_musl/bpftools-5.8.9/tools/build/Makefile.build:97: /home/kodidev/openwrt-project/build_dir/target-powerpc_8540_musl/bpftools-minimal/bpftools-5.8.9//libbpf/staticobjs/libbpf.o] Error 1 - -Fixes: 95f28190aa01 ("tools include arch: Grab a copy of errno.h for arch's - supported by perf") -Fixes: c3617f72036c ("UAPI: (Scripted) Disintegrate arch/powerpc/include/asm") - -Reported-by: Rosen Penev <rosenp@gmail.com> -Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com> ---- - tools/arch/powerpc/include/uapi/asm/errno.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/tools/arch/powerpc/include/uapi/asm/errno.h -+++ b/tools/arch/powerpc/include/uapi/asm/errno.h -@@ -2,6 +2,7 @@ - #ifndef _ASM_POWERPC_ERRNO_H - #define _ASM_POWERPC_ERRNO_H - -+#undef EDEADLOCK - #include <asm-generic/errno.h> - - #undef EDEADLOCK diff --git a/package/network/utils/bpftools/patches/006-musl-120.patch b/package/network/utils/bpftools/patches/006-musl-120.patch deleted file mode 100644 index 53be466f0b..0000000000 --- a/package/network/utils/bpftools/patches/006-musl-120.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/tools/bpf/bpftool/btf_dumper.c -+++ b/tools/bpf/bpftool/btf_dumper.c -@@ -5,6 +5,7 @@ - #include <stdio.h> /* for (FILE *) used by json_writer */ - #include <string.h> - #include <unistd.h> -+#include <linux/compiler.h> - #include <asm/byteorder.h> - #include <linux/bitops.h> - #include <linux/btf.h> ---- a/tools/bpf/bpftool/map_perf_ring.c -+++ b/tools/bpf/bpftool/map_perf_ring.c -@@ -16,6 +16,7 @@ - #include <time.h> - #include <unistd.h> - #include <linux/bpf.h> -+#include <linux/compiler.h> - #include <linux/perf_event.h> - #include <sys/ioctl.h> - #include <sys/mman.h> |