Allow to set sanitizer flags for the rump build from the

build.sh command line, like: -V RUMP_SANITIZE=address
This commit is contained in:
martin 2021-07-07 11:51:45 +00:00
parent d66b04778c
commit 5c18a11ba1
9 changed files with 45 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.rump,v 1.132 2021/04/25 15:16:56 christos Exp $ # $NetBSD: Makefile.rump,v 1.133 2021/07/07 11:51:45 martin Exp $
# #
.if !defined(_RUMP_MK) .if !defined(_RUMP_MK)
@ -24,6 +24,11 @@ CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern
# aborts after kern_assert on NULL pointer checks. # aborts after kern_assert on NULL pointer checks.
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :} CFLAGS+= ${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :}
.if ${RUMP_SANITIZE:Uno} != "no"
CFLAGS+= -fsanitize=${RUMP_SANITIZE}
LDFLAGS+= -fsanitize=${RUMP_SANITIZE}
.endif
# NULL + 0 arithmetic raises LLVM UBSan warnings, specially in sys/pslist.h # NULL + 0 arithmetic raises LLVM UBSan warnings, specially in sys/pslist.h
# in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER. # in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER.
.if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes" .if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes"

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.9 2020/05/17 18:52:43 christos Exp $ # $NetBSD: Makefile.inc,v 1.10 2021/07/07 11:51:45 martin Exp $
WARNS ?= 4 WARNS ?= 4
CWARNFLAGS+= -Wno-missing-noreturn CWARNFLAGS+= -Wno-missing-noreturn
TOOLSSRCDIR:= ${.PARSEDIR} TOOLSSRCDIR:= ${.PARSEDIR}
@ -9,3 +9,6 @@ LIBRUMPFIFO_PRE = -lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet
LIBRUMPFIFO = -lrumpvfs_nofifofs LIBRUMPFIFO = -lrumpvfs_nofifofs
LIBRUMPBASE = ${LIBRUMPFIFO_PRE} -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrumpuser -lrump -lpthread LIBRUMPBASE = ${LIBRUMPFIFO_PRE} -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrumpuser -lrump -lpthread
.if ${RUMP_SANITIZE:Uno} != "no"
LIBRUMPBASE+= -fsanitize=${RUMP_SANITIZE}
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2020/05/26 18:52:29 christos Exp $ # $NetBSD: Makefile,v 1.13 2021/07/07 11:51:45 martin Exp $
# #
.include <bsd.init.mk> .include <bsd.init.mk>
@ -25,6 +25,10 @@ LDADD+= \
LDADD+= -lrumpuser -lpthread LDADD+= -lrumpuser -lpthread
DPADD+= ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} DPADD+= ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
WARNS= 4 WARNS= 4
# To include a rump version of sysctlbyname() # To include a rump version of sysctlbyname()

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.13 2020/05/17 19:37:15 christos Exp $ # $NetBSD: Makefile,v 1.14 2021/07/07 11:51:45 martin Exp $
# #
PROG= rump_allserver PROG= rump_allserver
@ -14,4 +14,8 @@ RUMPTOP=${.CURDIR}/../../sys/rump
LDADD+= ${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD} LDADD+= ${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD}
LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpthread LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpthread
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2017/05/11 13:20:02 sevan Exp $ # $NetBSD: Makefile,v 1.4 2021/07/07 11:51:46 martin Exp $
# #
PROG= rump.dhcpclient PROG= rump.dhcpclient
@ -6,4 +6,8 @@ SRCS= main.c bpf.c common.c configure.c dhcp.c if-bsd.c net.c
LDADD+= -lrumpclient LDADD+= -lrumpclient
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2017/05/11 13:20:02 sevan Exp $ # $NetBSD: Makefile,v 1.4 2021/07/07 11:51:46 martin Exp $
# #
PROG= rump.halt PROG= rump.halt
@ -6,4 +6,8 @@ PROG= rump.halt
LDADD+= -lrumpclient LDADD+= -lrumpclient
DPADD+= ${RUMPCLIENT} DPADD+= ${RUMPCLIENT}
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.14 2020/05/16 12:46:57 christos Exp $ # $NetBSD: Makefile,v 1.15 2021/07/07 11:51:46 martin Exp $
# #
.PATH: ${.CURDIR}/../rump_allserver .PATH: ${.CURDIR}/../rump_allserver
@ -13,4 +13,8 @@ LDADD+= \
-Wl,--no-whole-archive -Wl,--no-whole-archive
LDADD+= -lpthread LDADD+= -lpthread
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.13 2020/05/16 12:42:11 christos Exp $ # $NetBSD: Makefile,v 1.14 2021/07/07 11:51:46 martin Exp $
# #
# Public Domain # Public Domain
# #
@ -20,6 +20,10 @@ LDADD+= -L${LIBNPFTEST} -lnpftest
LDADD+= -lrump -lrumpvfs_nofifofs -lrumpvfs -lrumpuser LDADD+= -lrump -lrumpvfs_nofifofs -lrumpvfs -lrumpuser
LDADD+= -lrumpnet -lrumpnet_net -lrumpdev_bpf LDADD+= -lrumpnet -lrumpnet_net -lrumpdev_bpf
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
.include <bsd.own.mk> .include <bsd.own.mk>
.if ${MKSLJIT} != "no" .if ${MKSLJIT} != "no"

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.17 2020/05/17 18:59:02 christos Exp $ # $NetBSD: Makefile.inc,v 1.18 2021/07/07 11:51:46 martin Exp $
WARNS?= 4 WARNS?= 4
@ -46,6 +46,10 @@ LDADD+= -lrumpdev_disk -lrumpdev
LDADD+= -lp2k -lukfs -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpuffs -lutil LDADD+= -lp2k -lukfs -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpuffs -lutil
LDADD+= -lpthread LDADD+= -lpthread
.if ${RUMP_SANITIZE:Uno} != "no"
LDADD+= -fsanitize=${RUMP_SANITIZE}
.endif
DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}
DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD} DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD}
.endif # ISRUMP .endif # ISRUMP