[compiler-rt] r328417 - [sanitizer] Fix Darwin build
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 24 01:13:18 PDT 2018
Author: vitalybuka
Date: Sat Mar 24 01:13:18 2018
New Revision: 328417
URL: http://llvm.org/viewvc/llvm-project?rev=328417&view=rev
Log:
[sanitizer] Fix Darwin build
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_malloc_mac.inc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=328417&r1=328416&r2=328417&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Sat Mar 24 01:13:18 2018
@@ -344,9 +344,9 @@ uptr GetPageSize() {
return sysconf(_SC_PAGESIZE);
}
-extern unsigned malloc_num_zones;
-extern malloc_zone_t **malloc_zones;
-static malloc_zone_t sanitizer_zone;
+extern "C" unsigned malloc_num_zones;
+extern "C" malloc_zone_t **malloc_zones;
+malloc_zone_t sanitizer_zone;
// We need to make sure that sanitizer_zone is registered as malloc_zones[0]. If
// libmalloc tries to set up a different zone as malloc_zones[0], it will call
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_malloc_mac.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_malloc_mac.inc?rev=328417&r1=328416&r2=328417&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_malloc_mac.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_malloc_mac.inc Sat Mar 24 01:13:18 2018
@@ -29,6 +29,10 @@
// Similar code is used in Google Perftools,
// https://github.com/gperftools/gperftools.
+namespace __sanitizer {
+extern malloc_zone_t sanitizer_zone;
+}
+
INTERCEPTOR(malloc_zone_t *, malloc_create_zone,
vm_size_t start_size, unsigned zone_flags) {
COMMON_MALLOC_ENTER();
More information about the llvm-commits
mailing list