Index: lib/libac/cpu/trampoline_ppc.c
--- lib/libac/cpu/trampoline_ppc.c.orig
+++ lib/libac/cpu/trampoline_ppc.c
@@ -23,8 +23,10 @@
 #if defined(__ppc__) || defined(__PPC__)
 #ifdef HAS_AUXV
 #include <sys/auxv.h>
+#ifdef __linux__
 #include <bits/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_HWCAP2);
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
+	long hwcaps = 0;
+	elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps));
+#endif
 
 #if defined(PPC_FEATURE2_ARCH_2_07)
 	if (hwcaps & PPC_FEATURE2_ARCH_2_07)
