From a577c3fe79dbdda7e027d14344ee682e64c21e73 Mon Sep 17 00:00:00 2001 From: pkubaj Date: Mon, 29 Nov 2021 00:03:45 +0000 Subject: [PATCH] Fix build on FreeBSD/armv7 1. FreeBSD uses elf_aux_info instead of getauxval. 2. FreeBSD uses HWCAP_NEON macro for Neon. --- src/zm_utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index 7d2bbc888..b4e9a86d1 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -224,8 +224,15 @@ void HwCapsDetect() { #elif defined(__arm__) // ARM processor in 32bit mode // To see if it supports NEON, we need to get that information from the kernel + #ifdef __linux__ unsigned long auxval = getauxval(AT_HWCAP); if (auxval & HWCAP_ARM_NEON) { + #elif defined(__FreeBSD__) + unsigned long auxval = 0; + elf_aux_info(AT_HWCAP, &auxval, sizeof(auxval)); + if (auxval & HWCAP_NEON) { + #error Unsupported OS. + #endif Debug(1,"Detected ARM (AArch32) processor with Neon"); neonversion = 1; } else {