Enable use of elf_aux_info() to detect CPU features on aarch64 and powerpc64

This commit is contained in:
Brad Smith 2025-06-13 19:34:36 -04:00 committed by Daniel Black
commit f66cd044d5
2 changed files with 8 additions and 6 deletions

View file

@ -33,7 +33,7 @@ my_crc32_t crc32c_aarch64_available(void)
}
# else
# include <sys/auxv.h>
# ifdef __FreeBSD__
# if defined(__FreeBSD__) || defined(__OpenBSD__)
static unsigned long getauxval(unsigned int key)
{
unsigned long val;

View file

@ -455,10 +455,12 @@ static int arch_ppc_probe(void) {
return arch_ppc_crc32;
}
# elif defined __FreeBSD__
# include <machine/cpu.h>
# elif defined(__FreeBSD__) || defined(__OpenBSD__)
# include <sys/auxv.h>
# include <sys/elf_common.h>
# ifdef __FreeBSD__
# include <machine/cpu.h>
# include <sys/elf_common.h>
# endif
static int arch_ppc_probe(void) {
unsigned long cpufeatures;
arch_ppc_crc32 = 0;
@ -470,12 +472,12 @@ static int arch_ppc_probe(void) {
return arch_ppc_crc32;
}
# elif defined(_AIX) || defined(__OpenBSD__)
# elif defined(_AIX)
static int arch_ppc_probe(void) {
arch_ppc_crc32 = 0;
# if defined(__powerpc64__)
// AIX 7.1+/OpenBSD has vector crypto features on all POWER 8+
// AIX 7.1+ has vector crypto features on all POWER 8+
arch_ppc_crc32 = 1;
# endif /* __powerpc64__ */