Split partition from LTO enable

This commit is contained in:
Scott Shawcroft 2022-06-01 11:12:14 -07:00
parent 6d3698848c
commit 09c61efcff
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
4 changed files with 15 additions and 21 deletions

View File

@ -13,4 +13,4 @@ LONGINT_IMPL = MPZ
CIRCUITPY__EVE = 1
CIRCUITPY_CANIO = 1
CIRCUITPY_LTO = one
CIRCUITPY_LTO_PARTITION = one

View File

@ -9,6 +9,7 @@ USB_NUM_ENDPOINT_PAIRS = 8
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1
CIRCUITPY_LTO = 1
######################################################################
# Put samd21-only choices here.
@ -78,7 +79,7 @@ endif
SUPEROPT_GC = 0
SUPEROPT_VM = 0
CIRCUITPY_LTO = one
CIRCUITPY_LTO_PARTITION = one
ifeq ($(CIRCUITPY_FULL_BUILD),0)
# On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used.
@ -96,10 +97,8 @@ ifeq ($(CHIP_FAMILY),samd51)
# No native touchio on SAMD51.
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
ifeq ($(CIRCUITPY_FULL_BUILD),1)
CIRCUITPY_LTO ?= balanced
else
CIRCUITPY_LTO ?= one
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CIRCUITPY_LTO_PARTITION ?= one
endif
# The ?='s allow overriding in mpconfigboard.mk.
@ -124,10 +123,8 @@ ifeq ($(CHIP_FAMILY),same51)
# No native touchio on SAME51.
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
ifeq ($(CIRCUITPY_FULL_BUILD),1)
CIRCUITPY_LTO ?= balanced
else
CIRCUITPY_LTO ?= one
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CIRCUITPY_LTO_PARTITION ?= one
endif
# The ?='s allow overriding in mpconfigboard.mk.

View File

@ -73,7 +73,8 @@ CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
OPTIMIZATION_FLAGS ?= -Os
CIRCUITPY_LTO=balanced
CIRCUITPY_LTO = 1
CIRCUITPY_LTO_PARTITION = balanced
endif
else
@ -94,6 +95,7 @@ NRF_DEFINES += -DNRF52833_XXAA -DNRF52833
OPTIMIZATION_FLAGS ?= -Os
CIRCUITPY_LTO=one
CIRCUITPY_LTO = 1
CIRCUITPY_LTO_PARTITION = one
endif
endif

View File

@ -68,20 +68,15 @@ CFLAGS += -DCIRCUITPY_DEBUG=0
endif
CIRCUITPY_LTO ?= 0
ifneq ($(CIRCUITPY_LTO),0)
CFLAGS += -DCIRCUITPY_LTO=1 -flto=$(shell $(NPROC)) -flto-partition=$(CIRCUITPY_LTO)
else
CFLAGS += -DCIRCUITPY_LTO=0
CIRCUITPY_LTO_PARTITION ?= balanced
ifeq ($(CIRCUITPY_LTO),1)
CFLAGS += -flto -flto-partition=$(CIRCUITPY_LTO_PARTITION)
endif
# Produce an object file for translate.c instead of including it in a header.
# The header version can be optimized on non-LTO builds *if* inlining is allowed
# otherwise, it blows up the binary sizes with tons of translate copies.
ifeq ($(CIRCUITPY_LTO), 0)
CIRCUITPY_TRANSLATE_OBJECT ?= 0
else
CIRCUITPY_TRANSLATE_OBJECT ?= 1
endif
CIRCUITPY_TRANSLATE_OBJECT ?= $(CIRCUITPY_LTO)
CFLAGS += -DCIRCUITPY_TRANSLATE_OBJECT=$(CIRCUITPY_TRANSLATE_OBJECT)
###