diff options
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_defs.h | 3 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_defs.h b/compiler-rt/lib/tsan/rtl/tsan_defs.h index e0c04733f0a..125458afd11 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_defs.h +++ b/compiler-rt/lib/tsan/rtl/tsan_defs.h @@ -28,10 +28,13 @@ namespace __tsan { const bool kGoMode = true; const bool kCppMode = false; const char *const kTsanOptionsEnv = "GORACE"; +#define CPP_WEAK WEAK #else const bool kGoMode = false; const bool kCppMode = true; const char *const kTsanOptionsEnv = "TSAN_OPTIONS"; +// Go linker does not support weak symbols. +#define CPP_WEAK #endif const int kTidBits = 13; diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 0c520305e62..d81f44254d3 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -38,11 +38,9 @@ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64); static char ctx_placeholder[sizeof(Context)] ALIGNED(64); // Can be overriden by a front-end. -#ifndef TSAN_GO -bool WEAK OnFinalize(bool failed) { +bool CPP_WEAK OnFinalize(bool failed) { return failed; } -#endif static Context *ctx; Context *CTX() { @@ -284,9 +282,7 @@ int Finalize(ThreadState *thr) { ctx->nmissed_expected); } -#ifndef TSAN_GO failed = OnFinalize(failed); -#endif StatAggregate(ctx->stat, thr->stat); StatOutput(ctx->stat); |