Merge pull request #2751 from openmv/update_toolchain

misc: Update GCC toolchain.
This commit is contained in:
Ibrahim Abdelkader 2025-07-05 15:15:39 +03:00 committed by GitHub
commit 287e387122
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 8 deletions

View File

@ -68,7 +68,7 @@ jobs:
~/cache/llvm
~/cache/make
~/cache/stedgeai
key: 'gcc-13.2.rel1_llvm-18.1.3_make-4.4.1_stedgeai-2.1'
key: 'gcc-14.3.rel1_llvm-18.1.3_make-4.4.1_stedgeai-2.1'
- name: '🐍 Install Python'
uses: actions/setup-python@v5
@ -129,7 +129,7 @@ jobs:
~/cache/llvm
~/cache/make
~/cache/stedgeai
key: 'gcc-13.2.rel1_llvm-18.1.3_make-4.4.1_stedgeai-2.1'
key: 'gcc-14.3.rel1_llvm-18.1.3_make-4.4.1_stedgeai-2.1'
- name: '🐍 Install Python'
uses: actions/setup-python@v5

View File

@ -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)
# Disable broken optimization for CM55.
# Check GCC toolchain version.
ifeq ($(CPU),cortex-m55)
CFLAGS += -fdisable-rtl-loop2_doloop
include $(TOP_DIR)/common/check_toolchain.mk
endif
# Configure additional built-in modules. Note must define both the CFLAGS and the Make command line args.

View File

@ -49,8 +49,8 @@ endif
# Include the port Makefile.
include $(PORT_DIR)/$(PORT_LOWER)_port.mk
# Disable broken optimization for CM55.
# Check GCC toolchain version.
ifeq ($(CPU),cortex-m55)
CFLAGS += -fdisable-rtl-loop2_doloop
include $(TOP_DIR)/common/check_toolchain.mk
endif

17
common/check_toolchain.mk Normal file
View 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

View File

@ -10,7 +10,7 @@ RUN apt update && apt install -y \
# Download and extract GCC
RUN mkdir -p /workspace/gcc
ENV GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz"
ENV GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz"
RUN wget --no-check-certificate -O - ${GCC_URL} | tar --strip-components=1 -Jx -C /workspace/gcc
# Download and extract LLVM

View File

@ -3,7 +3,7 @@
########################################################################################
# Install ARM GCC.
GCC_TOOLCHAIN_PATH=${HOME}/cache/gcc
GCC_TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz"
GCC_TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz"
ci_install_arm_gcc() {
mkdir -p ${GCC_TOOLCHAIN_PATH}