Makefile: Include debug symbols in the .elf

Signed-off-by: Sergey Alirzaev <zl29ah@gmail.com>
This commit is contained in:
Sergey Alirzaev 2021-05-19 19:35:13 +03:00 committed by KevinOConnor
parent b513d085a5
commit c19d1fbb59
2 changed files with 4 additions and 2 deletions

View File

@ -29,10 +29,10 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \ cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;) ; then echo "$(2)"; else echo "$(3)"; fi ;)
CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -O2 -MD -g \ CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -O2 -MD \
-Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \ -Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
-ffunction-sections -fdata-sections -ffunction-sections -fdata-sections
CFLAGS += -flto -fwhole-program -fno-use-linker-plugin CFLAGS += -flto -fwhole-program -fno-use-linker-plugin -ggdb3
OBJS_klipper.elf = $(patsubst %.c, $(OUT)src/%.o,$(src-y)) OBJS_klipper.elf = $(patsubst %.c, $(OUT)src/%.o,$(src-y))
OBJS_klipper.elf += $(OUT)compile_time_request.o OBJS_klipper.elf += $(OUT)compile_time_request.o

View File

@ -3,7 +3,9 @@ SECTIONS
{ {
/* binutils on the PRU doesn't support --gc-sections so manually /* binutils on the PRU doesn't support --gc-sections so manually
* discard the .compile_time_request section */ * discard the .compile_time_request section */
/* and GDB extended debugging information */
/DISCARD/ : { /DISCARD/ : {
*( .compile_time_request ) *( .compile_time_request )
*( .gnu.debug* )
} }
} }