summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2019-11-21 09:57:20 -0600
committerJeff Epler <jepler@gmail.com>2019-11-26 08:50:45 -0600
commit2e4a6b94e71edd3c27cb66eaa56aec9b1e42be33 (patch)
tree4bc9db5b08beded4c13c9b93d562804e62f77a4f
parenteb44b2bb26ba4578ca97e459c9baa69d549c40a5 (diff)
atmel-samd: get most constrained m0 builds to work again
By tweaking the optimizer flags, we can get back a few hundred bytes and allow these builds to work with the gcc9 compiler.
-rw-r--r--ports/atmel-samd/Makefile5
-rw-r--r--ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/pyruler/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk2
4 files changed, 11 insertions, 0 deletions
diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile
index 11e6874ed..f26d1f53e 100644
--- a/ports/atmel-samd/Makefile
+++ b/ports/atmel-samd/Makefile
@@ -122,7 +122,12 @@ else
ifdef CFLAGS_INLINE_LIMIT
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
endif
+
CFLAGS += -flto -flto-partition=none
+
+ ifdef CFLAGS_BOARD
+ CFLAGS += $(CFLAGS_BOARD)
+ endif
endif
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
index 686c9099f..fe48db141 100644
--- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
@@ -29,3 +29,5 @@ SUPEROPT_GC = 0
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote
+
+CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20
diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
index 9663944a3..2fbc178af 100644
--- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
@@ -12,3 +12,5 @@ LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0
+
+CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20
diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
index b4a00b654..7cbfc3630 100644
--- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
@@ -12,3 +12,5 @@ LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0
+
+CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20