kconfig: add CONFIG_CC_OPTIMIZE_FOR_SIZE
Copy the Kconfig option from "init/Kconfig" of Linux v3.16 tag and adjust the help document. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit is contained in:
parent
a6f47d2434
commit
4a8ed8e248
2 changed files with 15 additions and 1 deletions
10
Kconfig
10
Kconfig
|
@ -46,6 +46,16 @@ config LOCALVERSION_AUTO
|
||||||
|
|
||||||
which is done within the script "scripts/setlocalversion".)
|
which is done within the script "scripts/setlocalversion".)
|
||||||
|
|
||||||
|
config CC_OPTIMIZE_FOR_SIZE
|
||||||
|
bool "Optimize for size"
|
||||||
|
depends on !SPL_BUILD
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enabling this option will pass "-Os" instead of "-O2" to gcc
|
||||||
|
resulting in a smaller U-Boot image.
|
||||||
|
|
||||||
|
This option is enabled by default for U-Boot.
|
||||||
|
|
||||||
endmenu # General setup
|
endmenu # General setup
|
||||||
|
|
||||||
menu "Boot images"
|
menu "Boot images"
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -529,7 +529,11 @@ else
|
||||||
include/config/auto.conf: ;
|
include/config/auto.conf: ;
|
||||||
endif # $(dot-config)
|
endif # $(dot-config)
|
||||||
|
|
||||||
KBUILD_CFLAGS += -Os #-fomit-frame-pointer
|
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
|
KBUILD_CFLAGS += -Os
|
||||||
|
else
|
||||||
|
KBUILD_CFLAGS += -O2
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef BUILD_TAG
|
ifdef BUILD_TAG
|
||||||
KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
|
KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
|
||||||
|
|
Loading…
Reference in a new issue