diff --git a/arch/x86_64/src/common/Toolchain.defs b/arch/x86_64/src/common/Toolchain.defs index 9cc456593e535..fb4b4a93d3a6f 100644 --- a/arch/x86_64/src/common/Toolchain.defs +++ b/arch/x86_64/src/common/Toolchain.defs @@ -41,7 +41,9 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif -ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y) +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -O0 +else ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y) ARCHOPTIMIZATION += $(CONFIG_DEBUG_OPTLEVEL) else ifeq ($(CONFIG_DEBUG_FULLOPT),y) ARCHOPTIMIZATION += -Os