diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -59,6 +59,11 @@ #if defined(__APPLE__) # define SANITIZER_MAC 1 # include +#if TARGET_OS_OSX +#define SANITIZER_OSX 1 +#else +#define SANITIZER_OSX 0 +#endif # if TARGET_OS_IPHONE # define SANITIZER_IOS 1 # else @@ -73,6 +78,7 @@ # define SANITIZER_MAC 0 # define SANITIZER_IOS 0 # define SANITIZER_IOSSIM 0 +#define SANITIZER_OSX 0 #endif #if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_WATCH @@ -259,7 +265,7 @@ #elif SANITIZER_RISCV64 #define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 38) #elif defined(__aarch64__) -# if SANITIZER_MAC +#if SANITIZER_MAC && !SANITIZER_OSX // Darwin iOS/ARM64 has a 36-bit VMA, 64GiB VM # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 36) # else