From 27fa9d33e1355ae1ef1c0a072f9b511858dfef85 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 23 Oct 2024 14:57:20 +0100 Subject: [PATCH] Fix builds on riscv64 using musl Some environments using musl are reported to have the hwprobe.h include file but not have the __NR_riscv_hwprobe define. Fixes #25772 Reviewed-by: Viktor Dukhovni Reviewed-by: Ben Kaduk Reviewed-by: Paul Dale Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/25787) --- include/crypto/riscv_arch.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/crypto/riscv_arch.h b/include/crypto/riscv_arch.h index 4b3573f5a34..885842763d9 100644 --- a/include/crypto/riscv_arch.h +++ b/include/crypto/riscv_arch.h @@ -15,7 +15,14 @@ # if defined(OPENSSL_SYS_LINUX) && !defined(FIPS_MODULE) # if __has_include() -# define OSSL_RISCV_HWPROBE +# include +# /* + * Some environments using musl are reported to have the hwprobe.h include + * file but not have the __NR_riscv_hwprobe define. + */ +# ifdef __NR_riscv_hwprobe +# define OSSL_RISCV_HWPROBE +# endif # endif # endif -- 2.47.2