summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-04-27 12:56:16 +0000
committerDmitry Vyukov <dvyukov@google.com>2016-04-27 12:56:16 +0000
commitcd91beb57373b973766b42fb3759ee533c1eca9d (patch)
tree17e7694476c1da711f59e5b9570d7a8a3cc5efc1 /lib
parentdabf0d61b1a6a304664b6738c3fac687c48ca2e6 (diff)
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). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_mac.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_mac.cc b/lib/sanitizer_common/sanitizer_mac.cc
index 5fbb14729..5036dd2a9 100644
--- a/lib/sanitizer_common/sanitizer_mac.cc
+++ b/lib/sanitizer_common/sanitizer_mac.cc
@@ -450,11 +450,15 @@ void *internal_start_thread(void(*func)(void *arg), void *arg) {
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, uptr *sp, uptr *bp) {
# 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();