[llvm-branch-commits] [compiler-rt] 90b8fd6 - scudo: Fix compilation for non-Linux aarch64

Roland McGrath via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 5 13:26:09 PST 2021


Author: Roland McGrath
Date: 2021-01-05T13:21:52-08:00
New Revision: 90b8fd6136078127f5b792ec64745e5ae54a12a4

URL: https://github.com/llvm/llvm-project/commit/90b8fd6136078127f5b792ec64745e5ae54a12a4
DIFF: https://github.com/llvm/llvm-project/commit/90b8fd6136078127f5b792ec64745e5ae54a12a4.diff

LOG: scudo: Fix compilation for non-Linux aarch64

Linux-specific aarch64 code was deconditionalized in commit
dfa40840e0e2fa094c5d3f441affe0785cdc8d09.  This broke builds for
non-Linux aarch64 platforms.

Reviewed By: cryptoad

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

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/memtag.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/memtag.h b/compiler-rt/lib/scudo/standalone/memtag.h
index d848e3a0b6c9..b1b62065ed72 100644
--- a/compiler-rt/lib/scudo/standalone/memtag.h
+++ b/compiler-rt/lib/scudo/standalone/memtag.h
@@ -52,6 +52,8 @@ inline uint8_t extractTag(uptr Ptr) {
 
 #if defined(__aarch64__)
 
+#if SCUDO_LINUX
+
 inline bool systemSupportsMemoryTagging() {
 #ifndef HWCAP2_MTE
 #define HWCAP2_MTE (1 << 18)
@@ -77,6 +79,14 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() {
           PR_MTE_TCF_MASK) != PR_MTE_TCF_NONE;
 }
 
+#else // !SCUDO_LINUX
+
+inline bool systemSupportsMemoryTagging() { return false; }
+
+inline bool systemDetectsMemoryTagFaultsTestOnly() { return false; }
+
+#endif // SCUDO_LINUX
+
 inline void disableMemoryTagChecksTestOnly() {
   __asm__ __volatile__(".arch_extension mte; msr tco, #1");
 }


        


More information about the llvm-branch-commits mailing list