[Cbe-oss-dev] [PATCH 11/22]MARS/base: Force size optimization cflag

Yuji Mano yuji.mano at am.sony.com
Wed Jan 21 11:28:57 EST 2009


This is a non-elegant solution of appending the desired optimization flags to
CFLAGS to work around the fact that autoconf by default sets CFLAGS to '-g -O2'
if no user CFLAGS variable is set.
The user should not override the optimization level due
to code size limitations.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
 base/src/mpu/kernel/Makefile.am |    2 ++
 base/src/mpu/lib/Makefile.am    |    2 ++
 2 files changed, 4 insertions(+)

--- a/base/src/mpu/kernel/Makefile.am
+++ b/base/src/mpu/kernel/Makefile.am
@@ -44,10 +44,12 @@ if DEBUG
  extra_cppflags += "-DDEBUG"
  # debug kernel is 64K
  extra_ldflags += -Wl,--defsym=__stack=0x0fff0
+ CFLAGS += -O0
 else
  extra_cppflags += "-DNDEBUG"
  # release kernel is 16K
  extra_ldflags += -Wl,--defsym=__stack=0x03ff0
+ CFLAGS += -Os
 endif
 
 if MARS_PLATFORM_CELL
--- a/base/src/mpu/lib/Makefile.am
+++ b/base/src/mpu/lib/Makefile.am
@@ -42,8 +42,10 @@ extra_ldflags =
 
 if DEBUG
  extra_cppflags += "-DDEBUG"
+ CFLAGS += -O0
 else
  extra_cppflags += "-DNDEBUG"
+ CFLAGS += -Os
 endif
 
 if MARS_PLATFORM_CELL






More information about the cbe-oss-dev mailing list