Support SHA-512 hwcap detection on old libc

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2024-01-30 15:31:42 +00:00
parent cbb9caead4
commit dae21d3808

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>