From 26a65e852c5bd8e586205ce8dff582de623cb566 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 25 Feb 2023 22:21:15 +0100 Subject: [PATCH] bpftool: Update to version 7.1.0 bpftool changelog: https://github.com/libbpf/bpftool/releases libbpf changelog: https://github.com/libbpf/libbpf/releases This updates the bfptool to version 7.1.0. This also includes an update of the libbpf to version 1.1. This also adds some new feature options and removes some old ones which were also removed form the source code. zlib for example is now mandatory. Add -flto also to LD flags to make it really work. Before this change bpftool was on a git commit between version 6.7 and 6.8 and libbpf was on a commit between version 0.7 and 0.8. Signed-off-by: Hauke Mehrtens --- package/network/utils/bpftools/Makefile | 14 +++++++------- .../utils/bpftools/patches/001-cflags.patch | 6 +++--- .../utils/bpftools/patches/002-includes.patch | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/network/utils/bpftools/Makefile b/package/network/utils/bpftools/Makefile index 56422e7902..7adda2edaf 100644 --- a/package/network/utils/bpftools/Makefile +++ b/package/network/utils/bpftools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/bpftool PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-03-08 -PKG_SOURCE_VERSION:=04c465fd1f561f67796dc68bbfe1aa7cfa956c3c -PKG_MIRROR_HASH:=e22a954cd186f43228a96586bbdc120b11e6c87360ab88ae96ba37afb9c7cb58 +PKG_SOURCE_DATE:=7.1.0 +PKG_SOURCE_VERSION:=b01941c8f7890489f09713348a7d89567538504b +PKG_MIRROR_HASH:=641fb337342e25ae784a3efe72c71d8c88600a326300d8d5834e26be21547015 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) PKG_MAINTAINER:=Tony Ambardar @@ -82,7 +82,7 @@ endef # LTO not compatible with DSO using PIC ifneq ($(BUILD_VARIANT),lib) TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto - TARGET_LDFLAGS += -Wl,--gc-sections + TARGET_LDFLAGS += -Wl,--gc-sections -flto endif ifeq ($(BUILD_VARIANT),full) @@ -102,11 +102,11 @@ MAKE_FLAGS += \ LIBSUBDIR=lib \ check_feat=0 \ feature-clang-bpf-co-re=0 \ - feature-reallocarray=1 \ - feature-zlib=1 \ feature-libbfd=$(full) \ + feature-llvm=0 \ feature-libcap=0 \ - feature-disassembler-four-args=$(full) + feature-disassembler-four-args=1 \ + feature-disassembler-init-styled=0 ifeq ($(BUILD_VARIANT),lib) MAKE_PATH = libbpf/src diff --git a/package/network/utils/bpftools/patches/001-cflags.patch b/package/network/utils/bpftools/patches/001-cflags.patch index 48617e302b..b06842a0be 100644 --- a/package/network/utils/bpftools/patches/001-cflags.patch +++ b/package/network/utils/bpftools/patches/001-cflags.patch @@ -1,10 +1,10 @@ --- a/libbpf/src/Makefile +++ b/libbpf/src/Makefile -@@ -25,6 +25,7 @@ ALL_CFLAGS := $(INCLUDES) +@@ -34,6 +34,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) + ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) + ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) diff --git a/package/network/utils/bpftools/patches/002-includes.patch b/package/network/utils/bpftools/patches/002-includes.patch index 589d71c31e..ac1b5fcc22 100644 --- a/package/network/utils/bpftools/patches/002-includes.patch +++ b/package/network/utils/bpftools/patches/002-includes.patch @@ -14,7 +14,7 @@ @@ -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$(or $(OUTPUT),.) \ - -I$(LIBBPF_INCLUDE) \ -I$(srctree)/src/kernel/bpf/ \ -I$(srctree)/include \ -- 2.30.2