build: fix build with CONFIG_STRIP_KERNEL_EXPORTS
authorFelix Fietkau <nbd@nbd.name>
Wed, 17 Feb 2021 12:49:14 +0000 (13:49 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 17 Feb 2021 12:49:43 +0000 (13:49 +0100)
Only use symtab.h on the final kernel link

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/kernel-defaults.mk

index 51a32106e47caa1beb907082f3d80299215fa509..8293956f6b766be9c271e57b7d684e246c3f013a 100644 (file)
@@ -3,7 +3,7 @@
 # Copyright (C) 2006-2020 OpenWrt.org
 
 ifdef CONFIG_STRIP_KERNEL_EXPORTS
-  KERNEL_MAKEOPTS += \
+  KERNEL_MAKEOPTS_IMAGE += \
        EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
 endif
 
@@ -137,7 +137,7 @@ endef
 
 define Kernel/CompileImage/Default
        rm -f $(TARGET_DIR)/init
-       +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
+       +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
        $(call Kernel/CopyImage)
 endef
 
@@ -147,7 +147,7 @@ define Kernel/CompileImage/Initramfs
        $(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
        $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
        rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
-       +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
+       +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
        $(call Kernel/CopyImage,-initramfs)
 endef
 else