Optimize ulab for size on samd51/same51

This commit is contained in:
Jeff Epler 2023-07-25 09:35:49 -05:00
parent 164fcb22c2
commit 8579766ede
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
3 changed files with 8 additions and 0 deletions

View File

@ -106,6 +106,7 @@ CIRCUITPY_PS2IO ?= 1
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
CIRCUITPY_SAMD ?= 1
CIRCUITPY_SYNTHIO_MAX_CHANNELS = 12
CIRCUITPY_ULAB_OPTIMIZE_SIZE ?= 1
CIRCUITPY_WATCHDOG ?= 1
endif # samd51
@ -131,6 +132,7 @@ CIRCUITPY_SAMD ?= 1
CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD)
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
CIRCUITPY_ULAB_OPTIMIZE_SIZE ?= 1
endif # same51
######################################################################

View File

@ -559,6 +559,9 @@ CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB)
CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB)
# whether to use -Os optimization on files in ulab
CIRCUITPY_ULAB_OPTIMIZE_SIZE ?= 0
# CIRCUITPY_VIDEOCORE is handled in the broadcom tree.
# Only for Broadcom chips.
# Assume not a Broadcom build.

View File

@ -57,6 +57,9 @@ ULAB_SRCS := $(shell find $(TOP)/extmod/ulab/code -type f -name "*.c")
SRC_MOD += $(patsubst $(TOP)/%,%,$(ULAB_SRCS))
CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 -DULAB_HAS_USER_MODULE=0 -iquote $(TOP)/extmod/ulab/code
$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-missing-declarations -Wno-missing-prototypes -Wno-unused-parameter -Wno-float-equal -Wno-sign-compare -Wno-cast-align -Wno-shadow -DCIRCUITPY
ifeq ($(CIRCUITPY_ULAB_OPTIMIZE_SIZE),1)
$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Os
endif
endif
# py object files