svn commit: r343746 - head/sys/conf

Andrew Turner andrew at FreeBSD.org
Mon Feb 4 16:55:25 UTC 2019


Author: andrew
Date: Mon Feb  4 16:55:24 2019
New Revision: 343746
URL: https://svnweb.freebsd.org/changeset/base/343746

Log:
  Only enable trace-cmp on Clang and modern GCC.
  
  It's was only added to GCC 8.1 so don't try to enable it for earlier
  releases.
  
  Reported by:	lwhsu
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/conf/files
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Mon Feb  4 16:13:41 2019	(r343745)
+++ head/sys/conf/files	Mon Feb  4 16:55:24 2019	(r343746)
@@ -3808,7 +3808,7 @@ kern/kern_idle.c		standard
 kern/kern_intr.c		standard
 kern/kern_jail.c		standard
 kern/kern_kcov.c		optional kcov			\
-	compile-with		"${NORMAL_C} -fno-sanitize-coverage=trace-pc,trace-cmp"
+	compile-with		"${NORMAL_C} -fno-sanitize=all"
 kern/kern_khelp.c		standard
 kern/kern_kthread.c		standard
 kern/kern_ktr.c			optional ktr

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Mon Feb  4 16:13:41 2019	(r343745)
+++ head/sys/conf/kern.pre.mk	Mon Feb  4 16:55:24 2019	(r343746)
@@ -120,7 +120,12 @@ SAN_CFLAGS+=	-fsanitize=undefined
 
 COVERAGE_ENABLED!=	grep COVERAGE opt_global.h || true ; echo
 .if !empty(COVERAGE_ENABLED)
+.if ${COMPILER_TYPE} == "clang" || \
+    (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100)
 SAN_CFLAGS+=	-fsanitize-coverage=trace-pc,trace-cmp
+.else
+SAN_CFLAGS+=	-fsanitize-coverage=trace-pc
+.endif
 .endif
 
 CFLAGS+=	${SAN_CFLAGS}


More information about the svn-src-all mailing list