From e3cfb5ce0bf20643298a747048329cfda8103667 Mon Sep 17 00:00:00 2001 From: rusefillc <48498823+rusefillc@users.noreply.github.com> Date: Tue, 8 Nov 2022 18:10:53 -0500 Subject: [PATCH] gcc11 (#4680) * gcc11 * Gcc 11 hw ci (#4754) * hw ci -> gcc11 * setup script * GCC 11.3 (#4757) * setup_linux_environment.sh tar uses --auto-compress * use ARM GCC 11.3 * gcc11 #4680 * update build-primary-bundle GCC to v11.3 (#4758) * factor GCC toolchain provider (#4761) Co-authored-by: rusefillc Co-authored-by: Matthew Kennedy Co-authored-by: Nathan Schulte <8540239+nmschulte@users.noreply.github.com> --- .github/workflows/build-firmware.yaml | 18 ++++++++---------- .github/workflows/hardware-ci.yaml | 2 +- firmware/check.c | 6 +++--- firmware/provide_gcc.sh | 21 +++++++++++++++++++++ firmware/setup_linux_environment.sh | 13 +++---------- 5 files changed, 36 insertions(+), 24 deletions(-) create mode 100755 firmware/provide_gcc.sh diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index bcb47b27c0..8e977077fb 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: build-firmware: runs-on: ubuntu-latest - + strategy: # Let all builds finish even if one fails early fail-fast: false @@ -318,10 +318,9 @@ jobs: if: ${{ env.skip != 'true' }} env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time - wget 'https://github.com/rusefi/build_support/raw/master/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2' -O compiler.tar.bz2 - tar -xvf compiler.tar.bz2 - echo "`pwd`/gcc-arm-none-eabi-10.3-2021.10/bin" >> $GITHUB_PATH + run: | + sh ./firmware/provide_gcc.sh + echo "::add-path::`pwd`/gcc-arm-none-eabi/bin" # Make sure the compiler we just downloaded works - just print out the version - name: Test Compiler @@ -440,11 +439,10 @@ jobs: - name: Download & Install GCC env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time - wget 'https://github.com/rusefi/build_support/raw/master/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2' -O compiler.tar.bz2 - tar -xvf compiler.tar.bz2 - echo "::add-path::`pwd`/gcc-arm-none-eabi-10.3-2021.10/bin" - + run: | + sh ./firmware/provide_gcc.sh + echo "::add-path::`pwd`/gcc-arm-none-eabi/bin" + # Make sure the compiler we just downloaded works - just print out the version - name: Test Compiler run: arm-none-eabi-gcc -v diff --git a/.github/workflows/hardware-ci.yaml b/.github/workflows/hardware-ci.yaml index 16857e990f..849a5c33dc 100644 --- a/.github/workflows/hardware-ci.yaml +++ b/.github/workflows/hardware-ci.yaml @@ -53,7 +53,7 @@ jobs: run: ./gen_live_documentation.sh - name: Add compiler to PATH - run: echo "$HOME/.rusefi-tools/gcc-arm-none-eabi-10.3-2021.10/bin" >> $GITHUB_PATH + run: echo "$HOME/.rusefi-tools/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_PATH # Make sure the compiler works - name: Test/Identify Compiler diff --git a/firmware/check.c b/firmware/check.c index c3d8aecd89..b1febf26db 100644 --- a/firmware/check.c +++ b/firmware/check.c @@ -10,9 +10,9 @@ #pragma message("GCC is " STR(__GNUC__)"."STR(__GNUC_MINOR__)"."STR(__GNUC_PATCHLEVEL__)) -// Firmware builds require at least GCC 10.3.1 -#if (GCC_VERSION < 1031) - #error "GCC compiler >= 10.3.1 required" +// Firmware builds require at least GCC 11.3.1 +#if (GCC_VERSION < 1131) + #error "GCC compiler >= 11.3.1 required" #endif #endif diff --git a/firmware/provide_gcc.sh b/firmware/provide_gcc.sh new file mode 100755 index 0000000000..d15465b5d1 --- /dev/null +++ b/firmware/provide_gcc.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Download and extract GCC arm-none-eabi toolchain + +URL="https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz" +ARCHIVE="${URL##*/}" +DIR="gcc-arm-none-eabi" + +# Delete existing archive +rm -rf ${ARCHIVE} + +# Download and extract archive +curl -L -o ${ARCHIVE} ${URL} +tar -xavf ${ARCHIVE} + +# Create colloquially named link +ARCHIVE_DIR=$(tar --exclude="*/*" -tf ${ARCHIVE}) +ln -s ${ARCHIVE_DIR%/} ${DIR} + +# Delete downloaded archive +rm ${ARCHIVE} diff --git a/firmware/setup_linux_environment.sh b/firmware/setup_linux_environment.sh index 3eb035fce1..0482239bd2 100755 --- a/firmware/setup_linux_environment.sh +++ b/firmware/setup_linux_environment.sh @@ -22,18 +22,11 @@ rm -rf ~/.rusefi-tools mkdir ~/.rusefi-tools cd ~/.rusefi-tools -# in case not first execution -rm -rf arm-none-eabi-gcc.tar.bz2 - -# Download and extract GCC compiler -curl -L -o arm-none-eabi-gcc.tar.bz2 https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -tar -xjvf arm-none-eabi-gcc.tar.bz2 - -# Delete downloaded image -rm arm-none-eabi-gcc.tar.bz2 +# provide GCC arm-none-eabi toolchain +sh ./provide_gcc.sh # Add the compiler to your path -echo 'export PATH=$PATH:$HOME/.rusefi-tools/gcc-arm-none-eabi-10.3-2021.10/bin' >> ~/.profile +echo 'export PATH=$PATH:$HOME/.rusefi-tools/gcc-arm-none-eabi/bin' >> ~/.profile # Allow the current user to use serial ports sudo usermod -a -G dialout $USER