diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig index f5d8286456..2919801010 100644 --- a/arch/sim/Kconfig +++ b/arch/sim/Kconfig @@ -83,6 +83,13 @@ config SIM_UBSAN Compile-time instrumentation is used to detect various undefined behaviours at runtime. +config SIM_UBSAN_DUMMY + bool "Bypass Undefined Behaviour Sanitizer" + default n + depends on SIM_UBSAN + ---help--- + Keep SIM_UBSAN compile time but disable runtime actions. + choice prompt "X64_64 ABI" default SIM_X8664_SYSTEMV if HOST_LINUX diff --git a/arch/sim/src/sim/sim_head.c b/arch/sim/src/sim/sim_head.c index e97c2bb901..c81dbb869d 100644 --- a/arch/sim/src/sim/sim_head.c +++ b/arch/sim/src/sim/sim_head.c @@ -142,8 +142,12 @@ const char *__lsan_default_options(void) #ifdef CONFIG_SIM_UBSAN const char *__ubsan_default_options(void) { +#ifdef CONFIG_SIM_UBSAN_DUMMY + return ""; +#else return "print_stacktrace=1" " fast_unwind_on_malloc=0"; +#endif } #endif