[compiler-rt] r252922 - tsan: fix windows Go build
Dmitry Vyukov via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 10:50:19 PST 2015
Author: dvyukov
Date: Thu Nov 12 12:50:19 2015
New Revision: 252922
URL: http://llvm.org/viewvc/llvm-project?rev=252922&view=rev
Log:
tsan: fix windows Go build
Go build does not link in whatever library provides these symbols:
# runtime/race
race_windows_amd64.syso:gotsan.cc:(.text+0x578f): undefined reference to `__sanitizer::DumpProcessMap()'
race_windows_amd64.syso:gotsan.cc:(.text+0xee33): undefined reference to `EnumProcessModules'
race_windows_amd64.syso:gotsan.cc:(.text+0xeeb9): undefined reference to `GetModuleInformation'
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=252922&r1=252921&r2=252922&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Thu Nov 12 12:50:19 2015
@@ -176,7 +176,9 @@ void NORETURN ReportMmapFailureAndDie(up
Report("ERROR: %s failed to "
"%s 0x%zx (%zd) bytes of %s (error code: %d)\n",
SanitizerToolName, mmap_type, size, size, mem_type, err);
+#ifndef SANITIZER_GO
DumpProcessMap();
+#endif
UNREACHABLE("unable to mmap");
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=252922&r1=252921&r2=252922&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Thu Nov 12 12:50:19 2015
@@ -368,6 +368,7 @@ static uptr GetPreferredBase(const char
return (uptr)pe_header->ImageBase;
}
+#ifndef SANITIZER_GO
uptr GetListOfModules(LoadedModule *modules, uptr max_modules,
string_predicate_t filter) {
HANDLE cur_process = GetCurrentProcess();
@@ -436,7 +437,6 @@ uptr GetListOfModules(LoadedModule *modu
return count;
};
-#ifndef SANITIZER_GO
// We can't use atexit() directly at __asan_init time as the CRT is not fully
// initialized at this point. Place the functions into a vector and use
// atexit() as soon as it is ready for use (i.e. after .CRT$XIC initializers).
More information about the llvm-commits
mailing list