arch: Add -fsanitize=kernel-address to ARCHCPUFLAGS if CONFIG_MM_KASAN=y

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-28 02:55:53 +08:00 committed by Petro Karashchenko
parent e87d262c7f
commit 8c8c60f70a
9 changed files with 36 additions and 0 deletions

View File

@ -73,6 +73,10 @@ else
MAXOPTIMIZATION += -fomit-frame-pointer
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT)

View File

@ -81,6 +81,10 @@ ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),GNU_EABI)
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Default toolchain
CC = $(CROSSDEV)gcc

View File

@ -102,6 +102,10 @@ else
ARCHFPUFLAGS += -mfloat-abi=soft
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else

View File

@ -130,6 +130,10 @@ else
endif
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),GNU_EABI)

View File

@ -90,6 +90,10 @@ ifeq ($(CONFIG_ENDIAN_BIG),y)
ARCHCPUFLAGS += -mbig-endian
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
ifeq ($(CONFIG_ENDIAN_BIG),y)
TARGET_ARCH := armeb
else

View File

@ -128,6 +128,10 @@ else
endif
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV8M_TOOLCHAIN),GNU_EABI)

View File

@ -115,6 +115,10 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Default toolchain
CC = $(CROSSDEV)gcc

View File

@ -55,6 +55,10 @@ else
MAXOPTIMIZATION += -fomit-frame-pointer
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
CC = $(CROSSDEV)xcc

View File

@ -55,6 +55,10 @@ else
MAXOPTIMIZATION += -fomit-frame-pointer
endif
ifeq ($(CONFIG_MM_KASAN),y)
ARCHCPUFLAGS += -fsanitize=kernel-address
endif
# Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
CC = $(CROSSDEV)xcc