Commit 4a8ed8e24886adf47086125f81307eaa8c358437

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent a6f47d2434

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>

Showing 2 changed files with 15 additions and 1 deletions Side-by-side Diff

... ... @@ -46,6 +46,16 @@
46 46  
47 47 which is done within the script "scripts/setlocalversion".)
48 48  
  49 +config CC_OPTIMIZE_FOR_SIZE
  50 + bool "Optimize for size"
  51 + depends on !SPL_BUILD
  52 + default y
  53 + help
  54 + Enabling this option will pass "-Os" instead of "-O2" to gcc
  55 + resulting in a smaller U-Boot image.
  56 +
  57 + This option is enabled by default for U-Boot.
  58 +
49 59 endmenu # General setup
50 60  
51 61 menu "Boot images"
... ... @@ -529,7 +529,11 @@
529 529 include/config/auto.conf: ;
530 530 endif # $(dot-config)
531 531  
532   -KBUILD_CFLAGS += -Os #-fomit-frame-pointer
  532 +ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  533 +KBUILD_CFLAGS += -Os
  534 +else
  535 +KBUILD_CFLAGS += -O2
  536 +endif
533 537  
534 538 ifdef BUILD_TAG
535 539 KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'