Skip to content

Update gcc 14.2 - fix [workaround] for mbedTLS #3197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-all:v2.57
FROM ghcr.io/nanoframework/dev-container-all:v2.58
10 changes: 6 additions & 4 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.3.rel1
ARG GCC_VERSION=14.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
Expand Down Expand Up @@ -84,9 +84,11 @@ RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./so
&& cd ./sources/mbedtls \
&& git submodule update --init --recursive

# Clone FreeRTOS and what is needed for ESP32
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
# Clone FreeRTOS
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS

# Clone CMSIS
RUN GIT_LFS_SKIP_SMUDGE=1 git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5

# Clone lwIP for STM32 and NXP
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/AzureRTOS/Dockerfile.AzureRTOS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-azure-rtos:v1.34
FROM ghcr.io/nanoframework/dev-container-azure-rtos:v1.35
2 changes: 1 addition & 1 deletion .devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.3.rel1
ARG GCC_VERSION=14.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/ChibiOS/Dockerfile.ChibiOS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-chibios:v1.35
FROM ghcr.io/nanoframework/dev-container-chibios:v1.36
2 changes: 1 addition & 1 deletion .devcontainer/ChibiOS/Dockerfile.ChibiOS.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.3.rel1
ARG GCC_VERSION=14.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/FreeRTOS-NXP/Dockerfile.FreeRTOS-NXP
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-freertos-nxp:v1.07
FROM ghcr.io/nanoframework/dev-container-freertos-nxp:v1.08
8 changes: 5 additions & 3 deletions .devcontainer/FreeRTOS-NXP/Dockerfile.FreeRTOS-NXP.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.3.rel1
ARG GCC_VERSION=14.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
Expand Down Expand Up @@ -62,8 +62,10 @@ RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./so
&& git submodule update --init --recursive

# Clone FreeRTOS
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS

# Clone CMSIS
RUN GIT_LFS_SKIP_SMUDGE=1 git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5

Comment on lines 64 to 69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Skipping Git-LFS smudge may break later builds

CMSIS_5 hosts several mandatory .zip/binary blobs under LFS pointers (e.g. DSP lib archives). With GIT_LFS_SKIP_SMUDGE=1 those blobs remain as 100-byte pointers; any CMake that expects real archives will fail at build time.

Options:

  1. Run git lfs pull --include="CMSIS/DSP/**" right after the clone.
  2. Clone normally and rely on the LFS cache layer in CI.
-RUN GIT_LFS_SKIP_SMUDGE=1 git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
+RUN git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5 \
+    && git -C ./sources/CMSIS_5 lfs pull --include="CMSIS/DSP/**"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Clone FreeRTOS
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS
# Clone CMSIS
RUN GIT_LFS_SKIP_SMUDGE=1 git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
# Clone FreeRTOS
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS
# Clone CMSIS
RUN git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5 \
&& git -C ./sources/CMSIS_5 lfs pull --include="CMSIS/DSP/**"
🤖 Prompt for AI Agents
In .devcontainer/FreeRTOS-NXP/Dockerfile.FreeRTOS-NXP.SRC around lines 64 to 69,
the clone command for CMSIS_5 uses GIT_LFS_SKIP_SMUDGE=1 which leaves LFS
pointers instead of actual binary files, causing build failures. To fix this,
remove the GIT_LFS_SKIP_SMUDGE=1 from the clone command and add a command
immediately after to run git lfs pull --include="CMSIS/DSP/**" to fetch the
required LFS binary blobs, ensuring all necessary files are present for the
build.

# set gcc location
ARG TMP_GCC_PATH=/usr/local/bin/gcc
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/TI/Dockerfile.TI.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.3.rel1
ARG GCC_VERSION=14.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-azurertos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-chibios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-esp32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-freertos-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer-ti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ env.CONTAINER_SRC_FILE }}
push: true # Will only build if this is not here
Expand Down
3 changes: 2 additions & 1 deletion CMake/binutils.common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ macro(nf_setup_target_build_common)

# need to unset several flags for MbedTLS to compile correctly
target_compile_options(mbedtls PRIVATE -Wno-undef -Wno-error=unused-function -Wno-error=discarded-qualifiers -Wno-error=unused-parameter)
target_compile_options(mbedcrypto PRIVATE -Wno-undef -Wno-error=unused-function -Wno-error=discarded-qualifiers -Wno-error=unused-parameter)
# FIXME: -fomit-frame-pointer should be removed when the issue is resolved: https://github.com/Mbed-TLS/mbedtls/issues/9875
target_compile_options(mbedcrypto PRIVATE -fomit-frame-pointer -Wno-undef -Wno-error=unused-function -Wno-error=discarded-qualifiers -Wno-error=unused-parameter)
target_compile_options(mbedx509 PRIVATE -Wno-undef -Wno-error=unused-function -Wno-error=discarded-qualifiers -Wno-error=unused-parameter)

endif()
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ jobs:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/build-chibios-stm32-targets.yml
Expand Down Expand Up @@ -741,6 +742,7 @@ jobs:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/build-azurertos-targets.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
parameters:
- name: gccArmVersion
type: string
default: "13.3.rel1"
default: "14.2.rel1"

steps:
- task: Cache@2
condition: eq(variables.GccArm_Version, '')
displayName: Cache latest ARM GCC toolchain
inputs:
key: "gcc-13_3__rel1 | gccUpdateKey"
key: 'gcc-14_2__rel1 | gccUpdateKey'
restoreKeys: gccUpdateKey
path: $(Agent.TempDirectory)\arm-gnu-toolchain-${{ parameters.gccArmVersion }}-mingw-w64-i686-arm-none-eabi
cacheHitVar: GCC_CACHE_RESTORED
Expand All @@ -30,7 +30,7 @@ steps:
condition: ne(variables.GCC_CACHE_RESTORED, 'true')
inputs:
archiveFilePatterns: '$(Agent.TempDirectory)\arm-gnu-toolchain-${{ parameters.gccArmVersion }}-mingw-w64-i686-arm-none-eabi.zip'
destinationFolder: "$(Agent.TempDirectory)"
destinationFolder: "$(Agent.TempDirectory)\\arm-gnu-toolchain-${{ parameters.gccArmVersion }}-mingw-w64-i686-arm-none-eabi"
cleanDestinationFolder: false

- script: echo "##vso[task.prependpath]$(Agent.TempDirectory)\arm-gnu-toolchain-${{ parameters.gccArmVersion }}-mingw-w64-i686-arm-none-eabi\bin"
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ jobs:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/build-chibios-stm32-targets.yml
Expand Down Expand Up @@ -618,6 +619,7 @@ jobs:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/build-freertos-nxp-targets.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
Expand Down Expand Up @@ -767,6 +769,7 @@ jobs:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/build-azurertos-targets.yml
Expand Down
Loading
Loading