[compiler-rt] r204232 - tsan: use attribute instead of compiler flag for tls-model=initial-exec as asked in comments for r203111
Dmitry Vyukov
dvyukov at google.com
Wed Mar 19 06:24:52 PDT 2014
Author: dvyukov
Date: Wed Mar 19 08:24:52 2014
New Revision: 204232
URL: http://llvm.org/viewvc/llvm-project?rev=204232&view=rev
Log:
tsan: use attribute instead of compiler flag for tls-model=initial-exec as asked in comments for r203111
Modified:
compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt?rev=204232&r1=204231&r2=204232&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt Wed Mar 19 08:24:52 2014
@@ -4,7 +4,6 @@ include_directories(../..)
set(DD_CFLAGS ${SANITIZER_COMMON_CFLAGS})
append_no_rtti_flag(DD_CFLAGS)
-list(APPEND DD_CFLAGS -ftls-model=initial-exec)
if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
set(DD_COMMON_DEFINITIONS DEBUG=0)
Modified: compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc?rev=204232&r1=204231&r2=204232&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc Wed Mar 19 08:24:52 2014
@@ -18,7 +18,9 @@ using namespace __dsan;
extern "C" void *__libc_malloc(uptr size);
extern "C" void __libc_free(void *ptr);
+__attribute__((tls_model("initial-exec")))
static __thread Thread *thr;
+__attribute__((tls_model("initial-exec")))
static __thread volatile int initing;
static bool inited;
static uptr g_data_start;
More information about the llvm-commits
mailing list