diff --git a/arch/risc-v/src/rv32im/Toolchain.defs b/arch/risc-v/src/rv32im/Toolchain.defs index 281225685bd..4f88e099b10 100644 --- a/arch/risc-v/src/rv32im/Toolchain.defs +++ b/arch/risc-v/src/rv32im/Toolchain.defs @@ -49,6 +49,8 @@ endif ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y) MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL) +else + MAXOPTIMIZATION ?= -Os endif # Generic GNU RVG toolchain @@ -67,13 +69,6 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG) endif endif -# Individual tools may limit the optimization level but, by default, the -# optimization level will be set to -Os - -ifeq ($(CONFIG_DEBUG_SYMBOLS),) -MAXOPTIMIZATION ?= -Os -endif - # Default toolchain CC = $(CROSSDEV)gcc