commit: 206a802baa29af093ca086a08f1d9aa5d9c91737
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 04:34:36 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Mar 11 04:34:36 2014 +0000
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=206a802b
build: use -fsanitize=address when doing a debug build
Will help track down memory errors nicely.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d202f54..79a19eb 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ CFLAGS ?= -O2 -g -pipe
CFLAGS += -std=gnu99
CPPFLAGS ?=
CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
-#CFLAGS += -DEBUG -g
+DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc,
-fsanitize=address)
#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2
-falign-labels=2 -falign-loops=2
#LDFLAGS := -pie
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo
'-lkvm')
@@ -62,7 +62,7 @@ all: q
@true
debug:
- $(MAKE) CFLAGS="$(CFLAGS) -O0 -DEBUG -g3 -ggdb -fno-pie" clean symlinks
+ $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" clean symlinks
@-scanelf -o /dev/null -BXxz permsx q
q: $(SRC) libq/*.c *.h libq/*.h