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:
parent
e87d262c7f
commit
8c8c60f70a
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user