[libc-commits] [libc] [libc] Change LIBC_THREAD_LOCAL to be dependent on LIBC_THREAD_MODE (PR #151527)
William Huynh via libc-commits
libc-commits at lists.llvm.org
Thu Jul 31 07:29:01 PDT 2025
https://github.com/saturn691 created https://github.com/llvm/llvm-project/pull/151527
This allows baremetal builds to avoid using thread_local. However, libcxx may be affected by this.
>From ddc1e5ce1b733117518ed77ded4ccc4e1007a737 Mon Sep 17 00:00:00 2001
From: William Huynh <William.Huynh at arm.com>
Date: Thu, 31 Jul 2025 15:26:33 +0100
Subject: [PATCH] [libc] Change LIBC_THREAD_LOCAL to be dependent on
LIBC_THREAD_MODE
This allows baremetal builds to avoid using thread_local. However,
libcxx may be affected by this.
---
libc/src/__support/macros/attributes.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/__support/macros/attributes.h b/libc/src/__support/macros/attributes.h
index c6474673de85a..23f973827b6f9 100644
--- a/libc/src/__support/macros/attributes.h
+++ b/libc/src/__support/macros/attributes.h
@@ -28,7 +28,7 @@
#define LIBC_INLINE_ASM __asm__ __volatile__
#define LIBC_UNUSED __attribute__((unused))
-#ifdef LIBC_TARGET_ARCH_IS_GPU
+#if LIBC_THREAD_MODE == LIBC_THREAD_MODE_SINGLE
#define LIBC_THREAD_LOCAL
#else
#define LIBC_THREAD_LOCAL thread_local
More information about the libc-commits
mailing list