2012-09-17 18:38:38 +02:00
|
|
|
# Makefile.am -- Backtrace Makefile.
|
2020-01-01 12:51:42 +01:00
|
|
|
# Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
2012-09-17 18:38:38 +02:00
|
|
|
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met:
|
|
|
|
|
|
|
|
# (1) Redistributions of source code must retain the above copyright
|
2016-09-11 15:44:07 +02:00
|
|
|
# notice, this list of conditions and the following disclaimer.
|
2012-09-17 18:38:38 +02:00
|
|
|
|
|
|
|
# (2) Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
2016-09-11 15:44:07 +02:00
|
|
|
# distribution.
|
2012-10-02 15:14:25 +02:00
|
|
|
|
2012-09-17 18:38:38 +02:00
|
|
|
# (3) The name of the author may not be used to
|
|
|
|
# endorse or promote products derived from this software without
|
|
|
|
# specific prior written permission.
|
|
|
|
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
|
|
|
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
ACLOCAL_AMFLAGS = -I .. -I ../config
|
|
|
|
|
2012-09-19 06:37:40 +02:00
|
|
|
AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
|
2013-01-01 17:23:03 +01:00
|
|
|
-I ../libgcc
|
2012-09-19 06:37:40 +02:00
|
|
|
|
2012-12-11 19:45:45 +01:00
|
|
|
AM_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) $(PIC_FLAG)
|
2012-09-17 18:38:38 +02:00
|
|
|
|
|
|
|
noinst_LTLIBRARIES = libbacktrace.la
|
|
|
|
|
|
|
|
libbacktrace_la_SOURCES = \
|
|
|
|
backtrace.h \
|
2013-11-19 02:09:47 +01:00
|
|
|
atomic.c \
|
2012-09-17 18:38:38 +02:00
|
|
|
dwarf.c \
|
|
|
|
fileline.c \
|
|
|
|
internal.h \
|
|
|
|
posix.c \
|
|
|
|
print.c \
|
2014-03-07 06:07:56 +01:00
|
|
|
sort.c \
|
2012-09-17 18:38:38 +02:00
|
|
|
state.c
|
|
|
|
|
|
|
|
BACKTRACE_FILES = \
|
|
|
|
backtrace.c \
|
|
|
|
simple.c \
|
|
|
|
nounwind.c
|
|
|
|
|
|
|
|
FORMAT_FILES = \
|
|
|
|
elf.c \
|
2015-05-29 10:40:20 +02:00
|
|
|
pecoff.c \
|
2017-07-21 20:05:08 +02:00
|
|
|
unknown.c \
|
|
|
|
xcoff.c
|
2012-09-17 18:38:38 +02:00
|
|
|
|
|
|
|
VIEW_FILES = \
|
|
|
|
read.c \
|
|
|
|
mmapio.c
|
|
|
|
|
|
|
|
ALLOC_FILES = \
|
|
|
|
alloc.c \
|
|
|
|
mmap.c
|
|
|
|
|
|
|
|
EXTRA_libbacktrace_la_SOURCES = \
|
|
|
|
$(BACKTRACE_FILES) \
|
|
|
|
$(FORMAT_FILES) \
|
|
|
|
$(VIEW_FILES) \
|
|
|
|
$(ALLOC_FILES)
|
|
|
|
|
|
|
|
libbacktrace_la_LIBADD = \
|
|
|
|
$(BACKTRACE_FILE) \
|
|
|
|
$(FORMAT_FILE) \
|
|
|
|
$(VIEW_FILE) \
|
|
|
|
$(ALLOC_FILE)
|
|
|
|
|
|
|
|
libbacktrace_la_DEPENDENCIES = $(libbacktrace_la_LIBADD)
|
|
|
|
|
|
|
|
# Testsuite.
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
# Add test to this variable, if you want it to be build.
|
2012-09-17 18:38:38 +02:00
|
|
|
check_PROGRAMS =
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
# Add test to this variable, if you want it to be run.
|
|
|
|
TESTS =
|
|
|
|
|
|
|
|
# Add test to this variable, if you want it to be build and run.
|
|
|
|
BUILDTESTS =
|
2012-09-17 18:38:38 +02:00
|
|
|
|
|
|
|
if NATIVE
|
2018-11-30 16:33:12 +01:00
|
|
|
check_LTLIBRARIES = libbacktrace_alloc.la
|
|
|
|
|
|
|
|
libbacktrace_alloc_la_SOURCES = $(libbacktrace_la_SOURCES)
|
|
|
|
libbacktrace_alloc_la_LIBADD = $(BACKTRACE_FILE) $(FORMAT_FILE) read.lo alloc.lo
|
|
|
|
|
|
|
|
libbacktrace_alloc_la_DEPENDENCIES = $(libbacktrace_alloc_la_LIBADD)
|
|
|
|
|
2018-11-30 16:33:23 +01:00
|
|
|
check_LTLIBRARIES += libbacktrace_noformat.la
|
|
|
|
|
|
|
|
libbacktrace_noformat_la_SOURCES = $(libbacktrace_la_SOURCES)
|
|
|
|
libbacktrace_noformat_la_LIBADD = $(BACKTRACE_FILE) $(VIEW_FILE) $(ALLOC_FILE)
|
|
|
|
|
|
|
|
libbacktrace_noformat_la_DEPENDENCIES = $(libbacktrace_noformat_la_LIBADD)
|
|
|
|
|
2019-01-29 17:25:46 +01:00
|
|
|
if HAVE_ELF
|
|
|
|
if HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
|
|
|
TEST_BUILD_ID_DIR=$(abs_builddir)/usr/lib/debug/.build-id/
|
|
|
|
|
|
|
|
check_LTLIBRARIES += libbacktrace_elf_for_test.la
|
|
|
|
|
|
|
|
libbacktrace_elf_for_test_la_SOURCES = $(libbacktrace_la_SOURCES)
|
|
|
|
libbacktrace_elf_for_test_la_LIBADD = $(BACKTRACE_FILE) elf_for_test.lo \
|
|
|
|
$(VIEW_FILE) $(ALLOC_FILE)
|
|
|
|
|
|
|
|
elf_for_test.c: elf.c
|
|
|
|
SEARCH='^#define SYSTEM_BUILD_ID_DIR.*$$'; \
|
|
|
|
REPLACE="#define SYSTEM_BUILD_ID_DIR \"$(TEST_BUILD_ID_DIR)\""; \
|
|
|
|
$(SED) "s%$$SEARCH%$$REPLACE%" \
|
|
|
|
$< \
|
|
|
|
> $@.tmp
|
|
|
|
mv $@.tmp $@
|
|
|
|
|
|
|
|
endif HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
endif HAVE_ELF
|
|
|
|
|
2019-05-24 13:55:21 +02:00
|
|
|
elf_%.c: elf.c
|
|
|
|
SEARCH='#error "Unknown BACKTRACE_ELF_SIZE"'; \
|
|
|
|
REPLACE='#undef BACKTRACE_ELF_SIZE\
|
|
|
|
#define BACKTRACE_ELF_SIZE'; \
|
|
|
|
$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
|
|
|
|
$< \
|
|
|
|
> $@.tmp
|
|
|
|
mv $@.tmp $@
|
|
|
|
|
2018-11-30 16:33:23 +01:00
|
|
|
xcoff_%.c: xcoff.c
|
|
|
|
SEARCH='#error "Unknown BACKTRACE_XCOFF_SIZE"'; \
|
2018-12-30 00:22:50 +01:00
|
|
|
REPLACE='#undef BACKTRACE_XCOFF_SIZE\
|
|
|
|
#define BACKTRACE_XCOFF_SIZE'; \
|
2018-11-30 16:33:23 +01:00
|
|
|
$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
|
2019-01-28 23:21:19 +01:00
|
|
|
$< \
|
|
|
|
> $@.tmp
|
|
|
|
mv $@.tmp $@
|
2018-11-30 16:33:23 +01:00
|
|
|
|
2019-05-24 13:55:21 +02:00
|
|
|
test_elf_32_SOURCES = test_format.c testlib.c
|
|
|
|
test_elf_32_LDADD = libbacktrace_noformat.la elf_32.lo
|
|
|
|
|
|
|
|
BUILDTESTS += test_elf_32
|
|
|
|
|
|
|
|
test_elf_64_SOURCES = test_format.c testlib.c
|
|
|
|
test_elf_64_LDADD = libbacktrace_noformat.la elf_64.lo
|
2018-11-30 16:33:23 +01:00
|
|
|
|
2019-05-24 13:55:21 +02:00
|
|
|
BUILDTESTS += test_elf_64
|
2018-11-30 16:33:23 +01:00
|
|
|
|
|
|
|
test_xcoff_32_SOURCES = test_format.c testlib.c
|
|
|
|
test_xcoff_32_LDADD = libbacktrace_noformat.la xcoff_32.lo
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += test_xcoff_32
|
2018-11-30 16:33:23 +01:00
|
|
|
|
|
|
|
test_xcoff_64_SOURCES = test_format.c testlib.c
|
|
|
|
test_xcoff_64_LDADD = libbacktrace_noformat.la xcoff_64.lo
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += test_xcoff_64
|
2018-11-30 16:33:23 +01:00
|
|
|
|
|
|
|
test_pecoff_SOURCES = test_format.c testlib.c
|
|
|
|
test_pecoff_LDADD = libbacktrace_noformat.la pecoff.lo
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += test_pecoff
|
2018-11-30 16:33:23 +01:00
|
|
|
|
|
|
|
test_unknown_SOURCES = test_format.c testlib.c
|
|
|
|
test_unknown_LDADD = libbacktrace_noformat.la unknown.lo
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += test_unknown
|
2018-11-30 16:33:23 +01:00
|
|
|
|
2018-11-27 09:25:52 +01:00
|
|
|
unittest_SOURCES = unittest.c testlib.c
|
|
|
|
unittest_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += unittest
|
2012-09-17 18:38:38 +02:00
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
unittest_alloc_SOURCES = $(unittest_SOURCES)
|
|
|
|
unittest_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += unittest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
2018-12-12 14:50:51 +01:00
|
|
|
check_LTLIBRARIES += libbacktrace_instrumented_alloc.la
|
|
|
|
|
|
|
|
libbacktrace_instrumented_alloc_la_SOURCES = $(libbacktrace_la_SOURCES)
|
|
|
|
libbacktrace_instrumented_alloc_la_LIBADD = $(BACKTRACE_FILE) $(FORMAT_FILE) \
|
|
|
|
read.lo instrumented_alloc.lo
|
|
|
|
|
|
|
|
libbacktrace_instrumented_alloc_la_DEPENDENCIES = \
|
|
|
|
$(libbacktrace_instrumented_alloc_la_LIBADD)
|
|
|
|
|
|
|
|
instrumented_alloc.lo: alloc.c
|
|
|
|
|
|
|
|
allocfail_SOURCES = allocfail.c testlib.c
|
|
|
|
allocfail_LDADD = libbacktrace_instrumented_alloc.la
|
|
|
|
|
|
|
|
check_PROGRAMS += allocfail
|
|
|
|
|
|
|
|
allocfail.sh: allocfail
|
|
|
|
|
|
|
|
TESTS += allocfail.sh
|
|
|
|
|
2019-01-29 17:25:46 +01:00
|
|
|
if HAVE_ELF
|
|
|
|
if HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
|
|
|
b2test_SOURCES = $(btest_SOURCES)
|
|
|
|
b2test_CFLAGS = $(btest_CFLAGS)
|
|
|
|
b2test_LDFLAGS = -Wl,--build-id
|
|
|
|
b2test_LDADD = libbacktrace_elf_for_test.la
|
|
|
|
|
|
|
|
check_PROGRAMS += b2test
|
|
|
|
TESTS += b2test_buildid
|
|
|
|
|
2019-02-26 08:54:57 +01:00
|
|
|
if HAVE_DWZ
|
|
|
|
|
2019-01-29 17:25:46 +01:00
|
|
|
b3test_SOURCES = $(btest_SOURCES)
|
|
|
|
b3test_CFLAGS = $(btest_CFLAGS)
|
|
|
|
b3test_LDFLAGS = -Wl,--build-id
|
|
|
|
b3test_LDADD = libbacktrace_elf_for_test.la
|
|
|
|
|
|
|
|
check_PROGRAMS += b3test
|
|
|
|
TESTS += b3test_dwz_buildid
|
|
|
|
|
2019-02-26 08:54:57 +01:00
|
|
|
endif HAVE_DWZ
|
|
|
|
|
2019-01-29 17:25:46 +01:00
|
|
|
endif HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
endif HAVE_ELF
|
|
|
|
|
2017-06-12 05:25:04 +02:00
|
|
|
btest_SOURCES = btest.c testlib.c
|
2012-09-17 18:38:38 +02:00
|
|
|
btest_CFLAGS = $(AM_CFLAGS) -g -O
|
|
|
|
btest_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += btest
|
2012-09-17 18:38:38 +02:00
|
|
|
|
2019-02-10 04:16:09 +01:00
|
|
|
if HAVE_ELF
|
|
|
|
|
|
|
|
btest_lto_SOURCES = btest.c testlib.c
|
|
|
|
btest_lto_CFLAGS = $(AM_CFLAGS) -g -O -flto
|
|
|
|
btest_lto_LDADD = libbacktrace.la
|
|
|
|
|
|
|
|
BUILDTESTS += btest_lto
|
|
|
|
|
|
|
|
endif HAVE_ELF
|
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
btest_alloc_SOURCES = $(btest_SOURCES)
|
|
|
|
btest_alloc_CFLAGS = $(btest_CFLAGS)
|
|
|
|
btest_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += btest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
2019-01-17 14:42:30 +01:00
|
|
|
if HAVE_DWZ
|
|
|
|
|
|
|
|
%_dwz: %
|
|
|
|
rm -f $@ $@_common.debug
|
|
|
|
cp $< $@_1
|
|
|
|
cp $< $@_2
|
|
|
|
$(DWZ) -m $@_common.debug $@_1 $@_2
|
|
|
|
rm -f $@_2
|
|
|
|
mv $@_1 $@
|
|
|
|
|
|
|
|
TESTS += btest_dwz
|
|
|
|
|
2019-01-25 15:39:58 +01:00
|
|
|
if HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
|
|
|
TESTS += btest_dwz_gnudebuglink
|
|
|
|
|
|
|
|
endif HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
2019-01-17 14:42:30 +01:00
|
|
|
endif HAVE_DWZ
|
|
|
|
|
2014-03-07 06:07:56 +01:00
|
|
|
stest_SOURCES = stest.c
|
|
|
|
stest_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += stest
|
2014-03-07 06:07:56 +01:00
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
stest_alloc_SOURCES = $(stest_SOURCES)
|
|
|
|
stest_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += stest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
2019-03-11 21:40:34 +01:00
|
|
|
if HAVE_ELF
|
|
|
|
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
ztest_SOURCES = ztest.c testlib.c
|
|
|
|
ztest_CFLAGS = -DSRCDIR=\"$(srcdir)\"
|
|
|
|
ztest_LDADD = libbacktrace.la
|
2018-11-30 16:33:12 +01:00
|
|
|
ztest_alloc_LDADD = libbacktrace_alloc.la
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
|
|
|
|
if HAVE_ZLIB
|
|
|
|
ztest_LDADD += -lz
|
2018-11-30 16:33:12 +01:00
|
|
|
ztest_alloc_LDADD += -lz
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
endif
|
2017-10-03 04:27:33 +02:00
|
|
|
ztest_LDADD += $(CLOCK_GETTIME_LINK)
|
2018-11-30 16:33:12 +01:00
|
|
|
ztest_alloc_LDADD += $(CLOCK_GETTIME_LINK)
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ztest
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
ztest_alloc_SOURCES = $(ztest_SOURCES)
|
|
|
|
ztest_alloc_CFLAGS = $(ztest_CFLAGS)
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ztest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
2019-03-11 21:40:34 +01:00
|
|
|
endif HAVE_ELF
|
|
|
|
|
2017-06-12 05:25:04 +02:00
|
|
|
edtest_SOURCES = edtest.c edtest2_build.c testlib.c
|
2017-05-19 18:07:24 +02:00
|
|
|
edtest_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += edtest
|
2017-05-19 18:07:24 +02:00
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
edtest_alloc_SOURCES = $(edtest_SOURCES)
|
|
|
|
edtest_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += edtest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
2017-05-19 18:07:24 +02:00
|
|
|
edtest2_build.c: gen_edtest2_build; @true
|
|
|
|
gen_edtest2_build: $(srcdir)/edtest2.c
|
|
|
|
cat $(srcdir)/edtest2.c > tmp-edtest2_build.c
|
|
|
|
$(SHELL) $(srcdir)/../move-if-change tmp-edtest2_build.c edtest2_build.c
|
|
|
|
echo timestamp > $@
|
|
|
|
|
2017-06-12 05:25:04 +02:00
|
|
|
if HAVE_PTHREAD
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ttest
|
2017-06-12 05:25:04 +02:00
|
|
|
|
|
|
|
ttest_SOURCES = ttest.c testlib.c
|
2017-09-12 19:00:00 +02:00
|
|
|
ttest_CFLAGS = $(AM_CFLAGS) -pthread
|
2017-06-12 05:25:04 +02:00
|
|
|
ttest_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ttest_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
|
|
|
ttest_alloc_SOURCES = $(ttest_SOURCES)
|
|
|
|
ttest_alloc_CFLAGS = $(ttest_CFLAGS)
|
|
|
|
ttest_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2017-06-12 05:25:04 +02:00
|
|
|
endif HAVE_PTHREAD
|
|
|
|
|
2017-09-20 23:09:37 +02:00
|
|
|
if HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
2019-01-25 15:39:47 +01:00
|
|
|
TESTS += btest_gnudebuglink
|
2017-09-20 23:09:37 +02:00
|
|
|
|
2019-01-25 15:39:47 +01:00
|
|
|
%_gnudebuglink: %
|
|
|
|
$(OBJCOPY) --only-keep-debug $< $@.debug
|
|
|
|
$(OBJCOPY) --strip-debug --add-gnu-debuglink=$@.debug $< $@
|
2017-09-20 23:09:37 +02:00
|
|
|
|
|
|
|
endif HAVE_OBJCOPY_DEBUGLINK
|
|
|
|
|
2019-01-29 17:25:46 +01:00
|
|
|
%_buildid: %
|
|
|
|
./install-debuginfo-for-buildid.sh \
|
|
|
|
"$(TEST_BUILD_ID_DIR)" \
|
|
|
|
$<
|
|
|
|
$(OBJCOPY) --strip-debug $< $@
|
|
|
|
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
if HAVE_COMPRESSED_DEBUG
|
|
|
|
|
|
|
|
ctestg_SOURCES = btest.c testlib.c
|
|
|
|
ctestg_CFLAGS = $(AM_CFLAGS) -g
|
|
|
|
ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu
|
|
|
|
ctestg_LDADD = libbacktrace.la
|
|
|
|
|
|
|
|
ctesta_SOURCES = btest.c testlib.c
|
|
|
|
ctesta_CFLAGS = $(AM_CFLAGS) -g
|
|
|
|
ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
|
|
|
|
ctesta_LDADD = libbacktrace.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ctestg ctesta
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
|
2018-11-30 16:33:12 +01:00
|
|
|
ctestg_alloc_SOURCES = $(ctestg_SOURCES)
|
|
|
|
ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
|
|
|
|
ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
|
|
|
|
ctestg_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
|
|
|
ctesta_alloc_SOURCES = $(ctesta_SOURCES)
|
|
|
|
ctesta_alloc_CFLAGS = $(ctesta_CFLAGS)
|
|
|
|
ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS)
|
|
|
|
ctesta_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
BUILDTESTS += ctestg_alloc ctesta_alloc
|
2018-11-30 16:33:12 +01:00
|
|
|
|
re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
From-SVN: r253275
2017-09-29 02:30:35 +02:00
|
|
|
endif
|
|
|
|
|
libbacktrace: add DWARF 5 support
* dwarf.c (struct attr): Add val field.
(enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
(struct line_header): Add addrsize field.
(struct line_header_format): Define.
(struct unit): Add str_offsets_base, addr_base, and rnglists_base
fields.
(read_uint24): New static function.
(read_attribute): Add implicit_val parameter. Replace dwarf_str
and dwarf_str_size parameters with dwarf_sections parameter. Add
support for new DWARF 5 forms. Change all callers.
(resolve_string): New static function.
(resolve_addr_index): Likewise.
(read_abbrevs): Support DW_FORM_implicit_const.
(struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
and ranges_is_index fields.
(update_pcrange): Support DWARF 5 encodings.
(add_high_low_range): New static function, split out of
add_ranges.
(add_ranges_from_ranges): Likewise.
(add_ranges_from_rnglists): New static function.
(add_ranges): Just call new helper functions.
(find_address_ranges): Use resolve_string for strings, after
reading all attributes. Handle new DWARF 5 attributes.
(build_address_map): Support DWARF 5 compilation units.
(read_v2_paths): New static function, split out of
read_line_header.
(read_lnct): New static function.
(read_line_header_format_entries): Likewise.
(read_line_header): Add ddata parameter. Support DWARF 5 line
headers. Call new helper functions. Change all callers.
(read_line_program): Use addrsize from line program header. Don't
special case directory index 0 for DWARF 5.
(read_referenced_name): Use resolve_string.
(read_function_entry): Handle DWARF 5 encodings. Use
resolve_string.
* internal.h (enum dwarf_section): Add DEBUG_ADDR,
DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
* elf.c (dwarf_section_names): Add new section names.
* pecoff.c (dwarf_section_names): Likewise.
* xcoff.c (xcoff_add): Clear dwarf_sections before setting
fields.
* configure.ac: Define HAVE_DWARF5 automake conditional.
* Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
(dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
(dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
(dwarf5_alloc_LDADD): Likewise.
(BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
(CLEANFILES, clean-local): Define.
From-SVN: r279380
2019-12-13 21:04:47 +01:00
|
|
|
if HAVE_DWARF5
|
|
|
|
|
|
|
|
dwarf5_SOURCES = btest.c testlib.c
|
|
|
|
dwarf5_CFLAGS = $(AM_CFLAGS) -gdwarf-5
|
|
|
|
dwarf5_LDADD = libbacktrace.la
|
|
|
|
|
|
|
|
BUILDTESTS += dwarf5
|
|
|
|
|
|
|
|
dwarf5_alloc_SOURCES = $(dwarf5_SOURCES)
|
|
|
|
dwarf5_alloc_CFLAGS = $(dwarf5_CFLAGS)
|
|
|
|
dwarf5_alloc_LDADD = libbacktrace_alloc.la
|
|
|
|
|
|
|
|
BUILDTESTS += dwarf5_alloc
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-09-17 18:38:38 +02:00
|
|
|
endif NATIVE
|
2012-09-28 08:13:00 +02:00
|
|
|
|
2019-01-29 08:22:16 +01:00
|
|
|
check_PROGRAMS += $(BUILDTESTS)
|
|
|
|
|
|
|
|
TESTS += $(BUILDTESTS)
|
|
|
|
|
libbacktrace: add DWARF 5 support
* dwarf.c (struct attr): Add val field.
(enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
(struct line_header): Add addrsize field.
(struct line_header_format): Define.
(struct unit): Add str_offsets_base, addr_base, and rnglists_base
fields.
(read_uint24): New static function.
(read_attribute): Add implicit_val parameter. Replace dwarf_str
and dwarf_str_size parameters with dwarf_sections parameter. Add
support for new DWARF 5 forms. Change all callers.
(resolve_string): New static function.
(resolve_addr_index): Likewise.
(read_abbrevs): Support DW_FORM_implicit_const.
(struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
and ranges_is_index fields.
(update_pcrange): Support DWARF 5 encodings.
(add_high_low_range): New static function, split out of
add_ranges.
(add_ranges_from_ranges): Likewise.
(add_ranges_from_rnglists): New static function.
(add_ranges): Just call new helper functions.
(find_address_ranges): Use resolve_string for strings, after
reading all attributes. Handle new DWARF 5 attributes.
(build_address_map): Support DWARF 5 compilation units.
(read_v2_paths): New static function, split out of
read_line_header.
(read_lnct): New static function.
(read_line_header_format_entries): Likewise.
(read_line_header): Add ddata parameter. Support DWARF 5 line
headers. Call new helper functions. Change all callers.
(read_line_program): Use addrsize from line program header. Don't
special case directory index 0 for DWARF 5.
(read_referenced_name): Use resolve_string.
(read_function_entry): Handle DWARF 5 encodings. Use
resolve_string.
* internal.h (enum dwarf_section): Add DEBUG_ADDR,
DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
* elf.c (dwarf_section_names): Add new section names.
* pecoff.c (dwarf_section_names): Likewise.
* xcoff.c (xcoff_add): Clear dwarf_sections before setting
fields.
* configure.ac: Define HAVE_DWARF5 automake conditional.
* Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
(dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
(dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
(dwarf5_alloc_LDADD): Likewise.
(BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
(CLEANFILES, clean-local): Define.
From-SVN: r279380
2019-12-13 21:04:47 +01:00
|
|
|
CLEANFILES = $(TESTS) *.debug elf_for_test.c edtest2_build.c gen_edtest2_build
|
|
|
|
|
|
|
|
clean-local:
|
|
|
|
-rm -rf usr
|
|
|
|
|
2012-09-28 08:13:00 +02:00
|
|
|
# We can't use automake's automatic dependency tracking, because it
|
|
|
|
# breaks when using bootstrap-lean. Automatic dependency tracking
|
|
|
|
# with GCC bootstrap will cause some of the objects to depend on
|
|
|
|
# header files in prev-gcc/include, e.g., stddef.h and stdarg.h. When
|
|
|
|
# using bootstrap-lean, prev-gcc is removed after each stage. When
|
|
|
|
# running "make install", those header files will be gone, causing the
|
|
|
|
# library to be rebuilt at install time. That may not succeed.
|
|
|
|
|
|
|
|
# These manual dependencies do not include dependencies on unwind.h,
|
|
|
|
# even though that is part of GCC, because where to find it depends on
|
|
|
|
# whether we are being built as a host library or a target library.
|
|
|
|
|
|
|
|
INCDIR = $(top_srcdir)/../include
|
|
|
|
alloc.lo: config.h backtrace.h internal.h
|
2015-09-11 20:37:31 +02:00
|
|
|
backtrace.lo: config.h backtrace.h internal.h
|
2012-09-28 08:13:00 +02:00
|
|
|
btest.lo: (INCDIR)/filenames.h backtrace.h backtrace-supported.h
|
|
|
|
dwarf.lo: config.h $(INCDIR)/dwarf2.h $(INCDIR)/dwarf2.def \
|
|
|
|
$(INCDIR)/filenames.h backtrace.h internal.h
|
|
|
|
elf.lo: config.h backtrace.h internal.h
|
|
|
|
fileline.lo: config.h backtrace.h internal.h
|
|
|
|
mmap.lo: config.h backtrace.h internal.h
|
|
|
|
mmapio.lo: config.h backtrace.h internal.h
|
|
|
|
nounwind.lo: config.h internal.h
|
2015-05-29 10:40:20 +02:00
|
|
|
pecoff.lo: config.h backtrace.h internal.h
|
2012-09-28 08:13:00 +02:00
|
|
|
posix.lo: config.h backtrace.h internal.h
|
|
|
|
print.lo: config.h backtrace.h internal.h
|
|
|
|
read.lo: config.h backtrace.h internal.h
|
|
|
|
simple.lo: config.h backtrace.h internal.h
|
2015-09-11 20:37:31 +02:00
|
|
|
sort.lo: config.h backtrace.h internal.h
|
|
|
|
stest.lo: config.h backtrace.h internal.h
|
2012-09-28 08:13:00 +02:00
|
|
|
state.lo: config.h backtrace.h backtrace-supported.h internal.h
|
|
|
|
unknown.lo: config.h backtrace.h internal.h
|
2017-07-21 20:05:08 +02:00
|
|
|
xcoff.lo: config.h backtrace.h internal.h
|
|
|
|
|
Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)
The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf. Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree. Autoconf 2.69 has Go support, so
local copies of that support are removed. I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update. Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.
Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory). Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.
While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers. Specifically, most of those warnings
were of the following form (example from libgfortran):
Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed. In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.
I've tested this with native, cross and Canadian cross builds. The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.
top level:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* multilib.am: New file. From automake.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.
config:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* math.m4, tls.m4: Use AC_LANG_SOURCE.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.
fixincludes:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, configure: Regenerate.
gcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use single
line for second argument of AC_DEFINE_UNQUOTED.
* doc/install.texi (Tools/packages necessary for modifying GCC):
Update to autoconf 2.69 and automake 1.15.1.
* aclocal.m4, config.in, configure: Regenerate.
gnattools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
gotools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* config/go.m4: Remove file.
* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
* configure.ac: Remove AC_PREREQ. Do not include config/go.m4.
* Makefile.in, aclocal.m4, configure: Regenerate.
intl:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.
libada:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
libatomic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* acinclude.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libbacktrace:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libcc1:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libcpp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* aclocal.m4, config.in, configure: Regenerate.
libdecnumber:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.
libffi:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove doc/libffi.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
Regenerate.
libgcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* configure: Regenerate.
libgfortran:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libgo [logically part of this change but omitted from the commit]:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* config/go.m4: Remove file.
* config/libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use
-Wno-override in AM_INIT_AUTOMAKE call.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libgomp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libgomp.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libhsail-rt:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libiberty:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.
libitm:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libitm.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libobjc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, config.h.in, configure: Regenerate.
liboffloadmic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* plugin/Makefile.am: Include multilib.am.
* plugin/configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
plugin/aclocal.m4, plugin/configure: Regenerate.
libphobos:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use -Wno-override in
AM_INIT_AUTOMAKE call.
* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
* m4/druntime/os.m4: Use AC_LANG_SOURCE.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
src/Makefile.in, testsuite/Makefile.in: Regenerate.
libquadmath:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.8. Add info-in-builddir.
(all-local): Define outside conditional code.
(CLEANFILES): Remove libquadmath.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libsanitizer:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
interception/Makefile.in, libbacktrace/Makefile.in,
lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
ubsan/Makefile.in: Regenerate.
libssp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.9.5.
* configure.ac: Remove AC_PREREQ. Quote argument to
AC_RUN_IFELSE.
* Makefile.in, aclocal.m4, configure: Regenerate.
libstdc++-v3:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
src/c++17/Makefile.in, src/c++98/Makefile.in,
src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.
libvtv:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
lto-plugin:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
zlib:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
From-SVN: r265695
2018-10-31 18:03:16 +01:00
|
|
|
include $(top_srcdir)/../multilib.am
|