about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-06-17 16:02:26 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-06-17 16:02:26 +0200
commit387c64b74c9e91f96c3dfa26bf90a74a689c5dc5 (patch)
treedf42315fffcf1f0ad1ed035d229b37748eda9761 /src
parent4d068eee26809e491fb3ff6e115222630f3288bc (diff)
downloadbox64-387c64b74c9e91f96c3dfa26bf90a74a689c5dc5.tar.gz
box64-387c64b74c9e91f96c3dfa26bf90a74a689c5dc5.zip
Fixed usage of getcpu, only enablign that for recent enough glibc (should help #1586)
Diffstat (limited to 'src')
-rw-r--r--src/tools/my_cpuid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c
index 835e4662..1656e269 100644
--- a/src/tools/my_cpuid.c
+++ b/src/tools/my_cpuid.c
@@ -470,10 +470,12 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
 }
 
 uint32_t helper_getcpu(x64emu_t* emu) {
-    #ifndef ANDROID
+    #if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && !defined(ANDROID)
+    #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 28)
     uint32_t cpu, node;
     if(!getcpu(&cpu, &node))
         return (node&0xff)<<12 | (cpu&0xff);
     #endif
+    #endif
     return 0;
 }
\ No newline at end of file