File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,9 @@ USB_NUM_ENDPOINT_PAIRS = 8
25
25
USB_HIGHSPEED = 1
26
26
27
27
CIRCUITPY_BUILD_EXTENSIONS ?= disk.img.zip,kernel8.img
28
+
29
+ ifeq ($(CHIP_VARIANT ) , "bcm2711")
30
+ CIRCUITPY_MIN_GCC_VERSION ?= 10
31
+ else ifeq ($(CHIP_VARIANT), "bcm2837")
32
+ CIRCUITPY_MIN_GCC_VERSION ?= 10
33
+ endif
Original file line number Diff line number Diff line change @@ -31,3 +31,4 @@ CIRCUITPY_USB_HID = 1
31
31
CIRCUITPY_USB_MIDI = 1
32
32
33
33
CIRCUITPY_BUILD_EXTENSIONS ?= dfu
34
+ CIRCUITPY_MIN_GCC_VERSION ?= 8
Original file line number Diff line number Diff line change @@ -599,3 +599,19 @@ void background_callback_run_all(void);
599
599
// Enable compiler functionality.
600
600
#define MICROPY_ENABLE_COMPILER (1)
601
601
#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)
697
697
CIRCUITPY_SWO_TRACE ?= 0
698
698
CFLAGS += -DCIRCUITPY_SWO_TRACE=$(CIRCUITPY_SWO_TRACE )
699
699
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
+
700
704
# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk
701
705
# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers.
702
706
# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h.
You can’t perform that action at this time.
0 commit comments