diff --git a/fat-arm64.c b/fat-arm64.c index f2b8493d..48160b16 100644 --- a/fat-arm64.c +++ b/fat-arm64.c @@ -46,6 +46,10 @@ # include # include # endif +#elif defined(__FreeBSD__) +# define USE_GETAUXVAL 1 +# include +#endif #elif defined(__OpenBSD__) # include # include @@ -117,7 +121,14 @@ get_arm64_features (struct arm64_features *features) else { #if USE_GETAUXVAL +#if defined (__FreeBSD__) + unsigned long hwcap; + if(elf_aux_info(AT_HWCAP, &hwcap, sizeof(unsigned long)) != 0) { + hwcap = 0; + } +#else unsigned long hwcap = getauxval(AT_HWCAP); +#endif features->have_aes = ((hwcap & (HWCAP_ASIMD | HWCAP_AES)) == (HWCAP_ASIMD | HWCAP_AES)); features->have_pmull