Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Apr 2024 18:00:21 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b811dac2115a - main - Fix GENERIC-KASAN kernel build for amd64
Message-ID:  <202404071800.437I0L83037790@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=b811dac2115a6ada606c03d7d823a95d11c5f3c9

commit b811dac2115a6ada606c03d7d823a95d11c5f3c9
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-04-07 17:56:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-07 17:58:52 +0000

    Fix GENERIC-KASAN kernel build for amd64
    
    Work around https://github.com/llvm/llvm-project/issues/87923, which
    leads to an assertion failure compiling several kernel source files with
    asan enabled.
    
    PR:             276104
    MFC after:      1 month
---
 sys/conf/kern.pre.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 6bf647f5c3ea..567c68e5887e 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -111,6 +111,11 @@ SAN_CFLAGS+=	-DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
 #	upstreamed similar to: https://reviews.llvm.org/D98285
 #
 SAN_CFLAGS+=	-mllvm -asan-mapping-offset=0xdfff208000000000
+.elif ${MACHINE_CPUARCH} == "amd64" && \
+      ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
+# Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
+# an assertion failure compiling dtrace.c with asan enabled.
+SAN_CFLAGS+=	-mllvm -asan-use-stack-safety=0
 .endif
 .endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404071800.437I0L83037790>