[PATCH] D86377: [tsan] Use large address space mapping on Apple Silicon Macs

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 08:18:52 PDT 2020


kubamracek updated this revision to Diff 287674.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86377/new/

https://reviews.llvm.org/D86377

Files:
  compiler-rt/lib/tsan/rtl/tsan_platform.h
  compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp


Index: compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
===================================================================
--- compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
+++ compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
@@ -99,7 +99,7 @@
     Die();
   }
 
-#if defined(__aarch64__) && defined(__APPLE__)
+#if defined(__aarch64__) && !HAS_48_BIT_ADDRESS_SPACE
   ProtectRange(HeapMemEnd(), ShadowBeg());
   ProtectRange(ShadowEnd(), MetaShadowBeg());
   ProtectRange(MetaShadowEnd(), TraceMemBeg());
Index: compiler-rt/lib/tsan/rtl/tsan_platform.h
===================================================================
--- compiler-rt/lib/tsan/rtl/tsan_platform.h
+++ compiler-rt/lib/tsan/rtl/tsan_platform.h
@@ -26,6 +26,18 @@
 #if !SANITIZER_GO
 
 #if defined(__x86_64__)
+#define HAS_48_BIT_ADDRESS_SPACE 1
+#elif SANITIZER_IOSSIM // arm64 iOS simulators (order of #if matters)
+#define HAS_48_BIT_ADDRESS_SPACE 1
+#elif SANITIZER_IOS // arm64 iOS devices (order of #if matters)
+#define HAS_48_BIT_ADDRESS_SPACE 0
+#elif SANITIZER_MAC // arm64 macOS (order of #if matters)
+#define HAS_48_BIT_ADDRESS_SPACE 1
+#else
+#define HAS_48_BIT_ADDRESS_SPACE 0
+#endif
+
+#if HAS_48_BIT_ADDRESS_SPACE
 /*
 C/C++ on linux/x86_64 and freebsd/x86_64
 0000 0000 1000 - 0080 0000 0000: main binary and/or MAP_32BIT mappings (512GB)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86377.287674.patch
Type: text/x-patch
Size: 1329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200825/b968cde1/attachment.bin>


More information about the llvm-commits mailing list