build: cache kernel module package compiling
authorZeyu Dong <dzy201415@gmail.com>
Sat, 30 Sep 2023 00:54:58 +0000 (20:54 -0400)
committerChristian Marangi <ansuelsmth@gmail.com>
Sat, 28 Oct 2023 19:34:20 +0000 (21:34 +0200)
Kernel module packages compiling is not cached (e.g. mac80211)
even with CONFIG_CCACHE on.

CC should be set to KERNEL_CC in KERNEL_MAKE_FLAGS at kernel.mk
to allow kernel module packages using ccache.

Signed-off-by: Zeyu Dong <dzy201415@gmail.com>
include/kernel-defaults.mk
include/kernel.mk

index a0527c0d28604bccd9a81e2d2945f876ffdc77bf..d9842fd82aebaa7599d544ac593245e833f23273 100644 (file)
@@ -9,10 +9,6 @@ endif
 
 INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt
 
-ifneq (,$(KERNEL_CC))
-  KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
-endif
-
 export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
 
 # defined in quilt.mk
index 3012eb899352e28cbbbd9f9cce60e5cb78d49485..8236416132d63d9823193614357c5fc317a5900a 100644 (file)
@@ -119,6 +119,10 @@ KERNEL_MAKE_FLAGS = \
        cmd_syscalls= \
        $(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)")
 
+ifneq (,$(KERNEL_CC))
+  KERNEL_MAKE_FLAGS += CC="$(KERNEL_CC)"
+endif
+
 KERNEL_NOSTDINC_FLAGS = \
        -nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include))