summaryrefslogtreecommitdiff
path: root/core/cortex-m0/build.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m0/build.mk')
-rw-r--r--core/cortex-m0/build.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/cortex-m0/build.mk b/core/cortex-m0/build.mk
index 44093b93ff..40764f53c6 100644
--- a/core/cortex-m0/build.mk
+++ b/core/cortex-m0/build.mk
@@ -12,8 +12,11 @@ $(call set-option,CROSS_COMPILE,\
/opt/coreboot-sdk/bin/arm-eabi-)
# CPU specific compilation flags
-CFLAGS_CPU+=-mthumb -Os
-ifneq ($(cc-name),clang)
+CFLAGS_CPU+=-mthumb
+ifeq ($(cc-name),clang)
+CFLAGS_CPU+=-Oz # Like -Os (and thus -O2), but reduces code size further.
+else
+CFLAGS_CPU+=-Os
CFLAGS_CPU+=-mno-sched-prolog
endif
CFLAGS_CPU+=-mno-unaligned-access