arch: Move -fsanitize=kernel-address to ARCHOPTIMIZATION
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
4f090eb7fd
commit
8b7c5b039d
@ -80,7 +80,7 @@ ifeq ($(CONFIG_ARCH_COVERAGE),y)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
# NuttX buildroot under Linux or Cygwin
|
||||
|
@ -154,7 +154,7 @@ endif
|
||||
# Architecture flags
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ARCHCFLAGS += -fno-common
|
||||
|
@ -97,7 +97,7 @@ else
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
|
||||
|
@ -172,7 +172,7 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
# Generic GNU EABI toolchain
|
||||
|
@ -97,7 +97,7 @@ ifeq ($(CONFIG_ENDIAN_BIG),y)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENDIAN_BIG),y)
|
||||
|
@ -181,7 +181,7 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
# Generic GNU EABI toolchain
|
||||
|
@ -141,7 +141,7 @@ endif
|
||||
# Architecture flags
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ARCHCFLAGS += -fno-common
|
||||
|
@ -153,7 +153,7 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
# Default toolchain
|
||||
|
@ -44,7 +44,7 @@ endif
|
||||
ARCHCPUFLAGS = -mlongcalls
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
|
||||
|
@ -44,7 +44,7 @@ endif
|
||||
ARCHCPUFLAGS = -mlongcalls
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHCPUFLAGS += -fsanitize=kernel-address
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
|
||||
|
@ -71,6 +71,16 @@ ifeq ($(CONFIG_ARCH_COVERAGE),y)
|
||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_ASAN),y)
|
||||
ARCHOPTIMIZATION += -fsanitize=address
|
||||
else ifeq ($(CONFIG_MM_KASAN),y)
|
||||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_UBSAN),y)
|
||||
ARCHOPTIMIZATION += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
|
||||
# for common symbols.
|
||||
ARCHCFLAGS = -fno-common -ffunction-sections -fdata-sections
|
||||
@ -141,19 +151,6 @@ ifeq ($(CONFIG_LIBCXX),y)
|
||||
CXXFLAGS += -D_LIBCPP_DISABLE_AVAILABILITY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_ASAN),y)
|
||||
CFLAGS += -fsanitize=address
|
||||
CXXFLAGS += -fsanitize=address
|
||||
else ifeq ($(CONFIG_MM_KASAN),y)
|
||||
CFLAGS += -fsanitize=kernel-address
|
||||
CXXFLAGS += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_UBSAN),y)
|
||||
CFLAGS += -fsanitize=undefined
|
||||
CXXFLAGS += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
CMODULEFLAGS = $(CFLAGS)
|
||||
|
Loading…
Reference in New Issue
Block a user