Skip to content

Commit f66cd04

Browse files
brad0grooverdan
authored andcommitted
Enable use of elf_aux_info() to detect CPU features on aarch64 and powerpc64
1 parent 729b27d commit f66cd04

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

mysys/crc32/crc32_arm64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ my_crc32_t crc32c_aarch64_available(void)
3333
}
3434
# else
3535
# include <sys/auxv.h>
36-
# ifdef __FreeBSD__
36+
# if defined(__FreeBSD__) || defined(__OpenBSD__)
3737
static unsigned long getauxval(unsigned int key)
3838
{
3939
unsigned long val;

mysys/crc32/crc32c.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,12 @@ static int arch_ppc_probe(void) {
455455

456456
return arch_ppc_crc32;
457457
}
458-
# elif defined __FreeBSD__
459-
# include <machine/cpu.h>
458+
# elif defined(__FreeBSD__) || defined(__OpenBSD__)
460459
# include <sys/auxv.h>
461-
# include <sys/elf_common.h>
460+
# ifdef __FreeBSD__
461+
# include <machine/cpu.h>
462+
# include <sys/elf_common.h>
463+
# endif
462464
static int arch_ppc_probe(void) {
463465
unsigned long cpufeatures;
464466
arch_ppc_crc32 = 0;
@@ -470,12 +472,12 @@ static int arch_ppc_probe(void) {
470472

471473
return arch_ppc_crc32;
472474
}
473-
# elif defined(_AIX) || defined(__OpenBSD__)
475+
# elif defined(_AIX)
474476
static int arch_ppc_probe(void) {
475477
arch_ppc_crc32 = 0;
476478

477479
# if defined(__powerpc64__)
478-
// AIX 7.1+/OpenBSD has vector crypto features on all POWER 8+
480+
// AIX 7.1+ has vector crypto features on all POWER 8+
479481
arch_ppc_crc32 = 1;
480482
# endif /* __powerpc64__ */
481483

0 commit comments

Comments
 (0)