[compiler-rt] 94ba3b6 - [compiler-rt][asan] use full vm range on apple silicon macs

Emily Shi via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 12:12:34 PDT 2021


Author: Emily Shi
Date: 2021-04-19T12:12:26-07:00
New Revision: 94ba3b6e3bb3c9774f7a77c6759f12b3b7cf8690

URL: https://github.com/llvm/llvm-project/commit/94ba3b6e3bb3c9774f7a77c6759f12b3b7cf8690
DIFF: https://github.com/llvm/llvm-project/commit/94ba3b6e3bb3c9774f7a77c6759f12b3b7cf8690.diff

LOG: [compiler-rt][asan] use full vm range on apple silicon macs

We previously shrunk the mmap range size on ios, but those settings got inherited by apple silicon macs.
Don't shrink the vm range on apple silicon Mac since we have access to the full range.

Also don't shrink vm range for iOS simulators because they have the same range as the host OS, not the simulated OS.

rdar://75302812

Reviewed By: delcypher, kubamracek, yln

Differential Revision: https://reviews.llvm.org/D100234

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index bcbb36009eba..2f6458431c89 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -266,8 +266,12 @@
 #define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 38)
 #elif defined(__aarch64__)
 # if SANITIZER_MAC
-// Darwin iOS/ARM64 has a 36-bit VMA, 64GiB VM
-#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 36)
+#  if SANITIZER_OSX || SANITIZER_IOSSIM
+#   define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
+#  else
+    // Darwin iOS/ARM64 has a 36-bit VMA, 64GiB VM
+#   define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 36)
+#  endif
 # else
 #  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 48)
 # endif


        


More information about the llvm-commits mailing list