Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/tests/kernel Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/bfc5e50dbf6e
branches:  netbsd-9
changeset: 962820:bfc5e50dbf6e
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Aug 16 19:26:48 2019 +0000

description:
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.

diffstat:

 tests/kernel/Makefile |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r e7abdb11d3cf -r bfc5e50dbf6e tests/kernel/Makefile
--- a/tests/kernel/Makefile     Fri Aug 16 19:25:31 2019 +0000
+++ b/tests/kernel/Makefile     Fri Aug 16 19:26:48 2019 +0000
@@ -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 @@
 
 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-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



Home | Main Index | Thread Index | Old Index