ports: Always include debug information in the ELF.

For bare metal ARM & xtensa targets, passing -g will make the ELF file
larger but doesn't change the binary size.  However, this means tools like
gdb, addr2line, etc can extract source-level information from the ELF.

Also standardise -ggdb to -g, these produce the exact same ELF file on
arm-none-eabi-gcc and will use DWARF format for all these ports.
This commit is contained in:
Angus Gratton
2022-07-28 17:56:27 +10:00
committed by Damien George
parent 3c32ca6e77
commit fdfe4eca74
8 changed files with 16 additions and 9 deletions

View File

@@ -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