Index: lib/libac/cpu/trampoline_arm.c
--- lib/libac/cpu/trampoline_arm.c.orig
+++ lib/libac/cpu/trampoline_arm.c
@@ -23,8 +23,10 @@
 #if defined(__arm__) || defined(__aarch64__)
 #ifdef HAS_AUXV
 #include <sys/auxv.h>
+#ifdef __linux__
 #include <asm/hwcap.h>
 #endif
+#endif
 #else
 #error "The wrong CPU architecture file has been included."
 #endif
@@ -39,7 +41,12 @@ int simd_get_supported_features(void)
 {
 	int result = 0;
 #ifdef HAS_AUXV
+#ifdef __linux__
 	long hwcaps = getauxval(AT_HWCAP);
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
+	long hwcaps = 0;
+	elf_aux_info(AT_HWCAP, &hwcaps, sizeof(hwcaps));
+#endif
 
 #if defined(HWCAP_ASIMD)
 	if (hwcaps & HWCAP_ASIMD)
