Index: lib/tsan/rtl/tsan_platform_linux.cc =================================================================== --- lib/tsan/rtl/tsan_platform_linux.cc +++ lib/tsan/rtl/tsan_platform_linux.cc @@ -36,7 +36,9 @@ #include #include #include +#if SANITIZER_LINUX #include +#endif #include #include #include @@ -292,7 +294,7 @@ SetAddressSpaceUnlimited(); reexec = true; } -#if defined(__aarch64__) +#if SANITIZER_LINUX && defined(__aarch64__) // After patch "arm64: mm: support ARCH_MMAP_RND_BITS." is introduced in // linux kernel, the random gap between stack and mapped area is increased // from 128M to 36G on 39-bit aarch64. As it is almost impossible to cover