diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index ef4b1462b9..686d2dd660 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -78,13 +78,12 @@ else ifeq ($(CONFIG_MM_KASAN_ALL),y) endif ifeq ($(CONFIG_SIM_UBSAN),y) - ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION) + ARCHOPTIMIZATION += -fsanitize=undefined else ifeq ($(CONFIG_MM_UBSAN_ALL),y) ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION) -endif - -ifeq ($(CONFIG_MM_UBSAN_TRAP_ON_ERROR),y) - ARCHOPTIMIZATION += -fsanitize-undefined-trap-on-error + ifeq ($(CONFIG_MM_UBSAN_TRAP_ON_ERROR),y) + ARCHOPTIMIZATION += -fsanitize-undefined-trap-on-error + endif endif # Add -fno-common because macOS "ld -r" doesn't seem to pick objects diff --git a/mm/Kconfig b/mm/Kconfig index d604703581..21950a696d 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -212,7 +212,7 @@ config MM_UBSAN_ALL config MM_UBSAN_OPTION string "UBSan options" - depends on MM_UBSAN || SIM_UBSAN + depends on MM_UBSAN default "-fsanitize=undefined" ---help--- This option activates specified UBSan instrumentation. Please