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 support and CI workflow for riscv64 #1627

Merged
merged 5 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ jobs:
- i686-pc-windows-msvc
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- riscv64gc-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
Expand Down Expand Up @@ -246,6 +247,9 @@ jobs:
- target: i686-unknown-linux-musl
host_os: ubuntu-22.04

- target: riscv64gc-unknown-linux-gnu
host_os: ubuntu-22.04

- target: x86_64-pc-windows-gnu
host_os: windows-latest

Expand Down Expand Up @@ -484,6 +488,7 @@ jobs:
target:
- aarch64-unknown-linux-gnu
- i686-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- x86_64-unknown-linux-musl

mode:
Expand All @@ -507,6 +512,9 @@ jobs:
- target: i686-unknown-linux-gnu
host_os: ubuntu-22.04

- target: riscv64gc-unknown-linux-gnu
host_os: ubuntu-22.04
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous CI run passed except coverage. coverage failed because this was missing. I added it and now coverage is passing.


- target: x86_64-unknown-linux-musl
host_os: ubuntu-22.04

Expand Down
3 changes: 3 additions & 0 deletions include/ring-core/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#elif defined(__MIPSEL__) && defined(__LP64__)
#define OPENSSL_64_BIT
#define OPENSSL_MIPS64
#elif defined(__riscv) && __SIZEOF_POINTER__ == 8
#define OPENSSL_64_BIT
#define OPENSSL_RISCV64
#elif defined(__wasm__)
#define OPENSSL_32_BIT
#else
Expand Down
7 changes: 7 additions & 0 deletions mk/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld"
qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu"
qemu_arm="qemu-arm -L /usr/arm-linux-gnueabihf"
qemu_mipsel="qemu-mipsel -L /usr/mipsel-linux-gnu"
qemu_riscv64="qemu-riscv64 -L /usr/riscv64-linux-gnu"

# Avoid putting the Android tools in `$PATH` because there are tools in this
# directory like `clang` that would conflict with the same-named tools that may
Expand Down Expand Up @@ -99,6 +100,12 @@ case $target in
export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc
export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_RUNNER="$qemu_mipsel"
;;
riscv64gc-unknown-linux-gnu)
export CC_riscv64gc_unknown_linux_gnu=clang-$llvm_version
export AR_riscv64gc_unknown_linux_gnu=llvm-ar-$llvm_version
export CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc
export CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER="$qemu_riscv64"
;;
x86_64-unknown-linux-musl)
export CC_x86_64_unknown_linux_musl=clang-$llvm_version
export AR_x86_64_unknown_linux_musl=llvm-ar-$llvm_version
Expand Down
7 changes: 7 additions & 0 deletions mk/install-build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ case $target in
libc6-dev-mipsel-cross \
qemu-user
;;
--target=riscv64gc-unknown-linux-gnu)
use_clang=1
install_packages \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \
leso-kn marked this conversation as resolved.
Show resolved Hide resolved
qemu-user
;;
--target=wasm32-unknown-unknown)
cargo install wasm-bindgen-cli --bin wasm-bindgen-test-runner
use_clang=1
Expand Down
Loading