mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
misc: Add GCC minimum toolchain check for CM55.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
parent
ad722d0153
commit
a008ecf707
5
Makefile
5
Makefile
@ -127,9 +127,10 @@ MPY_MKARGS = PORT=$(PORT) BOARD=$(TARGET) DEBUG=$(DEBUG) MICROPY_MANIFEST_OMV_LI
|
|||||||
MICROPY_ROM_TEXT_COMPRESSION=$(ROM_TEXT_COMPRESSION) USER_C_MODULES=$(TOP_DIR)
|
MICROPY_ROM_TEXT_COMPRESSION=$(ROM_TEXT_COMPRESSION) USER_C_MODULES=$(TOP_DIR)
|
||||||
|
|
||||||
|
|
||||||
# Disable broken optimization for CM55.
|
|
||||||
|
# Check GCC toolchain version.
|
||||||
ifeq ($(CPU),cortex-m55)
|
ifeq ($(CPU),cortex-m55)
|
||||||
CFLAGS += -fdisable-rtl-loop2_doloop
|
include $(TOP_DIR)/common/check_toolchain.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Configure additional built-in modules. Note must define both the CFLAGS and the Make command line args.
|
# Configure additional built-in modules. Note must define both the CFLAGS and the Make command line args.
|
||||||
|
@ -49,8 +49,8 @@ endif
|
|||||||
# Include the port Makefile.
|
# Include the port Makefile.
|
||||||
include $(PORT_DIR)/$(PORT_LOWER)_port.mk
|
include $(PORT_DIR)/$(PORT_LOWER)_port.mk
|
||||||
|
|
||||||
# Disable broken optimization for CM55.
|
# Check GCC toolchain version.
|
||||||
ifeq ($(CPU),cortex-m55)
|
ifeq ($(CPU),cortex-m55)
|
||||||
CFLAGS += -fdisable-rtl-loop2_doloop
|
include $(TOP_DIR)/common/check_toolchain.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
17
common/check_toolchain.mk
Normal file
17
common/check_toolchain.mk
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
ifeq ($(CPU),cortex-m55)
|
||||||
|
# Check if GCC version is less than 14.3
|
||||||
|
GCC_VERSION := $(shell arm-none-eabi-gcc -dumpversion | cut -d. -f1-2)
|
||||||
|
GCC_MAJOR := $(shell echo $(GCC_VERSION) | cut -d. -f1)
|
||||||
|
GCC_MINOR := $(shell echo $(GCC_VERSION) | cut -d. -f2)
|
||||||
|
|
||||||
|
# Convert to comparable number (14.3 becomes 1403)
|
||||||
|
GCC_VERSION_NUM := $(shell echo $$(($(GCC_MAJOR) * 100 + $(GCC_MINOR))))
|
||||||
|
|
||||||
|
# Only add the flag if version < 14.3 (1403)
|
||||||
|
ifeq ($(shell test $(GCC_VERSION_NUM) -lt 1403 && echo yes),yes)
|
||||||
|
$(warning *** ERROR ***)
|
||||||
|
$(warning GCC $(GCC_VERSION) has known issues with Cortex-M55)
|
||||||
|
$(warning Upgrade to GCC 14.3+ for proper CM55 support)
|
||||||
|
$(error )
|
||||||
|
endif
|
||||||
|
endif
|
Loading…
Reference in New Issue
Block a user