summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-09-12 22:14:51 +1000
committerDamien George <damien.p.george@gmail.com>2019-09-17 11:43:52 +1000
commitb45f9de8096f37a5f588f833e6b6a00b59e67e3f (patch)
tree153d510e910fb75af0a15cb70f938d16288fbb9c
parentac112f88d0496d33a9195ace02ed3928fcb015d3 (diff)
bare-arm, minimal: Set CSUPEROPT=-Os to get minimal firmware size.
This option affects py/vm.c and py/gc.c and using -Os gets them compiling a bit smaller, and small firmware is the aim of these two ports. Also, having these files compiled with -Os on these ports, and -O3 as the default on other ports, gives a better understanding of code-size changes when making changes to these files.
-rw-r--r--ports/bare-arm/Makefile1
-rw-r--r--ports/minimal/Makefile2
2 files changed, 3 insertions, 0 deletions
diff --git a/ports/bare-arm/Makefile b/ports/bare-arm/Makefile
index a515db80e..7cb343281 100644
--- a/ports/bare-arm/Makefile
+++ b/ports/bare-arm/Makefile
@@ -14,6 +14,7 @@ INC += -I$(BUILD)
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
+CSUPEROPT = -Os # save some code space
#Debugging/Optimization
ifeq ($(DEBUG), 1)
diff --git a/ports/minimal/Makefile b/ports/minimal/Makefile
index b3e27509f..f26a7ec97 100644
--- a/ports/minimal/Makefile
+++ b/ports/minimal/Makefile
@@ -28,6 +28,8 @@ CFLAGS = -m32 $(INC) -Wall -Werror -std=c99 $(COPT)
LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -Wl,--gc-sections
endif
+CSUPEROPT = -Os # save some code space
+
# Tune for Debugging or Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -ggdb