From 4ea0c905e63abebfaf4f3938a0f512c1fa9a8430 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 21 Oct 2022 12:28:45 +0800 Subject: [PATCH] ci: Install LLVM Embedded Toolchain for Arm Signed-off-by: Xiang Xiao --- tools/ci/cibuild.sh | 15 ++++++++++++++- tools/ci/docker/linux/Dockerfile | 8 ++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/ci/cibuild.sh b/tools/ci/cibuild.sh index e300b676fa..a980d47a23 100755 --- a/tools/ci/cibuild.sh +++ b/tools/ci/cibuild.sh @@ -46,7 +46,7 @@ case ${os} in brew update --quiet ;; Linux) - install="python-tools codechecker clang_clang-tidy gen-romfs gperf kconfig-frontends rust arm-gcc-toolchain arm64-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain sparc-gcc-toolchain c-cache" + install="python-tools codechecker clang_clang-tidy gen-romfs gperf kconfig-frontends rust arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain sparc-gcc-toolchain c-cache" ;; esac @@ -169,6 +169,19 @@ function bloaty { fi } +function arm-clang-toolchain { + add_path "${prebuilt}"/clang-arm-none-eabi/bin + + if [ ! -f "${prebuilt}/clang-arm-none-eabi/bin/clang" ]; then + cd "${prebuilt}" + curl -O -L -s https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-14.0.0/LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz + tar zxf LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz + mv LLVMEmbeddedToolchainForArm-14.0.0 clang-arm-none-eabi + rm LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz + fi + clang --version +} + function arm-gcc-toolchain { add_path "${prebuilt}"/gcc-arm-none-eabi/bin diff --git a/tools/ci/docker/linux/Dockerfile b/tools/ci/docker/linux/Dockerfile index 5b0401406e..9dbdf895a4 100644 --- a/tools/ci/docker/linux/Dockerfile +++ b/tools/ci/docker/linux/Dockerfile @@ -90,6 +90,11 @@ RUN mkdir gcc-arm-none-eabi && \ && curl -s -L -O "https://raw.githubusercontent.com/apache/incubator-nuttx/master/tools/ci/patch/arm-none-eabi-workaround-for-newlib-version-break.patch" \ && patch -p0 < arm-none-eabi-workaround-for-newlib-version-break.patch +# Download the latest ARM clang toolchain prebuilt by ARM +RUN mkdir clang-arm-none-eabi && \ + curl -s -L "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-14.0.0/LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz" \ + | tar -C clang-arm-none-eabi --strip-components 1 -xz + ############################################################################### # Build image for tool required by ARM64 builds ############################################################################### @@ -300,6 +305,9 @@ ENV PATH="/tools/rust/cargo/bin:$PATH" COPY --from=nuttx-toolchain-arm /tools/gcc-arm-none-eabi/ gcc-arm-none-eabi/ ENV PATH="/tools/gcc-arm-none-eabi/bin:$PATH" +COPY --from=nuttx-toolchain-arm /tools/clang-arm-none-eabi/ clang-arm-none-eabi/ +ENV PATH="/tools/clang-arm-none-eabi/bin:$PATH" + # ARM64 toolchain COPY --from=nuttx-toolchain-arm64 /tools/gcc-aarch64-none-elf/ gcc-aarch64-none-elf/ ENV PATH="/tools/gcc-aarch64-none-elf/bin:$PATH"