Skip to content

Commit

Permalink
add riscv support
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardoaraujor authored and felixonmars committed Sep 8, 2021
1 parent 022f4db commit cf3a51e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ jobs:
- x86_64-apple-darwin
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- riscv32gc-unknown-linux-gnu

mode:
- # debug
Expand Down Expand Up @@ -259,6 +261,12 @@ jobs:
- target: x86_64-unknown-linux-gnu
host_os: ubuntu-18.04

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

- target: riscv32gc-unknown-linux-gnu
host_os: ubuntu-18.04

steps:
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
run: sudo apt-get update -y
Expand Down
14 changes: 14 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ const ASM_TARGETS: &[AsmTarget] = &[
asm_extension: "S",
preassemble: false,
},
AsmTarget {
oss: LINUX_ABI,
arch: "riscv32",
perlasm_format: "linux32",
asm_extension: "S",
preassemble: false,
},
AsmTarget {
oss: LINUX_ABI,
arch: "riscv64",
perlasm_format: "linux64",
asm_extension: "S",
preassemble: false,
},
AsmTarget {
oss: MACOS_ABI,
arch: "aarch64",
Expand Down
8 changes: 8 additions & 0 deletions include/ring-core/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@
#define OPENSSL_MIPS64
#elif defined(__wasm__)
#define OPENSSL_32_BIT
#elif defined(__riscv)
# if (__riscv_xlen == 64)
# define OPENSSL_64_BIT
# define OPENSSL_RISCV64
# elif(__riscv_xlen == 32)
# define OPENSSL_32_BIT
# define OPENSSL_RISCV32
# endif
#else
// Note BoringSSL only supports standard 32-bit and 64-bit two's-complement,
// little-endian architectures. Functions will not produce the correct answer
Expand Down

0 comments on commit cf3a51e

Please sign in to comment.