aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-10-23 11:26:48 +0200
committerFelix Fietkau <nbd@nbd.name>2020-11-13 13:16:37 +0100
commit5d7606562940b52206712bb4bc274ad39521c3e1 (patch)
tree2c29fa3dfea4994fa3c759d25e9aa5ef4dc379db /include
parent92b707f61bfb9bf767b8be4e4193a23277f939bb (diff)
downloadupstream-5d7606562940b52206712bb4bc274ad39521c3e1.tar.gz
upstream-5d7606562940b52206712bb4bc274ad39521c3e1.tar.bz2
upstream-5d7606562940b52206712bb4bc274ad39521c3e1.zip
build: pass KBUILD_EXTRA_SYMBOLS with symvers files for kernel module packages
This replaces the previous (deprecated) method of collecting symvers data in $(PKG_BUILD_DIR)/Module.symvers, which does not work on newer kernels Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include')
-rw-r--r--include/kernel-build.mk1
-rw-r--r--include/kernel.mk12
2 files changed, 3 insertions, 10 deletions
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 9dfb19ccc7..600cf1d771 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -136,6 +136,7 @@ define BuildKernel
$(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
$(Kernel/CompileModules)
+ mkdir -p $(PKG_SYMVERS_DIR)
touch $$@
$(LINUX_DIR)/.image: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
diff --git a/include/kernel.mk b/include/kernel.mk
index 40aa1a5163..1ae9c6be29 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -118,7 +118,8 @@ KERNEL_MAKE_FLAGS = \
CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
$(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \
- cmd_syscalls=
+ cmd_syscalls= \
+ $(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)")
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
KERNEL_MAKE_FLAGS += \
@@ -140,14 +141,6 @@ PKG_EXTMOD_SUBDIRS ?= .
PKG_SYMVERS_DIR = $(KERNEL_BUILD_DIR)/symvers
-define populate_module_symvers
- @mkdir -p $(PKG_SYMVERS_DIR)
- cat /dev/null > $(PKG_SYMVERS_DIR)/$(PKG_NAME).symvers; \
- for subdir in $(PKG_EXTMOD_SUBDIRS); do \
- cat $(PKG_SYMVERS_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
- done
-endef
-
define collect_module_symvers
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
realdir=$$$$(readlink -f $(PKG_BUILD_DIR)); \
@@ -161,7 +154,6 @@ endef
define KernelPackage/hooks
ifneq ($(PKG_NAME),kernel)
- Hooks/Compile/Pre += populate_module_symvers
Hooks/Compile/Post += collect_module_symvers
endif
define KernelPackage/hooks