diff --git a/boards/sim/sim/sim/configs/kasan/defconfig b/boards/sim/sim/sim/configs/kasan/defconfig new file mode 100644 index 0000000000..1a98918e2c --- /dev/null +++ b/boards/sim/sim/sim/configs/kasan/defconfig @@ -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" diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index 080eb70492..119d6a104e 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -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) \ diff --git a/tools/ci/testlist/sim-01.dat b/tools/ci/testlist/sim-01.dat index 21fc19b86e..0c1e472c0f 100644 --- a/tools/ci/testlist/sim-01.dat +++ b/tools/ci/testlist/sim-01.dat @@ -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