aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Alirzaev <zl29ah@gmail.com>2021-05-19 19:35:13 +0300
committerKevinOConnor <kevin@koconnor.net>2021-06-08 19:29:16 -0400
commitc19d1fbb5900630447b0e955a61e9f82dd1ff502 (patch)
treebbd49bc928342354cc265ef65af05a95a3869efb
parentb513d085a51251b0715461a473ada59254271350 (diff)
downloadkutter-c19d1fbb5900630447b0e955a61e9f82dd1ff502.tar.gz
kutter-c19d1fbb5900630447b0e955a61e9f82dd1ff502.tar.xz
kutter-c19d1fbb5900630447b0e955a61e9f82dd1ff502.zip
Makefile: Include debug symbols in the .elf
Signed-off-by: Sergey Alirzaev <zl29ah@gmail.com>
-rw-r--r--Makefile4
-rw-r--r--src/pru/pru.lds2
2 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a2e95785..af74951a 100644
--- a/Makefile
+++ b/Makefile
@@ -29,10 +29,10 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; 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,) \
-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 += $(OUT)compile_time_request.o
diff --git a/src/pru/pru.lds b/src/pru/pru.lds
index db36803c..48f71d6d 100644
--- a/src/pru/pru.lds
+++ b/src/pru/pru.lds
@@ -3,7 +3,9 @@ SECTIONS
{
/* binutils on the PRU doesn't support --gc-sections so manually
* discard the .compile_time_request section */
+ /* and GDB extended debugging information */
/DISCARD/ : {
*( .compile_time_request )
+ *( .gnu.debug* )
}
}