forked from cory/tildefriends
Use libbacktrace to generate better leak callstacks.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3986 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
54
Makefile
54
Makefile
@ -15,19 +15,21 @@ CFLAGS += \
|
||||
-Wno-cast-function-type \
|
||||
-MMD \
|
||||
-ffunction-sections \
|
||||
-fdata-sections
|
||||
-fdata-sections \
|
||||
-fno-omit-frame-pointer \
|
||||
-g
|
||||
LDFLAGS += -Wl,-gc-sections
|
||||
|
||||
debug windebug: CFLAGS += -Og -g -fno-omit-frame-pointer
|
||||
debug windebug: CFLAGS += -Og
|
||||
debug release: LDFLAGS += -rdynamic
|
||||
release winrelease: CFLAGS += -DNDEBUG -O3 -g
|
||||
release winrelease: CFLAGS += -DNDEBUG -O3
|
||||
windebug winrelease: CC = i686-w64-mingw32-gcc-win32
|
||||
windebug winrelease: AS = $(CC)
|
||||
windebug winrelease: CFLAGS += -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNTDDI_VERSION=NTDDI_WIN10
|
||||
windebug winrelease: LDFLAGS += -static
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-common
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
|
||||
@ -135,7 +137,6 @@ $(UV_OBJS): CFLAGS += \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-incompatible-pointer-types \
|
||||
-Wno-sign-compare \
|
||||
-Wno-maybe-uninitialized \
|
||||
-Wno-unused-variable \
|
||||
-D_GNU_SOURCE \
|
||||
|
||||
@ -237,6 +238,48 @@ $(QUICKJS_OBJS): CFLAGS += \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-enum-conversion
|
||||
|
||||
LIBBACKTRACE_SOURCES := \
|
||||
deps/libbacktrace/atomic.c \
|
||||
deps/libbacktrace/backtrace.c \
|
||||
deps/libbacktrace/dwarf.c \
|
||||
deps/libbacktrace/elf.c \
|
||||
deps/libbacktrace/fileline.c \
|
||||
deps/libbacktrace/mmap.c \
|
||||
deps/libbacktrace/mmapio.c \
|
||||
deps/libbacktrace/posix.c \
|
||||
deps/libbacktrace/print.c \
|
||||
deps/libbacktrace/simple.c \
|
||||
deps/libbacktrace/sort.c \
|
||||
deps/libbacktrace/state.c
|
||||
|
||||
#deps/libbacktrace/unknown.c
|
||||
#deps/libbacktrace/read.c \
|
||||
#deps/libbacktrace/nounwind.c \
|
||||
#deps/libbacktrace/instrumented_alloc.c \
|
||||
#deps/libbacktrace/pecoff.c \
|
||||
#deps/libbacktrace/xcoff.c
|
||||
#deps/libbacktrace/macho.c \
|
||||
#deps/libbacktrace/alloc.c \
|
||||
#deps/libbacktrace/allocfail.c
|
||||
#deps/libbacktrace/btest.c
|
||||
#deps/libbacktrace/edtest.c
|
||||
#deps/libbacktrace/edtest2.c
|
||||
#deps/libbacktrace/mtest.c
|
||||
#deps/libbacktrace/stest.c
|
||||
#deps/libbacktrace/test_format.c
|
||||
#deps/libbacktrace/testlib.c
|
||||
#deps/libbacktrace/ttest.c
|
||||
#deps/libbacktrace/unittest.c
|
||||
#deps/libbacktrace/xztest.c
|
||||
#deps/libbacktrace/ztest.c
|
||||
LIBBACKTRACE_OBJS := $(call get_objs,LIBBACKTRACE_SOURCES)
|
||||
$(LIBBACKTRACE_OBJS): CFLAGS += \
|
||||
-Ideps/libbacktrace_config \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-maybe-initialized \
|
||||
-Wno-unused-function \
|
||||
-DBACKTRACE_ELF_SIZE=64
|
||||
|
||||
LDFLAGS += \
|
||||
-pthread \
|
||||
-lm
|
||||
@ -260,6 +303,7 @@ ALL_APP_OBJS := \
|
||||
$(APP_OBJS) \
|
||||
$(BASE64C_OBJS) \
|
||||
$(BLOWFISH_OBJS) \
|
||||
$(LIBBACKTRACE_OBJS) \
|
||||
$(QUICKJS_OBJS) \
|
||||
$(SODIUM_OBJS) \
|
||||
$(SQLITE_OBJS) \
|
||||
|
Reference in New Issue
Block a user