diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 31e69f36c9..ca906ab98f 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -104,19 +104,16 @@ else CFLAGS += -DNDEBUG # Do a default shrink for small builds, including all SAMD21 builds. - ifeq ($(CIRCUITPY_FULL_BUILD),0) - SHRINK_BUILD = 1 - else - ifeq ($(CHIP_FAMILY), samd21) - SHRINK_BUILD = 1 - endif - endif - # -finline-limit can shrink the image size. # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. - ifeq ($(SHRINK_BUILD), 1) - CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 + ifeq ($(CIRCUITPY_FULL_BUILD),0) + CFLAGS += -finline-limit=45 + else + ifeq ($(CHIP_FAMILY), samd21) + # max-inline-insns-auto increases the size of SAMD51 builds. + CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 + endif endif # We used to do this but it seems to not reduce space any more, at least in gcc 11.