2 # Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE_URL
:=https
://github.com
/libbpf
/bpftool
15 PKG_MIRROR_HASH
:=42030a007714aa075fbd402ccb0196e4892344fb7215b4f51a99b633cc5104fa
17 PKG_SOURCE_VERSION
:=v7.3
.0
19 PKG_MAINTAINER
:=Tony Ambardar
<itugrok@yahoo.com
>
21 PKG_BUILD_FLAGS
:=no-mips16
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/nls.mk
28 define Package
/bpftool
/Default
31 TITLE
:=bpftool
- eBPF subsystem utility
32 LICENSE
:=GPL-2.0
-only OR BSD-2-Clause
33 URL
:=http
://www.kernel.org
37 define Package
/bpftool-minimal
38 $(call Package
/bpftool
/Default
)
43 ALTERNATIVES
:=200:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-minimal
46 define Package
/bpftool-full
47 $(call Package
/bpftool
/Default
)
51 ALTERNATIVES
:=300:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-full
52 DEPENDS
+= +libbfd
+libopcodes
55 define Package
/bpftool-minimal
/description
56 A tool for inspection and simple manipulation of eBPF programs and maps.
59 define Package
/bpftool-full
/description
60 A tool for inspection and simple manipulation of eBPF programs and maps.
61 This full version uses libbfd and libopcodes to support disassembly of
62 eBPF programs and jited code.
65 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
-flto
66 TARGET_LDFLAGS
+= -Wl
,--gc-sections
-flto
68 ifeq ($(BUILD_VARIANT
),full
)
75 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
76 LDFLAGS
="$(TARGET_LDFLAGS)"
79 OUTPUT
="$(PKG_BUILD_DIR)/" \
81 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
83 feature-clang-bpf-co-re
=0 \
84 feature-libbfd
=$(full
) \
87 feature-disassembler-four-args
=1 \
88 feature-disassembler-init-styled
=1
92 define Package
/bpftool-
$(BUILD_VARIANT
)/install
93 $(INSTALL_DIR
) $(1)/usr
/libexec
94 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bpftool \
95 $(1)/usr
/libexec
/bpftool-
$(BUILD_VARIANT
)
98 $(eval
$(call BuildPackage
,bpftool-full
))
99 $(eval
$(call BuildPackage
,bpftool-minimal
))