From b3c4f3afc354c9a66865141605511716eecec18e Mon Sep 17 00:00:00 2001 From: p-szafonimateusz Date: Mon, 26 Feb 2024 08:18:48 +0100 Subject: [PATCH] x86_64/common/Toolchain.defs: change optimization to -Os for CONFIG_DEBUG_FULLOPT change optimization to -Os for CONFIG_DEBUG_FULLOPT to be compatible with other architectures and add an option to select CONFIG_DEBUG_CUSTOMOPT Signed-off-by: p-szafonimateusz --- arch/x86_64/src/common/Toolchain.defs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86_64/src/common/Toolchain.defs b/arch/x86_64/src/common/Toolchain.defs index d4c1717575..7d00e0e444 100644 --- a/arch/x86_64/src/common/Toolchain.defs +++ b/arch/x86_64/src/common/Toolchain.defs @@ -22,10 +22,10 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = -g endif -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += -O2 -fno-optimize-sibling-calls - ARCHOPTIMIZATION += -fno-omit-frame-pointer -fno-crossjumping - ARCHOPTIMIZATION += -fno-delete-null-pointer-checks +ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y) + ARCHOPTIMIZATION += $(CONFIG_DEBUG_OPTLEVEL) +else ifeq ($(CONFIG_DEBUG_FULLOPT),y) + ARCHOPTIMIZATION += -Os endif ARCHCPUFLAGS = -fPIC -fno-stack-protector -mno-red-zone -mrdrnd