From 28cb5e7984042346eee5ee68ae0d12e2105bba71 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Wed, 12 Jul 2023 12:14:19 +0800 Subject: [PATCH] arm64: add kasan support for arm64 Add kasan compiler option in arm64 Toolchain.defs Signed-off-by: Bowen Wang --- arch/arm64/src/Toolchain.defs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/src/Toolchain.defs b/arch/arm64/src/Toolchain.defs index c8d6052ca2..1150b661f9 100644 --- a/arch/arm64/src/Toolchain.defs +++ b/arch/arm64/src/Toolchain.defs @@ -80,6 +80,10 @@ ifeq ($(CONFIG_MM_UBSAN_TRAP_ON_ERROR),y) ARCHOPTIMIZATION += -fsanitize-undefined-trap-on-error endif +ifeq ($(CONFIG_MM_KASAN_ALL),y) + ARCHOPTIMIZATION += -fsanitize=kernel-address +endif + ifeq ($(CONFIG_ARCH_FPU),y) ARCHCXXFLAGS += -D_LDBL_EQ_DBL ARCHCFLAGS += -D_LDBL_EQ_DBL