Index: compiler-rt/lib/builtins/cpu_model.c =================================================================== --- compiler-rt/lib/builtins/cpu_model.c +++ compiler-rt/lib/builtins/cpu_model.c @@ -799,7 +799,12 @@ #define HWCAP_ATOMICS (1 << 8) #endif static void CONSTRUCTOR_ATTRIBUTE init_have_lse_atomics(void) { - unsigned long hwcap = getauxval(AT_HWCAP); + unsigned long hwcap = 0; +#if defined(__FreeBSD__) + elf_aux_info(AT_HWCAP, &hwcap, sizeof(unsigned long)); +#else + hwcap = getauxval(AT_HWCAP); +#endif __aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0; } #endif // defined(__has_include)