diff options
author | Tony Ambardar <itugrok@yahoo.com> | 2020-08-20 11:46:50 -0700 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-08-31 12:23:59 +0100 |
commit | 2f0d672088c39914ab9cd59b9de3d6f705cd6d5d (patch) | |
tree | ba3810d5384e7529d19f8f318c36d804e2354f96 /package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch | |
parent | 735947229c0e89fd714b3cded1e76ea9093827ed (diff) | |
download | upstream-2f0d672088c39914ab9cd59b9de3d6f705cd6d5d.tar.gz upstream-2f0d672088c39914ab9cd59b9de3d6f705cd6d5d.tar.bz2 upstream-2f0d672088c39914ab9cd59b9de3d6f705cd6d5d.zip |
bpftools: add utility and library packages supporting eBPF usage
Add support for building bpftool and libbpf from the latest 5.8.3 kernel
sources, ensuring up-to-date functionality and fixes. Both are written to
be backwards compatible, which simplfies build and usage across different
OpenWRT image kernels.
'bpftool' is the primary userspace tool widely used for introspection and
manipulation of eBPF programs and maps. Two variants are built: a 'full'
version which supports object disassembly and depends on libbfd/libopcodes
(total ~500KB); and a 'minimal' version without disassembly functions and
dependencies. The default 'minimal' variant is otherwise fully functional,
and both are compiled using LTO for further (~30KB) size reductions.
'libbpf' provides shared/static libraries and dev files needed for building
userspace programs that perform eBPF interaction.
Several cross-compilation and build-failure problems are addressed by new
patches and ones backported from farther upstream:
* 001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch
* 002-libbpf-fix-build-failure-from-uninitialized-variable.patch
* 003-bpftool-allow-passing-BPFTOOL_VERSION-to-make.patch
* 004-v5.9-bpftool-use-only-ftw-for-file-tree-parsing.patch
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Diffstat (limited to 'package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch')
-rw-r--r-- | package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch b/package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch new file mode 100644 index 0000000000..0b223644dc --- /dev/null +++ b/package/network/utils/bpftools/patches/001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch @@ -0,0 +1,36 @@ +From fafb2e7eaec6d33ce16e28f481edf781219d5d27 Mon Sep 17 00:00:00 2001 +From: Tony Ambardar <Tony.Ambardar@gmail.com> +Date: Fri, 24 Jul 2020 23:58:17 -0700 +Subject: [PATCH] tools/libbpf: ensure no local symbols counted in ABI check + +This avoids finding versioned local symbols such as _init and _fini in +the libbpf.so file. + +Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com> +--- + tools/lib/bpf/Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile +index bf8ed134cb8a..c820b0be9d63 100644 +--- a/tools/lib/bpf/Makefile ++++ b/tools/lib/bpf/Makefile +@@ -152,6 +152,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \ + awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ + sort -u | wc -l) + VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \ ++ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ + grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l) + + CMD_TARGETS = $(LIB_TARGET) $(PC_FILE) +@@ -219,6 +220,7 @@ check_abi: $(OUTPUT)libbpf.so + awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ + sort -u > $(OUTPUT)libbpf_global_syms.tmp; \ + readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \ ++ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ + grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | \ + sort -u > $(OUTPUT)libbpf_versioned_syms.tmp; \ + diff -u $(OUTPUT)libbpf_global_syms.tmp \ +-- +2.25.1 + |