From fbbe956071782e5ce424585035509a52d9cb2e8f Mon Sep 17 00:00:00 2001 From: icex2 Date: Sun, 28 Jan 2024 21:57:08 +0100 Subject: [PATCH] fix(make): Include dwarf symbols and remove stripping Expecting to improve debugability significantly. Stacktraces can be enhanced with function names, file names and line numbers when symbols are included in all exe and dll files. Furthermore, this also improves debugger usage as symbols can be imported to help navigate disassembly/decompiled code. --- GNUmakefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index be0bd9b..c7ffdde 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -25,7 +25,7 @@ toolchain_64 := x86_64-w64-mingw32- gitrev := $(shell git rev-parse HEAD) cppflags := -I src -I src/main -I src/test -DGITREV=$(gitrev) -cflags := -O2 -pipe -ffunction-sections -fdata-sections \ +cflags := -g -O2 -pipe -ffunction-sections -fdata-sections \ -Wall -std=c99 -DPSAPI_VERSION=1 cflags_release := -Werror ldflags := -Wl,--gc-sections -static-libgcc @@ -240,7 +240,6 @@ $$(dll_$1_$2_$3) $$(implib_$1_$2_$3): $$(obj_$1_$2_$3) $$(abslib_$1_$2_$3) \ $(V)$$(toolchain_$1)gcc -shared \ -o $$(dll_$1_$2_$3) -Wl,--out-implib,$$(implib_$1_$2_$3) \ -Wl,--start-group $$^ -Wl,--end-group $$(ldflags_$3) - $(V)$$(toolchain_$1)strip $$(dll_$1_$2_$3) $(V)$$(toolchain_$1)ranlib $$(implib_$1_$2_$3) endef @@ -257,7 +256,6 @@ $$(exe_$1_$2_$3): $$(obj_$1_$2_$3) $$(abslib_$1_$2_$3) $$(absdpl_$1_$2_$3) \ | $$(bindir_$1_$2) $(V)echo ... $$@ $(V)$$(toolchain_$1)gcc -o $$@ $$^ $$(ldflags_$3) - $(V)$$(toolchain_$1)strip $$@ endef