diff options
| author | Jiao, Joey <jiangenj@qti.qualcomm.com> | 2025-05-08 09:00:40 +0800 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-05-13 06:52:40 +0000 |
| commit | 9497799b814907703e4a8bb6d32afe684570c848 (patch) | |
| tree | ae40481652ce7199cf1bff5185295c986c8a4e25 /Makefile | |
| parent | f6671af7193a6d6860e38e17e108afb5934568dc (diff) | |
Makefile: add DEBUG=true env to enable debug symbols
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -72,8 +72,15 @@ GITREVDATE=$(shell git log -n 1 --format="%cd" --date=format:%Y%m%d-%H%M%S) # Don't generate symbol table and DWARF debug info. # Reduces build time and binary sizes considerably. # That's only needed if you use gdb or nm. -# If you need that, build manually without these flags. -GOFLAGS := "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X 'github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)'" +# If you need that, build manually with DEBUG=true env. +GLFLAGS := +GGFLAGS := +ifeq ("$(DEBUG)", "true") + GGFLAGS := -gcflags="all=-N -l" +else + GLFLAGS := -s -w +endif +GOFLAGS := -ldflags="$(GLFLAGS) -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)" $(GGFLAGS) ifneq ("$(GOTAGS)", "") GOFLAGS += " -tags=$(GOTAGS)" endif |
