Skip to content

Commit 3241b82

Browse files
committed
Makefile: add DEBUG=true env to enable debug symbols
1 parent dbf35fa commit 3241b82

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,15 @@ GITREVDATE=$(shell git log -n 1 --format="%cd" --date=format:%Y%m%d-%H%M%S)
7272
# Don't generate symbol table and DWARF debug info.
7373
# Reduces build time and binary sizes considerably.
7474
# That's only needed if you use gdb or nm.
75-
# If you need that, build manually without these flags.
76-
GOFLAGS := "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X 'github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)'"
75+
# If you need that, build manually with DEBUG=true env.
76+
GLFLAGS :=
77+
GGFLAGS :=
78+
ifeq ("$(DEBUG)", "true")
79+
GGFLAGS := -gcflags="all=-N -l"
80+
else
81+
GLFLAGS := -s -w
82+
endif
83+
GOFLAGS := -ldflags="$(GLFLAGS) -X github.com/google/syzkaller/prog.GitRevision=$(REV) -X github.com/google/syzkaller/prog.gitRevisionDate=$(GITREVDATE)" $(GGFLAGS)
7784
ifneq ("$(GOTAGS)", "")
7885
GOFLAGS += " -tags=$(GOTAGS)"
7986
endif

0 commit comments

Comments
 (0)