diff --git a/sys/rump/Makefile.rump b/sys/rump/Makefile.rump index cdbaef327bc3..066101c04a06 100644 --- a/sys/rump/Makefile.rump +++ b/sys/rump/Makefile.rump @@ -24,6 +24,12 @@ CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern # 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*)