diff --git a/Kconfig b/Kconfig index 3b588dd966..beb02405dd 100644 --- a/Kconfig +++ b/Kconfig @@ -566,8 +566,15 @@ config DEBUG_SYMBOLS bool "Generate Debug Symbols" default n ---help--- - Build without optimization and with debug symbols (needed - for use with a debugger). + Build with debug symbols (needed for use with a debugger). + +config DEBUG_NOOPT + bool "Suppress optimization" + default y if DEBUG_SYMBOLS + default n if !DEBUG_SYMBOLS + ---help--- + Build without optimization. This is often helpful when debugging code. + endmenu endmenu diff --git a/configs/ez80f910200kitg/ostest/Make.defs b/configs/ez80f910200kitg/ostest/Make.defs index f4fc1975eb..ae19306e24 100644 --- a/configs/ez80f910200kitg/ostest/Make.defs +++ b/configs/ez80f910200kitg/ostest/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/dhcpd/Make.defs b/configs/ez80f910200zco/dhcpd/Make.defs index 42066d9a29..6a036b4a1e 100644 --- a/configs/ez80f910200zco/dhcpd/Make.defs +++ b/configs/ez80f910200zco/dhcpd/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/httpd/Make.defs b/configs/ez80f910200zco/httpd/Make.defs index ed87a37ec6..81063778d7 100644 --- a/configs/ez80f910200zco/httpd/Make.defs +++ b/configs/ez80f910200zco/httpd/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/nettest/Make.defs b/configs/ez80f910200zco/nettest/Make.defs index f6db2f84ab..f5f1e4c0f4 100644 --- a/configs/ez80f910200zco/nettest/Make.defs +++ b/configs/ez80f910200zco/nettest/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/nsh/Make.defs b/configs/ez80f910200zco/nsh/Make.defs index f8a79c7eb2..f8c540c9be 100644 --- a/configs/ez80f910200zco/nsh/Make.defs +++ b/configs/ez80f910200zco/nsh/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/ostest/Make.defs b/configs/ez80f910200zco/ostest/Make.defs index ae963a36fe..b83e646037 100644 --- a/configs/ez80f910200zco/ostest/Make.defs +++ b/configs/ez80f910200zco/ostest/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/ez80f910200zco/poll/Make.defs b/configs/ez80f910200zco/poll/Make.defs index 920696b3c3..6fbcaf900b 100644 --- a/configs/ez80f910200zco/poll/Make.defs +++ b/configs/ez80f910200zco/poll/Make.defs @@ -118,9 +118,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize endif ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ diff --git a/configs/z16f2800100zcog/ostest/Make.defs b/configs/z16f2800100zcog/ostest/Make.defs index 5d8e964ef6..1b552f9609 100644 --- a/configs/z16f2800100zcog/ostest/Make.defs +++ b/configs/z16f2800100zcog/ostest/Make.defs @@ -112,9 +112,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -NOregvar -reduceopt +else + ARCHOPTIMIZATION += -regvar endif ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ diff --git a/configs/z16f2800100zcog/pashello/Make.defs b/configs/z16f2800100zcog/pashello/Make.defs index 3a2945c07e..ed91536431 100644 --- a/configs/z16f2800100zcog/pashello/Make.defs +++ b/configs/z16f2800100zcog/pashello/Make.defs @@ -112,9 +112,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -NOregvar -reduceopt +else + ARCHOPTIMIZATION += -regvar endif ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ diff --git a/configs/z8encore000zco/ostest/Make.defs b/configs/z8encore000zco/ostest/Make.defs index 2bf1bc4244..39cf842a81 100644 --- a/configs/z8encore000zco/ostest/Make.defs +++ b/configs/z8encore000zco/ostest/Make.defs @@ -145,9 +145,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -NOregvar -reduceopt +else + ARCHOPTIMIZATION += -regvar endif ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \ diff --git a/configs/z8f64200100kit/ostest/Make.defs b/configs/z8f64200100kit/ostest/Make.defs index 7cc5a2705c..446b62c20f 100644 --- a/configs/z8f64200100kit/ostest/Make.defs +++ b/configs/z8f64200100kit/ostest/Make.defs @@ -145,9 +145,15 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -NOregvar -reduceopt +else + ARCHOPTIMIZATION += -regvar endif ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \