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
This commit is contained in:
andrew 2019-02-04 16:55:24 +00:00
parent ebadf79ae6
commit bf60d6d3e9
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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}