From 6a135be19fa0cc594fd61f9caf3c0be2b7f1466e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 14 Oct 2013 06:31:03 +0000 Subject: tsan: allow to override OnFinalize() in front-ends that does not support weak functions (Go) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192569 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/tsan/rtl/tsan_rtl.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc index 9ecfd590..1ce99172 100644 --- a/lib/tsan/rtl/tsan_rtl.cc +++ b/lib/tsan/rtl/tsan_rtl.cc @@ -39,9 +39,13 @@ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64); static char ctx_placeholder[sizeof(Context)] ALIGNED(64); // Can be overriden by a front-end. -bool CPP_WEAK OnFinalize(bool failed) { +#ifdef TSAN_EXTERNAL_HOOKS +bool OnFinalize(bool failed); +#else +bool WEAK OnFinalize(bool failed) { return failed; } +#endif static Context *ctx; Context *CTX() { -- cgit v1.2.3