[compiler-rt] r208536 - [tsan] force tls_model='initial-exec' for tsan's cur_thread_placeholder so that we don't depend on the compiler flags

Kostya Serebryany kcc at google.com
Mon May 12 03:40:34 PDT 2014


Author: kcc
Date: Mon May 12 05:40:33 2014
New Revision: 208536

URL: http://llvm.org/viewvc/llvm-project?rev=208536&view=rev
Log:
[tsan] force tls_model='initial-exec' for tsan's cur_thread_placeholder so that we don't depend on the compiler flags

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=208536&r1=208535&r2=208536&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h Mon May 12 05:40:33 2014
@@ -473,6 +473,7 @@ struct ThreadState {
 };
 
 #ifndef TSAN_GO
+__attribute__((tls_model("initial-exec")))
 extern THREADLOCAL char cur_thread_placeholder[];
 INLINE ThreadState *cur_thread() {
   return reinterpret_cast<ThreadState *>(&cur_thread_placeholder);





More information about the llvm-commits mailing list