Separate translate object control from LTO
This commit is contained in:
parent
8d559196ed
commit
4d776339ad
@ -107,7 +107,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
|||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
|
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
|
||||||
|
|
||||||
# BCM CLFAGS
|
# BCM CLFAGS
|
||||||
CFLAGS += -ffreestanding -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\""
|
CFLAGS += -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\""
|
||||||
|
|
||||||
|
|
||||||
OPTIMIZATION_FLAGS ?= -O3
|
OPTIMIZATION_FLAGS ?= -O3
|
||||||
|
@ -3,6 +3,8 @@ USB_HIGHSPEED = 1
|
|||||||
# Number of USB endpoint pairs.
|
# Number of USB endpoint pairs.
|
||||||
USB_NUM_ENDPOINT_PAIRS = 6
|
USB_NUM_ENDPOINT_PAIRS = 6
|
||||||
|
|
||||||
|
CIRCUITPY_TRANSLATE_OBJECT = 1
|
||||||
|
|
||||||
# Longints can be implemented as mpz, as longlong, or not
|
# Longints can be implemented as mpz, as longlong, or not
|
||||||
LONGINT_IMPL = MPZ
|
LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
|
@ -51,7 +51,8 @@ BASE_CFLAGS = \
|
|||||||
-DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \
|
-DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \
|
||||||
-DCIRCUITPY_CANARY_WORD=0xADAF00 \
|
-DCIRCUITPY_CANARY_WORD=0xADAF00 \
|
||||||
-DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
|
-DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
|
||||||
-DCIRCUITPY_BOARD_ID="\"$(BOARD)\""
|
-DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \
|
||||||
|
--param max-inline-insns-single=500
|
||||||
|
|
||||||
# Use these flags to debug build times and header includes.
|
# Use these flags to debug build times and header includes.
|
||||||
# -ftime-report
|
# -ftime-report
|
||||||
@ -73,6 +74,16 @@ else
|
|||||||
CFLAGS += -DCIRCUITPY_LTO=0
|
CFLAGS += -DCIRCUITPY_LTO=0
|
||||||
endif
|
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
|
||||||
|
CFLAGS += -DCIRCUITPY_TRANSLATE_OBJECT=$(CIRCUITPY_TRANSLATE_OBJECT)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Handle frozen modules.
|
# Handle frozen modules.
|
||||||
|
|
||||||
|
@ -135,6 +135,6 @@ char *decompress(const compressed_string_t *compressed, char *decompressed) {
|
|||||||
return decompressed;
|
return decompressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CIRCUITPY_LTO == 1
|
#if CIRCUITPY_TRANSLATE_OBJECT == 1
|
||||||
#include "supervisor/shared/translate/translate_impl.h"
|
#include "supervisor/shared/translate/translate_impl.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
// that the build process will optimize this away and replace it with the
|
// that the build process will optimize this away and replace it with the
|
||||||
// appropriate compressed data for each call site.
|
// appropriate compressed data for each call site.
|
||||||
|
|
||||||
#if CIRCUITPY_LTO == 0
|
#if CIRCUITPY_TRANSLATE_OBJECT == 0
|
||||||
// Without LTO, we need to include a copy of this function in each compilation
|
// Without LTO, we need to include a copy of this function in each compilation
|
||||||
// unit so that the compile stage can do the optimization. Otherwise the linker
|
// unit so that the compile stage can do the optimization. Otherwise the linker
|
||||||
// will leave this as a giant function and have each call site call into it.
|
// will leave this as a giant function and have each call site call into it.
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "supervisor/shared/translate/compressed_string.h"
|
#include "supervisor/shared/translate/compressed_string.h"
|
||||||
|
|
||||||
#if CIRCUITPY_LTO == 0
|
#if CIRCUITPY_TRANSLATE_OBJECT == 0
|
||||||
static
|
static
|
||||||
#endif
|
#endif
|
||||||
inline
|
inline
|
||||||
|
Loading…
x
Reference in New Issue
Block a user