Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102016896
D47193.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47193.diff
View Options
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -712,21 +712,33 @@
* GCC has the nosanitize attribute, but as a function attribute only, and
* warns on use as a variable attribute.
*/
-#if __has_attribute(no_sanitize) && defined(__clang__)
+#if __has_feature(address_sanitizer) && defined(__clang__)
#ifdef _KERNEL
-#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address")))
-#define __nosanitizememory __attribute__((no_sanitize("kernel-memory")))
+#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address")))
#else
-#define __nosanitizeaddress __attribute__((no_sanitize("address")))
-#define __nosanitizememory __attribute__((no_sanitize("memory")))
+#define __nosanitizeaddress __attribute__((no_sanitize("address")))
#endif
-#define __nosanitizecoverage __attribute__((no_sanitize("coverage")))
-#define __nosanitizethread __attribute__((no_sanitize("thread")))
#else
-#define __nosanitizeaddress
-#define __nosanitizecoverage
-#define __nosanitizememory
-#define __nosanitizethread
+#define __nosanitizeaddress
+#endif
+#if __has_feature(coverage_sanitizer) && defined(__clang__)
+#define __nosanitizecoverage __attribute__((no_sanitize("coverage")))
+#else
+#define __nosanitizecoverage
+#endif
+#if __has_feature(memory_sanitizer) && defined(__clang__)
+#ifdef _KERNEL
+#define __nosanitizememory __attribute__((no_sanitize("kernel-memory")))
+#else
+#define __nosanitizememory __attribute__((no_sanitize("memory")))
+#endif
+#else
+#define __nosanitizememory
+#endif
+#if __has_feature(thread_sanitizer) && defined(__clang__)
+#define __nosanitizethread __attribute__((no_sanitize("thread")))
+#else
+#define __nosanitizethread
#endif
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 2:30 PM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14277356
Default Alt Text
D47193.diff (1 KB)
Attached To
Mode
D47193: cdefs: Use __has_feature to gate the definition of __nosanitize*
Attached
Detach File
Event Timeline
Log In to Comment