[compiler-rt] r267709 - tsan: fix darwin Go build

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 05:56:19 PDT 2016


Author: dvyukov
Date: Wed Apr 27 07:56:16 2016
New Revision: 267709

URL: http://llvm.org/viewvc/llvm-project?rev=267709&view=rev
Log:
tsan: fix darwin Go build

Ifdef out global variables with destructors.
This requires runtime support that is not provided by Go runtime
(in particular _dso_handle symbol).


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=267709&r1=267708&r2=267709&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Wed Apr 27 07:56:16 2016
@@ -450,11 +450,15 @@ void *internal_start_thread(void(*func)(
 
 void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); }
 
+#ifndef SANITIZER_GO
 static BlockingMutex syslog_lock(LINKER_INITIALIZED);
+#endif
 
 void WriteOneLineToSyslog(const char *s) {
+#ifndef SANITIZER_GO
   syslog_lock.CheckLocked();
   asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", s);
+#endif
 }
 
 void LogMessageOnPrintf(const char *str) {
@@ -530,6 +534,7 @@ void GetPcSpBp(void *context, uptr *pc,
 # endif
 }
 
+#ifndef SANITIZER_GO
 static const char kDyldInsertLibraries[] = "DYLD_INSERT_LIBRARIES";
 LowLevelAllocator allocator_for_env;
 
@@ -714,6 +719,7 @@ void MaybeReexec() {
   if (new_env_pos == new_env + env_name_len + 1) new_env = NULL;
   LeakyResetEnv(kDyldInsertLibraries, new_env);
 }
+#endif  // SANITIZER_GO
 
 char **GetArgv() {
   return *_NSGetArgv();




More information about the llvm-commits mailing list