sim: Split SIM_SANITIZE to SIM_ASAN and SIM_UBSAN
align the naming style with MM_ASAN Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
c82a676630
commit
3e967f784e
@ -58,7 +58,7 @@ config SIM_CYGWIN_DECORATED
|
||||
run: It will crash early, probably in some function due to the failure to
|
||||
allocate memory.
|
||||
|
||||
config SIM_SANITIZE
|
||||
config SIM_ASAN
|
||||
bool "Address Sanitizer"
|
||||
default n
|
||||
depends on MM_CUSTOMIZE_MANAGER
|
||||
@ -66,6 +66,13 @@ config SIM_SANITIZE
|
||||
AddressSanitizer (ASan) is a fast compiler-based tool for detecting memory
|
||||
bugs in native code.
|
||||
|
||||
config SIM_UBSAN
|
||||
bool "Undefined Behaviour Sanitizer"
|
||||
default n
|
||||
---help---
|
||||
Compile-time instrumentation is used to detect various undefined behaviours
|
||||
at runtime.
|
||||
|
||||
choice
|
||||
prompt "X64_64 ABI"
|
||||
default SIM_X8664_SYSTEMV if HOST_LINUX
|
||||
|
@ -26,7 +26,8 @@ CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_SCHED_HAVE_PARENT=y
|
||||
CONFIG_SCHED_ONEXIT=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SIM_SANITIZE=y
|
||||
CONFIG_SIM_ASAN=y
|
||||
CONFIG_SIM_UBSAN=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TESTING_OSTEST=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
|
@ -129,14 +129,19 @@ ifeq ($(CONFIG_LIBCXX),y)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_SANITIZE),y)
|
||||
CFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
||||
CXXFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
||||
ifeq ($(CONFIG_SIM_ASAN),y)
|
||||
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||
CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||
else ifeq ($(CONFIG_MM_KASAN),y)
|
||||
CFLAGS += -fsanitize=kernel-address
|
||||
CXXFLAGS += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_UBSAN),y)
|
||||
CFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
|
||||
CXXFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
|
||||
endif
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
CMODULEFLAGS = $(CFLAGS)
|
||||
@ -200,11 +205,16 @@ ifeq ($(CONFIG_SIM_M32),y)
|
||||
HOSTLDFLAGS += -m32
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_SANITIZE),y)
|
||||
CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
||||
ifeq ($(CONFIG_SIM_ASAN),y)
|
||||
CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||
else ifeq ($(CONFIG_MM_KASAN),y)
|
||||
CCLINKFLAGS += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_UBSAN),y)
|
||||
CCLINKFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
|
||||
endif
|
||||
|
||||
|
||||
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -D__SIM__ -pipe
|
||||
|
Loading…
Reference in New Issue
Block a user