From fee9285d68e238686bcc0eca1a3d89a54f61d7cf Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 18 Aug 2026 22:34:01 +0200 Subject: [PATCH] Use the compiler builtin for the ARM thread id. The mrc to c13/c0/3 (thread id register) is undefined on ARMv5 (e.g. ARM926EJ-S) and SIGILL'd during init. __builtin_thread_pointer lowers to the same mrc on targets with a thread pointer register and to __aeabi_read_tp on soft-TLS targets. --- public/client/tracy_rpmalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/client/tracy_rpmalloc.cpp b/public/client/tracy_rpmalloc.cpp index c43b8cab..60042106 100644 --- a/public/client/tracy_rpmalloc.cpp +++ b/public/client/tracy_rpmalloc.cpp @@ -743,7 +743,7 @@ get_thread_id(void) { __asm__("movq %%fs:0, %0" : "=r" (tid) : : ); # endif # elif defined(__arm__) - __asm__ volatile ("mrc p15, 0, %0, c13, c0, 3" : "=r" (tid)); + tid = (uintptr_t)__builtin_thread_pointer(); # elif defined(__aarch64__) # if defined(__MACH__) // tpidr_el0 likely unused, always return 0 on iOS