[compiler-rt] 5af991d - [tsan] Fix aarch64-*-linux after D86377

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 22:16:10 PST 2021


Author: Fangrui Song
Date: 2021-03-10T22:16:04-08:00
New Revision: 5af991d46497c9473d2a0fd0989aa4ff4e6a0643

URL: https://github.com/llvm/llvm-project/commit/5af991d46497c9473d2a0fd0989aa4ff4e6a0643
DIFF: https://github.com/llvm/llvm-project/commit/5af991d46497c9473d2a0fd0989aa4ff4e6a0643.diff

LOG: [tsan] Fix aarch64-*-linux after D86377

All check-tsan tests fail on aarch64-*-linux because HeapMemEnd() > ShadowBeg()
for the following code path:
```
 #if defined(__aarch64__) && !HAS_48_BIT_ADDRESS_SPACE
   ProtectRange(HeapMemEnd(), ShadowBeg());
```

Restore the behavior before D86377 for aarch64-*-linux.

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
index 8e14a05f5083..73e1d4577c2c 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cpp
@@ -99,7 +99,7 @@ void CheckAndProtect() {
     Die();
   }
 
-#if defined(__aarch64__) && !HAS_48_BIT_ADDRESS_SPACE
+#if defined(__aarch64__) && defined(__APPLE__) && !HAS_48_BIT_ADDRESS_SPACE
   ProtectRange(HeapMemEnd(), ShadowBeg());
   ProtectRange(ShadowEnd(), MetaShadowBeg());
   ProtectRange(MetaShadowEnd(), TraceMemBeg());


        


More information about the llvm-commits mailing list