aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2024-01-11 16:42:47 +0000
committerMark Johnston <markj@FreeBSD.org>2024-01-11 19:20:22 +0000
commitd682a91726d72eaf7ba8dddeb4d9ce161ab8b93a (patch)
treec306a2bbdd6fe264e641a1acce5c7ed9f85f950b
parente2417a21a02562655d760005e9827f1190bb652f (diff)
downloadsrc-d682a91726d72eaf7ba8dddeb4d9ce161ab8b93a.tar.gz
src-d682a91726d72eaf7ba8dddeb4d9ce161ab8b93a.zip
conf: Do not set -fno-sanitize-memory-param-retval for old compilers
The option was introduced in LLVM 16. Fixes: b6c653c97463 ("kmsan: Set -fno-sanitize-memory-param-retval for now") MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc.
-rw-r--r--sys/conf/kern.pre.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 158175eb6899..6bf647f5c3ea 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -125,8 +125,10 @@ KMSAN_ENABLED!= grep KMSAN opt_global.h || true ; echo
# Disable -fno-sanitize-memory-param-retval until interceptors have been
# updated to work properly with it.
SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \
- -fsanitize=kernel-memory \
- -fno-sanitize-memory-param-retval
+ -fsanitize=kernel-memory
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 160000
+SAN_CFLAGS+= -fno-sanitize-memory-param-retval
+.endif
.endif
KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo