Make sure _SC_LEVEL1_DCACHE_LINESIZE is defined (#507)

pull/484/merge
Deadpikle 2017-09-17 14:34:05 -04:00 committed by Jeffrey Walton
parent 7097546cfc
commit 723d87c9b5
1 changed files with 2 additions and 2 deletions

View File

@ -605,7 +605,7 @@ void DetectArmFeatures()
g_hasSHA1 = CPU_QuerySHA1() || CPU_ProbeSHA1(); g_hasSHA1 = CPU_QuerySHA1() || CPU_ProbeSHA1();
g_hasSHA2 = CPU_QuerySHA2() || CPU_ProbeSHA2(); g_hasSHA2 = CPU_QuerySHA2() || CPU_ProbeSHA2();
#if defined(__linux__) #if defined(__linux__) && defined(_SC_LEVEL1_DCACHE_LINESIZE)
g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#endif #endif
@ -726,7 +726,7 @@ void DetectPowerpcFeatures()
#if defined(_AIX) #if defined(_AIX)
// /usr/include/sys/systemcfg.h // /usr/include/sys/systemcfg.h
g_cacheLineSize = getsystemcfg(SC_L1C_DLS); g_cacheLineSize = getsystemcfg(SC_L1C_DLS);
#elif defined(__linux__) #elif defined(__linux__) && defined(_SC_LEVEL1_DCACHE_LINESIZE)
// GCC112 CentOS 7 returns 0? // GCC112 CentOS 7 returns 0?
g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); g_cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#endif #endif