diff options
author | Tony Ambardar <itugrok@yahoo.com> | 2024-05-05 16:11:02 -0700 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2024-05-06 22:39:18 +0200 |
commit | 708e6b840ee7e08e9056e40c96bd93b1355928a7 (patch) | |
tree | cf472e28187a1dd13b24898eda9e57c2af5e5262 /package | |
parent | 0b0e3e22f8830c6f0224509f25eb0f55d36ba7b5 (diff) |
kselftests-bpf: update for kernel 6.6
Enable building multiple test programs and related kernel modules, with
initial support for the bpf_testmod.ko module required since kernel 6.4.
Explicitly disable LTO and clean up makefile variables and formatting.
Fix a musl-related build failure by adding a kernel 6.6 patch:
360-selftests-bpf-portability-of-unprivileged-tests.patch
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/devel/kselftests-bpf/Makefile | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/package/devel/kselftests-bpf/Makefile b/package/devel/kselftests-bpf/Makefile index 0a5b874e04..d69e1e6dc3 100644 --- a/package/devel/kselftests-bpf/Makefile +++ b/package/devel/kselftests-bpf/Makefile @@ -13,7 +13,7 @@ PKG_VERSION:=$(LINUX_VERSION) PKG_RELEASE:=1 PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com> -PKG_BUILD_FLAGS:=gc-sections lto +PKG_BUILD_FLAGS:=no-lto PKG_BUILD_PARALLEL:=1 PKG_FLAGS:=nonshared @@ -23,8 +23,9 @@ include $(INCLUDE_DIR)/nls.mk define Package/kselftests-bpf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf +zlib +libpthread +librt @!IN_SDK \ - @KERNEL_DEBUG_FS @KERNEL_DEBUG_INFO_BTF @KERNEL_BPF_EVENTS + DEPENDS:= \ + +libelf +zlib +libpthread +librt @!IN_SDK \ + @KERNEL_DEBUG_FS @KERNEL_DEBUG_INFO_BTF @KERNEL_BPF_EVENTS TITLE:=Linux Kernel Selftests (BPF) URL:=http://www.kernel.org endef @@ -33,31 +34,40 @@ define Package/kselftests-bpf/description kselftests-bpf is the Linux kernel BPF test suite endef -TEST_TARGET = test_verifier +EXE_TARGETS = test_verifier + +MOD_TARGETS = $(if $(call kernel_patchver_ge,6.4),bpf_testmod.ko) MAKE_PATH:=tools/testing/selftests/bpf MAKE_VARS = \ ARCH="$(LINUX_KARCH)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ - SAN_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ LDLIBS="$(TARGET_LDFLAGS)" \ TOOLCHAIN_INCLUDE="$(TOOLCHAIN_INC_DIRS)" \ - VMLINUX_BTF="$(LINUX_DIR)/vmlinux" + KBUILD_OUTPUT="$(LINUX_DIR)" MAKE_FLAGS = \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ - O=$(PKG_BUILD_DIR) + OUTPUT=$(PKG_BUILD_DIR) define Build/Compile +$(MAKE_VARS) \ $(MAKE) $(PKG_JOBS) -C $(LINUX_DIR)/$(MAKE_PATH) \ - $(MAKE_FLAGS) $(TEST_TARGET) ; + $(MAKE_FLAGS) $(EXE_TARGETS) $(MOD_TARGETS) ; endef define Package/kselftests-bpf/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(TEST_TARGET) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/libexec/$(PKG_NAME) + $(foreach tgt,$(MOD_TARGETS), \ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(tgt) $(1)/usr/libexec/$(PKG_NAME); \ + ) + $(foreach tgt,$(EXE_TARGETS), \ + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/$(tgt) $(1)/usr/libexec/$(PKG_NAME); \ +) endef $(eval $(call BuildPackage,kselftests-bpf)) |