riscv: fix RV32 issues found during validation#30733
Open
cmuellner wants to merge 3 commits intoopenssl:masterfrom
Open
riscv: fix RV32 issues found during validation#30733cmuellner wants to merge 3 commits intoopenssl:masterfrom
cmuellner wants to merge 3 commits intoopenssl:masterfrom
Conversation
Use %zu when formatting riscv_vlen() in the CPU info string. On RV32, riscv_vlen() returns size_t backed by unsigned int, so %lu triggers -Werror=format during the build. This keeps the RV32 build aligned with the existing size_t interface. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Cast the XTS stream selection operands to OSSL_xts_stream_fn before assigning them to the provider context. On RV32, the Zknd/Zkne XTS paths pass NULL stream callbacks. Without the cast, the conditional expression is treated as void * and fails under -Werror=pedantic. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
This adds an example that shows how to set OPENSSL_riscvcap for an "rv32gc" ISA string. This documents that the mechanism works for RV32 as well as RV64. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Contributor
Author
|
CI/CD failed because of formatting issues. |
Contributor
Author
|
@ZenithalHourlyRate and @paulidale, please review. |
Member
|
I guess it is worth adding RV32 to the CI matrix as well. |
Contributor
Author
There is no RV32 cross compiler in Ubuntu. |
Contributor
ZenithalHourlyRate
left a comment
There was a problem hiding this comment.
I agree with the code changes.
paulidale
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes several RV32 issues found while validating the RISC-V crypto backends on current master.
Changes:
size_tformatting for the reported RISC-V vector lengthOPENSSL_riscvcap(3)RV32 exampleThe first two changes are real build/portability fixes for RV32.
The documentation cleanup is small, but came out of the same validation pass.
Validation:
Note that RV32 is not fully supported as a target because Ubuntu lacks an RV32 cross-toolchain package.
Also, I don't think there are many real HW RV32 SoCs targeting Linux.
However, we should still keep an eye on it.
Checklist