briansmith / ring

Safe, fast, small crypto using Rust
Other
3.72k stars 703 forks source link

support for RISCV32 #2041

Closed ub-tech closed 4 months ago

ub-tech commented 5 months ago

Hi - I'm trying to run a repo with ring as dependency on a RISC32 arch. I tried to override the dependency based on this convo. Is riscv32 supported? Am I trying to implement this override correctly (please see below)? TY very much for any insights.

[patch.crates-io] ring = { git = "https://github.com/leso-kn/ring.git", package = "ring", branch = "riscv64-support-plus-riscv32" }

briansmith commented 4 months ago

In target.h, we have:

#elif defined(__riscv) && __SIZEOF_POINTER__ == 8
#define OPENSSL_64_BIT

So presumably we would also need to add the corresponding change for riscv32.

The bigger issue, AFAICT, is that we don't have any way of testing riscv32 code in CI.

briansmith commented 4 months ago

See https://github.com/briansmith/ring/pull/2042#issuecomment-2120898907 for an alternative approach.

briansmith commented 4 months ago

Please check out PR #2082 to see if this works for you.

briansmith commented 4 months ago

Closing this on the assumption that PR #2082 resolves this, at least if you're not using an old version of GCC>