Skip to content

Commit

Permalink
Update: Optimize level config
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDrOiD committed May 15, 2011
1 parent 58d7e28 commit 045ef8c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,13 @@ all: vmlinux

ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
else
endif
ifdef CONFIG_CC_OPTIMIZE_DEFAULT
KBUILD_CFLAGS += -O2
endif
ifdef CONFIG_CC_OPTIMIZE_ALOT
KBUILD_CFLAGS += -O3
endif

include $(srctree)/arch/$(SRCARCH)/Makefile

Expand Down
18 changes: 12 additions & 6 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,20 @@ source "usr/Kconfig"

endif

choice
prompt "Optimization level"
default CC_OPTIMIZE_DEFAULT

config CC_OPTIMIZE_FOR_SIZE
bool "Optimize for size"
default y
help
Enabling this option will pass "-Os" instead of "-O2" to gcc
resulting in a smaller kernel.
bool "Use -Os"

If unsure, say Y.
config CC_OPTIMIZE_DEFAULT
bool "Use -O2"

config CC_OPTIMIZE_ALOT
bool "Use -O3"

endchoice

config SYSCTL
bool
Expand Down

0 comments on commit 045ef8c

Please sign in to comment.