Skip to content

Commit 3257e94

Browse files
committed
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 <[email protected]>
1 parent 03ec647 commit 3257e94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backends.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ cfg_if! {
100100
// Minimum supported Linux kernel version for MUSL targets
101101
// is not specified explicitly (as of Rust 1.77) and they
102102
// are used in practice to target pre-3.17 kernels.
103-
target_env = "musl",
103+
not(
104+
all(
105+
target_env = "musl",
106+
target_arch = "riscv64",
107+
target_arch = "riscv32",
108+
),
109+
),
104110
),
105111
)
106112
))] {

0 commit comments

Comments
 (0)