mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
kernel: use KCFLAGS for passing EXTRA_OPTIMIZATION flags
This uses kernel's generic variable and doesn't require patching it with a custom Makefile change. It's expected *not* to change any behaviour. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
parent
77692d6112
commit
1d42af720c
@ -101,7 +101,7 @@ endif
|
|||||||
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
||||||
|
|
||||||
KERNEL_MAKE_FLAGS = \
|
KERNEL_MAKE_FLAGS = \
|
||||||
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
|
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))" \
|
||||||
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
||||||
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
||||||
ARCH="$(LINUX_KARCH)" \
|
ARCH="$(LINUX_KARCH)" \
|
||||||
|
@ -14,18 +14,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -735,11 +735,11 @@ KBUILD_CFLAGS += $(call cc-disable-warni
|
@@ -739,7 +739,7 @@ KBUILD_CFLAGS += -O2
|
||||||
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
|
||||||
|
|
||||||
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
|
|
||||||
-KBUILD_CFLAGS += -O2
|
|
||||||
+KBUILD_CFLAGS += -O2 $(EXTRA_OPTIMIZATION)
|
|
||||||
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
|
||||||
-KBUILD_CFLAGS += -O3
|
KBUILD_CFLAGS += -O3
|
||||||
+KBUILD_CFLAGS += -O3 $(EXTRA_OPTIMIZATION)
|
|
||||||
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
-KBUILD_CFLAGS += -Os
|
-KBUILD_CFLAGS += -Os
|
||||||
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
|
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Tell gcc to never replace conditional load with a non-conditional one
|
# Tell gcc to never replace conditional load with a non-conditional one
|
||||||
|
@ -14,18 +14,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -752,11 +752,11 @@ KBUILD_CFLAGS += $(call cc-disable-warni
|
@@ -756,7 +756,7 @@ KBUILD_CFLAGS += -O2
|
||||||
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
|
||||||
|
|
||||||
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
|
|
||||||
-KBUILD_CFLAGS += -O2
|
|
||||||
+KBUILD_CFLAGS += -O2 $(EXTRA_OPTIMIZATION)
|
|
||||||
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
|
||||||
-KBUILD_CFLAGS += -O3
|
KBUILD_CFLAGS += -O3
|
||||||
+KBUILD_CFLAGS += -O3 $(EXTRA_OPTIMIZATION)
|
|
||||||
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
-KBUILD_CFLAGS += -Os
|
-KBUILD_CFLAGS += -Os
|
||||||
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
|
+KBUILD_CFLAGS += -Os -fno-reorder-blocks -fno-tree-ch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Tell gcc to never replace conditional load with a non-conditional one
|
# Tell gcc to never replace conditional load with a non-conditional one
|
||||||
|
Loading…
Reference in New Issue
Block a user