Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Allow to set sanitizer flags for the rump build from the
details: https://anonhg.NetBSD.org/src/rev/9566d7102602
branches: trunk
changeset: 1022178:9566d7102602
user: martin <martin%NetBSD.org@localhost>
date: Wed Jul 07 11:51:45 2021 +0000
description:
Allow to set sanitizer flags for the rump build from the
build.sh command line, like: -V RUMP_SANITIZE=address
diffstat:
sys/rump/Makefile.rump | 7 ++++++-
tests/Makefile.inc | 5 ++++-
tests/rump/modautoload/Makefile | 6 +++++-
usr.bin/rump_allserver/Makefile | 6 +++++-
usr.bin/rump_dhcpclient/Makefile | 6 +++++-
usr.bin/rump_halt/Makefile | 6 +++++-
usr.bin/rump_server/Makefile | 6 +++++-
usr.sbin/npf/npftest/Makefile | 6 +++++-
usr.sbin/puffs/Makefile.inc | 6 +++++-
9 files changed, 45 insertions(+), 9 deletions(-)
diffs (169 lines):
diff -r cf9810017777 -r 9566d7102602 sys/rump/Makefile.rump
--- a/sys/rump/Makefile.rump Wed Jul 07 11:06:37 2021 +0000
+++ b/sys/rump/Makefile.rump Wed Jul 07 11:51:45 2021 +0000
@@ -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)
@@ -24,6 +24,11 @@
# aborts after kern_assert on 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
# in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER.
.if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes"
diff -r cf9810017777 -r 9566d7102602 tests/Makefile.inc
--- a/tests/Makefile.inc Wed Jul 07 11:06:37 2021 +0000
+++ b/tests/Makefile.inc Wed Jul 07 11:51:45 2021 +0000
@@ -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
CWARNFLAGS+= -Wno-missing-noreturn
TOOLSSRCDIR:= ${.PARSEDIR}
@@ -9,3 +9,6 @@
LIBRUMPFIFO = -lrumpvfs_nofifofs
LIBRUMPBASE = ${LIBRUMPFIFO_PRE} -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrumpuser -lrump -lpthread
+.if ${RUMP_SANITIZE:Uno} != "no"
+LIBRUMPBASE+= -fsanitize=${RUMP_SANITIZE}
+.endif
diff -r cf9810017777 -r 9566d7102602 tests/rump/modautoload/Makefile
--- a/tests/rump/modautoload/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/tests/rump/modautoload/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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>
@@ -25,6 +25,10 @@
LDADD+= -lrumpuser -lpthread
DPADD+= ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
WARNS= 4
# To include a rump version of sysctlbyname()
diff -r cf9810017777 -r 9566d7102602 usr.bin/rump_allserver/Makefile
--- a/usr.bin/rump_allserver/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.bin/rump_allserver/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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
@@ -14,4 +14,8 @@
LDADD+= ${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD}
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>
diff -r cf9810017777 -r 9566d7102602 usr.bin/rump_dhcpclient/Makefile
--- a/usr.bin/rump_dhcpclient/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.bin/rump_dhcpclient/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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
@@ -6,4 +6,8 @@
LDADD+= -lrumpclient
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
.include <bsd.prog.mk>
diff -r cf9810017777 -r 9566d7102602 usr.bin/rump_halt/Makefile
--- a/usr.bin/rump_halt/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.bin/rump_halt/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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
@@ -6,4 +6,8 @@
LDADD+= -lrumpclient
DPADD+= ${RUMPCLIENT}
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
.include <bsd.prog.mk>
diff -r cf9810017777 -r 9566d7102602 usr.bin/rump_server/Makefile
--- a/usr.bin/rump_server/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.bin/rump_server/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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
@@ -13,4 +13,8 @@
-Wl,--no-whole-archive
LDADD+= -lpthread
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
.include <bsd.prog.mk>
diff -r cf9810017777 -r 9566d7102602 usr.sbin/npf/npftest/Makefile
--- a/usr.sbin/npf/npftest/Makefile Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.sbin/npf/npftest/Makefile Wed Jul 07 11:51:45 2021 +0000
@@ -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
#
@@ -20,6 +20,10 @@
LDADD+= -lrump -lrumpvfs_nofifofs -lrumpvfs -lrumpuser
LDADD+= -lrumpnet -lrumpnet_net -lrumpdev_bpf
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
.include <bsd.own.mk>
.if ${MKSLJIT} != "no"
diff -r cf9810017777 -r 9566d7102602 usr.sbin/puffs/Makefile.inc
--- a/usr.sbin/puffs/Makefile.inc Wed Jul 07 11:06:37 2021 +0000
+++ b/usr.sbin/puffs/Makefile.inc Wed Jul 07 11:51:45 2021 +0000
@@ -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
@@ -46,6 +46,10 @@
LDADD+= -lp2k -lukfs -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpuffs -lutil
LDADD+= -lpthread
+.if ${RUMP_SANITIZE:Uno} != "no"
+LDADD+= -fsanitize=${RUMP_SANITIZE}
+.endif
+
DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}
DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD}
.endif # ISRUMP
Home |
Main Index |
Thread Index |
Old Index