From 387c64b74c9e91f96c3dfa26bf90a74a689c5dc5 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 17 Jun 2024 16:02:26 +0200 Subject: Fixed usage of getcpu, only enablign that for recent enough glibc (should help #1586) --- src/tools/my_cpuid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit 1.4.1