Skip to content
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

Add risc-v cross llvm build #595

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
36 changes: 31 additions & 5 deletions .github/workflows/create_llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down