https://github.com/dybv-sc created 
https://github.com/llvm/llvm-project/pull/132241

This is a backport of original commit #97591 to 18.x release.

>From 881b155a6a432cd8caf96076ed8d53bd6ac029fb Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionn...@gmail.com>
Date: Mon, 8 Jul 2024 15:20:21 -0500
Subject: [PATCH] [libc++abi] Use __has_feature check to enable usage of
 thread_local for exception storage (#97591)

Previously, we'd use HAS_THREAD_LOCAL which was never defined. Hence,
we'd basically never use the code path where we use thread_local.

Fixes #78207
---
 libcxxabi/src/cxa_exception_storage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxxabi/src/cxa_exception_storage.cpp 
b/libcxxabi/src/cxa_exception_storage.cpp
index 3a3233a1b9272..83408c904e1f7 100644
--- a/libcxxabi/src/cxa_exception_storage.cpp
+++ b/libcxxabi/src/cxa_exception_storage.cpp
@@ -24,7 +24,7 @@ extern "C" {
 } // extern "C"
 } // namespace __cxxabiv1
 
-#elif defined(HAS_THREAD_LOCAL)
+#elif __has_feature(cxx_thread_local)
 
 namespace __cxxabiv1 {
 namespace {

_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to