From 8b2ddfeb0b65a4682a3db108a347f160591bb68c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 22 Nov 2016 08:59:17 +0000 Subject: [PATCH] tsan: mark cur_thread_placeholder definition as initial-exec See https://sourceware.org/bugzilla/show_bug.cgi?id=20805 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294 for context. Previously we marked only declaration as initial-exec. But compilers treat initial-exec attribute somewhat differently. Mark definition as well. llvm-svn: 287629 --- compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index b341c41..87a1c83 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -45,6 +45,7 @@ extern "C" void __tsan_resume() { namespace __tsan { #if !SANITIZER_GO && !SANITIZER_MAC +__attribute__((tls_model("initial-exec"))) THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64); #endif static char ctx_placeholder[sizeof(Context)] ALIGNED(64); -- 2.7.4