From 48fc28c5841a6c155260c0eac7a077c3393e8a01 Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Thu, 21 Nov 2024 09:03:16 +0000 Subject: [PATCH] Add risc-v cross llvm build --- .github/workflows/create_llvm.yml | 36 ++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create_llvm.yml b/.github/workflows/create_llvm.yml index c33f52139..152216a44 100644 --- a/.github/workflows/create_llvm.yml +++ b/.github/workflows/create_llvm.yml @@ -18,16 +18,20 @@ jobs: strategy: matrix: version: [18, 19] - os: [ubuntu-22.04, windows-2019] + os: [ubuntu-22.04, ubuntu-24.04, windows-2019] build_type: [Release, RelAssert] - arch : [x86, x86_64, aarch64] + arch : [x86, x86_64, aarch64, riscv64] exclude: - # Reduce the versions of llvm for aarch64 & x86 architectures and windows, as + # Reduce the versions of llvm for aarch64, riscv64 & x86 architectures and windows, as # well as any windows os variants to reduce cache usage. - arch: aarch64 version: 18 - arch: aarch64 build_type: Release + - arch: riscv64 + version: 18 + - arch: riscv64 + build_type: Release - arch: x86 version: 18 - arch: x86 @@ -39,7 +43,21 @@ jobs: - os: windows-2019 arch: aarch64 - os: windows-2019 + arch: riscv64 + - os: windows-2019 + arch: x86 + - os: windows-2019 + arch: ubuntu-22.04 + # Todo: for risc-v we need to build on ubuntu-24.04 as gcc 13 is required for the dynamic links flags to work + - os: ubuntu-22.04 + arch: riscv64 + # we build the other arches on 22.04 + - os: ubuntu-24.04 arch: x86 + - os: ubuntu-24.04 + arch: x86_64 + - os: ubuntu-24.04 + arch: aarch64 include: # We want to set flags related to particular matrix dimensions. To do this # we need to create default values first, and then against particular matrix @@ -53,15 +71,18 @@ jobs: - arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/arm-linux/aarch64-toolchain.cmake" -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu arch: aarch64 + - arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/riscv64-linux/riscv64-gcc-toolchain.cmake " + -DLLVM_HOST_TRIPLE=riscv64-unknown-linux-gnu + arch: riscv64 - arch_flags: -DLLVM_BUILD_32_BITS=ON -DLIBXML2_LIBRARIES=IGNORE -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_HOST_TRIPLE=i686-unknown-linux-gnu arch: x86 - build_type: Release build_type_flags: -DCMAKE_BUILD_TYPE=Release - # Todo: for risc-v we need to build on ubuntu-24.04 as gcc 13 is required for the dynamic links flags to work - # This will probably require some exclude: on the different os or building all on each os. - os: ubuntu-22.04 os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON + - os: ubuntu-24.04 + os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON runs-on: ${{ matrix.os }} steps: @@ -103,6 +124,11 @@ jobs: run: sudo apt-get install --yes g++-11-aarch64-linux-gnu + - name: install risc64 build tools + if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.arch == 'riscv64' }} + run: + sudo apt-get install --yes g++-13-riscv64-linux-gnu + - name: install x86 build tools if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.arch == 'x86' }} run: |