Skip to content

Instantly share code, notes, and snippets.

@userdocs
Created October 23, 2024 15:14
Show Gist options
  • Select an option

  • Save userdocs/5b014d91de2dd1147b6c380650d7d404 to your computer and use it in GitHub Desktop.

Select an option

Save userdocs/5b014d91de2dd1147b6c380650d7d404 to your computer and use it in GitHub Desktop.
openssl-3.4.0.patch
#!/usr/bin/env bash
cd && rm -rf openssl-3.4.0
[[ ! -f openssl-3.4.0.tar.gz ]] && curl -LO https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz
tar xf openssl-3.4.0.tar.gz
cd openssl-3.4.0
cat >> "riscv-patch" << EOF
diff --git a/include/crypto/riscv_arch.h b/include/crypto/riscv_arch.h
index 4b3573f5a3..c0b94d1ca5 100644
--- a/include/crypto/riscv_arch.h
+++ b/include/crypto/riscv_arch.h
@@ -15,7 +15,10 @@
# if defined(OPENSSL_SYS_LINUX) && !defined(FIPS_MODULE)
# if __has_include(<asm/hwprobe.h>)
-# define OSSL_RISCV_HWPROBE
+# include <sys/syscall.h>
+# ifdef __NR_riscv_hwprobe
+# define OSSL_RISCV_HWPROBE
+# endif
# endif
# endif
EOF
patch -p1 < riscv-patch
./Configure linux64-riscv64 --prefix=/root/build threads no-shared no-dso no-comp no-docs
make j"$(nproc)"
make install_sw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment