ci: add a Clang RISCV test target

Similar to the GCC one, this test target uses system toolchain and QEMU
too.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
This commit is contained in:
Icenowy Zheng 2025-03-25 22:37:02 +08:00 committed by Hans Kristian Rosbach
parent 549ca4d617
commit 64d16e10bc
2 changed files with 21 additions and 0 deletions

View File

@ -312,6 +312,11 @@ jobs:
gcov-exec: riscv64-linux-gnu-gcov gcov-exec: riscv64-linux-gnu-gcov
codecov: ubuntu_gcc_riscv64 codecov: ubuntu_gcc_riscv64
- name: Ubuntu Clang RISC-V
os: ubuntu-latest
cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv-clang.cmake
packages: qemu-user crossbuild-essential-riscv64
- name: Ubuntu GCC SPARC64 - name: Ubuntu GCC SPARC64
# qemu appears to be broken in newer versions of Ubuntu (see issue 1378) # qemu appears to be broken in newer versions of Ubuntu (see issue 1378)
os: ubuntu-20.04 os: ubuntu-20.04

View File

@ -0,0 +1,16 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR riscv64)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET riscv64-linux-gnu)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET riscv64-linux-gnu)
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_CROSSCOMPILING_EMULATOR qemu-riscv64 -cpu rv64,zba=true,zbb=true,zbc=true,zbs=true,v=true,vlen=512,elen=64,vext_spec=v1.0 -L /usr/${CMAKE_C_COMPILER_TARGET}/)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)