boards/sim: Add new config for KASan

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-10-15 22:45:40 +08:00 committed by Gustavo Henrique Nihei
parent 39cdd99d77
commit df877a8a91
3 changed files with 48 additions and 8 deletions

View File

@ -0,0 +1,32 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="sim"
CONFIG_ARCH_BOARD="sim"
CONFIG_ARCH_BOARD_SIM=y
CONFIG_ARCH_CHIP="sim"
CONFIG_ARCH_SIM=y
CONFIG_BOARDCTL_POWEROFF=y
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_LOOP=y
CONFIG_DEV_ZERO=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_FS_BINFS=y
CONFIG_FS_PROCFS=y
CONFIG_MM_KASAN=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_READLINE_TABCOMPLETION=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_WAITPID=y
CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_OSTEST=y
CONFIG_USER_ENTRYPOINT="nsh_main"

View File

@ -51,10 +51,6 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_SIM_SANITIZE),y)
ARCHOPTIMIZATION += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ARCHOPTIMIZATION += -fprofile-arcs -ftest-coverage
endif
@ -133,6 +129,14 @@ 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
else ifeq ($(CONFIG_MM_KASAN),y)
CFLAGS += -fsanitize=kernel-address
CXXFLAGS += -fsanitize=kernel-address
endif
# Loadable module definitions
CMODULEFLAGS = $(CFLAGS)
@ -198,7 +202,8 @@ endif
ifeq ($(CONFIG_SIM_SANITIZE),y)
CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
HOSTLDFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
else ifeq ($(CONFIG_MM_KASAN),y)
CCLINKFLAGS += -fsanitize=kernel-address
endif
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \

View File

@ -6,9 +6,8 @@
-Darwin,sim:cxxtest
-Darwin,sim:libcxxtest
# Do not build Linux configs
-Darwin,sim:linuxi2c
-Darwin,sim:linuxspi
# clang doesn't -fsanitize=kernel-address
-Darwin,sim:kasan
# macOS doesn't support 32bit(CONFIG_SIM_M32=y) anymore
-Darwin,sim:elf
@ -16,6 +15,10 @@
-Darwin,sim:loadable
-Darwin,sim:module32
# Do not build Linux configs
-Darwin,sim:linuxi2c
-Darwin,sim:linuxspi
# macOS doesn't have X11
-Darwin,sim:lvgl
-Darwin,sim:nsh2