From 6fa8385bcec5a40c5ba1dac7007d07d60ea4c2f7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 22 Jul 2025 09:46:03 -0700 Subject: [PATCH] Use getrandom syscall on riscv32/riscv64 linux Minimum kernel needed on RISCV is fairly new (4.15+) so we are sure to have getrandom syscall, on glibc there is mimimal ABI kernel to denote it but musl does not have any other way to indicate it, so add it as a condition here to choose getrandom backend for rv32/rv64 on linux when using musl. Signed-off-by: Khem Raj --- src/backends.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/backends.rs b/src/backends.rs index bf0381d26..d7b73cec0 100644 --- a/src/backends.rs +++ b/src/backends.rs @@ -100,7 +100,15 @@ cfg_if! { // Minimum supported Linux kernel version for MUSL targets // is not specified explicitly (as of Rust 1.77) and they // are used in practice to target pre-3.17 kernels. - target_env = "musl", + all( + target_env = "musl", + not( + any( + target_arch = "riscv64", + target_arch = "riscv32", + ), + ), + ), ), ) ))] {