diff --git a/Kconfig b/Kconfig index 5938852151..636d982bc4 100644 --- a/Kconfig +++ b/Kconfig @@ -2495,6 +2495,7 @@ config DEBUG_SYMBOLS config DEBUG_SYMBOLS_LEVEL string "Custom symbols level" + depends on DEBUG_SYMBOLS default "-g" ---help--- This string represents the custom symbol level that will be diff --git a/arch/tricore/src/common/ToolchainGnuc.defs b/arch/tricore/src/common/ToolchainGnuc.defs index 163d574eab..450390a4c0 100644 --- a/arch/tricore/src/common/ToolchainGnuc.defs +++ b/arch/tricore/src/common/ToolchainGnuc.defs @@ -166,7 +166,7 @@ ifeq ($(CONFIG_DEBUG_LINK_MAP),y) endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION += -g + ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif LDFLAGS += --no-warn-rwx-segments diff --git a/arch/tricore/src/common/ToolchainTasking.defs b/arch/tricore/src/common/ToolchainTasking.defs index c4a6d66e50..cf121918ee 100644 --- a/arch/tricore/src/common/ToolchainTasking.defs +++ b/arch/tricore/src/common/ToolchainTasking.defs @@ -76,7 +76,7 @@ ARCHOPTIMIZATION += --tradeoff=2 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION += --debug-info=default ARCHOPTIMIZATION += --keep-temporary-files - LDFLAGS += -g + LDFLAGS += $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif # merge source code with assembly output diff --git a/arch/x86/src/common/Toolchain.defs b/arch/x86/src/common/Toolchain.defs index 84bc7e4ea0..4f8a6da769 100644 --- a/arch/x86/src/common/Toolchain.defs +++ b/arch/x86/src/common/Toolchain.defs @@ -21,7 +21,7 @@ ############################################################################ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g3 + ARCHOPTIMIZATION = $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif ifneq ($(CONFIG_DEBUG_NOOPT),y) diff --git a/tools/D.defs b/tools/D.defs index 8c0209a897..c8a2144005 100644 --- a/tools/D.defs +++ b/tools/D.defs @@ -25,7 +25,7 @@ DC := ldmd2 DFLAGS := -i ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - DFLAGS += -g + DFLAGS += $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif ifeq ($(CONFIG_DEBUG_NOOPT),y) diff --git a/tools/Rust.defs b/tools/Rust.defs index df68a4a79a..c3ca78298c 100644 --- a/tools/Rust.defs +++ b/tools/Rust.defs @@ -25,7 +25,7 @@ RUSTC := rustc --edition 2021 RUSTFLAGS := ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - RUSTFLAGS += -g + RUSTFLAGS += $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif ifeq ($(CONFIG_DEBUG_NOOPT),y) diff --git a/tools/Swift.defs b/tools/Swift.defs index 65af970299..9667b357c7 100644 --- a/tools/Swift.defs +++ b/tools/Swift.defs @@ -27,7 +27,7 @@ SWIFTC := swiftc SWIFTFLAGS := -enable-experimental-feature Embedded -wmo ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - SWIFTFLAGS += -g + SWIFTFLAGS += $(CONFIG_DEBUG_SYMBOLS_LEVEL) endif ifeq ($(CONFIG_DEBUG_NOOPT),y)