Skip to content

Commit

Permalink
Add RISC-V (64bit) environment in actions
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 authored and ksh8281 committed Nov 8, 2024
1 parent 8fae950 commit 4387f6c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,36 @@ jobs:
python3 ./tools/run-tests.py --engine="./out/pure/walrus" basic-tests wasm-test-core jit
python3 ./tools/run-tests.py --jit --engine="./out/pure/walrus" basic-tests wasm-test-core jit
build-test-on-riscv64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in riscv64 container
uses: uraimo/[email protected]
with:
arch: riscv64
distro: ubuntu22.04

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}

install: |
apt-get update
apt-get install -y cmake build-essential ninja-build pkg-config python3 clang git
run: |
# TODO enable JIT for RISC-V
CC=clang CXX=clang++ cmake -H. -Bout/release -DWALRUS_JIT=OFF -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja
CC=clang CXX=clang++ cmake -H. -Bout/pure -DWALRUS_JIT=OFF -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja
ninja -Cout/release
ninja -Cout/pure
python3 ./tools/run-tests.py --engine="./out/release/walrus"
#python3 ./tools/run-tests.py --jit --engine="./out/release/walrus"
python3 ./tools/run-tests.py --engine="./out/pure/walrus" basic-tests wasm-test-core jit
#python3 ./tools/run-tests.py --jit --engine="./out/pure/walrus" basic-tests wasm-test-core jit
test-on-windows-x86-x64:
runs-on: windows-2022
strategy:
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ IF (NOT DEFINED WALRUS_ARCH)
SET(WALRUS_ARCH "arm")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(WALRUS_ARCH "aarch64")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "riscv64")
SET(WALRUS_ARCH "riscv64")
ENDIF()
ENDIF()

Expand Down
6 changes: 6 additions & 0 deletions src/Walrus.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ if (f.type == Type::B) { puts("failed in msvc."); }
#elif defined(__aarch64__)
#define CPU_ARM64

#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32
#define CPU_RISCV32

#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
#define CPU_RISCV64

#else
#error "Could't find cpu arch."
#endif
Expand Down

0 comments on commit 4387f6c

Please sign in to comment.