Module Name:    src
Committed By:   kamil
Date:           Wed May 22 08:31:26 UTC 2019

Modified Files:
        src/share/mk: bsd.sys.mk
        src/sys/arch/amd64/conf: Makefile.amd64

Log Message:
Allow to use KCOV + kASan together

Stop instrumenting KCOV files with kASan and the other way around.
This fixes booting of the setup of using them together.

In theory the checks could be more fine grained, however there is no good
reason (except extra DIAGNISTIC) for running a kernel sanitizer without
kernel coverage.

Patch by <R3x>


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/amd64/conf/Makefile.amd64

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.291 src/share/mk/bsd.sys.mk:1.292
--- src/share/mk/bsd.sys.mk:1.291	Sat Feb 23 03:10:06 2019
+++ src/share/mk/bsd.sys.mk	Wed May 22 08:31:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.291 2019/02/23 03:10:06 kamil Exp $
+#	$NetBSD: bsd.sys.mk,v 1.292 2019/05/22 08:31:25 kamil Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -242,7 +242,7 @@ CFLAGS+=	${KLEAKFLAGS.${.IMPSRC:T}:U${KL
 
 .if ${KCOV:U0} > 0
 KCOVFLAGS=	-fsanitize-coverage=trace-pc
-.for f in subr_kcov.c subr_lwp_specificdata.c subr_specificdata.c
+.for f in subr_kcov.c subr_lwp_specificdata.c subr_specificdata.c subr_asan.c
 KCOVFLAGS.${f}=		# empty
 .endfor
 CFLAGS+=	${KCOVFLAGS.${.IMPSRC:T}:U${KCOVFLAGS}}

Index: src/sys/arch/amd64/conf/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.76 src/sys/arch/amd64/conf/Makefile.amd64:1.77
--- src/sys/arch/amd64/conf/Makefile.amd64:1.76	Sun Feb 24 08:02:45 2019
+++ src/sys/arch/amd64/conf/Makefile.amd64	Wed May 22 08:31:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.76 2019/02/24 08:02:45 maxv Exp $
+#	$NetBSD: Makefile.amd64,v 1.77 2019/05/22 08:31:25 kamil Exp $
 
 # Makefile for NetBSD
 #
@@ -54,7 +54,7 @@ KASANFLAGS=	-fsanitize=kernel-address \
 		--param asan-globals=1 --param asan-stack=1 \
 		-fsanitize-address-use-after-scope \
 		-fasan-shadow-offset=0xDFFF900000000000
-.for f in subr_asan.c
+.for f in subr_asan.c subr_kcov.c subr_lwp_specificdata.c subr_specificdata.c
 KASANFLAGS.${f}=	# empty
 .endfor
 CFLAGS+=	${KASANFLAGS.${.IMPSRC:T}:U${KASANFLAGS}}

Reply via email to