Skip to content

Commit 89cc833

Browse files
committed
Fix GENERIC-KASAN kernel build for amd64
Work around llvm/llvm-project#87923, which leads to an assertion failure compiling several kernel source files with asan enabled. PR: 276104 MFC after: 1 month (cherry picked from commit b811dac)
1 parent 0764680 commit 89cc833

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sys/conf/kern.pre.mk

+7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
119119
-mllvm -asan-use-after-scope=true \
120120
-mllvm -asan-instrumentation-with-call-threshold=0 \
121121
-mllvm -asan-instrument-byval=false
122+
123+
.if ${MACHINE_CPUARCH} == "amd64" && \
124+
${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
125+
# Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
126+
# an assertion failure compiling dtrace.c with asan enabled.
127+
SAN_CFLAGS+= -mllvm -asan-use-stack-safety=0
128+
.endif
122129
.endif
123130

124131
KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo

0 commit comments

Comments
 (0)