Prechádzať zdrojové kódy

kernel: support setting extra CFLAGS for kernel compilation

They may be used e.g. to optimize kernel size or performance.

Signed-off-by: Rafał Miłecki <[email protected]>
Rafał Miłecki 3 rokov pred
rodič
commit
907d7d7472
2 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 4 0
      config/Config-devel.in
  2. 1 1
      include/kernel.mk

+ 4 - 0
config/Config-devel.in

@@ -74,6 +74,10 @@ menuconfig DEVEL
 		  Store ccache in this directory.
 		  If not set, uses './.ccache'
 
+	config KERNEL_CFLAGS
+		string "Kernel extra CFLAGS" if DEVEL
+		default ""
+
 	config EXTERNAL_KERNEL_TREE
 		string "Use external kernel tree" if DEVEL
 		default ""

+ 1 - 1
include/kernel.mk

@@ -101,7 +101,7 @@ endif
 KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
 
 KERNEL_MAKE_FLAGS = \
-	KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))" \
+	KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION)) $(call qstrip,$(CONFIG_KERNEL_CFLAGS))" \
 	HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
 	CROSS_COMPILE="$(KERNEL_CROSS)" \
 	ARCH="$(LINUX_KARCH)" \