kopia lustrzana https://github.com/micropython/micropython
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.pull/8981/head
rodzic
3c32ca6e77
commit
fdfe4eca74
|
@ -68,8 +68,8 @@ LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||||
LIBS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
|
LIBS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
|
||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -g
|
|
||||||
COPT = -O0
|
COPT = -O0
|
||||||
else
|
else
|
||||||
CFLAGS += -fdata-sections -ffunction-sections
|
CFLAGS += -fdata-sections -ffunction-sections
|
||||||
|
|
|
@ -297,8 +297,9 @@ SRC_QSTR += \
|
||||||
# Compiler Flags
|
# Compiler Flags
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -Og -ggdb
|
CFLAGS += -Og
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -34,8 +34,9 @@ endif
|
||||||
CSUPEROPT = -Os # save some code space
|
CSUPEROPT = -Os # save some code space
|
||||||
|
|
||||||
# Tune for Debugging or Optimization
|
# Tune for Debugging or Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -ggdb
|
CFLAGS += -O0
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
CFLAGS += -fdata-sections -ffunction-sections
|
CFLAGS += -fdata-sections -ffunction-sections
|
||||||
|
|
|
@ -124,7 +124,7 @@ endif
|
||||||
|
|
||||||
|
|
||||||
CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES))
|
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 += -fno-strict-aliasing
|
||||||
CFLAGS += -Iboards/$(BOARD)
|
CFLAGS += -Iboards/$(BOARD)
|
||||||
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
|
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
|
||||||
|
@ -138,9 +138,10 @@ LDFLAGS += -Wl,'--defsym=_fs_size=$(FS_SIZE)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#Debugging/Optimization
|
#Debugging/Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
#ASMFLAGS += -g -gtabs+
|
#ASMFLAGS += -g -gtabs+
|
||||||
CFLAGS += -O0 -ggdb
|
CFLAGS += -O0
|
||||||
LDFLAGS += -O0
|
LDFLAGS += -O0
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
|
|
|
@ -148,8 +148,9 @@ CFLAGS += -fdata-sections -ffunction-sections
|
||||||
LDFLAGS += --gc-sections
|
LDFLAGS += --gc-sections
|
||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -g -DPENDSV_DEBUG
|
CFLAGS += -DPENDSV_DEBUG
|
||||||
#COPT = -Og
|
#COPT = -Og
|
||||||
COPT = -Os
|
COPT = -Os
|
||||||
# Disable text compression in debug builds
|
# Disable text compression in debug builds
|
||||||
|
|
|
@ -57,8 +57,9 @@ LDFLAGS += $(LDFLAGS_MOD)
|
||||||
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
# Tune for Debugging or Optimization
|
# Tune for Debugging or Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -O0 -ggdb
|
CFLAGS += -O0
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
LDFLAGS += --gc-sections
|
LDFLAGS += --gc-sections
|
||||||
|
|
|
@ -114,8 +114,9 @@ $(BUILD)/stm32_it.o $(BUILD)/pendsv.o: CFLAGS += -fno-lto
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -g -DPENDSV_DEBUG
|
CFLAGS += -DPENDSV_DEBUG
|
||||||
COPT ?= -Og
|
COPT ?= -Og
|
||||||
# Disable text compression in debug builds
|
# Disable text compression in debug builds
|
||||||
MICROPY_ROM_TEXT_COMPRESSION = 0
|
MICROPY_ROM_TEXT_COMPRESSION = 0
|
||||||
|
|
|
@ -105,8 +105,9 @@ LIBS += -L $(dir $(LIBC_FILE_NAME)) -lc
|
||||||
LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
|
LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
|
||||||
|
|
||||||
#Debugging/Optimization
|
#Debugging/Optimization
|
||||||
|
CFLAGS += -g # always include debug info in the ELF
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -Og -ggdb
|
CFLAGS += -Og
|
||||||
else
|
else
|
||||||
CFLAGS += -Os #-DNDEBUG
|
CFLAGS += -Os #-DNDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
Ładowanie…
Reference in New Issue