]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix builds on riscv64 using musl
authorMatt Caswell <matt@openssl.org>
Wed, 23 Oct 2024 13:57:20 +0000 (14:57 +0100)
committerTodd Short <todd.short@me.com>
Mon, 28 Oct 2024 19:44:44 +0000 (15:44 -0400)
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)

include/crypto/riscv_arch.h

index 4b3573f5a34a2d3eebf93267d61f7e8b35636ca7..885842763d93ec30eae0152ad6f89324a7843059 100644 (file)
 
 # 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