[sanitizer] Fix darwin Go tsan build by unifying r281567 and r281553.

Avoid redefining the weak stub when building gotsan.cc

llvm-svn: 281576
This commit is contained in:
Ahmed Bougacha 2016-09-15 04:28:20 +00:00
parent 3076cc398d
commit 546d2a3820
3 changed files with 7 additions and 10 deletions

View File

@ -488,4 +488,11 @@ int __sanitizer_install_malloc_and_free_hooks(void (*malloc_hook)(const void *,
void (*free_hook)(const void *)) {
return InstallMallocFreeHooks(malloc_hook, free_hook);
}
#if !SANITIZER_SUPPORTS_WEAK_HOOKS
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
void __sanitizer_print_memory_profile(int top_percent) {
(void)top_percent;
}
#endif
} // extern "C"

View File

@ -747,12 +747,4 @@ void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { }
} // namespace __sanitizer
extern "C" {
// Provide a definition on mac, where 'weak' symbols don't behave like on linux.
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
void __sanitizer_print_memory_profile(int top_percent) {
(void)top_percent;
}
} // extern "C"
#endif // SANITIZER_MAC

View File

@ -42,8 +42,6 @@ extern "C" void __tsan_resume() {
__tsan_resumed = 1;
}
extern "C" void __sanitizer_print_memory_profile(int percent) {} // Stub.
namespace __tsan {
#if !defined(SANITIZER_GO) && !SANITIZER_MAC