Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152487268
D45300.id139508.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45300.id139508.diff
View Options
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -94,13 +94,15 @@
KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo
.if !empty(KASAN_ENABLED)
SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
- -fsanitize=kernel-address \
- -mllvm -asan-stack=true \
+ -fsanitize=kernel-address
+.if ${COMPILER_TYPE} == "clang"
+SAN_CFLAGS+= -mllvm -asan-stack=true \
-mllvm -asan-instrument-dynamic-allocas=true \
-mllvm -asan-globals=true \
-mllvm -asan-use-after-scope=true \
-mllvm -asan-instrumentation-with-call-threshold=0 \
-mllvm -asan-instrument-byval=false
+.endif
.if ${MACHINE_CPUARCH} == "aarch64"
# KASAN/ARM64 TODO: -asan-mapping-offset is calculated from:
@@ -110,7 +112,11 @@
# KASAN_MIN_ADDRESS, and this offset value should eventually be
# upstreamed similar to: https://reviews.llvm.org/D98285
#
+.if ${COMPILER_TYPE} == "clang"
SAN_CFLAGS+= -mllvm -asan-mapping-offset=0xdfff208000000000
+.else
+SAN_CFLAGS+= -fasan-shadow-offset=0xdfff208000000000
+.endif
.elif ${MACHINE_CPUARCH} == "amd64" && \
${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
# Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 6:38 AM (9 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31585104
Default Alt Text
D45300.id139508.diff (1 KB)
Attached To
Mode
D45300: sys/conf: Support building kasan with gcc on arm64
Attached
Detach File
Event Timeline
Log In to Comment