Module Name:    src
Committed By:   martin
Date:           Fri Aug 16 19:26:48 UTC 2019

Modified Files:
        src/tests/kernel [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by kamil in ticket #71):

        tests/kernel/Makefile: revision 1.61

Adapt tests/kernel/t_subr_prf for MKSANITIZER

Allow to rename snprintf-like functions to avoid clashes with a sanitizer.

This tests needs a fixup to remove 'undef symbol' from the test code
generator.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.60.2.1 src/tests/kernel/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.60 src/tests/kernel/Makefile:1.60.2.1
--- src/tests/kernel/Makefile:1.60	Fri Jun  7 21:18:16 2019
+++ src/tests/kernel/Makefile	Fri Aug 16 19:26:48 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.60 2019/06/07 21:18:16 christos Exp $
+# $NetBSD: Makefile,v 1.60.2.1 2019/08/16 19:26:48 martin Exp $
 
 NOMAN=		# defined
 
@@ -66,6 +66,11 @@ CPPFLAGS.subr_extent.c=	-D_EXTENT_TESTIN
 
 t_subr_prf.c: gen_t_subr_prf ${NETBSDSRCDIR}/sys/kern/subr_prf.c
 	${HOST_SH} ${.ALLSRC} ${.TARGET}
+.if ${MKSANITIZER:Uno} == "yes"
+	# These symbols will be redefined by MKSANITIZER
+	${TOOL_SED} -i '/undef .*printf/d' ${.TARGET}
+.endif
+
 CPPFLAGS.t_subr_prf.c=	-Wno-pointer-sign	# XXX platform vs kernel SHA2
 
 .if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
@@ -73,6 +78,14 @@ CPPFLAGS.t_subr_prf.c=	-Wno-pointer-sign
 CPPFLAGS.t_subr_prf.c+=	-Wno-error=format-truncation
 .endif
 
+SANITIZER_RENAME_CLASSES+=		t_subr_prf
+SANITIZER_RENAME_FILES.t_subr_prf+=	t_subr_prf.c
+SANITIZER_RENAME_SYMBOL.t_subr_prf+=	snprintf
+SANITIZER_RENAME_SYMBOL.t_subr_prf+=	vsnprintf
+SANITIZER_RENAME_SYMBOL.t_subr_prf+=	sprintf
+SANITIZER_RENAME_SYMBOL.t_subr_prf+=	vsnprintf
+SANITIZER_RENAME_SYMBOL.t_subr_prf+=	vasprintf
+
 CLEANFILES+=	t_subr_prf.c
 
 LDADD.h_segv+=	-lm

Reply via email to