Skip to content

Commit 17f687d

Browse files
thanmianlancetaylor
authored andcommitted
Update from gcc trunk version of libbacktrace at svn rev 256427. (#8)
Includes (among other things) support for compressed debug sections, a variety of bugfixes, and expanded test coverage.
1 parent 14d377e commit 17f687d

37 files changed

+10195
-2161
lines changed

Makefile.am

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile.am -- Backtrace Makefile.
2-
# Copyright (C) 2012-2016 Free Software Foundation, Inc.
2+
# Copyright (C) 2012-2018 Free Software Foundation, Inc.
33

44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are
@@ -29,11 +29,14 @@
2929
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3030
# POSSIBILITY OF SUCH DAMAGE.
3131

32+
ACLOCAL_AMFLAGS = -I .. -I ../config
33+
3234
AM_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) $(PIC_FLAG)
3335

34-
lib_LTLIBRARIES = libbacktrace.la
3536
include_HEADERS = backtrace.h backtrace-supported.h
3637

38+
noinst_LTLIBRARIES = libbacktrace.la
39+
3740
libbacktrace_la_SOURCES = \
3841
backtrace.h \
3942
atomic.c \
@@ -53,7 +56,8 @@ BACKTRACE_FILES = \
5356
FORMAT_FILES = \
5457
elf.c \
5558
pecoff.c \
56-
unknown.c
59+
unknown.c \
60+
xcoff.c
5761

5862
VIEW_FILES = \
5963
read.c \
@@ -85,7 +89,7 @@ TESTS = $(check_PROGRAMS)
8589

8690
if NATIVE
8791

88-
btest_SOURCES = btest.c
92+
btest_SOURCES = btest.c testlib.c
8993
btest_CFLAGS = $(AM_CFLAGS) -g -O
9094
btest_LDADD = libbacktrace.la
9195

@@ -96,6 +100,64 @@ stest_LDADD = libbacktrace.la
96100

97101
check_PROGRAMS += stest
98102

103+
ztest_SOURCES = ztest.c testlib.c
104+
ztest_CFLAGS = -DSRCDIR=\"$(srcdir)\"
105+
ztest_LDADD = libbacktrace.la
106+
107+
if HAVE_ZLIB
108+
ztest_LDADD += -lz
109+
endif
110+
ztest_LDADD += $(CLOCK_GETTIME_LINK)
111+
112+
check_PROGRAMS += ztest
113+
114+
edtest_SOURCES = edtest.c edtest2_build.c testlib.c
115+
edtest_LDADD = libbacktrace.la
116+
117+
check_PROGRAMS += edtest
118+
119+
edtest2_build.c: gen_edtest2_build; @true
120+
gen_edtest2_build: $(srcdir)/edtest2.c
121+
cat $(srcdir)/edtest2.c > tmp-edtest2_build.c
122+
$(SHELL) $(srcdir)/move-if-change tmp-edtest2_build.c edtest2_build.c
123+
echo timestamp > $@
124+
125+
if HAVE_PTHREAD
126+
127+
check_PROGRAMS += ttest
128+
129+
ttest_SOURCES = ttest.c testlib.c
130+
ttest_CFLAGS = $(AM_CFLAGS) -pthread
131+
ttest_LDADD = libbacktrace.la
132+
133+
endif HAVE_PTHREAD
134+
135+
if HAVE_OBJCOPY_DEBUGLINK
136+
137+
TESTS += dtest
138+
139+
dtest: btest
140+
$(OBJCOPY) --only-keep-debug btest btest.debug
141+
$(OBJCOPY) --strip-debug --add-gnu-debuglink=btest.debug btest dtest
142+
143+
endif HAVE_OBJCOPY_DEBUGLINK
144+
145+
if HAVE_COMPRESSED_DEBUG
146+
147+
ctestg_SOURCES = btest.c testlib.c
148+
ctestg_CFLAGS = $(AM_CFLAGS) -g
149+
ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu
150+
ctestg_LDADD = libbacktrace.la
151+
152+
ctesta_SOURCES = btest.c testlib.c
153+
ctesta_CFLAGS = $(AM_CFLAGS) -g
154+
ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
155+
ctesta_LDADD = libbacktrace.la
156+
157+
check_PROGRAMS += ctestg ctesta
158+
159+
endif
160+
99161
endif NATIVE
100162

101163
# We can't use automake's automatic dependency tracking, because it
@@ -112,8 +174,8 @@ endif NATIVE
112174

113175
alloc.lo: config.h backtrace.h internal.h
114176
backtrace.lo: config.h backtrace.h internal.h
115-
btest.lo: backtrace.h backtrace-supported.h
116-
dwarf.lo: config.h backtrace.h internal.h
177+
btest.lo: backtrace.h backtrace-supported.h filenames.h
178+
dwarf.lo: config.h filenames.h backtrace.h internal.h
117179
elf.lo: config.h backtrace.h internal.h
118180
fileline.lo: config.h backtrace.h internal.h
119181
mmap.lo: config.h backtrace.h internal.h
@@ -128,3 +190,5 @@ sort.lo: config.h backtrace.h internal.h
128190
stest.lo: config.h backtrace.h internal.h
129191
state.lo: config.h backtrace.h backtrace-supported.h internal.h
130192
unknown.lo: config.h backtrace.h internal.h
193+
xcoff.lo: config.h backtrace.h internal.h
194+

0 commit comments

Comments
 (0)