summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/esp8266/Makefile2
-rw-r--r--ports/mimxrt/Makefile3
-rw-r--r--ports/minimal/Makefile3
-rw-r--r--ports/nrf/Makefile5
-rw-r--r--ports/renesas-ra/Makefile3
-rw-r--r--ports/samd/Makefile3
-rw-r--r--ports/stm32/Makefile3
-rw-r--r--ports/teensy/Makefile3
8 files changed, 16 insertions, 9 deletions
diff --git a/ports/esp8266/Makefile b/ports/esp8266/Makefile
index f70fbd228..52ba18d7d 100644
--- a/ports/esp8266/Makefile
+++ b/ports/esp8266/Makefile
@@ -68,8 +68,8 @@ LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LIBS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
# Debugging/Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1)
-CFLAGS += -g
COPT = -O0
else
CFLAGS += -fdata-sections -ffunction-sections
diff --git a/ports/mimxrt/Makefile b/ports/mimxrt/Makefile
index de560bdb6..13b766eb3 100644
--- a/ports/mimxrt/Makefile
+++ b/ports/mimxrt/Makefile
@@ -297,8 +297,9 @@ SRC_QSTR += \
# Compiler Flags
# =============================================================================
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG),1)
-CFLAGS += -Og -ggdb
+CFLAGS += -Og
else
CFLAGS += -Os -DNDEBUG
endif
diff --git a/ports/minimal/Makefile b/ports/minimal/Makefile
index 4a17df680..169132a1a 100644
--- a/ports/minimal/Makefile
+++ b/ports/minimal/Makefile
@@ -34,8 +34,9 @@ endif
CSUPEROPT = -Os # save some code space
# Tune for Debugging or Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1)
-CFLAGS += -O0 -ggdb
+CFLAGS += -O0
else
CFLAGS += -Os -DNDEBUG
CFLAGS += -fdata-sections -ffunction-sections
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 47653ae71..0586524ba 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -124,7 +124,7 @@ endif
CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES))
-CFLAGS += $(INC) -Wall -Werror -g -ansi -std=c11 -nostdlib $(COPT) $(NRF_DEFINES) $(CFLAGS_MOD) $(CFLAGS_EXTRA)
+CFLAGS += $(INC) -Wall -Werror -ansi -std=c11 -nostdlib $(COPT) $(NRF_DEFINES) $(CFLAGS_MOD) $(CFLAGS_EXTRA)
CFLAGS += -fno-strict-aliasing
CFLAGS += -Iboards/$(BOARD)
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
@@ -138,9 +138,10 @@ LDFLAGS += -Wl,'--defsym=_fs_size=$(FS_SIZE)'
endif
#Debugging/Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1)
#ASMFLAGS += -g -gtabs+
-CFLAGS += -O0 -ggdb
+CFLAGS += -O0
LDFLAGS += -O0
else
CFLAGS += -Os -DNDEBUG
diff --git a/ports/renesas-ra/Makefile b/ports/renesas-ra/Makefile
index d326c81e7..92d8be069 100644
--- a/ports/renesas-ra/Makefile
+++ b/ports/renesas-ra/Makefile
@@ -148,8 +148,9 @@ CFLAGS += -fdata-sections -ffunction-sections
LDFLAGS += --gc-sections
# Debugging/Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1)
-CFLAGS += -g -DPENDSV_DEBUG
+CFLAGS += -DPENDSV_DEBUG
#COPT = -Og
COPT = -Os
# Disable text compression in debug builds
diff --git a/ports/samd/Makefile b/ports/samd/Makefile
index b3d6d8b22..7091365f4 100644
--- a/ports/samd/Makefile
+++ b/ports/samd/Makefile
@@ -57,8 +57,9 @@ LDFLAGS += $(LDFLAGS_MOD)
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
# Tune for Debugging or Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG),1)
-CFLAGS += -O0 -ggdb
+CFLAGS += -O0
else
CFLAGS += -Os -DNDEBUG
LDFLAGS += --gc-sections
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 652dff19f..657524798 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -114,8 +114,9 @@ $(BUILD)/stm32_it.o $(BUILD)/pendsv.o: CFLAGS += -fno-lto
endif
# Debugging/Optimization
+CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1)
-CFLAGS += -g -DPENDSV_DEBUG
+CFLAGS += -DPENDSV_DEBUG
COPT ?= -Og
# Disable text compression in debug builds
MICROPY_ROM_TEXT_COMPRESSION = 0
diff --git a/ports/teensy/Makefile b/ports/teensy/Makefile
index 745f530d7..d7161fcbb 100644
--- a/ports/teensy/Makefile
+++ b/ports/teensy/Makefile
@@ -105,8 +105,9 @@ LIBS += -L $(dir $(LIBC_FILE_NAME)) -lc
LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
#Debugging/Optimization
+CFLAGS += -g # always include debug info in the ELF
ifdef DEBUG
-CFLAGS += -Og -ggdb
+CFLAGS += -Og
else
CFLAGS += -Os #-DNDEBUG
endif