From 7cf6779c4f15677c23708dce44fa0caf2e7c4ed0 Mon Sep 17 00:00:00 2001 From: Scott Dixon Date: Tue, 13 Aug 2024 21:18:37 -0700 Subject: [PATCH] Fixing arm-none-eabi alternatives (#52) I flubbed setting up the arm-none-eabi alternatives. this fixes that. --- README.md | 6 +--- toolshed/Dockerfile | 2 +- toolshed/arm-none-eabi-gcc-select.sh | 45 ++++++++++++++++++++-------- toolshed/llvm-select.sh | 2 +- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index bb8f3a8..debbed7 100644 --- a/README.md +++ b/README.md @@ -25,15 +25,11 @@ like [libcanard](https://github.com/OpenCyphal/libcanard) and | tag | Python | GCC (native) | GCC (arm-none-eabi) | Clang (native) | Cmake | Host Platforms | Other Utilities | |----------|--------|--------------|---------------------|----------------|-------|----------------|-----------------| -| [ts22.4.9](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 12.3.0 | 13.3.1 | 18.1.3 | 3.30.1 | | | +| [ts22.4.10](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 12.3.0 | 13.3.1 | 18.1.3 | 3.30.1 | | | | [ts22.4.8](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 12.3.0 | (N/A) | 18.1.3 | 3.22.1 | | | | [ts22.4.7](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 12.3.0 | (N/A) | 18.1.3 | 3.22.1 | | | | [ts22.4.6](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 11.4.0 | (N/A) | 18.0.0 | 3.22.1 | | | | [ts22.4.5](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 11.4.0 | (N/A) | 18.0.0 | 3.22.1 | | | -| [ts22.4.3](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 11.3.0 | (N/A) | 15.0.7 | 3.22.1 | | | -| [ts22.4.2](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 11.3.0 | (N/A) | 15.0.7 | 3.22.1 | | | -| [ts22.4.1](https://github.com/OpenCyphal/docker_toolchains/pkgs/container/toolshed) | 3.10 | 11.3.0 | (N/A) | 15.0.7 | 3.22.1 | | | - You can use this in your workflow yaml like this: diff --git a/toolshed/Dockerfile b/toolshed/Dockerfile index 14ab12b..e8cb251 100644 --- a/toolshed/Dockerfile +++ b/toolshed/Dockerfile @@ -157,7 +157,7 @@ RUN --mount=type=cache,target=/arm-none-eabi-download \ --unpack-dir "/opt" ADD arm-none-eabi-gcc-select.sh ./arm-none-eabi-gcc-select.sh -RUN ./arm-none-eabi-gcc-select.sh 13.3.1 1 /opt/arm-gnu-toolchain-${ARM_NONE_EABI_VERSION}-${GCC_HOST_VERSION}-arm-none-eabi/bin/ +RUN ./arm-none-eabi-gcc-select.sh 1 /opt/arm-gnu-toolchain-${ARM_NONE_EABI_VERSION}-${GCC_HOST_VERSION}-arm-none-eabi/bin/ RUN update-alternatives --display arm-none-eabi-gcc # LEAVE THE WORKDIR AS /repo diff --git a/toolshed/arm-none-eabi-gcc-select.sh b/toolshed/arm-none-eabi-gcc-select.sh index dbbf058..b02a28c 100755 --- a/toolshed/arm-none-eabi-gcc-select.sh +++ b/toolshed/arm-none-eabi-gcc-select.sh @@ -1,28 +1,32 @@ #!/bin/bash -GCC_VERSION=${1} - setup_gcc_alternatives() { - local version=${1} - local priority=${2} - local group=${3} - local members=${4} - local path=${5} + local priority=${1} + local group=${2} + local members=${3} + local path=${4} local cmdln - cmdln="--verbose --install /usr/bin/${group} ${group} ${path}${group}-${version} ${priority}" + cmdln="--verbose --install /usr/bin/${group} ${group} ${path}${group} ${priority}" for member in ${members}; do - cmdln="${cmdln} --slave ${path}${member} ${member} ${path}${member}-${version}" + cmdln="${cmdln} --slave /usr/bin/${member} ${member} ${path}${member}" done update-alternatives ${cmdln} } -GCC_ALTERNATIVES_PRI=${2} -GCC_ALTERNATIVES_PATH=${3} +GCC_ALTERNATIVES_PRI=${1} +GCC_ALTERNATIVES_PATH=${2} # setup gcc group GCC_ALTERNATIVES_GROUP_GCC_CONFIG="" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-addr2line" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-ar" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-as" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-c++" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-c++filt" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-cpp" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-elfedit" GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-g++" GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gcc-ar" GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gcc-nm" @@ -30,5 +34,22 @@ GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gcov" GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gcov-dump" GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gcov-tool" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gdb" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gdb-add-index" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gdb-add-index-py" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gdb-py" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gfortran" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-gprof" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-ld" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-ld.bfd" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-lto-dump" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-nm" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-objcopy" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-objdump" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-ranlib" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-readelf" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-size" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-strings" +GCC_ALTERNATIVES_GROUP_GCC_CONFIG="${GCC_ALTERNATIVES_GROUP_GCC_CONFIG} arm-none-eabi-strip" -setup_gcc_alternatives "${GCC_VERSION}" "${GCC_ALTERNATIVES_PRI}" "arm-none-eabi-gcc" "${GCC_ALTERNATIVES_GROUP_GCC_CONFIG}" "${GCC_ALTERNATIVES_PATH}" +setup_gcc_alternatives "${GCC_ALTERNATIVES_PRI}" "arm-none-eabi-gcc" "${GCC_ALTERNATIVES_GROUP_GCC_CONFIG}" "${GCC_ALTERNATIVES_PATH}" diff --git a/toolshed/llvm-select.sh b/toolshed/llvm-select.sh index ced3e32..df64e19 100755 --- a/toolshed/llvm-select.sh +++ b/toolshed/llvm-select.sh @@ -97,7 +97,7 @@ LLVM_ALTERNATIVES_GROUP_LLVM_CONFIG="${LLVM_ALTERNATIVES_GROUP_LLVM_CONFIG} llvm setup_llvm_alternatives "${LLVM_VERSION}" "${LLVM_ALTERNATIVES_PRI}" "llvm-config" "${LLVM_ALTERNATIVES_GROUP_LLVM_CONFIG}" "${LLVM_ALTERNATIVES_PATH}" -# setup clang grioup +# setup clang group LLVM_ALTERNATIVES_GROUP_CLANG="" LLVM_ALTERNATIVES_GROUP_CLANG="${LLVM_ALTERNATIVES_GROUP_CLANG} analyze-build" LLVM_ALTERNATIVES_GROUP_CLANG="${LLVM_ALTERNATIVES_GROUP_CLANG} asan_symbolize"