From aa8fa60ba8c43b833e3fcec54da22a0e18bb04c6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 1 Sep 2014 11:44:59 +0000 Subject: [PATCH] tsan: unbreak windows build Currently it fails with: # Testing race detector. race_windows_amd64.syso:gotsan.cc:(.text+0x4d89): undefined reference to `__imp_SymGetModuleBase64' race_windows_amd64.syso:gotsan.cc:(.text+0x4d90): undefined reference to `__imp_SymFunctionTableAccess64' race_windows_amd64.syso:gotsan.cc:(.text+0x4dd8): undefined reference to `__imp_StackWalk64' x86_64-w64-mingw32/bin/ld.exe: race_windows_amd64.syso : bad reloc address 0x10 in section `.data' collect2.exe: error: ld returned 1 exit status llvm-svn: 216875 --- compiler-rt/lib/sanitizer_common/sanitizer_win.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc index e1aa788841f9..9d578fe2c99d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc @@ -65,6 +65,7 @@ uptr GetThreadSelf() { return GetTid(); } +#if !SANITIZER_GO void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, uptr *stack_bottom) { CHECK(stack_top); @@ -77,6 +78,7 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, *stack_top = (uptr)mbi.BaseAddress + mbi.RegionSize; *stack_bottom = (uptr)mbi.AllocationBase; } +#endif // #if !SANITIZER_GO void *MmapOrDie(uptr size, const char *mem_type) { void *rv = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); @@ -441,6 +443,7 @@ void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, #endif } +#if !SANITIZER_GO void StackTrace::SlowUnwindStack(uptr pc, uptr max_depth) { CHECK_GE(max_depth, 2); // FIXME: CaptureStackBackTrace might be too slow for us. @@ -483,6 +486,7 @@ void StackTrace::SlowUnwindStackWithContext(uptr pc, void *context, trace[size++] = (uptr)stack_frame.AddrPC.Offset; } } +#endif // #if !SANITIZER_GO void MaybeOpenReportFile() { // Windows doesn't have native fork, and we don't support Cygwin or other