aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-12-29 05:44:10 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2003-12-29 05:44:10 -0800
commitffd0cf49cd09ff1ef6495691d3dc076151454f14 (patch)
treeb3486609f012ec13a7f2a3f3524f8f7477687c53 /Makefile
parenta93fabd3f90062015859589ee8bf249a1d76a99b (diff)
downloadhistory-ffd0cf49cd09ff1ef6495691d3dc076151454f14.tar.gz
[PATCH] Add `gcc -Os' config option
From: Adrian Bunk <bunk@fs.tum.de> Allow the kernel to be built with `-Os'. It requires CONFIG_EMBEDDED. This is to make it "hard to get at" because one gcc version (3.2.x I think) from RH9 generates crashy kernels with this option set.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index acc02ef8710142..2b2b841b7e5ff2 100644
--- a/Makefile
+++ b/Makefile
@@ -275,7 +275,7 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
-CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__
@@ -431,6 +431,12 @@ libs-y := $(libs-y1) $(libs-y2)
# ---------------------------------------------------------------------------
+ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+CFLAGS += -Os
+else
+CFLAGS += -O2
+endif
+
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
endif