diff mbox series

[1/2] build: cache kernel module package compiling

Message ID 20230930005459.1457589-1-dzy201415@gmail.com
State Accepted
Headers show
Series [1/2] build: cache kernel module package compiling | expand

Commit Message

Zeyu Dong Sept. 30, 2023, 12:54 a.m. UTC
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>
---
The package Makefile is not sourcing kernel-defaults.mk, where CC is set
to KERNEL_CC, which will be ccache when CONFIG_CCACHE is on. Also, some
module packages are using KERNEL_MAKE_FLAGS instead of standard
KERNEL_MAKE to compile.
---
 include/kernel-defaults.mk | 4 ----
 include/kernel.mk          | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 6a0251a9e2..7848b8e8f0 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -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
diff --git a/include/kernel.mk b/include/kernel.mk
index 3012eb8993..8236416132 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -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))