summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-10-28 14:16:13 +0000
committerDmitry Vyukov <dvyukov@google.com>2016-10-28 14:16:13 +0000
commit7e6f8db7aa604df47ddb0943b72a031be7e9b225 (patch)
tree0446e4d0408c6a56c86fbe1e38ec6ba7bd49b081
parentd9189891fc8fb21b9513aaf1f56cae0c75e33bd8 (diff)
downloadbcm5719-llvm-7e6f8db7aa604df47ddb0943b72a031be7e9b225.tar.gz
bcm5719-llvm-7e6f8db7aa604df47ddb0943b72a031be7e9b225.zip
tsan: fix windows build
Currently fails with: C:\workdir\compiler-rt\lib\tsan\go>gcc -c -o race_windows_amd64.syso gotsan.cc -I..\rtl -I..\.. -I..\..\sanitizer_common -I..\..\..\include -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO -Wno-error=at tributes -Wno-attributes -Wno-format -Wno-maybe-uninitialized -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer -std=c++11 gotsan.cc:9229:0: warning: ignoring #pragma comment [-Wunknown-pragmas] #pragma comment(linker, "/alternatename:__sanitizer_print_memory_profile=__sanitizer_default_print_memory_profile") // NOLINT ^ gotsan.cc: In function 'void __sanitizer_print_memory_profile(int)': gotsan.cc:9226:17: error: redefinition of 'void __sanitizer_print_memory_profile(int)' extern "C" void __sanitizer_print_memory_profile(int top_percent) {} ^ gotsan.cc:6898:6: note: 'void __sanitizer_print_memory_profile(int)' previously defined here void __sanitizer_print_memory_profile(int top_percent) { Remove __sanitizer_print_memory_profile from Go build, it is not needed. llvm-svn: 285400
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common.cc2
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc2
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_win.cc2
3 files changed, 5 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
index 24c8a1727ad..70ee481ca10 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
@@ -489,7 +489,7 @@ int __sanitizer_install_malloc_and_free_hooks(void (*malloc_hook)(const void *,
return InstallMallocFreeHooks(malloc_hook, free_hook);
}
-#if !SANITIZER_SUPPORTS_WEAK_HOOKS
+#if !SANITIZER_GO && !SANITIZER_SUPPORTS_WEAK_HOOKS
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
void __sanitizer_print_memory_profile(int top_percent) {
(void)top_percent;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
index 94ef2ee07e9..288ca9556dc 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
@@ -76,6 +76,7 @@ void SetAllocatorReleaseToOSCallback(AllocatorReleaseToOSCallback Callback) {
ReleseCallback = Callback;
}
+#if SANITIZER_LINUX && !SANITIZER_GO
void BackgroundThread(void *arg) {
uptr hard_rss_limit_mb = common_flags()->hard_rss_limit_mb;
uptr soft_rss_limit_mb = common_flags()->soft_rss_limit_mb;
@@ -135,6 +136,7 @@ void BackgroundThread(void *arg) {
}
}
}
+#endif
void WriteToSyslog(const char *msg) {
InternalScopedString msg_copy(kErrorMessageBufferSize);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
index 1fd79231d17..36dc3225015 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
@@ -915,6 +915,7 @@ void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { }
} // namespace __sanitizer
+#if !SANITIZER_GO
// Workaround to implement weak hooks on Windows. COFF doesn't directly support
// weak symbols, but it does support /alternatename, which is similar. If the
// user does not override the hook, we will use this default definition instead
@@ -926,5 +927,6 @@ extern "C" void __sanitizer_print_memory_profile(int top_percent) {}
#else
#pragma comment(linker, "/alternatename:___sanitizer_print_memory_profile=___sanitizer_default_print_memory_profile") // NOLINT
#endif
+#endif
#endif // _WIN32
OpenPOWER on IntegriCloud