Merge pull request #8767 from daverodgman/sha-glibc-changelog

SHA-256 and 512 support for old libc
This commit is contained in:
Dave Rodgman 2024-01-31 13:21:52 +00:00 committed by GitHub
commit 4c92845210
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,4 @@
Bugfix
* On Linux on ARMv8, fix a build error with SHA-256 and SHA-512
acceleration detection when the libc headers do not define the
corresponding constant. Reported by valord577.

View file

@ -102,6 +102,14 @@
# if defined(__linux__) # if defined(__linux__)
/* Our preferred method of detection is getauxval() */ /* Our preferred method of detection is getauxval() */
# include <sys/auxv.h> # include <sys/auxv.h>
# if !defined(HWCAP_SHA512)
/* The same header that declares getauxval() should provide the HWCAP_xxx
* constants to analyze its return value. However, the libc may be too
* old to have the constant that we need. So if it's missing, assume that
* the value is the same one used by the Linux kernel ABI.
*/
# define HWCAP_SHA512 (1 << 21)
# endif
# endif # endif
/* Use SIGILL on Unix, and fall back to it on Linux */ /* Use SIGILL on Unix, and fall back to it on Linux */
# include <signal.h> # include <signal.h>