Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Define __noubsan in sys/cdefs.h for KERNEL sanitization



details:   https://anonhg.NetBSD.org/src/rev/dbae62832b46
branches:  trunk
changeset: 463982:dbae62832b46
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Sep 18 15:06:03 2019 +0000

description:
Define __noubsan in sys/cdefs.h for KERNEL sanitization

diffstat:

 sys/sys/cdefs.h |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 523fb241291d -r dbae62832b46 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Wed Sep 18 14:07:38 2019 +0000
+++ b/sys/sys/cdefs.h   Wed Sep 18 15:06:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.143 2019/09/15 15:18:45 kamil Exp $        */
+/*     $NetBSD: cdefs.h,v 1.144 2019/09/18 15:06:03 kamil Exp $        */
 
 /* * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -331,6 +331,14 @@
 #else
 #define        __noasan        /* nothing */
 #endif
+
+#if defined(__clang__)
+#define __noubsan      __attribute__((no_sanitize("undefined")))
+#elif __GNUC_PREREQ__(4, 9)
+#define __noubsan      __attribute__((no_sanitize_undefined))
+#else
+#define __noubsan      /* nothing */
+#endif
 #endif
 
 #if defined(__COVERITY__) ||                                           \



Home | Main Index | Thread Index | Old Index