summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-11-06 10:35:47 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-09 12:49:47 -0800
commit1aebf16f5e44ae551651e10f3554719f9127b4c0 (patch)
treea75133d9ef5e2bb76292ad9036445c3a383c0a42 /chip
parent20562ac025d8b65fe252a9a9232f70011cf052b3 (diff)
downloadchrome-ec-1aebf16f5e44ae551651e10f3554719f9127b4c0.tar.gz
GLaDOS: Kunimitsu: Enable link-time optimization.
Turn on LTO for GLaDOS and Kunimitsu. This saves about 5k from the image on GLaDOS. Also, LTO is disabled for the loader since it actually causes it to bloat in size for some reason. BUG=chrome-os-partner:46063 BRANCH=None TEST=Build and flash on GLaDOS with charger inserted. Verify that EC boot is successful. sysjump to RW and verify that the jump is successful. TEST=make -j buildall tests Change-Id: I9892edfc724f290acaf6cceba181c177702d63bf Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/311208 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/mec1322/build.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/mec1322/build.mk b/chip/mec1322/build.mk
index 0f18cee24c..f2c5cf80a0 100644
--- a/chip/mec1322/build.mk
+++ b/chip/mec1322/build.mk
@@ -11,6 +11,11 @@ CORE:=cortex-m
# Allow the full Cortex-M4 instruction set
CFLAGS_CPU+=-march=armv7e-m -mcpu=cortex-m4
+ifeq ($(CONFIG_LTO),y)
+# Re-include the core's build.mk file so we can remove the lto flag.
+include core/$(CORE)/build.mk
+endif
+
# Required chip modules
chip-y=clock.o gpio.o hwtimer.o system.o uart.o jtag.o port80.o
chip-$(CONFIG_ADC)+=adc.o
@@ -55,6 +60,10 @@ dirs-y+=chip/$(CHIP)/lfw
# objs with -lfw suffix are to include lfw's gpio
$(out)/RW/%-lfw.o: private CC+=-I$(BDIR)/lfw -DLFW
+# Remove the lto flag for the loader. It actually causes it to bloat in size.
+ifeq ($(CONFIG_LTO),y)
+$(out)/RW/%-lfw.o: private CFLAGS_CPU := $(filter-out -flto, $(CFLAGS_CPU))
+endif
$(out)/RW/%-lfw.o: %.c
$(call quiet,c_to_o,CC )