summaryrefslogtreecommitdiffstats
path: root/include/crypto/riscv_arch.h
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2024-10-23 15:57:20 +0200
committerTodd Short <todd.short@me.com>2024-10-28 20:44:44 +0100
commit27fa9d33e1355ae1ef1c0a072f9b511858dfef85 (patch)
treeb526cffda74c786f131a9fa9ed0dcc10a9d2cb88 /include/crypto/riscv_arch.h
parentFix ambiguous output of Signature Algorithms (diff)
downloadopenssl-27fa9d33e1355ae1ef1c0a072f9b511858dfef85.tar.xz
openssl-27fa9d33e1355ae1ef1c0a072f9b511858dfef85.zip
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 <viktor@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/25787)
Diffstat (limited to '')
-rw-r--r--include/crypto/riscv_arch.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/crypto/riscv_arch.h b/include/crypto/riscv_arch.h
index 4b3573f5a3..885842763d 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(<asm/hwprobe.h>)
-# define OSSL_RISCV_HWPROBE
+# include <sys/syscall.h>
+# /*
+ * 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