summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_mac.cc6
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc4
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
index 7297e889eda..2269ff682be 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
@@ -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
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc b/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
index 03bac1e7dcc..e69d6f94b0e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
@@ -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();
OpenPOWER on IntegriCloud