summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread.h')
-rw-r--r--src/corelib/thread/qthread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index caa91b100f..49224c81e6 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -182,12 +182,12 @@ inline Qt::HANDLE QThread::currentThreadId() noexcept
Qt::HANDLE tid; // typedef to void*
static_assert(sizeof(tid) == sizeof(void*));
// See https://akkadia.org/drepper/tls.pdf for x86 ABI
-#if defined(Q_PROCESSOR_X86_32) && defined(Q_OS_LINUX) // x86 32-bit always uses GS
+#if defined(Q_PROCESSOR_X86_32) && defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) // x86 32-bit always uses GS
__asm__("movl %%gs:0, %0" : "=r" (tid) : : );
#elif defined(Q_PROCESSOR_X86_64) && defined(Q_OS_DARWIN64)
// 64bit macOS uses GS, see https://github.com/apple/darwin-xnu/blob/master/libsyscall/os/tsd.h
__asm__("movq %%gs:0, %0" : "=r" (tid) : : );
-#elif defined(Q_PROCESSOR_X86_64) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD))
+#elif defined(Q_PROCESSOR_X86_64) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)) && !defined(Q_OS_ANDROID)
// x86_64 Linux, BSD uses FS
__asm__("movq %%fs:0, %0" : "=r" (tid) : : );
#else