Source-Changes-HG archive

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

[src/trunk]: src/sys/rump Set -fno-delete-null-pointer-checks for RUMP/MKSANI...



details:   https://anonhg.NetBSD.org/src/rev/5a34f95b882d
branches:  trunk
changeset: 933710:5a34f95b882d
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri May 29 00:05:26 2020 +0000

description:
Set -fno-delete-null-pointer-checks for RUMP/MKSANITIZER with Clang

NULL + 0 arithmetic raises LLVM UBSan warnings, specially in sys/pslist.h
in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER.

Proposes on <tech-userlevel> without objections.

diffstat:

 sys/rump/Makefile.rump |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r ed5a6bbb3ce2 -r 5a34f95b882d sys/rump/Makefile.rump
--- a/sys/rump/Makefile.rump    Thu May 28 23:25:17 2020 +0000
+++ b/sys/rump/Makefile.rump    Fri May 29 00:05:26 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rump,v 1.127 2020/03/09 14:45:41 kamil Exp $
+#      $NetBSD: Makefile.rump,v 1.128 2020/05/29 00:05:26 kamil Exp $
 #
 
 .if !defined(_RUMP_MK)
@@ -24,6 +24,12 @@
 # aborts after kern_assert on NULL pointer checks.
 CFLAGS+=    ${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :}
 
+# NULL + 0 arithmetic raises LLVM UBSan warnings, specially in sys/pslist.h
+# in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER.
+.if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes"
+CFLAGS+=    ${${ACTIVE_CC} == "clang":? -fno-delete-null-pointer-checks :}
+.endif
+
 # Define baseline cpu for mips ports, required for
 # rumpcomp_sync_icache() hypercall.
 .if !empty(MACHINE_ARCH:Mmips*)



Home | Main Index | Thread Index | Old Index