[compiler-rt] db4c258 - [scudo] Check if we use __clang_major__ >= 12

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 17:48:57 PDT 2021


Author: Vitaly Buka
Date: 2021-07-09T17:48:44-07:00
New Revision: db4c25822a1d9458f961eeb6cecf8a7bbce05b13

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

LOG: [scudo] Check if we use __clang_major__ >= 12

This makes sure we have support for MTE instructions.
Later the check can be extended to support MTE on other compilers.

Reviewed By: pcc

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

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 0c47f67a57416..cd8d95a3f7563 100644
--- a/compiler-rt/lib/scudo/standalone/memtag.h
+++ b/compiler-rt/lib/scudo/standalone/memtag.h
@@ -18,7 +18,7 @@
 
 namespace scudo {
 
-#if defined(__aarch64__) || defined(SCUDO_FUZZ)
+#if (__clang_major__ >= 12 && defined(__aarch64__)) || defined(SCUDO_FUZZ)
 
 // We assume that Top-Byte Ignore is enabled if the architecture supports memory
 // tagging. Not all operating systems enable TBI, so we only claim architectural
@@ -55,7 +55,7 @@ inline uint8_t extractTag(uptr Ptr) {
 
 #endif
 
-#if defined(__aarch64__)
+#if __clang_major__ >= 12 && defined(__aarch64__)
 
 #if SCUDO_LINUX
 


        


More information about the llvm-commits mailing list