mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
Split CONFIG_CC_OPTIMIZE_FOR_SIZE into two configs
This adds a separate CONFIG_CC_OPTIMIZE_FOR_SPEED option in a choice, in preparation for adding another optimization option. Also convert SH's makefile to use this new option. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
e47bbf7e0e
commit
f38cb2aca7
17
Kconfig
17
Kconfig
@ -72,15 +72,26 @@ config CLANG_VERSION
|
|||||||
int
|
int
|
||||||
default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
|
default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Optimization level"
|
||||||
|
default CC_OPTIMIZE_FOR_SIZE
|
||||||
|
|
||||||
config CC_OPTIMIZE_FOR_SIZE
|
config CC_OPTIMIZE_FOR_SIZE
|
||||||
bool "Optimize for size"
|
bool "Optimize for size"
|
||||||
default y
|
|
||||||
help
|
help
|
||||||
Enabling this option will pass "-Os" instead of "-O2" to gcc
|
Enabling this option will pass "-Os" to gcc, resulting in a smaller
|
||||||
resulting in a smaller U-Boot image.
|
U-Boot image.
|
||||||
|
|
||||||
This option is enabled by default for U-Boot.
|
This option is enabled by default for U-Boot.
|
||||||
|
|
||||||
|
config CC_OPTIMIZE_FOR_SPEED
|
||||||
|
bool "Optimize for speed"
|
||||||
|
help
|
||||||
|
Enabling this option will pass "-O2" to gcc, resulting in a faster
|
||||||
|
U-Boot image.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
config OPTIMIZE_INLINING
|
config OPTIMIZE_INLINING
|
||||||
bool "Allow compiler to uninline functions marked 'inline' in full U-Boot"
|
bool "Allow compiler to uninline functions marked 'inline' in full U-Boot"
|
||||||
help
|
help
|
||||||
|
4
Makefile
4
Makefile
@ -683,7 +683,9 @@ endif
|
|||||||
|
|
||||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
KBUILD_CFLAGS += -Os
|
KBUILD_CFLAGS += -Os
|
||||||
else
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_CC_OPTIMIZE_FOR_SPEED
|
||||||
KBUILD_CFLAGS += -O2
|
KBUILD_CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ obj-$(CONFIG_CMD_SH_ZIMAGEBOOT) += zimageboot.o
|
|||||||
|
|
||||||
udivsi3-y := udivsi3_i4i-Os.o
|
udivsi3-y := udivsi3_i4i-Os.o
|
||||||
|
|
||||||
ifneq ($(CONFIG_CC_OPTIMIZE_FOR_SIZE),y)
|
ifeq ($(CONFIG_CC_OPTIMIZE_FOR_SPEED),y)
|
||||||
udivsi3-$(CONFIG_CPU_SH4) := udivsi3_i4i.o
|
udivsi3-$(CONFIG_CPU_SH4) := udivsi3_i4i.o
|
||||||
endif
|
endif
|
||||||
udivsi3-y += udivsi3.o
|
udivsi3-y += udivsi3.o
|
||||||
|
Loading…
x
Reference in New Issue
Block a user