Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for elf_aux_info() on OpenBSD #1834

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ HTS_HIDE_DYNAMIC_SYMBOLS

dnl FIXME This pulls in dozens of standard header checks
AC_FUNC_MMAP
AC_CHECK_FUNCS([gmtime_r fsync drand48 srand48_deterministic])
AC_CHECK_FUNCS([gmtime_r fsync drand48 srand48_deterministic elf_aux_info])

# Darwin has a dubious fdatasync() symbol, but no declaration in <unistd.h>
AC_CHECK_DECL([fdatasync(int)], [AC_CHECK_FUNCS(fdatasync)])
Expand Down
6 changes: 3 additions & 3 deletions simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DEALINGS IN THE SOFTWARE. */

#if defined __arm__ || defined __aarch64__

#if defined __linux__ || defined __FreeBSD__
#if defined __linux__ || defined HAVE_ELF_AUX_INFO
#include <sys/auxv.h>
#elif defined __APPLE__
#include <sys/types.h>
Expand Down Expand Up @@ -73,11 +73,11 @@ static inline int cpu_supports_neon(void) {
if (sysctlbyname("hw.optional.AdvSIMD", &ctl, &ctlsize, NULL, 0) != 0) return 0;
if (ctlsize != sizeof ctl) return 0;
return ctl;
#elif defined __FreeBSD__ && defined __arm__ && defined HWCAP_NEON
#elif defined HAVE_ELF_AUX_INFO && defined __arm__ && defined HWCAP_NEON
unsigned long cap;
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
return (cap & HWCAP_NEON) != 0;
#elif defined __FreeBSD__ && defined __aarch64__ && defined HWCAP_ASIMD
#elif defined HAVE_ELF_AUX_INFO && defined __aarch64__ && defined HWCAP_ASIMD
unsigned long cap;
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
return (cap & HWCAP_ASIMD) != 0;
Expand Down