diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78f7114..0262f5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,9 +34,14 @@ jobs: cross_cmake_args: >- -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=riscv64 + -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc + -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++ -DWASI_SDK_LLDB=OFF env: WASI_SDK_CI_SKIP_SYSROOT: 1 + WASI_SDK_CI_TOOLCHAIN_LLVM_CMAKE_ARGS: >- + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=riscv64 - artifact: arm64-macos os: macos-14 diff --git a/ci/docker/Dockerfile.riscv64-linux b/ci/docker/Dockerfile.riscv64-linux index 6012568..f4456ec 100644 --- a/ci/docker/Dockerfile.riscv64-linux +++ b/ci/docker/Dockerfile.riscv64-linux @@ -16,13 +16,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ccache \ && rm -rf /var/lib/apt/lists/* -# Set the cross-compiler as the default so that cmake picks it up via CC/CXX -# and sets CMAKE_CROSSCOMPILING=TRUE, which causes LLVM to build a native -# tablegen before cross-compiling the rest of the toolchain. -ENV CC=riscv64-linux-gnu-gcc -ENV CXX=riscv64-linux-gnu-g++ - # Cargo needs an explicit linker when cross-compiling for riscv64. +# The C/C++ cross-compiler is passed via CMAKE_C/CXX_COMPILER cmake flags +# rather than CC/CXX env vars so that LLVM's native tblgen sub-build can +# still find the host compiler (cmake cache vars are not inherited by +# subprocess cmake invocations, but env vars are). ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc # Tell programs to cache in a location that both isn't a `--volume` mounted root