File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -599,3 +599,19 @@ void background_callback_run_all(void);
599599// Enable compiler functionality.
600600#define MICROPY_ENABLE_COMPILER (1)
601601#define MICROPY_PY_BUILTINS_COMPILE (1)
602+
603+ #ifndef CIRCUITPY_MIN_GCC_VERSION
604+ #define CIRCUITPY_MIN_GCC_VERSION 13
605+ #endif
606+
607+ #if defined(__GNUC__ )
608+ #if __GNUC__ < CIRCUITPY_MIN_GCC_VERSION
609+ // (the 3 level scheme here is required to get expansion & stringization
610+ // correct)
611+ #define DO_PRAGMA (x ) _Pragma(#x)
612+ #define DO_ERROR_HELPER (x ) DO_PRAGMA(GCC error #x)
613+ #define DO_ERROR (x ) DO_ERROR_HELPER(Minimum GCC version x \
614+ -- older versions are known to miscompile CircuitPython)
615+ DO_ERROR (CIRCUITPY_MIN_GCC_VERSION );
616+ #endif
617+ #endif
Original file line number Diff line number Diff line change @@ -697,6 +697,10 @@ CFLAGS += -DCIRCUITPY_TUSB_ATTR_USBRAM=$(CIRCUITPY_TUSB_ATTR_USBRAM)
697697CIRCUITPY_SWO_TRACE ?= 0
698698CFLAGS += -DCIRCUITPY_SWO_TRACE=$(CIRCUITPY_SWO_TRACE )
699699
700+ # Check for a minimum GCC version during build (set to 0 to disable)
701+ CIRCUITPY_MIN_GCC_VERSION ?= 13
702+ CFLAGS += -DCIRCUITPY_MIN_GCC_VERSION=$(CIRCUITPY_MIN_GCC_VERSION )
703+
700704# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk
701705# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers.
702706# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h.
You can’t perform that action at this time.
0 commit comments