From 339a92a7b250c94f03fc7289ca9058789e50c000 Mon Sep 17 00:00:00 2001 From: Trout Zhang Date: Fri, 15 Nov 2024 18:22:35 +0200 Subject: [PATCH] Fix crash on Android due to wrong TLS model --- public/client/tracy_rpmalloc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/client/tracy_rpmalloc.cpp b/public/client/tracy_rpmalloc.cpp index 4a0d0b40..315a40f9 100644 --- a/public/client/tracy_rpmalloc.cpp +++ b/public/client/tracy_rpmalloc.cpp @@ -690,7 +690,9 @@ static pthread_key_t _memory_thread_heap; # define _Thread_local __declspec(thread) # define TLS_MODEL # else -# ifndef __HAIKU__ +# if defined(__ANDROID__) && __ANDROID_API__ >= 29 && defined(__NDK_MAJOR__) && __NDK_MAJOR__ >= 26 +# define TLS_MODEL __attribute__((tls_model("local-dynamic"))) +# elif !defined(__HAIKU__) # define TLS_MODEL __attribute__((tls_model("initial-exec"))) # else # define TLS_MODEL