]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - include/linux/compiler-clang.h
kcsan: Add Kernel Concurrency Sanitizer infrastructure
[mirror_ubuntu-jammy-kernel.git] / include / linux / compiler-clang.h
index 333a6695a918c3dcea8402c054bb7a6069640cb0..a213eb55e725f686105a4fb93c959d7b2324bcb8 100644 (file)
 #define __no_sanitize_address
 #endif
 
+#if __has_feature(thread_sanitizer)
+/* emulate gcc's __SANITIZE_THREAD__ flag */
+#define __SANITIZE_THREAD__
+#define __no_sanitize_thread \
+               __attribute__((no_sanitize("thread")))
+#else
+#define __no_sanitize_thread
+#endif
+
 /*
  * Not all versions of clang implement the the type-generic versions
  * of the builtin overflow checkers. Fortunately, clang implements