Skip to content

Commit 9ff08a3

Browse files
committed
Add support for elf_aux_info() on OpenBSD
1 parent bf11805 commit 9ff08a3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ HTS_HIDE_DYNAMIC_SYMBOLS
326326

327327
dnl FIXME This pulls in dozens of standard header checks
328328
AC_FUNC_MMAP
329-
AC_CHECK_FUNCS([gmtime_r fsync drand48 srand48_deterministic])
329+
AC_CHECK_FUNCS([gmtime_r fsync drand48 srand48_deterministic elf_aux_info])
330330

331331
# Darwin has a dubious fdatasync() symbol, but no declaration in <unistd.h>
332332
AC_CHECK_DECL([fdatasync(int)], [AC_CHECK_FUNCS(fdatasync)])

simd.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ DEALINGS IN THE SOFTWARE. */
4242

4343
#if defined __arm__ || defined __aarch64__
4444

45-
#if defined __linux__ || defined __FreeBSD__
45+
#if defined __linux__ || defined HAVE_ELF_AUX_INFO
4646
#include <sys/auxv.h>
4747
#elif defined __APPLE__
4848
#include <sys/types.h>
@@ -73,11 +73,11 @@ static inline int cpu_supports_neon(void) {
7373
if (sysctlbyname("hw.optional.AdvSIMD", &ctl, &ctlsize, NULL, 0) != 0) return 0;
7474
if (ctlsize != sizeof ctl) return 0;
7575
return ctl;
76-
#elif defined __FreeBSD__ && defined __arm__ && defined HWCAP_NEON
76+
#elif defined HAVE_ELF_AUX_INFO && defined __arm__ && defined HWCAP_NEON
7777
unsigned long cap;
7878
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
7979
return (cap & HWCAP_NEON) != 0;
80-
#elif defined __FreeBSD__ && defined __aarch64__ && defined HWCAP_ASIMD
80+
#elif defined HAVE_ELF_AUX_INFO && defined __aarch64__ && defined HWCAP_ASIMD
8181
unsigned long cap;
8282
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
8383
return (cap & HWCAP_ASIMD) != 0;

0 commit comments

Comments
 (0)