Module Name: src Committed By: kamil Date: Fri May 29 00:05:26 UTC 2020
Modified Files: src/sys/rump: Makefile.rump Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/rump/Makefile.rump Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.127 src/sys/rump/Makefile.rump:1.128 --- src/sys/rump/Makefile.rump:1.127 Mon Mar 9 14:45:41 2020 +++ src/sys/rump/Makefile.rump Fri May 29 00:05:26 2020 @@ -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 @@ CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/li # 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*)