Skip to content

Commit 924cf78

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 f0e0559 commit 924cf78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sys/conf/kern.pre.mk

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
111111
# upstreamed similar to: https://reviews.llvm.org/D98285
112112
#
113113
SAN_CFLAGS+= -mllvm -asan-mapping-offset=0xdfff208000000000
114+
.elif ${MACHINE_CPUARCH} == "amd64" && \
115+
${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
116+
# Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
117+
# an assertion failure compiling dtrace.c with asan enabled.
118+
SAN_CFLAGS+= -mllvm -asan-use-stack-safety=0
114119
.endif
115120
.endif
116121

0 commit comments

Comments
 (0)