aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/conf/files2
-rw-r--r--sys/conf/kern.pre.mk5
2 files changed, 6 insertions, 1 deletions
diff --git a/sys/conf/files b/sys/conf/files
index c7c15cd3738c..d3c2c0324135 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -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
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ef90658147d2..407bfee936c9 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -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}