File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1296,13 +1296,15 @@ int cpuid_present(void)
1296
1296
#if defined(PLATFORM_X86 ) || defined(PLATFORM_X64 )
1297
1297
return cpuid_exists_by_eflags ();
1298
1298
#elif defined(PLATFORM_AARCH64 )
1299
- # if defined(HAVE_GETAUXVAL ) /* Linux */
1299
+ # if defined(HAVE_GETAUXVAL ) && defined( HWCAP_CPUID ) /* Linux */
1300
1300
return (getauxval (AT_HWCAP ) & HWCAP_CPUID );
1301
- # elif defined(HAVE_ELF_AUX_INFO ) /* FreeBSD */
1301
+ # elif defined(HAVE_ELF_AUX_INFO ) && defined( HWCAP_CPUID ) /* FreeBSD */
1302
1302
unsigned long hwcap = 0 ;
1303
1303
if (elf_aux_info (AT_HWCAP , & hwcap , sizeof (hwcap )) == 0 )
1304
1304
return ((hwcap & HWCAP_CPUID ) != 0 );
1305
- # endif /* HAVE_GETAUXVAL */
1305
+ # elif !defined(HWCAP_CPUID )
1306
+ # warning HWCAP_CPUID is not defined on this AArch64 system, cpuid_present() will always return 0
1307
+ # endif /* HWCAP_CPUID */
1306
1308
/* On AArch64, return 0 by default */
1307
1309
return 0 ;
1308
1310
#else
You can’t perform that action at this time.
0 commit comments