aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDenis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>2004-10-17 15:48:59 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2004-10-17 15:48:59 +0200
commit1ceee1b789e4c34b677eacabc39d99b0d6132d0f (patch)
treece8a08fcfc668930fd1fd34691275e18d0c51c7f /Makefile
parent78a14efa246b43d8bfcd64ffa214183a72f578b5 (diff)
downloadhistory-1ceee1b789e4c34b677eacabc39d99b0d6132d0f.tar.gz
kbuild: make gcc -align options .config-settable
With all alignment options set to 1 (minimum alignment), I've got 5% smaller vmlinux compared to one built with default code alignment. Original implementation altered to use cc-option-align by sam. From: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ba82153bbd815c..8e85b7de60f6d3 100644
--- a/Makefile
+++ b/Makefile
@@ -503,6 +503,13 @@ else
CFLAGS += -O2
endif
+#Add align options if CONFIG_CC_* is not equal to 0
+add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1)))
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
+
ifdef CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer
else