Sync libbacktrace from gcc [PR31327]

Note that this includes Nick's fix from edf64cd235 which
landed upstream a bit differently as r13-1566-g9ed57796235abc in GCC.

This pulls in libbacktrace as of r14-9404-gc775a030af9cad in GCC trunk.

Note that I have dropped a top-level Darwin change from r14-4825-g6a6d3817afa02b
which would've required an autoreconf, as it should be handled separately.

Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Sam James 2024-03-11 17:21:07 +00:00
parent 0a909fdd47
commit b450e10273
46 changed files with 4306 additions and 362 deletions

View File

@ -1,7 +1,278 @@
2023-01-12 Nick Clifton <nickc@redhat.com>
2024-03-08 Ian Lance Taylor <iant@golang.org>
* Makefile.am (CLEANFILES): Import patch from upstream to prevent
allocafail.sh from being removed when running 'make clean'.
* elf.c (elf_uncompress_chdr): Don't assume compressed section is
aligned.
2024-03-02 Ian Lance Taylor <iant@golang.org>
* Makefile.am (libbacktrace_testing_ldflags): Define.
(*_LDFLAGS): Add $(libbacktrace_testing_ldflags) for test
programs.
* Makefile.in: Regenerate
2024-03-02 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_uncompress_lzma_block): Skip all header padding bytes
and verify that they are zero.
2024-03-02 Ian Lance Taylor <iant@golang.org>
PR libbacktrace/114201
* elf.c (elf_add): Add caller_opd parameter. Change all callers.
Release opd data after all recursive calls.
2024-03-01 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_add): Add the symbol table from a debuginfo file.
* Makefile.am (MAKETESTS): Add buildidfull and gnudebuglinkfull
variants of buildid and gnudebuglink tests.
(%_gnudebuglinkfull, %_buildidfull): New patterns.
* Makefile.in: Regenerate.
2023-11-30 Ian Lance Taylor <iant@golang.org>
* pecoff.c: Include <windows.h> if available.
(coff_add): On Windows call GetModuleHandle to get base address.
2023-11-29 Ian Lance Taylor <iant@golang.org>
* fileline.c: Include <windows.h> if available.
(windows_get_executable_path): New static function.
(fileline_initialize): Call windows_get_executable_path.
* configure.ac: Checked for windows.h
* configure: Regenerate.
* config.h.in: Regenerate.
2023-10-22 Iain Sandoe <iain@sandoe.co.uk>
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
2023-08-07 Nick Alcock <nick.alcock@oracle.com>
* configure: Regenerate.
2023-08-07 Alexander von Gluck IV <kallisti5@unixzen.com>
* configure: Regenerate.
2023-08-07 Nick Alcock <nick.alcock@oracle.com>
* configure: Regenerate.
2023-08-07 Nick Alcock <nick.alcock@oracle.com>
* configure: Regenerate.
2023-08-07 H.J. Lu <hjl.tools@gmail.com>
* configure: Regenerate.
2023-08-07 H.J. Lu <hjl.tools@gmail.com>
* configure: Regenerate.
2023-08-03 Richard Biener <rguenther@suse.de>
* zstdtest.c (test_samples): Properly compute the allocation
size for the uncompressed data.
2023-07-31 Ian Lance Taylor <iant@golang.org>
* configure.ac: Check for _pgmptr declaration.
* fileline.c (fileline_initialize): Check for _pgmfptr before
/proc/self/exec.
* configure, config.h.in: Regenerate.
2023-03-28 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
bits, not before. Add unlikely for error case.
(elf_zstd_offset_table): Regenerate.
(elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
(elf_zstd_read_literals): For a single stream adjust by
total_streams_size, not compressed_size.
2023-01-20 Ian Lance Taylor <iant@golang.org>
* dwarf.c (struct function_addrs): Change low and high fields to
uintptr_t.
(struct unit_addrs): Likewise.
(resolve_addr_index): Change address parameter to uintptr_t*.
(add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
(add_function_range): Likewise.
(struct pcrange): Change lowpc and highpc fields to uintptr_t.
(add_low_high_range): Change add_range lowpc and highpc parameters
to uintptr_t.
(add_ranges_from_ranges): Likewise.
(add_ranges_from_rnglists): Likewise.
(add_low_high_range): Chnage lowpc and highpc variables to
uintpr_t.
(add_ranges_from_rnglists): Change some local variables to
uintptr_t.
(add_ranges_from_ranges): Change base parameter to uintptr_t.
(add_ranges_from_rnglists): Likewise.
(read_function_entry): Likewise.
(resolve_addr_index): Add explicit casts to uintptr_t.
(update_pcrange): Likewise.
(add_ranges_from_ranges): Likewise.
(add_ranges_from_rnglists): Likewise.
(read_function_entry): Likewise.
2023-01-17 Martin Liska <mliska@suse.cz>
* Makefile.in: Regenerate.
2023-01-06 Ian Lance Taylor <iant@golang.org>
PR libbacktrace/108297
* configure.ac: Test whether linker supports --build-id.
* Makefile.am: Only run --build-id tests if supported.
* configure, Makefile.in: Regenerate.
2022-12-17 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_fetch_backward_init): New static function.
(ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
literal size.
(ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
(elf_zstd_read_huff): Use elf_fetch_backward_init.
(elf_zstd_read_literals): New static function.
(ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
(struct elf_zstd_literals): Don't define.
(elf_zstd_literal_output): Remove static function.
(elf_zstd_decompress): Use elf_fetch_backward_init and
elf_zstd_read_literals. Rewrite literal copying.<
2022-12-10 Ian Lance Taylor <iant@golang.org>
* elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
(ZSTD_ENCODE_BASELINE_BITS): Define.
(ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
(elf_zstd_literal_length_base): New static const array.
(elf_zstd_match_length_base): Likewise.
(struct elf_zstd_fse_baseline_entry): Define.
(elf_zstd_make_literal_baseline_fse): New static function.
(elf_zstd_make_offset_baseline_fse): Likewise.
(elf_zstd_make_match_baseline_fse): Likewise.
(print_table, main): Use elf_zstd_fse_baseline_entry.
(elf_zstd_lit_table, elf_zstd_match_table): Likewise.
(elf_zstd_offset_table): Likewise.
(struct elf_zstd_seq_decode): Likewise. Remove use_rle and rle
fields.
(elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
taking a conversion function. Convert RLE to FSE.
(elf_zstd_literal_length_baseline): Remove.
(elf_zstd_literal_length_bits): Remove.
(elf_zstd_match_length_baseline): Remove.
(elf_zstd_match_length_bits): Remove.
(elf_zstd_decompress): Use elf_zstd_fse_baseline_entry. Rewrite
and simplify main loop.
2022-12-08 Ian Lance Taylor <iant@golang.org>
* configure.ac: Check for zstd library and
--compress-debug-sections=zstd linker option.
* Makefile.am (zstdtest_*): New targets.
(zstdtest_alloc_*, ctestzstd_*): New targets.
(BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
appropriate.
* elf.c (ELFCOMPRESS_ZSTD): Define.
(elf_fetch_bits): Rename from elf_zlib_fetch. Update uses.
(elf_fetch_bits_backward): New static function.
(ZLIB_HUFFMAN_*): Rename from HUFFMAN_*. Update uses.
(ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*. Update uses.
(ZSTD_TABLE_*): Define.
(struct elf_zstd_fse_entry): Define.
(elf_zstd_read_fse): New static function.
(elf_zstd_build_fse): Likewise.
(lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
(match, offset, next, print_table, main): Likewise.
(elf_zstd_lit_table): New static const array.
(elf_zstd_match_table, elf_zstd_offset_table): Likewise.
(elf_zstd_read_huff): New static function.
(struct elf_zstd_seq_decode): Define.
(elf_zstd_unpack_seq_decode): New static function.
(ZSTD_LIT_*): Define.
(struct elf_zstd_literals): Define.
(elf_zstd_literal_output): New static function.
(ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
(elf_zstd_literal_length_baseline): New static const array.
(elf_zstd_literal_length_bits): Likewise.
(ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
(elf_zstd_match_length_baseline): New static const array.
(elf_zstd_match_length_bits): Likewise.
(elf_zstd_decompress): New static function.
(ZDEBUG_TABLE_SIZE): New definition.
(elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
(backtrace_uncompress_zstd): New function.
(elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
* internal.h (backtrace_uncompress_zstd): Declare.
* zstdtest.c: New file.
* configure, config.h.in, Makefile.in: Regenerate.
2022-10-12 Martin Liska <mliska@suse.cz>
* configure: Regenerate.
2022-10-11 Olivier Hainque <hainque@adacore.com>
Olivier Hainque <hainque@adacore.com>
* configure: Regenerate.
2022-07-08 Ian Lance Taylor <iant@golang.org>
* configure.ac: Check for sys/link.h. Use either link.h or
sys/link.h when checking for dl_iterate_phdr.
* elf.c: Include sys/link.h if available.
* configure, config.h.in: Regenerate.
2022-07-07 Ian Lance Taylor <iant@golang.org>
* macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
loop if we can't find debug info for one shared library.
2022-07-07 Ian Lance Taylor <iant@golang.org>
* Makefile.am (MAKETESTS): New variable split out of TESTS.
(CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
* Makefile.in: Regenerate.
2022-06-27 Ian Lance Taylor <iant@golang.org>
* configure.ac: Use grep instead of fgrep.
* configure, Makefile.in: Regenerate.
2022-05-28 Ian Lance Taylor <iant@golang.org>
PR libbacktrace/105721
* README: Update.
2022-04-05 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
uncompressed block.
2022-02-17 Ian Lance Taylor <iant@golang.org>
* dwarf.c (find_address_ranges): Handle skeleton units.
(read_function_entry): Likewise.
2022-02-16 Ian Lance Taylor <iant@golang.org>
* dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
2022-02-03 David Seifert <soap@gentoo.org>
Jakub Jelinek <jakub@redhat.com>
* configure.ac: Support --disable-werror.
* configure: Regenerate.
2021-12-28 Francois-Xavier Coudert <fxcoudert@gmail.com>
PR libbacktrace/103822
* Makefile.am: Fix newline.
* Makefile.in: Regenerate.
2021-11-12 Martin Liska <mliska@suse.cz>
@ -1789,7 +2060,7 @@
* Initial implementation.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright

View File

@ -1,5 +1,5 @@
# Makefile.am -- Backtrace Makefile.
# Copyright (C) 2012-2021 Free Software Foundation, Inc.
# Copyright (C) 2012-2024 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@ -85,13 +85,19 @@ libbacktrace_la_DEPENDENCIES = $(libbacktrace_la_LIBADD)
# Testsuite.
# Add a test to this variable if you want it to be built.
# Add a test to this variable if you want it to be built as a program,
# with SOURCES, etc.
check_PROGRAMS =
# Add a test to this variable if you want it to be run.
TESTS =
# Add a test to this variable if you want it to be built and run.
# Add a test to this variable if you want it to be built as a Makefile
# target and run.
MAKETESTS =
# Add a test to this variable if you want it to be built as a program,
# with SOURCES, etc., and run.
BUILDTESTS =
# Add a file to this variable if you want it to be built for testing.
@ -100,6 +106,10 @@ check_DATA =
# Flags to use when compiling test programs.
libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
# Flags to use when linking test programs.
# This avoids generating a shell script when configured with --enable-shared.
libbacktrace_testing_ldflags = -no-install
if USE_DSYMUTIL
%.dSYM: %
@ -145,18 +155,18 @@ endif HAVE_OBJCOPY_DEBUGLINK
endif HAVE_ELF
elf_%.c: elf.c
nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
SEARCH='#error "Unknown BACKTRACE_ELF_SIZE"'; \
REPLACE='#undef BACKTRACE_ELF_SIZE\
#define BACKTRACE_ELF_SIZE'; \
REPLACE="#undef BACKTRACE_ELF_SIZE\\$${nl}#define BACKTRACE_ELF_SIZE"; \
$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
$< \
> $@.tmp
mv $@.tmp $@
xcoff_%.c: xcoff.c
nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
SEARCH='#error "Unknown BACKTRACE_XCOFF_SIZE"'; \
REPLACE='#undef BACKTRACE_XCOFF_SIZE\
#define BACKTRACE_XCOFF_SIZE'; \
REPLACE="#undef BACKTRACE_XCOFF_SIZE\\$${nl}#define BACKTRACE_XCOFF_SIZE"; \
$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
$< \
> $@.tmp
@ -164,54 +174,63 @@ xcoff_%.c: xcoff.c
test_elf_32_SOURCES = test_format.c testlib.c
test_elf_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_elf_32_LDFLAGS = $(libbacktrace_testing_ldflags)
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_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_elf_64_LDFLAGS = $(libbacktrace_testing_ldflags)
test_elf_64_LDADD = libbacktrace_noformat.la elf_64.lo
BUILDTESTS += test_elf_64
test_macho_SOURCES = test_format.c testlib.c
test_macho_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_macho_LDFLAGS = $(libbacktrace_testing_ldflags)
test_macho_LDADD = libbacktrace_noformat.la macho.lo
BUILDTESTS += test_macho
test_xcoff_32_SOURCES = test_format.c testlib.c
test_xcoff_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_xcoff_32_LDFLAGS = $(libbacktrace_testing_ldflags)
test_xcoff_32_LDADD = libbacktrace_noformat.la xcoff_32.lo
BUILDTESTS += test_xcoff_32
test_xcoff_64_SOURCES = test_format.c testlib.c
test_xcoff_64_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_xcoff_64_LDFLAGS = $(libbacktrace_testing_ldflags)
test_xcoff_64_LDADD = libbacktrace_noformat.la xcoff_64.lo
BUILDTESTS += test_xcoff_64
test_pecoff_SOURCES = test_format.c testlib.c
test_pecoff_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_pecoff_LDFLAGS = $(libbacktrace_testing_ldflags)
test_pecoff_LDADD = libbacktrace_noformat.la pecoff.lo
BUILDTESTS += test_pecoff
test_unknown_SOURCES = test_format.c testlib.c
test_unknown_CFLAGS = $(libbacktrace_TEST_CFLAGS)
test_unknown_LDFLAGS = $(libbacktrace_testing_ldflags)
test_unknown_LDADD = libbacktrace_noformat.la unknown.lo
BUILDTESTS += test_unknown
unittest_SOURCES = unittest.c testlib.c
unittest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
unittest_LDFLAGS = $(libbacktrace_testing_ldflags)
unittest_LDADD = libbacktrace.la
BUILDTESTS += unittest
unittest_alloc_SOURCES = $(unittest_SOURCES)
unittest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
unittest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
unittest_alloc_LDADD = libbacktrace_alloc.la
BUILDTESTS += unittest_alloc
@ -242,33 +261,36 @@ check_DATA += allocfail.dSYM
endif USE_DSYMUTIL
if HAVE_ELF
if HAVE_BUILDID
if HAVE_OBJCOPY_DEBUGLINK
b2test_SOURCES = $(btest_SOURCES)
b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
b2test_LDFLAGS = -Wl,--build-id
b2test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
b2test_LDADD = libbacktrace_elf_for_test.la
check_PROGRAMS += b2test
TESTS += b2test_buildid
MAKETESTS += b2test_buildid b2test_buildidfull
if HAVE_DWZ
b3test_SOURCES = $(btest_SOURCES)
b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
b3test_LDFLAGS = -Wl,--build-id
b3test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
b3test_LDADD = libbacktrace_elf_for_test.la
check_PROGRAMS += b3test
TESTS += b3test_dwz_buildid
MAKETESTS += b3test_dwz_buildid b3test_dwz_buildidfull
endif HAVE_DWZ
endif HAVE_OBJCOPY_DEBUGLINK
endif HAVE_BUILDID
endif HAVE_ELF
btest_SOURCES = btest.c testlib.c
btest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
btest_LDFLAGS = $(libbacktrace_testing_ldflags)
btest_LDADD = libbacktrace.la
BUILDTESTS += btest
@ -281,6 +303,7 @@ if HAVE_ELF
btest_lto_SOURCES = btest.c testlib.c
btest_lto_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O -flto
btest_lto_LDFLAGS = $(libbacktrace_testing_ldflags)
btest_lto_LDADD = libbacktrace.la
BUILDTESTS += btest_lto
@ -289,6 +312,7 @@ endif HAVE_ELF
btest_alloc_SOURCES = $(btest_SOURCES)
btest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
btest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
btest_alloc_LDADD = libbacktrace_alloc.la
BUILDTESTS += btest_alloc
@ -311,11 +335,11 @@ if HAVE_DWZ
cp $< $@; \
fi
TESTS += btest_dwz
MAKETESTS += btest_dwz
if HAVE_OBJCOPY_DEBUGLINK
TESTS += btest_dwz_gnudebuglink
MAKETESTS += btest_dwz_gnudebuglink
endif HAVE_OBJCOPY_DEBUGLINK
@ -323,6 +347,7 @@ endif HAVE_DWZ
stest_SOURCES = stest.c
stest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
stest_LDFLAGS = $(libbacktrace_testing_ldflags)
stest_LDADD = libbacktrace.la
BUILDTESTS += stest
@ -333,6 +358,7 @@ endif USE_DSYMUTIL
stest_alloc_SOURCES = $(stest_SOURCES)
stest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
stest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
stest_alloc_LDADD = libbacktrace_alloc.la
BUILDTESTS += stest_alloc
@ -345,6 +371,7 @@ if HAVE_ELF
ztest_SOURCES = ztest.c testlib.c
ztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
ztest_LDFLAGS = $(libbacktrace_testing_ldflags)
ztest_LDADD = libbacktrace.la
ztest_alloc_LDADD = libbacktrace_alloc.la
@ -359,13 +386,36 @@ BUILDTESTS += ztest
ztest_alloc_SOURCES = $(ztest_SOURCES)
ztest_alloc_CFLAGS = $(ztest_CFLAGS)
ztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
BUILDTESTS += ztest_alloc
zstdtest_SOURCES = zstdtest.c testlib.c
zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
zstdtest_LDFLAGS = $(libbacktrace_testing_ldflags)
zstdtest_LDADD = libbacktrace.la
zstdtest_alloc_LDADD = libbacktrace_alloc.la
if HAVE_ZSTD
zstdtest_LDADD += -lzstd
zstdtest_alloc_LDADD += -lzstd
endif
zstdtest_LDADD += $(CLOCK_GETTIME_LINK)
zstdtest_alloc_LDADD += $(CLOCK_GETTIME_LINK)
BUILDTESTS += zstdtest
zstdtest_alloc_SOURCES = $(zstdtest_SOURCES)
zstdtest_alloc_CFLAGS = $(zstdtest_CFLAGS)
zstdtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
BUILDTESTS += zstdtest_alloc
endif HAVE_ELF
edtest_SOURCES = edtest.c edtest2_build.c testlib.c
edtest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
edtest_LDFLAGS = $(libbacktrace_testing_ldflags)
edtest_LDADD = libbacktrace.la
BUILDTESTS += edtest
@ -376,6 +426,7 @@ endif USE_DSYMUTIL
edtest_alloc_SOURCES = $(edtest_SOURCES)
edtest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
edtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
edtest_alloc_LDADD = libbacktrace_alloc.la
if USE_DSYMUTIL
@ -396,6 +447,7 @@ BUILDTESTS += ttest
ttest_SOURCES = ttest.c testlib.c
ttest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -pthread
ttest_LDFLAGS = $(libbacktrace_testing_ldflags)
ttest_LDADD = libbacktrace.la
if USE_DSYMUTIL
@ -406,6 +458,7 @@ BUILDTESTS += ttest_alloc
ttest_alloc_SOURCES = $(ttest_SOURCES)
ttest_alloc_CFLAGS = $(ttest_CFLAGS)
ttest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
ttest_alloc_LDADD = libbacktrace_alloc.la
if USE_DSYMUTIL
@ -416,12 +469,16 @@ endif HAVE_PTHREAD
if HAVE_OBJCOPY_DEBUGLINK
TESTS += btest_gnudebuglink
MAKETESTS += btest_gnudebuglink btest_gnudebuglinkfull
%_gnudebuglink: %
$(OBJCOPY) --only-keep-debug $< $@.debug
$(OBJCOPY) --strip-debug --add-gnu-debuglink=$@.debug $< $@
%_gnudebuglinkfull: %
$(OBJCOPY) --only-keep-debug $< $@.debug
$(OBJCOPY) --strip-all --add-gnu-debuglink=$@.debug $< $@
endif HAVE_OBJCOPY_DEBUGLINK
%_buildid: %
@ -430,28 +487,45 @@ endif HAVE_OBJCOPY_DEBUGLINK
$<
$(OBJCOPY) --strip-debug $< $@
%_buildidfull: %
./install-debuginfo-for-buildid.sh \
"$(TEST_BUILD_ID_DIR)" \
$<
$(OBJCOPY) --strip-all $< $@
if HAVE_COMPRESSED_DEBUG
ctestg_SOURCES = btest.c testlib.c
ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu
ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
ctestg_LDADD = libbacktrace.la
ctesta_SOURCES = btest.c testlib.c
ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
ctesta_LDADD = libbacktrace.la
BUILDTESTS += ctestg ctesta
if HAVE_COMPRESSED_DEBUG_ZSTD
ctestzstd_SOURCES = btest.c testlib.c
ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd $(libbacktrace_testing_ldflags)
ctestzstd_LDADD = libbacktrace.la
BUILDTESTS += ctestzstd
endif
ctestg_alloc_SOURCES = $(ctestg_SOURCES)
ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS) $(libbacktrace_testing_ldflags)
ctestg_alloc_LDADD = libbacktrace_alloc.la
ctesta_alloc_SOURCES = $(ctesta_SOURCES)
ctesta_alloc_CFLAGS = $(ctesta_CFLAGS)
ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS)
ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS) $(libbacktrace_testing_ldflags)
ctesta_alloc_LDADD = libbacktrace_alloc.la
BUILDTESTS += ctestg_alloc ctesta_alloc
@ -462,6 +536,7 @@ if HAVE_DWARF5
dwarf5_SOURCES = btest.c testlib.c
dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
dwarf5_LDFLAGS = $(libbacktrace_testing_ldflags)
dwarf5_LDADD = libbacktrace.la
BUILDTESTS += dwarf5
@ -472,6 +547,7 @@ endif USE_DSYMUTIL
dwarf5_alloc_SOURCES = $(dwarf5_SOURCES)
dwarf5_alloc_CFLAGS = $(dwarf5_CFLAGS)
dwarf5_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
dwarf5_alloc_LDADD = libbacktrace_alloc.la
BUILDTESTS += dwarf5_alloc
@ -484,6 +560,7 @@ endif
mtest_SOURCES = mtest.c testlib.c
mtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
mtest_LDFLAGS = $(libbacktrace_testing_ldflags)
mtest_LDADD = libbacktrace.la
BUILDTESTS += mtest
@ -494,11 +571,11 @@ endif USE_DSYMUTIL
if HAVE_MINIDEBUG
TESTS += mtest_minidebug
MAKETESTS += mtest_minidebug
%_minidebug: %
$(NM) -D $< -P --defined-only | $(AWK) '{ print $$1 }' | sort > $<.dsyms
$(NM) $< -P --defined-only | $(AWK) '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D" || $$2 == "d") print $$1 }' | sort > $<.fsyms
$(NM) $< -P --defined-only | $(AWK) '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D") print $$1 }' | sort > $<.fsyms
$(COMM) -13 $<.dsyms $<.fsyms > $<.keepsyms
$(OBJCOPY) --only-keep-debug $< $<.dbg
$(OBJCOPY) -S --remove-section .gdb_index --remove-section .comment --keep-symbols=$<.keepsyms $<.dbg $<.mdbg
@ -516,10 +593,12 @@ if HAVE_ELF
xztest_SOURCES = xztest.c testlib.c
xztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
xztest_LDFLAGS = $(libbacktrace_testing_ldflags)
xztest_LDADD = libbacktrace.la
xztest_alloc_SOURCES = $(xztest_SOURCES)
xztest_alloc_CFLAGS = $(xztest_CFLAGS)
xztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
xztest_alloc_LDADD = libbacktrace_alloc.la
if HAVE_LIBLZMA
@ -536,10 +615,11 @@ endif HAVE_ELF
check_PROGRAMS += $(BUILDTESTS)
TESTS += $(BUILDTESTS)
TESTS += $(MAKETESTS) $(BUILDTESTS)
CLEANFILES = \
$(filter-out allocfail.sh,$(TESTS)) *.debug elf_for_test.c edtest2_build.c gen_edtest2_build \
$(MAKETESTS) $(BUILDTESTS) *.debug elf_for_test.c edtest2_build.c \
gen_edtest2_build \
*.dsyms *.fsyms *.keepsyms *.dbg *.mdbg *.mdbg.xz *.strip
clean-local:

View File

@ -15,7 +15,7 @@
@SET_MAKE@
# Makefile.am -- Backtrace Makefile.
# Copyright (C) 2012-2021 Free Software Foundation, Inc.
# Copyright (C) 2012-2024 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@ -121,10 +121,8 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
$(am__EXEEXT_14)
TESTS = $(am__append_4) $(am__append_7) $(am__append_9) \
$(am__append_12) $(am__append_13) $(am__append_20) \
$(am__append_26) $(am__EXEEXT_14)
$(am__EXEEXT_16)
TESTS = $(am__append_4) $(MAKETESTS) $(am__EXEEXT_16)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_1 = libbacktrace_elf_for_test.la
@NATIVE_TRUE@am__append_2 = test_elf_32 test_elf_64 test_macho \
@NATIVE_TRUE@ test_xcoff_32 test_xcoff_64 test_pecoff \
@ -135,36 +133,39 @@ TESTS = $(am__append_4) $(am__append_7) $(am__append_9) \
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ btest.dSYM btest_alloc.dSYM \
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ stest.dSYM stest_alloc.dSYM \
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ edtest.dSYM edtest_alloc.dSYM
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = b2test
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = b2test_buildid
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_8 = b3test
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_9 = b3test_dwz_buildid
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = b2test
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = b2test_buildid b2test_buildidfull
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_8 = b3test
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_9 = b3test_dwz_buildid b3test_dwz_buildidfull
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_10 = btest_lto
@NATIVE_TRUE@am__append_11 = btest_alloc stest stest_alloc
@HAVE_DWZ_TRUE@@NATIVE_TRUE@am__append_12 = btest_dwz
@HAVE_DWZ_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_13 = btest_dwz_gnudebuglink
@HAVE_ELF_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_14 = -lz
@HAVE_ELF_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_15 = -lz
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_16 = ztest ztest_alloc
@NATIVE_TRUE@am__append_17 = edtest edtest_alloc
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_18 = ttest ttest_alloc
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_19 = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_16 = ztest ztest_alloc zstdtest \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc
@HAVE_ELF_TRUE@@HAVE_ZSTD_TRUE@@NATIVE_TRUE@am__append_17 = -lzstd
@HAVE_ELF_TRUE@@HAVE_ZSTD_TRUE@@NATIVE_TRUE@am__append_18 = -lzstd
@NATIVE_TRUE@am__append_19 = edtest edtest_alloc
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_20 = ttest ttest_alloc
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_21 = \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest.dSYM \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest_alloc.dSYM
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_20 = btest_gnudebuglink
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_21 = ctestg ctesta \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_22 = dwarf5 dwarf5_alloc
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_23 = \
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_22 = btest_gnudebuglink btest_gnudebuglinkfull
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_23 = ctestg ctesta
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am__append_24 = ctestzstd
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_25 = ctestg_alloc ctesta_alloc
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_26 = dwarf5 dwarf5_alloc
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_27 = \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5.dSYM \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5_alloc.dSYM
@NATIVE_TRUE@am__append_24 = mtest
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_25 = mtest.dSYM
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@am__append_26 = mtest_minidebug
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_27 = -llzma
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_28 = -llzma
@HAVE_ELF_TRUE@am__append_29 = xztest xztest_alloc
@NATIVE_TRUE@am__append_28 = mtest
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_29 = mtest.dSYM
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@am__append_30 = mtest_minidebug
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_31 = -llzma
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_32 = -llzma
@HAVE_ELF_TRUE@am__append_33 = xztest xztest_alloc
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/cet.m4 \
@ -221,8 +222,8 @@ libbacktrace_noformat_la_OBJECTS = \
$(am_libbacktrace_noformat_la_OBJECTS)
@NATIVE_TRUE@am_libbacktrace_noformat_la_rpath =
@NATIVE_TRUE@am__EXEEXT_1 = allocfail$(EXEEXT)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_2 = b2test$(EXEEXT)
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_3 = b3test$(EXEEXT)
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_2 = b2test$(EXEEXT)
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_3 = b3test$(EXEEXT)
@NATIVE_TRUE@am__EXEEXT_4 = test_elf_32$(EXEEXT) test_elf_64$(EXEEXT) \
@NATIVE_TRUE@ test_macho$(EXEEXT) test_xcoff_32$(EXEEXT) \
@NATIVE_TRUE@ test_xcoff_64$(EXEEXT) test_pecoff$(EXEEXT) \
@ -232,23 +233,26 @@ libbacktrace_noformat_la_OBJECTS = \
@NATIVE_TRUE@am__EXEEXT_6 = btest_alloc$(EXEEXT) stest$(EXEEXT) \
@NATIVE_TRUE@ stest_alloc$(EXEEXT)
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__EXEEXT_7 = ztest$(EXEEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc$(EXEEXT)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc$(EXEEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest$(EXEEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc$(EXEEXT)
@NATIVE_TRUE@am__EXEEXT_8 = edtest$(EXEEXT) edtest_alloc$(EXEEXT)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__EXEEXT_9 = ttest$(EXEEXT) \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest_alloc$(EXEEXT)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__EXEEXT_10 = \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg$(EXEEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta$(EXEEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc$(EXEEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta$(EXEEXT)
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am__EXEEXT_11 = ctestzstd$(EXEEXT)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__EXEEXT_12 = ctestg_alloc$(EXEEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc$(EXEEXT)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__EXEEXT_11 = dwarf5$(EXEEXT) \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__EXEEXT_13 = dwarf5$(EXEEXT) \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5_alloc$(EXEEXT)
@NATIVE_TRUE@am__EXEEXT_12 = mtest$(EXEEXT)
@HAVE_ELF_TRUE@am__EXEEXT_13 = xztest$(EXEEXT) xztest_alloc$(EXEEXT)
am__EXEEXT_14 = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
@NATIVE_TRUE@am__EXEEXT_14 = mtest$(EXEEXT)
@HAVE_ELF_TRUE@am__EXEEXT_15 = xztest$(EXEEXT) xztest_alloc$(EXEEXT)
am__EXEEXT_16 = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
$(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
$(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
$(am__EXEEXT_13)
$(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15)
@NATIVE_TRUE@am_allocfail_OBJECTS = allocfail-allocfail.$(OBJEXT) \
@NATIVE_TRUE@ allocfail-testlib.$(OBJEXT)
allocfail_OBJECTS = $(am_allocfail_OBJECTS)
@ -259,17 +263,17 @@ allocfail_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_2 = b2test-btest.$(OBJEXT) \
@NATIVE_TRUE@ b2test-testlib.$(OBJEXT)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b2test_OBJECTS = $(am__objects_2)
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b2test_OBJECTS = $(am__objects_2)
b2test_OBJECTS = $(am_b2test_OBJECTS)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_DEPENDENCIES = libbacktrace_elf_for_test.la
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_DEPENDENCIES = libbacktrace_elf_for_test.la
b2test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(b2test_CFLAGS) $(CFLAGS) \
$(b2test_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_3 = b3test-btest.$(OBJEXT) \
@NATIVE_TRUE@ b3test-testlib.$(OBJEXT)
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b3test_OBJECTS = $(am__objects_3)
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b3test_OBJECTS = $(am__objects_3)
b3test_OBJECTS = $(am_b3test_OBJECTS)
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_DEPENDENCIES = libbacktrace_elf_for_test.la
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_DEPENDENCIES = libbacktrace_elf_for_test.la
b3test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(b3test_CFLAGS) $(CFLAGS) \
$(b3test_LDFLAGS) $(LDFLAGS) -o $@
@ -279,7 +283,7 @@ btest_OBJECTS = $(am_btest_OBJECTS)
@NATIVE_TRUE@btest_DEPENDENCIES = libbacktrace.la
btest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(btest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(btest_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_4 = btest_alloc-btest.$(OBJEXT) \
@NATIVE_TRUE@ btest_alloc-testlib.$(OBJEXT)
@NATIVE_TRUE@am_btest_alloc_OBJECTS = $(am__objects_4)
@ -287,7 +291,7 @@ btest_alloc_OBJECTS = $(am_btest_alloc_OBJECTS)
@NATIVE_TRUE@btest_alloc_DEPENDENCIES = libbacktrace_alloc.la
btest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(btest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(btest_alloc_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_btest_lto_OBJECTS = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ btest_lto-btest.$(OBJEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ btest_lto-testlib.$(OBJEXT)
@ -295,7 +299,7 @@ btest_lto_OBJECTS = $(am_btest_lto_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@btest_lto_DEPENDENCIES = libbacktrace.la
btest_lto_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(btest_lto_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(btest_lto_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am_ctesta_OBJECTS = ctesta-btest.$(OBJEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta-testlib.$(OBJEXT)
ctesta_OBJECTS = $(am_ctesta_OBJECTS)
@ -330,6 +334,13 @@ ctestg_alloc_OBJECTS = $(am_ctestg_alloc_OBJECTS)
ctestg_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ctestg_alloc_CFLAGS) \
$(CFLAGS) $(ctestg_alloc_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am_ctestzstd_OBJECTS = ctestzstd-btest.$(OBJEXT) \
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ ctestzstd-testlib.$(OBJEXT)
ctestzstd_OBJECTS = $(am_ctestzstd_OBJECTS)
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_DEPENDENCIES = libbacktrace.la
ctestzstd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ctestzstd_CFLAGS) \
$(CFLAGS) $(ctestzstd_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am_dwarf5_OBJECTS = \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5-btest.$(OBJEXT) \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5-testlib.$(OBJEXT)
@ -337,7 +348,7 @@ dwarf5_OBJECTS = $(am_dwarf5_OBJECTS)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_DEPENDENCIES = libbacktrace.la
dwarf5_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(dwarf5_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(dwarf5_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__objects_7 = \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5_alloc-btest.$(OBJEXT) \
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5_alloc-testlib.$(OBJEXT)
@ -348,7 +359,7 @@ dwarf5_alloc_OBJECTS = $(am_dwarf5_alloc_OBJECTS)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la
dwarf5_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(dwarf5_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(dwarf5_alloc_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_edtest_OBJECTS = edtest-edtest.$(OBJEXT) \
@NATIVE_TRUE@ edtest-edtest2_build.$(OBJEXT) \
@NATIVE_TRUE@ edtest-testlib.$(OBJEXT)
@ -356,7 +367,7 @@ edtest_OBJECTS = $(am_edtest_OBJECTS)
@NATIVE_TRUE@edtest_DEPENDENCIES = libbacktrace.la
edtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(edtest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(edtest_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_8 = edtest_alloc-edtest.$(OBJEXT) \
@NATIVE_TRUE@ edtest_alloc-edtest2_build.$(OBJEXT) \
@NATIVE_TRUE@ edtest_alloc-testlib.$(OBJEXT)
@ -365,27 +376,27 @@ edtest_alloc_OBJECTS = $(am_edtest_alloc_OBJECTS)
@NATIVE_TRUE@edtest_alloc_DEPENDENCIES = libbacktrace_alloc.la
edtest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(edtest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(edtest_alloc_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_mtest_OBJECTS = mtest-mtest.$(OBJEXT) \
@NATIVE_TRUE@ mtest-testlib.$(OBJEXT)
mtest_OBJECTS = $(am_mtest_OBJECTS)
@NATIVE_TRUE@mtest_DEPENDENCIES = libbacktrace.la
mtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mtest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(mtest_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_stest_OBJECTS = stest-stest.$(OBJEXT)
stest_OBJECTS = $(am_stest_OBJECTS)
@NATIVE_TRUE@stest_DEPENDENCIES = libbacktrace.la
stest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(stest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(stest_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_9 = stest_alloc-stest.$(OBJEXT)
@NATIVE_TRUE@am_stest_alloc_OBJECTS = $(am__objects_9)
stest_alloc_OBJECTS = $(am_stest_alloc_OBJECTS)
@NATIVE_TRUE@stest_alloc_DEPENDENCIES = libbacktrace_alloc.la
stest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(stest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(stest_alloc_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_elf_32_OBJECTS = \
@NATIVE_TRUE@ test_elf_32-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_elf_32-testlib.$(OBJEXT)
@ -394,7 +405,7 @@ test_elf_32_OBJECTS = $(am_test_elf_32_OBJECTS)
@NATIVE_TRUE@ elf_32.lo
test_elf_32_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_elf_32_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_elf_32_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_elf_64_OBJECTS = \
@NATIVE_TRUE@ test_elf_64-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_elf_64-testlib.$(OBJEXT)
@ -403,7 +414,7 @@ test_elf_64_OBJECTS = $(am_test_elf_64_OBJECTS)
@NATIVE_TRUE@ elf_64.lo
test_elf_64_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_elf_64_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_elf_64_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_macho_OBJECTS = test_macho-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_macho-testlib.$(OBJEXT)
test_macho_OBJECTS = $(am_test_macho_OBJECTS)
@ -411,7 +422,7 @@ test_macho_OBJECTS = $(am_test_macho_OBJECTS)
@NATIVE_TRUE@ macho.lo
test_macho_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_macho_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_macho_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_pecoff_OBJECTS = \
@NATIVE_TRUE@ test_pecoff-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_pecoff-testlib.$(OBJEXT)
@ -420,7 +431,7 @@ test_pecoff_OBJECTS = $(am_test_pecoff_OBJECTS)
@NATIVE_TRUE@ pecoff.lo
test_pecoff_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_pecoff_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_pecoff_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_unknown_OBJECTS = \
@NATIVE_TRUE@ test_unknown-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_unknown-testlib.$(OBJEXT)
@ -429,7 +440,7 @@ test_unknown_OBJECTS = $(am_test_unknown_OBJECTS)
@NATIVE_TRUE@ unknown.lo
test_unknown_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_unknown_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_unknown_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_xcoff_32_OBJECTS = \
@NATIVE_TRUE@ test_xcoff_32-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_xcoff_32-testlib.$(OBJEXT)
@ -438,7 +449,7 @@ test_xcoff_32_OBJECTS = $(am_test_xcoff_32_OBJECTS)
@NATIVE_TRUE@ xcoff_32.lo
test_xcoff_32_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_xcoff_32_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_xcoff_32_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_test_xcoff_64_OBJECTS = \
@NATIVE_TRUE@ test_xcoff_64-test_format.$(OBJEXT) \
@NATIVE_TRUE@ test_xcoff_64-testlib.$(OBJEXT)
@ -447,7 +458,7 @@ test_xcoff_64_OBJECTS = $(am_test_xcoff_64_OBJECTS)
@NATIVE_TRUE@ xcoff_64.lo
test_xcoff_64_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_xcoff_64_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(test_xcoff_64_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am_ttest_OBJECTS = \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest-ttest.$(OBJEXT) \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest-testlib.$(OBJEXT)
@ -455,7 +466,7 @@ ttest_OBJECTS = $(am_ttest_OBJECTS)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_DEPENDENCIES = libbacktrace.la
ttest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ttest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(ttest_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__objects_10 = \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest_alloc-ttest.$(OBJEXT) \
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest_alloc-testlib.$(OBJEXT)
@ -466,14 +477,14 @@ ttest_alloc_OBJECTS = $(am_ttest_alloc_OBJECTS)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la
ttest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ttest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(ttest_alloc_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am_unittest_OBJECTS = unittest-unittest.$(OBJEXT) \
@NATIVE_TRUE@ unittest-testlib.$(OBJEXT)
unittest_OBJECTS = $(am_unittest_OBJECTS)
@NATIVE_TRUE@unittest_DEPENDENCIES = libbacktrace.la
unittest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(unittest_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(unittest_LDFLAGS) $(LDFLAGS) -o $@
@NATIVE_TRUE@am__objects_11 = unittest_alloc-unittest.$(OBJEXT) \
@NATIVE_TRUE@ unittest_alloc-testlib.$(OBJEXT)
@NATIVE_TRUE@am_unittest_alloc_OBJECTS = $(am__objects_11)
@ -481,8 +492,8 @@ unittest_alloc_OBJECTS = $(am_unittest_alloc_OBJECTS)
@NATIVE_TRUE@unittest_alloc_DEPENDENCIES = libbacktrace_alloc.la
unittest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(unittest_alloc_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
$@
$(unittest_alloc_CFLAGS) $(CFLAGS) $(unittest_alloc_LDFLAGS) \
$(LDFLAGS) -o $@
@HAVE_ELF_TRUE@am_xztest_OBJECTS = xztest-xztest.$(OBJEXT) \
@HAVE_ELF_TRUE@ xztest-testlib.$(OBJEXT)
xztest_OBJECTS = $(am_xztest_OBJECTS)
@ -490,7 +501,7 @@ xztest_OBJECTS = $(am_xztest_OBJECTS)
@HAVE_ELF_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
xztest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(xztest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
$(xztest_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@am__objects_12 = xztest_alloc-xztest.$(OBJEXT) \
@HAVE_ELF_TRUE@ xztest_alloc-testlib.$(OBJEXT)
@HAVE_ELF_TRUE@am_xztest_alloc_OBJECTS = $(am__objects_12)
@ -499,7 +510,31 @@ xztest_alloc_OBJECTS = $(am_xztest_alloc_OBJECTS)
@HAVE_ELF_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
xztest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(xztest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(xztest_alloc_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_zstdtest_OBJECTS = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest-zstdtest.$(OBJEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest-testlib.$(OBJEXT)
zstdtest_OBJECTS = $(am_zstdtest_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_DEPENDENCIES = libbacktrace.la \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
zstdtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(zstdtest_CFLAGS) \
$(CFLAGS) $(zstdtest_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_13 = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc-zstdtest.$(OBJEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc-testlib.$(OBJEXT)
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_zstdtest_alloc_OBJECTS = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_13)
zstdtest_alloc_OBJECTS = $(am_zstdtest_alloc_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_DEPENDENCIES = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
zstdtest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(zstdtest_alloc_CFLAGS) $(CFLAGS) $(zstdtest_alloc_LDFLAGS) \
$(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_ztest_OBJECTS = ztest-ztest.$(OBJEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest-testlib.$(OBJEXT)
ztest_OBJECTS = $(am_ztest_OBJECTS)
@ -508,12 +543,12 @@ ztest_OBJECTS = $(am_ztest_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
ztest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ztest_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_13 = \
$(ztest_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_14 = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc-ztest.$(OBJEXT) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc-testlib.$(OBJEXT)
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_ztest_alloc_OBJECTS = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_13)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_14)
ztest_alloc_OBJECTS = $(am_ztest_alloc_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_DEPENDENCIES = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
@ -521,7 +556,7 @@ ztest_alloc_OBJECTS = $(am_ztest_alloc_OBJECTS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
ztest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ztest_alloc_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
$(CFLAGS) $(ztest_alloc_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -563,7 +598,7 @@ SOURCES = $(libbacktrace_la_SOURCES) $(EXTRA_libbacktrace_la_SOURCES) \
$(b2test_SOURCES) $(b3test_SOURCES) $(btest_SOURCES) \
$(btest_alloc_SOURCES) $(btest_lto_SOURCES) $(ctesta_SOURCES) \
$(ctesta_alloc_SOURCES) $(ctestg_SOURCES) \
$(ctestg_alloc_SOURCES) $(dwarf5_SOURCES) \
$(ctestg_alloc_SOURCES) $(ctestzstd_SOURCES) $(dwarf5_SOURCES) \
$(dwarf5_alloc_SOURCES) $(edtest_SOURCES) \
$(edtest_alloc_SOURCES) $(mtest_SOURCES) $(stest_SOURCES) \
$(stest_alloc_SOURCES) $(test_elf_32_SOURCES) \
@ -572,7 +607,8 @@ SOURCES = $(libbacktrace_la_SOURCES) $(EXTRA_libbacktrace_la_SOURCES) \
$(test_xcoff_32_SOURCES) $(test_xcoff_64_SOURCES) \
$(ttest_SOURCES) $(ttest_alloc_SOURCES) $(unittest_SOURCES) \
$(unittest_alloc_SOURCES) $(xztest_SOURCES) \
$(xztest_alloc_SOURCES) $(ztest_SOURCES) \
$(xztest_alloc_SOURCES) $(zstdtest_SOURCES) \
$(zstdtest_alloc_SOURCES) $(ztest_SOURCES) \
$(ztest_alloc_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
@ -988,18 +1024,28 @@ libbacktrace_la_LIBADD = \
libbacktrace_la_DEPENDENCIES = $(libbacktrace_la_LIBADD)
# Add a test to this variable if you want it to be built and run.
# Add a test to this variable if you want it to be built as a Makefile
# target and run.
MAKETESTS = $(am__append_7) $(am__append_9) $(am__append_12) \
$(am__append_13) $(am__append_22) $(am__append_30)
# Add a test to this variable if you want it to be built as a program,
# with SOURCES, etc., and run.
BUILDTESTS = $(am__append_2) $(am__append_10) $(am__append_11) \
$(am__append_16) $(am__append_17) $(am__append_18) \
$(am__append_21) $(am__append_22) $(am__append_24) \
$(am__append_29)
$(am__append_16) $(am__append_19) $(am__append_20) \
$(am__append_23) $(am__append_24) $(am__append_25) \
$(am__append_26) $(am__append_28) $(am__append_33)
# Add a file to this variable if you want it to be built for testing.
check_DATA = $(am__append_5) $(am__append_19) $(am__append_23) \
$(am__append_25)
check_DATA = $(am__append_5) $(am__append_21) $(am__append_27) \
$(am__append_29)
# Flags to use when compiling test programs.
libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
# Flags to use when linking test programs.
# This avoids generating a shell script when configured with --enable-shared.
libbacktrace_testing_ldflags = -no-install
@NATIVE_TRUE@check_LTLIBRARIES = libbacktrace_alloc.la \
@NATIVE_TRUE@ libbacktrace_noformat.la $(am__append_1) \
@NATIVE_TRUE@ libbacktrace_instrumented_alloc.la
@ -1016,30 +1062,39 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
@NATIVE_TRUE@test_elf_32_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_elf_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_elf_32_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_elf_32_LDADD = libbacktrace_noformat.la elf_32.lo
@NATIVE_TRUE@test_elf_64_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_elf_64_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_elf_64_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_elf_64_LDADD = libbacktrace_noformat.la elf_64.lo
@NATIVE_TRUE@test_macho_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_macho_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_macho_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_macho_LDADD = libbacktrace_noformat.la macho.lo
@NATIVE_TRUE@test_xcoff_32_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_xcoff_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_xcoff_32_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_xcoff_32_LDADD = libbacktrace_noformat.la xcoff_32.lo
@NATIVE_TRUE@test_xcoff_64_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_xcoff_64_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_xcoff_64_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_xcoff_64_LDADD = libbacktrace_noformat.la xcoff_64.lo
@NATIVE_TRUE@test_pecoff_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_pecoff_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_pecoff_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_pecoff_LDADD = libbacktrace_noformat.la pecoff.lo
@NATIVE_TRUE@test_unknown_SOURCES = test_format.c testlib.c
@NATIVE_TRUE@test_unknown_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@test_unknown_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@test_unknown_LDADD = libbacktrace_noformat.la unknown.lo
@NATIVE_TRUE@unittest_SOURCES = unittest.c testlib.c
@NATIVE_TRUE@unittest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@unittest_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@unittest_LDADD = libbacktrace.la
@NATIVE_TRUE@unittest_alloc_SOURCES = $(unittest_SOURCES)
@NATIVE_TRUE@unittest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@unittest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@unittest_alloc_LDADD = libbacktrace_alloc.la
@NATIVE_TRUE@libbacktrace_instrumented_alloc_la_SOURCES = $(libbacktrace_la_SOURCES)
@NATIVE_TRUE@libbacktrace_instrumented_alloc_la_LIBADD = $(BACKTRACE_FILE) $(FORMAT_FILE) \
@ -1051,31 +1106,37 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
@NATIVE_TRUE@allocfail_SOURCES = allocfail.c testlib.c
@NATIVE_TRUE@allocfail_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@allocfail_LDADD = libbacktrace_instrumented_alloc.la
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_SOURCES = $(btest_SOURCES)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDFLAGS = -Wl,--build-id
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDADD = libbacktrace_elf_for_test.la
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_SOURCES = $(btest_SOURCES)
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDFLAGS = -Wl,--build-id
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDADD = libbacktrace_elf_for_test.la
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_SOURCES = $(btest_SOURCES)
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDADD = libbacktrace_elf_for_test.la
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_SOURCES = $(btest_SOURCES)
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDADD = libbacktrace_elf_for_test.la
@NATIVE_TRUE@btest_SOURCES = btest.c testlib.c
@NATIVE_TRUE@btest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
@NATIVE_TRUE@btest_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@btest_LDADD = libbacktrace.la
@HAVE_ELF_TRUE@@NATIVE_TRUE@btest_lto_SOURCES = btest.c testlib.c
@HAVE_ELF_TRUE@@NATIVE_TRUE@btest_lto_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O -flto
@HAVE_ELF_TRUE@@NATIVE_TRUE@btest_lto_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@@NATIVE_TRUE@btest_lto_LDADD = libbacktrace.la
@NATIVE_TRUE@btest_alloc_SOURCES = $(btest_SOURCES)
@NATIVE_TRUE@btest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@btest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@btest_alloc_LDADD = libbacktrace_alloc.la
@NATIVE_TRUE@stest_SOURCES = stest.c
@NATIVE_TRUE@stest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@stest_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@stest_LDADD = libbacktrace.la
@NATIVE_TRUE@stest_alloc_SOURCES = $(stest_SOURCES)
@NATIVE_TRUE@stest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@stest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@stest_alloc_LDADD = libbacktrace_alloc.la
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_SOURCES = ztest.c testlib.c
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_LDADD = libbacktrace.la \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__append_14) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@ -1084,53 +1145,81 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_SOURCES = $(ztest_SOURCES)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_CFLAGS = $(ztest_CFLAGS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_SOURCES = zstdtest.c testlib.c
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_LDADD = libbacktrace.la \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__append_17) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_LDADD = \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__append_18) \
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_SOURCES = $(zstdtest_SOURCES)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_CFLAGS = $(zstdtest_CFLAGS)
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@edtest_SOURCES = edtest.c edtest2_build.c testlib.c
@NATIVE_TRUE@edtest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@edtest_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@edtest_LDADD = libbacktrace.la
@NATIVE_TRUE@edtest_alloc_SOURCES = $(edtest_SOURCES)
@NATIVE_TRUE@edtest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@NATIVE_TRUE@edtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@edtest_alloc_LDADD = libbacktrace_alloc.la
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_SOURCES = ttest.c testlib.c
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -pthread
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_LDADD = libbacktrace.la
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_SOURCES = $(ttest_SOURCES)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_CFLAGS = $(ttest_CFLAGS)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_LDADD = libbacktrace_alloc.la
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_SOURCES = btest.c testlib.c
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDADD = libbacktrace.la
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_SOURCES = btest.c testlib.c
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDADD = libbacktrace.la
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_SOURCES = btest.c testlib.c
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd $(libbacktrace_testing_ldflags)
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_LDADD = libbacktrace.la
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_SOURCES = $(ctestg_SOURCES)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS) $(libbacktrace_testing_ldflags)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_LDADD = libbacktrace_alloc.la
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_alloc_SOURCES = $(ctesta_SOURCES)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_alloc_CFLAGS = $(ctesta_CFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS) $(libbacktrace_testing_ldflags)
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_alloc_LDADD = libbacktrace_alloc.la
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_SOURCES = btest.c testlib.c
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_LDADD = libbacktrace.la
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_alloc_SOURCES = $(dwarf5_SOURCES)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_alloc_CFLAGS = $(dwarf5_CFLAGS)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@dwarf5_alloc_LDADD = libbacktrace_alloc.la
@NATIVE_TRUE@mtest_SOURCES = mtest.c testlib.c
@NATIVE_TRUE@mtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
@NATIVE_TRUE@mtest_LDFLAGS = $(libbacktrace_testing_ldflags)
@NATIVE_TRUE@mtest_LDADD = libbacktrace.la
@HAVE_ELF_TRUE@xztest_SOURCES = xztest.c testlib.c
@HAVE_ELF_TRUE@xztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
@HAVE_ELF_TRUE@xztest_LDADD = libbacktrace.la $(am__append_27) \
@HAVE_ELF_TRUE@xztest_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@xztest_LDADD = libbacktrace.la $(am__append_31) \
@HAVE_ELF_TRUE@ $(CLOCK_GETTIME_LINK)
@HAVE_ELF_TRUE@xztest_alloc_SOURCES = $(xztest_SOURCES)
@HAVE_ELF_TRUE@xztest_alloc_CFLAGS = $(xztest_CFLAGS)
@HAVE_ELF_TRUE@xztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
@HAVE_ELF_TRUE@xztest_alloc_LDADD = libbacktrace_alloc.la \
@HAVE_ELF_TRUE@ $(am__append_28) $(CLOCK_GETTIME_LINK)
@HAVE_ELF_TRUE@ $(am__append_32) $(CLOCK_GETTIME_LINK)
CLEANFILES = \
$(filter-out allocfail.sh,$(TESTS)) *.debug elf_for_test.c edtest2_build.c gen_edtest2_build \
$(MAKETESTS) $(BUILDTESTS) *.debug elf_for_test.c edtest2_build.c \
gen_edtest2_build \
*.dsyms *.fsyms *.keepsyms *.dbg *.mdbg *.mdbg.xz *.strip
@ -1297,6 +1386,10 @@ ctestg_alloc$(EXEEXT): $(ctestg_alloc_OBJECTS) $(ctestg_alloc_DEPENDENCIES) $(EX
@rm -f ctestg_alloc$(EXEEXT)
$(AM_V_CCLD)$(ctestg_alloc_LINK) $(ctestg_alloc_OBJECTS) $(ctestg_alloc_LDADD) $(LIBS)
ctestzstd$(EXEEXT): $(ctestzstd_OBJECTS) $(ctestzstd_DEPENDENCIES) $(EXTRA_ctestzstd_DEPENDENCIES)
@rm -f ctestzstd$(EXEEXT)
$(AM_V_CCLD)$(ctestzstd_LINK) $(ctestzstd_OBJECTS) $(ctestzstd_LDADD) $(LIBS)
dwarf5$(EXEEXT): $(dwarf5_OBJECTS) $(dwarf5_DEPENDENCIES) $(EXTRA_dwarf5_DEPENDENCIES)
@rm -f dwarf5$(EXEEXT)
$(AM_V_CCLD)$(dwarf5_LINK) $(dwarf5_OBJECTS) $(dwarf5_LDADD) $(LIBS)
@ -1377,6 +1470,14 @@ xztest_alloc$(EXEEXT): $(xztest_alloc_OBJECTS) $(xztest_alloc_DEPENDENCIES) $(EX
@rm -f xztest_alloc$(EXEEXT)
$(AM_V_CCLD)$(xztest_alloc_LINK) $(xztest_alloc_OBJECTS) $(xztest_alloc_LDADD) $(LIBS)
zstdtest$(EXEEXT): $(zstdtest_OBJECTS) $(zstdtest_DEPENDENCIES) $(EXTRA_zstdtest_DEPENDENCIES)
@rm -f zstdtest$(EXEEXT)
$(AM_V_CCLD)$(zstdtest_LINK) $(zstdtest_OBJECTS) $(zstdtest_LDADD) $(LIBS)
zstdtest_alloc$(EXEEXT): $(zstdtest_alloc_OBJECTS) $(zstdtest_alloc_DEPENDENCIES) $(EXTRA_zstdtest_alloc_DEPENDENCIES)
@rm -f zstdtest_alloc$(EXEEXT)
$(AM_V_CCLD)$(zstdtest_alloc_LINK) $(zstdtest_alloc_OBJECTS) $(zstdtest_alloc_LDADD) $(LIBS)
ztest$(EXEEXT): $(ztest_OBJECTS) $(ztest_DEPENDENCIES) $(EXTRA_ztest_DEPENDENCIES)
@rm -f ztest$(EXEEXT)
$(AM_V_CCLD)$(ztest_LINK) $(ztest_OBJECTS) $(ztest_LDADD) $(LIBS)
@ -1520,6 +1621,18 @@ ctestg_alloc-testlib.o: testlib.c
ctestg_alloc-testlib.obj: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestg_alloc_CFLAGS) $(CFLAGS) -c -o ctestg_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
ctestzstd-btest.o: btest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-btest.o `test -f 'btest.c' || echo '$(srcdir)/'`btest.c
ctestzstd-btest.obj: btest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-btest.obj `if test -f 'btest.c'; then $(CYGPATH_W) 'btest.c'; else $(CYGPATH_W) '$(srcdir)/btest.c'; fi`
ctestzstd-testlib.o: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
ctestzstd-testlib.obj: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
dwarf5-btest.o: btest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dwarf5_CFLAGS) $(CFLAGS) -c -o dwarf5-btest.o `test -f 'btest.c' || echo '$(srcdir)/'`btest.c
@ -1760,6 +1873,30 @@ xztest_alloc-testlib.o: testlib.c
xztest_alloc-testlib.obj: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xztest_alloc_CFLAGS) $(CFLAGS) -c -o xztest_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
zstdtest-zstdtest.o: zstdtest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-zstdtest.o `test -f 'zstdtest.c' || echo '$(srcdir)/'`zstdtest.c
zstdtest-zstdtest.obj: zstdtest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-zstdtest.obj `if test -f 'zstdtest.c'; then $(CYGPATH_W) 'zstdtest.c'; else $(CYGPATH_W) '$(srcdir)/zstdtest.c'; fi`
zstdtest-testlib.o: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
zstdtest-testlib.obj: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
zstdtest_alloc-zstdtest.o: zstdtest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-zstdtest.o `test -f 'zstdtest.c' || echo '$(srcdir)/'`zstdtest.c
zstdtest_alloc-zstdtest.obj: zstdtest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-zstdtest.obj `if test -f 'zstdtest.c'; then $(CYGPATH_W) 'zstdtest.c'; else $(CYGPATH_W) '$(srcdir)/zstdtest.c'; fi`
zstdtest_alloc-testlib.o: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
zstdtest_alloc-testlib.obj: testlib.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
ztest-ztest.o: ztest.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ztest_CFLAGS) $(CFLAGS) -c -o ztest-ztest.o `test -f 'ztest.c' || echo '$(srcdir)/'`ztest.c
@ -2007,6 +2144,13 @@ b2test_buildid.log: b2test_buildid
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
b2test_buildidfull.log: b2test_buildidfull
@p='b2test_buildidfull'; \
b='b2test_buildidfull'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
b3test_dwz_buildid.log: b3test_dwz_buildid
@p='b3test_dwz_buildid'; \
b='b3test_dwz_buildid'; \
@ -2014,6 +2158,13 @@ b3test_dwz_buildid.log: b3test_dwz_buildid
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
b3test_dwz_buildidfull.log: b3test_dwz_buildidfull
@p='b3test_dwz_buildidfull'; \
b='b3test_dwz_buildidfull'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
btest_dwz.log: btest_dwz
@p='btest_dwz'; \
b='btest_dwz'; \
@ -2035,6 +2186,13 @@ btest_gnudebuglink.log: btest_gnudebuglink
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
btest_gnudebuglinkfull.log: btest_gnudebuglinkfull
@p='btest_gnudebuglinkfull'; \
b='btest_gnudebuglinkfull'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
mtest_minidebug.log: mtest_minidebug
@p='mtest_minidebug'; \
b='mtest_minidebug'; \
@ -2154,6 +2312,20 @@ ztest_alloc.log: ztest_alloc$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
zstdtest.log: zstdtest$(EXEEXT)
@p='zstdtest$(EXEEXT)'; \
b='zstdtest'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
zstdtest_alloc.log: zstdtest_alloc$(EXEEXT)
@p='zstdtest_alloc$(EXEEXT)'; \
b='zstdtest_alloc'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
edtest.log: edtest$(EXEEXT)
@p='edtest$(EXEEXT)'; \
b='edtest'; \
@ -2196,6 +2368,13 @@ ctesta.log: ctesta$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
ctestzstd.log: ctestzstd$(EXEEXT)
@p='ctestzstd$(EXEEXT)'; \
b='ctestzstd'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
ctestg_alloc.log: ctestg_alloc$(EXEEXT)
@p='ctestg_alloc$(EXEEXT)'; \
b='ctestg_alloc'; \
@ -2408,18 +2587,18 @@ uninstall-am:
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ mv $@.tmp $@
@NATIVE_TRUE@elf_%.c: elf.c
@NATIVE_TRUE@ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
@NATIVE_TRUE@ SEARCH='#error "Unknown BACKTRACE_ELF_SIZE"'; \
@NATIVE_TRUE@ REPLACE='#undef BACKTRACE_ELF_SIZE\
@NATIVE_TRUE@ #define BACKTRACE_ELF_SIZE'; \
@NATIVE_TRUE@ REPLACE="#undef BACKTRACE_ELF_SIZE\\$${nl}#define BACKTRACE_ELF_SIZE"; \
@NATIVE_TRUE@ $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
@NATIVE_TRUE@ $< \
@NATIVE_TRUE@ > $@.tmp
@NATIVE_TRUE@ mv $@.tmp $@
@NATIVE_TRUE@xcoff_%.c: xcoff.c
@NATIVE_TRUE@ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
@NATIVE_TRUE@ SEARCH='#error "Unknown BACKTRACE_XCOFF_SIZE"'; \
@NATIVE_TRUE@ REPLACE='#undef BACKTRACE_XCOFF_SIZE\
@NATIVE_TRUE@ #define BACKTRACE_XCOFF_SIZE'; \
@NATIVE_TRUE@ REPLACE="#undef BACKTRACE_XCOFF_SIZE\\$${nl}#define BACKTRACE_XCOFF_SIZE"; \
@NATIVE_TRUE@ $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
@NATIVE_TRUE@ $< \
@NATIVE_TRUE@ > $@.tmp
@ -2451,15 +2630,25 @@ uninstall-am:
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ $(OBJCOPY) --only-keep-debug $< $@.debug
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ $(OBJCOPY) --strip-debug --add-gnu-debuglink=$@.debug $< $@
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@%_gnudebuglinkfull: %
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ $(OBJCOPY) --only-keep-debug $< $@.debug
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ $(OBJCOPY) --strip-all --add-gnu-debuglink=$@.debug $< $@
@NATIVE_TRUE@%_buildid: %
@NATIVE_TRUE@ ./install-debuginfo-for-buildid.sh \
@NATIVE_TRUE@ "$(TEST_BUILD_ID_DIR)" \
@NATIVE_TRUE@ $<
@NATIVE_TRUE@ $(OBJCOPY) --strip-debug $< $@
@NATIVE_TRUE@%_buildidfull: %
@NATIVE_TRUE@ ./install-debuginfo-for-buildid.sh \
@NATIVE_TRUE@ "$(TEST_BUILD_ID_DIR)" \
@NATIVE_TRUE@ $<
@NATIVE_TRUE@ $(OBJCOPY) --strip-all $< $@
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@%_minidebug: %
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(NM) -D $< -P --defined-only | $(AWK) '{ print $$1 }' | sort > $<.dsyms
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(NM) $< -P --defined-only | $(AWK) '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D" || $$2 == "d") print $$1 }' | sort > $<.fsyms
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(NM) $< -P --defined-only | $(AWK) '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D") print $$1 }' | sort > $<.fsyms
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(COMM) -13 $<.dsyms $<.fsyms > $<.keepsyms
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(OBJCOPY) --only-keep-debug $< $<.dbg
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@ $(OBJCOPY) -S --remove-section .gdb_index --remove-section .comment --keep-symbols=$<.keepsyms $<.dbg $<.mdbg

View File

@ -1,23 +1,31 @@
The libbacktrace library
Initially written by Ian Lance Taylor <iant@google.com>
Initially written by Ian Lance Taylor <iant@golang.org>
The libbacktrace library may be linked into a program or library and
used to produce symbolic backtraces. Sample uses would be to print a
detailed backtrace when an error occurs or to gather detailed
profiling information.
used to produce symbolic backtraces.
Sample uses would be to print a detailed backtrace when an error
occurs or to gather detailed profiling information.
In general the functions provided by this library are async-signal-safe,
meaning that they may be safely called from a signal handler.
The libbacktrace library is provided under a BSD license. See the
source files for the exact license text.
The libbacktrace library is provided under a BSD license.
See the source files for the exact license text.
The public functions are declared and documented in the header file
backtrace.h, which should be #include'd by a user of the library.
Building libbacktrace will generate a file backtrace-supported.h,
which a user of the library may use to determine whether backtraces
will work. See the source file backtrace-supported.h.in for the
macros that it defines.
will work.
See the source file backtrace-supported.h.in for the macros that it
defines.
As of September 2012, libbacktrace only supports ELF executables with
DWARF debugging information. The library is written to make it
straightforward to add support for other object file and debugging
formats.
As of October 2020, libbacktrace supports ELF, PE/COFF, Mach-O, and
XCOFF executables with DWARF debugging information.
In other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.
The library is written to make it straightforward to add support for
other object file and debugging formats.
The library relies on the C++ unwind API defined at
https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
This API is provided by GCC and clang.

View File

@ -1,5 +1,5 @@
/* alloc.c -- Memory allocation without mmap.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* allocfail.c -- Test for libbacktrace library
Copyright (C) 2018-2021 Free Software Foundation, Inc.
Copyright (C) 2018-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

View File

@ -1,7 +1,7 @@
#!/bin/sh
# allocfail.sh -- Test for libbacktrace library.
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
# Copyright (C) 2018-2024 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are

View File

@ -1,5 +1,5 @@
/* atomic.c -- Support for atomic functions if not present.
Copyright (C) 2013-2021 Free Software Foundation, Inc.
Copyright (C) 2013-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* backtrace-supported.h.in -- Whether stack backtrace is supported.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* backtrace.c -- Entry point for stack backtrace library.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* backtrace.h -- Public header file for stack backtrace library.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* btest.c -- Test for libbacktrace library
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -20,6 +20,10 @@
don't. */
#undef HAVE_DECL_STRNLEN
/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you
don't. */
#undef HAVE_DECL__PGMPTR
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@ -85,6 +89,9 @@
/* Define to 1 if you have the <sys/ldr.h> header file. */
#undef HAVE_SYS_LDR_H
/* Define to 1 if you have the <sys/link.h> header file. */
#undef HAVE_SYS_LINK_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
@ -97,9 +104,15 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
/* Define if -lz is available. */
#undef HAVE_ZLIB
/* Define if -lzstd is available. */
#undef HAVE_ZSTD
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR

204
libbacktrace/configure vendored
View File

@ -651,8 +651,14 @@ HAVE_OBJCOPY_DEBUGLINK_FALSE
HAVE_OBJCOPY_DEBUGLINK_TRUE
READELF
OBJCOPY
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE
HAVE_ZSTD_FALSE
HAVE_ZSTD_TRUE
HAVE_COMPRESSED_DEBUG_FALSE
HAVE_COMPRESSED_DEBUG_TRUE
HAVE_BUILDID_FALSE
HAVE_BUILDID_TRUE
HAVE_ZLIB_FALSE
HAVE_ZLIB_TRUE
HAVE_DWARF5_FALSE
@ -801,6 +807,7 @@ with_gnu_ld
enable_libtool_lock
enable_largefile
enable_cet
enable_werror
with_system_libunwind
enable_host_shared
'
@ -1448,6 +1455,7 @@ Optional Features:
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-largefile omit support for large files
--enable-cet enable Intel CET in target libraries [default=auto]
--disable-werror disable building with -Werror
--enable-host-shared build host code as shared libraries
--enable-cet enable Intel CET in host libraries [default=auto]
@ -11571,7 +11579,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11574 "configure"
#line 11582 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11677,7 +11685,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11680 "configure"
#line 11688 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12362,10 +12370,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "${with_target_subdir}"; then
WARN_FLAGS="$WARN_FLAGS -Werror"
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror;
fi
if test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"; then :
WARN_FLAGS="$WARN_FLAGS -Werror"
fi
if test -n "${with_target_subdir}"; then
@ -13323,26 +13335,31 @@ fi
# Check for dl_iterate_phdr.
for ac_header in link.h
for ac_header in link.h sys/link.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "link.h" "ac_cv_header_link_h" "$ac_includes_default"
if test "x$ac_cv_header_link_h" = xyes; then :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LINK_H 1
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
if test "$ac_cv_header_link_h" = "no"; then
if test "$ac_cv_header_link_h" = "no" -a "$ac_cv_header_sys_link_h" = "no"; then
have_dl_iterate_phdr=no
else
if test -n "${with_target_subdir}"; then
link_h=link.h
if test "$ac_cv_header_link_h" = "no"; then
link_h=sys/link.h
fi
# When built as a GCC target library, we can't do a link test.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <link.h>
#include <$link_h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
@ -13430,6 +13447,19 @@ $as_echo "#define HAVE_LOADQUERY 1" >>confdefs.h
fi
for ac_header in windows.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
if test "x$ac_cv_header_windows_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_WINDOWS_H 1
_ACEOF
fi
done
# Check for the fcntl function.
if test -n "${with_target_subdir}"; then
case "${host}" in
@ -13506,6 +13536,19 @@ $as_echo "#define HAVE_GETEXECNAME 1" >>confdefs.h
fi
# Check for _pgmptr variable, contains the executable filename on windows
ac_fn_c_check_decl "$LINENO" "_pgmptr" "ac_cv_have_decl__pgmptr" "$ac_includes_default"
if test "x$ac_cv_have_decl__pgmptr" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL__PGMPTR $ac_have_decl
_ACEOF
# Check for sysctl definitions.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for KERN_PROC" >&5
@ -13765,6 +13808,44 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --build-id is supported" >&5
$as_echo_n "checking whether --build-id is supported... " >&6; }
if ${libbacktrace_cv_ld_buildid+:} false; then :
$as_echo_n "(cached) " >&6
else
LDFLAGS_hold=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--build-id"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
libbacktrace_cv_ld_buildid=yes
else
libbacktrace_cv_ld_buildid=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$LDFLAGS_hold
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_ld_buildid" >&5
$as_echo "$libbacktrace_cv_ld_buildid" >&6; }
if test "$libbacktrace_cv_ld_buildid" = yes; then
HAVE_BUILDID_TRUE=
HAVE_BUILDID_FALSE='#'
else
HAVE_BUILDID_TRUE='#'
HAVE_BUILDID_FALSE=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --compress-debug-sections is supported" >&5
$as_echo_n "checking whether --compress-debug-sections is supported... " >&6; }
if ${libgo_cv_ld_compress+:} false; then :
@ -13803,6 +13884,95 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5
$as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; }
if ${ac_cv_lib_zstd_ZSTD_compress+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzstd $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ZSTD_compress ();
int
main ()
{
return ZSTD_compress ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_zstd_ZSTD_compress=yes
else
ac_cv_lib_zstd_ZSTD_compress=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5
$as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; }
if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then :
$as_echo "#define HAVE_ZSTD 1" >>confdefs.h
fi
if test "$ac_cv_lib_zstd_ZSTD_compress" = yes; then
HAVE_ZSTD_TRUE=
HAVE_ZSTD_FALSE='#'
else
HAVE_ZSTD_TRUE='#'
HAVE_ZSTD_FALSE=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --compress-debug-sections=zstd is supported" >&5
$as_echo_n "checking whether --compress-debug-sections=zstd is supported... " >&6; }
if ${libgo_cv_ld_compress_zstd+:} false; then :
$as_echo_n "(cached) " >&6
else
LDFLAGS_hold=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zstd"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
libgo_cv_ld_compress_zstd=yes
else
libgo_cv_ld_compress_zstd=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$LDFLAGS_hold
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_ld_compress_zstd" >&5
$as_echo "$libgo_cv_ld_compress_zstd" >&6; }
if test "$libgo_cv_ld_compress_zstd" = yes; then
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE=
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE='#'
else
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE='#'
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE=
fi
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
@ -13887,7 +14057,7 @@ else
libbacktrace_cv_objcopy_debuglink=no
elif ! test -n "${OBJCOPY}"; then
libbacktrace_cv_objcopy_debuglink=no
elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then
elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then
libbacktrace_cv_objcopy_debuglink=yes
else
libbacktrace_cv_objcopy_debuglink=no
@ -14345,10 +14515,22 @@ if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then
as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_BUILDID_TRUE}" && test -z "${HAVE_BUILDID_FALSE}"; then
as_fn_error $? "conditional \"HAVE_BUILDID\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_COMPRESSED_DEBUG_TRUE}" && test -z "${HAVE_COMPRESSED_DEBUG_FALSE}"; then
as_fn_error $? "conditional \"HAVE_COMPRESSED_DEBUG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_ZSTD_TRUE}" && test -z "${HAVE_ZSTD_FALSE}"; then
as_fn_error $? "conditional \"HAVE_ZSTD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_COMPRESSED_DEBUG_ZSTD_TRUE}" && test -z "${HAVE_COMPRESSED_DEBUG_ZSTD_FALSE}"; then
as_fn_error $? "conditional \"HAVE_COMPRESSED_DEBUG_ZSTD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_OBJCOPY_DEBUGLINK_TRUE}" && test -z "${HAVE_OBJCOPY_DEBUGLINK_FALSE}"; then
as_fn_error $? "conditional \"HAVE_OBJCOPY_DEBUGLINK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -1,5 +1,5 @@
# configure.ac -- Backtrace configure script.
# Copyright (C) 2012-2021 Free Software Foundation, Inc.
# Copyright (C) 2012-2024 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@ -145,10 +145,10 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
-Wmissing-format-attribute -Wcast-qual],
[WARN_FLAGS])
if test -n "${with_target_subdir}"; then
WARN_FLAGS="$WARN_FLAGS -Werror"
fi
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
AS_IF([test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"],
[WARN_FLAGS="$WARN_FLAGS -Werror"])
AC_SUBST(WARN_FLAGS)
if test -n "${with_target_subdir}"; then
@ -335,13 +335,17 @@ fi
AC_SUBST(BACKTRACE_USES_MALLOC)
# Check for dl_iterate_phdr.
AC_CHECK_HEADERS(link.h)
if test "$ac_cv_header_link_h" = "no"; then
AC_CHECK_HEADERS(link.h sys/link.h)
if test "$ac_cv_header_link_h" = "no" -a "$ac_cv_header_sys_link_h" = "no"; then
have_dl_iterate_phdr=no
else
if test -n "${with_target_subdir}"; then
link_h=link.h
if test "$ac_cv_header_link_h" = "no"; then
link_h=sys/link.h
fi
# When built as a GCC target library, we can't do a link test.
AC_EGREP_HEADER([dl_iterate_phdr], [link.h], [have_dl_iterate_phdr=yes],
AC_EGREP_HEADER([dl_iterate_phdr], [$link_h], [have_dl_iterate_phdr=yes],
[have_dl_iterate_phdr=no])
else
AC_CHECK_FUNC([dl_iterate_phdr], [have_dl_iterate_phdr=yes],
@ -373,6 +377,8 @@ if test "$have_loadquery" = "yes"; then
AC_DEFINE(HAVE_LOADQUERY, 1, [Define if AIX loadquery is available.])
fi
AC_CHECK_HEADERS(windows.h)
# Check for the fcntl function.
if test -n "${with_target_subdir}"; then
case "${host}" in
@ -403,6 +409,9 @@ if test "$have_getexecname" = "yes"; then
AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.])
fi
# Check for _pgmptr variable, contains the executable filename on windows
AC_CHECK_DECLS([_pgmptr])
# Check for sysctl definitions.
AC_CACHE_CHECK([for KERN_PROC],
@ -480,7 +489,18 @@ AC_CHECK_LIB([z], [compress],
[AC_DEFINE(HAVE_ZLIB, 1, [Define if -lz is available.])])
AM_CONDITIONAL(HAVE_ZLIB, test "$ac_cv_lib_z_compress" = yes)
dnl Test whether the linker supports the --compress_debug_sections option.
dnl Test whether the linker supports the --build-id option.
AC_CACHE_CHECK([whether --build-id is supported],
[libbacktrace_cv_ld_buildid],
[LDFLAGS_hold=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--build-id"
AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
[libbacktrace_cv_ld_buildid=yes],
[libbacktrace_cv_ld_buildid=no])
LDFLAGS=$LDFLAGS_hold])
AM_CONDITIONAL(HAVE_BUILDID, test "$libbacktrace_cv_ld_buildid" = yes)
dnl Test whether the linker supports the --compress-debug-sections option.
AC_CACHE_CHECK([whether --compress-debug-sections is supported],
[libgo_cv_ld_compress],
[LDFLAGS_hold=$LDFLAGS
@ -491,6 +511,21 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
LDFLAGS=$LDFLAGS_hold])
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG, test "$libgo_cv_ld_compress" = yes)
AC_CHECK_LIB([zstd], [ZSTD_compress],
[AC_DEFINE(HAVE_ZSTD, 1, [Define if -lzstd is available.])])
AM_CONDITIONAL(HAVE_ZSTD, test "$ac_cv_lib_zstd_ZSTD_compress" = yes)
dnl Test whether the linker supports --compress-debug-sections=zstd option.
AC_CACHE_CHECK([whether --compress-debug-sections=zstd is supported],
[libgo_cv_ld_compress_zstd],
[LDFLAGS_hold=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zstd"
AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
[libgo_cv_ld_compress_zstd=yes],
[libgo_cv_ld_compress_zstd=no])
LDFLAGS=$LDFLAGS_hold])
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZSTD, test "$libgo_cv_ld_compress_zstd" = yes)
AC_ARG_VAR(OBJCOPY, [location of objcopy])
AC_CHECK_PROG(OBJCOPY, objcopy, objcopy,)
AC_CHECK_PROG(READELF, readelf, readelf)
@ -500,7 +535,7 @@ AC_CACHE_CHECK([whether objcopy supports debuglink],
libbacktrace_cv_objcopy_debuglink=no
elif ! test -n "${OBJCOPY}"; then
libbacktrace_cv_objcopy_debuglink=no
elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then
elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then
libbacktrace_cv_objcopy_debuglink=yes
else
libbacktrace_cv_objcopy_debuglink=no

View File

@ -1,5 +1,5 @@
/* dwarf.c -- Get file/line information from DWARF for backtraces.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without
@ -136,7 +136,7 @@ enum attr_val_encoding
/* An address. */
ATTR_VAL_ADDRESS,
/* An index into the .debug_addr section, whose value is relative to
* the DW_AT_addr_base attribute of the compilation unit. */
the DW_AT_addr_base attribute of the compilation unit. */
ATTR_VAL_ADDRESS_INDEX,
/* A unsigned integer. */
ATTR_VAL_UINT,
@ -274,8 +274,8 @@ struct function
struct function_addrs
{
/* Range is LOW <= PC < HIGH. */
uint64_t low;
uint64_t high;
uintptr_t low;
uintptr_t high;
/* Function for this address range. */
struct function *function;
};
@ -356,8 +356,8 @@ struct unit
struct unit_addrs
{
/* Range is LOW <= PC < HIGH. */
uint64_t low;
uint64_t high;
uintptr_t low;
uintptr_t high;
/* Compilation unit for this address range. */
struct unit *u;
};
@ -1094,7 +1094,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
uint64_t addr_base, int addrsize, int is_bigendian,
uint64_t addr_index,
backtrace_error_callback error_callback, void *data,
uint64_t *address)
uintptr_t *address)
{
uint64_t offset;
struct dwarf_buf addr_buf;
@ -1115,7 +1115,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
addr_buf.data = data;
addr_buf.reported_underflow = 0;
*address = read_address (&addr_buf, addrsize);
*address = (uintptr_t) read_address (&addr_buf, addrsize);
return 1;
}
@ -1194,7 +1194,7 @@ function_addrs_search (const void *vkey, const void *ventry)
static int
add_unit_addr (struct backtrace_state *state, void *rdata,
uint64_t lowpc, uint64_t highpc,
uintptr_t lowpc, uintptr_t highpc,
backtrace_error_callback error_callback, void *data,
void *pvec)
{
@ -1530,10 +1530,10 @@ lookup_abbrev (struct abbrevs *abbrevs, uint64_t code,
lowpc/highpc is set or ranges is set. */
struct pcrange {
uint64_t lowpc; /* The low PC value. */
uintptr_t lowpc; /* The low PC value. */
int have_lowpc; /* Whether a low PC value was found. */
int lowpc_is_addr_index; /* Whether lowpc is in .debug_addr. */
uint64_t highpc; /* The high PC value. */
uintptr_t highpc; /* The high PC value. */
int have_highpc; /* Whether a high PC value was found. */
int highpc_is_relative; /* Whether highpc is relative to lowpc. */
int highpc_is_addr_index; /* Whether highpc is in .debug_addr. */
@ -1553,12 +1553,12 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
case DW_AT_low_pc:
if (val->encoding == ATTR_VAL_ADDRESS)
{
pcrange->lowpc = val->u.uint;
pcrange->lowpc = (uintptr_t) val->u.uint;
pcrange->have_lowpc = 1;
}
else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)
{
pcrange->lowpc = val->u.uint;
pcrange->lowpc = (uintptr_t) val->u.uint;
pcrange->have_lowpc = 1;
pcrange->lowpc_is_addr_index = 1;
}
@ -1567,18 +1567,18 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
case DW_AT_high_pc:
if (val->encoding == ATTR_VAL_ADDRESS)
{
pcrange->highpc = val->u.uint;
pcrange->highpc = (uintptr_t) val->u.uint;
pcrange->have_highpc = 1;
}
else if (val->encoding == ATTR_VAL_UINT)
{
pcrange->highpc = val->u.uint;
pcrange->highpc = (uintptr_t) val->u.uint;
pcrange->have_highpc = 1;
pcrange->highpc_is_relative = 1;
}
else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)
{
pcrange->highpc = val->u.uint;
pcrange->highpc = (uintptr_t) val->u.uint;
pcrange->have_highpc = 1;
pcrange->highpc_is_addr_index = 1;
}
@ -1613,16 +1613,16 @@ add_low_high_range (struct backtrace_state *state,
uintptr_t base_address, int is_bigendian,
struct unit *u, const struct pcrange *pcrange,
int (*add_range) (struct backtrace_state *state,
void *rdata, uint64_t lowpc,
uint64_t highpc,
void *rdata, uintptr_t lowpc,
uintptr_t highpc,
backtrace_error_callback error_callback,
void *data, void *vec),
void *rdata,
backtrace_error_callback error_callback, void *data,
void *vec)
{
uint64_t lowpc;
uint64_t highpc;
uintptr_t lowpc;
uintptr_t highpc;
lowpc = pcrange->lowpc;
if (pcrange->lowpc_is_addr_index)
@ -1660,10 +1660,10 @@ add_ranges_from_ranges (
struct backtrace_state *state,
const struct dwarf_sections *dwarf_sections,
uintptr_t base_address, int is_bigendian,
struct unit *u, uint64_t base,
struct unit *u, uintptr_t base,
const struct pcrange *pcrange,
int (*add_range) (struct backtrace_state *state, void *rdata,
uint64_t lowpc, uint64_t highpc,
uintptr_t lowpc, uintptr_t highpc,
backtrace_error_callback error_callback, void *data,
void *vec),
void *rdata,
@ -1702,12 +1702,12 @@ add_ranges_from_ranges (
break;
if (is_highest_address (low, u->addrsize))
base = high;
base = (uintptr_t) high;
else
{
if (!add_range (state, rdata,
low + base + base_address,
high + base + base_address,
(uintptr_t) low + base + base_address,
(uintptr_t) high + base + base_address,
error_callback, data, vec))
return 0;
}
@ -1727,10 +1727,10 @@ add_ranges_from_rnglists (
struct backtrace_state *state,
const struct dwarf_sections *dwarf_sections,
uintptr_t base_address, int is_bigendian,
struct unit *u, uint64_t base,
struct unit *u, uintptr_t base,
const struct pcrange *pcrange,
int (*add_range) (struct backtrace_state *state, void *rdata,
uint64_t lowpc, uint64_t highpc,
uintptr_t lowpc, uintptr_t highpc,
backtrace_error_callback error_callback, void *data,
void *vec),
void *rdata,
@ -1796,8 +1796,8 @@ add_ranges_from_rnglists (
case DW_RLE_startx_endx:
{
uint64_t index;
uint64_t low;
uint64_t high;
uintptr_t low;
uintptr_t high;
index = read_uleb128 (&rnglists_buf);
if (!resolve_addr_index (dwarf_sections, u->addr_base,
@ -1819,8 +1819,8 @@ add_ranges_from_rnglists (
case DW_RLE_startx_length:
{
uint64_t index;
uint64_t low;
uint64_t length;
uintptr_t low;
uintptr_t length;
index = read_uleb128 (&rnglists_buf);
if (!resolve_addr_index (dwarf_sections, u->addr_base,
@ -1850,16 +1850,16 @@ add_ranges_from_rnglists (
break;
case DW_RLE_base_address:
base = read_address (&rnglists_buf, u->addrsize);
base = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
break;
case DW_RLE_start_end:
{
uint64_t low;
uint64_t high;
uintptr_t low;
uintptr_t high;
low = read_address (&rnglists_buf, u->addrsize);
high = read_address (&rnglists_buf, u->addrsize);
low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
high = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
if (!add_range (state, rdata, low + base_address,
high + base_address, error_callback, data,
vec))
@ -1869,11 +1869,11 @@ add_ranges_from_rnglists (
case DW_RLE_start_length:
{
uint64_t low;
uint64_t length;
uintptr_t low;
uintptr_t length;
low = read_address (&rnglists_buf, u->addrsize);
length = read_uleb128 (&rnglists_buf);
low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
length = (uintptr_t) read_uleb128 (&rnglists_buf);
low += base_address;
if (!add_range (state, rdata, low, low + length,
error_callback, data, vec))
@ -1903,9 +1903,9 @@ static int
add_ranges (struct backtrace_state *state,
const struct dwarf_sections *dwarf_sections,
uintptr_t base_address, int is_bigendian,
struct unit *u, uint64_t base, const struct pcrange *pcrange,
struct unit *u, uintptr_t base, const struct pcrange *pcrange,
int (*add_range) (struct backtrace_state *state, void *rdata,
uint64_t lowpc, uint64_t highpc,
uintptr_t lowpc, uintptr_t highpc,
backtrace_error_callback error_callback,
void *data, void *vec),
void *rdata,
@ -1989,14 +1989,16 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
break;
case DW_AT_stmt_list:
if (abbrev->tag == DW_TAG_compile_unit
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& (val.encoding == ATTR_VAL_UINT
|| val.encoding == ATTR_VAL_REF_SECTION))
u->lineoff = val.u.uint;
break;
case DW_AT_name:
if (abbrev->tag == DW_TAG_compile_unit)
if (abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
{
name_val = val;
have_name_val = 1;
@ -2004,7 +2006,8 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
break;
case DW_AT_comp_dir:
if (abbrev->tag == DW_TAG_compile_unit)
if (abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
{
comp_dir_val = val;
have_comp_dir_val = 1;
@ -2012,19 +2015,22 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
break;
case DW_AT_str_offsets_base:
if (abbrev->tag == DW_TAG_compile_unit
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& val.encoding == ATTR_VAL_REF_SECTION)
u->str_offsets_base = val.u.uint;
break;
case DW_AT_addr_base:
if (abbrev->tag == DW_TAG_compile_unit
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& val.encoding == ATTR_VAL_REF_SECTION)
u->addr_base = val.u.uint;
break;
case DW_AT_rnglists_base:
if (abbrev->tag == DW_TAG_compile_unit
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& val.encoding == ATTR_VAL_REF_SECTION)
u->rnglists_base = val.u.uint;
break;
@ -2052,7 +2058,8 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
}
if (abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_subprogram)
|| abbrev->tag == DW_TAG_subprogram
|| abbrev->tag == DW_TAG_skeleton_unit)
{
if (!add_ranges (state, dwarf_sections, base_address,
is_bigendian, u, pcrange.lowpc, &pcrange,
@ -2060,9 +2067,10 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
(void *) addrs))
return 0;
/* If we found the PC range in the DW_TAG_compile_unit, we
can stop now. */
if (abbrev->tag == DW_TAG_compile_unit
/* If we found the PC range in the DW_TAG_compile_unit or
DW_TAG_skeleton_unit, we can stop now. */
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& (pcrange.have_ranges
|| (pcrange.have_lowpc && pcrange.have_highpc)))
return 1;
@ -2221,6 +2229,9 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address,
u->comp_dir = NULL;
u->abs_filename = NULL;
u->lineoff = 0;
u->str_offsets_base = 0;
u->addr_base = 0;
u->rnglists_base = 0;
/* The actual line number mappings will be read as needed. */
u->lines = NULL;
@ -3172,7 +3183,7 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u,
static int
add_function_range (struct backtrace_state *state, void *rdata,
uint64_t lowpc, uint64_t highpc,
uintptr_t lowpc, uintptr_t highpc,
backtrace_error_callback error_callback, void *data,
void *pvec)
{
@ -3212,7 +3223,7 @@ add_function_range (struct backtrace_state *state, void *rdata,
static int
read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
struct unit *u, uint64_t base, struct dwarf_buf *unit_buf,
struct unit *u, uintptr_t base, struct dwarf_buf *unit_buf,
const struct line_header *lhdr,
backtrace_error_callback error_callback, void *data,
struct function_vector *vec_function,
@ -3271,11 +3282,12 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
/* The compile unit sets the base address for any address
ranges in the function entries. */
if (abbrev->tag == DW_TAG_compile_unit
if ((abbrev->tag == DW_TAG_compile_unit
|| abbrev->tag == DW_TAG_skeleton_unit)
&& abbrev->attrs[i].name == DW_AT_low_pc)
{
if (val.encoding == ATTR_VAL_ADDRESS)
base = val.u.uint;
base = (uintptr_t) val.u.uint;
else if (val.encoding == ATTR_VAL_ADDRESS_INDEX)
{
if (!resolve_addr_index (&ddata->dwarf_sections,

View File

@ -1,5 +1,5 @@
/* edtest.c -- Test for libbacktrace storage allocation stress handling
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

View File

@ -1,5 +1,5 @@
/* edtest2.c -- Test for libbacktrace storage allocation stress handling (p2)
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* fileline.c -- Get file and line number information in a backtrace.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without
@ -47,6 +47,18 @@ POSSIBILITY OF SUCH DAMAGE. */
#include <mach-o/dyld.h>
#endif
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_MEAN_AND_LEAN
#define WIN32_MEAN_AND_LEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif
#include "backtrace.h"
#include "internal.h"
@ -155,6 +167,47 @@ macho_get_executable_path (struct backtrace_state *state,
#endif /* !defined (HAVE_MACH_O_DYLD_H) */
#if HAVE_DECL__PGMPTR
#define windows_executable_filename() _pgmptr
#else /* !HAVE_DECL__PGMPTR */
#define windows_executable_filename() NULL
#endif /* !HAVE_DECL__PGMPTR */
#ifdef HAVE_WINDOWS_H
#define FILENAME_BUF_SIZE (MAX_PATH)
static char *
windows_get_executable_path (char *buf, backtrace_error_callback error_callback,
void *data)
{
size_t got;
int error;
got = GetModuleFileNameA (NULL, buf, FILENAME_BUF_SIZE - 1);
error = GetLastError ();
if (got == 0
|| (got == FILENAME_BUF_SIZE - 1 && error == ERROR_INSUFFICIENT_BUFFER))
{
error_callback (data,
"could not get the filename of the current executable",
error);
return NULL;
}
return buf;
}
#else /* !defined (HAVE_WINDOWS_H) */
#define windows_get_executable_path(buf, error_callback, data) NULL
#define FILENAME_BUF_SIZE 64
#endif /* !defined (HAVE_WINDOWS_H) */
/* Initialize the fileline information from the executable. Returns 1
on success, 0 on failure. */
@ -168,7 +221,7 @@ fileline_initialize (struct backtrace_state *state,
int called_error_callback;
int descriptor;
const char *filename;
char buf[64];
char buf[FILENAME_BUF_SIZE];
if (!state->threaded)
failed = state->fileline_initialization_failed;
@ -192,7 +245,7 @@ fileline_initialize (struct backtrace_state *state,
descriptor = -1;
called_error_callback = 0;
for (pass = 0; pass < 8; ++pass)
for (pass = 0; pass < 10; ++pass)
{
int does_not_exist;
@ -205,25 +258,33 @@ fileline_initialize (struct backtrace_state *state,
filename = getexecname ();
break;
case 2:
filename = "/proc/self/exe";
/* Test this before /proc/self/exe, as the latter exists but points
to the wine binary (and thus doesn't work). */
filename = windows_executable_filename ();
break;
case 3:
filename = "/proc/curproc/file";
filename = "/proc/self/exe";
break;
case 4:
filename = "/proc/curproc/file";
break;
case 5:
snprintf (buf, sizeof (buf), "/proc/%ld/object/a.out",
(long) getpid ());
filename = buf;
break;
case 5:
case 6:
filename = sysctl_exec_name1 (state, error_callback, data);
break;
case 6:
case 7:
filename = sysctl_exec_name2 (state, error_callback, data);
break;
case 7:
case 8:
filename = macho_get_executable_path (state, error_callback, data);
break;
case 9:
filename = windows_get_executable_path (buf, error_callback, data);
break;
default:
abort ();
}

View File

@ -2,7 +2,7 @@
# install-debug-info-for-buildid.sh -- Helper script for libbacktrace library
# testing.
# Copyright (C) 2019-2021 Free Software Foundation, Inc.
# Copyright (C) 2019-2024 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are

View File

@ -1,6 +1,6 @@
/* instrumented_alloc.c -- Memory allocation instrumented to fail when
requested, for testing purposes.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
Copyright (C) 2018-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

View File

@ -1,5 +1,5 @@
/* internal.h -- Internal header file for stack backtrace library.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without
@ -368,6 +368,15 @@ extern int backtrace_uncompress_zdebug (struct backtrace_state *,
unsigned char **uncompressed,
size_t *uncompressed_size);
/* A test-only hook for elf_zstd_decompress. */
extern int backtrace_uncompress_zstd (struct backtrace_state *,
const unsigned char *compressed,
size_t compressed_size,
backtrace_error_callback, void *data,
unsigned char *uncompressed,
size_t uncompressed_size);
/* A test-only hook for elf_uncompress_lzma. */
extern int backtrace_uncompress_lzma (struct backtrace_state *,

View File

@ -1,5 +1,5 @@
/* elf.c -- Get debug data from a Mach-O file for backtraces.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Copyright (C) 2020-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without
@ -1268,7 +1268,7 @@ backtrace_initialize (struct backtrace_state *state, const char *filename,
mff = macho_nodebug;
if (!macho_add (state, name, d, 0, NULL, base_address, 0,
error_callback, data, &mff, &mfs))
return 0;
continue;
if (mff != macho_nodebug)
macho_fileline_fn = mff;

View File

@ -1,5 +1,5 @@
/* mmap.c -- Memory allocation with mmap.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* mmapio.c -- File views using mmap.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* mtest.c -- Minidebug test for libbacktrace library
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Copyright (C) 2020-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* backtrace.c -- Entry point for stack backtrace library.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* pecoff.c -- Get debug data from a PE/COFFF file for backtraces.
Copyright (C) 2015-2021 Free Software Foundation, Inc.
Copyright (C) 2015-2024 Free Software Foundation, Inc.
Adapted from elf.c by Tristan Gingold, AdaCore.
Redistribution and use in source and binary forms, with or without
@ -39,6 +39,18 @@ POSSIBILITY OF SUCH DAMAGE. */
#include "backtrace.h"
#include "internal.h"
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_MEAN_AND_LEAN
#define WIN32_MEAN_AND_LEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif
/* Coff file header. */
typedef struct {
@ -610,6 +622,7 @@ coff_add (struct backtrace_state *state, int descriptor,
int debug_view_valid;
int is_64;
uintptr_t image_base;
uintptr_t base_address = 0;
struct dwarf_sections dwarf_sections;
*found_sym = 0;
@ -856,7 +869,16 @@ coff_add (struct backtrace_state *state, int descriptor,
+ (sections[i].offset - min_offset));
}
if (!backtrace_dwarf_add (state, /* base_address */ 0, &dwarf_sections,
#ifdef HAVE_WINDOWS_H
{
uintptr_t module_handle;
module_handle = (uintptr_t) GetModuleHandle (NULL);
base_address = module_handle - image_base;
}
#endif
if (!backtrace_dwarf_add (state, base_address, &dwarf_sections,
0, /* FIXME: is_bigendian */
NULL, /* altlink */
error_callback, data, fileline_fn,

View File

@ -1,5 +1,5 @@
/* posix.c -- POSIX file I/O routines for the backtrace library.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* print.c -- Print the current backtrace.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* read.c -- File views without mmap.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* simple.c -- The backtrace_simple function.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* sort.c -- Sort without allocating memory
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* state.c -- Create the backtrace state.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* stest.c -- Test for libbacktrace internal sort function
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* test_format.c -- Test for libbacktrace library
Copyright (C) 2018-2021 Free Software Foundation, Inc.
Copyright (C) 2018-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

View File

@ -1,5 +1,5 @@
/* testlib.c -- test functions for libbacktrace library
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* testlib.h -- Header for test functions for libbacktrace library
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* ttest.c -- Test for libbacktrace library
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* unittest.c -- Test for libbacktrace library
Copyright (C) 2018-2021 Free Software Foundation, Inc.
Copyright (C) 2018-2024 Free Software Foundation, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are

View File

@ -1,5 +1,5 @@
/* unknown.c -- used when backtrace configury does not know file format.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* xcoff.c -- Get debug data from an XCOFF file for backtraces.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
Adapted from elf.c.
Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* xztest.c -- Test for libbacktrace LZMA decoder.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Copyright (C) 2020-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without

523
libbacktrace/zstdtest.c Normal file
View File

@ -0,0 +1,523 @@
/* ztest.c -- Test for libbacktrace zstd code.
Copyright (C) 2022-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
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
notice, this list of conditions and the following disclaimer.
(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
distribution.
(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. */
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_ZSTD
#include <zstd.h>
#endif
#include "backtrace.h"
#include "backtrace-supported.h"
#include "internal.h"
#include "testlib.h"
#ifndef HAVE_CLOCK_GETTIME
typedef int xclockid_t;
static int
xclock_gettime (xclockid_t id ATTRIBUTE_UNUSED,
struct timespec *ts ATTRIBUTE_UNUSED)
{
errno = EINVAL;
return -1;
}
#define clockid_t xclockid_t
#define clock_gettime xclock_gettime
#undef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif /* !defined(HAVE_CLOCK_GETTIME) */
#ifdef CLOCK_PROCESS_CPUTIME_ID
#define ZSTD_CLOCK_GETTIME_ARG CLOCK_PROCESS_CPUTIME_ID
#else
#define ZSTD_CLOCK_GETTIME_ARG CLOCK_REALTIME
#endif
/* Some tests for the local zstd inflation code. */
struct zstd_test
{
const char *name;
const char *uncompressed;
size_t uncompressed_len;
const char *compressed;
size_t compressed_len;
};
/* Error callback. */
static void
error_callback_compress (void *vdata ATTRIBUTE_UNUSED, const char *msg,
int errnum)
{
fprintf (stderr, "%s", msg);
if (errnum > 0)
fprintf (stderr, ": %s", strerror (errnum));
fprintf (stderr, "\n");
exit (EXIT_FAILURE);
}
static const struct zstd_test tests[] =
{
{
"empty",
"",
0,
"\x28\xb5\x2f\xfd\x24\x00\x01\x00\x00\x99\xe9\xd8\x51",
13,
},
{
"hello",
"hello, world\n",
0,
("\x28\xb5\x2f\xfd\x24\x0d\x69\x00\x00\x68\x65\x6c\x6c\x6f\x2c\x20"
"\x77\x6f\x72\x6c\x64\x0a\x4c\x1f\xf9\xf1"),
26,
},
{
"goodbye",
"goodbye, world",
0,
("\x28\xb5\x2f\xfd\x24\x0e\x71\x00\x00\x67\x6f\x6f\x64\x62\x79\x65"
"\x2c\x20\x77\x6f\x72\x6c\x64\x61\x7b\x4b\x83"),
27,
},
{
"ranges",
("\xcc\x11\x00\x00\x00\x00\x00\x00\xd5\x13\x00\x00\x00\x00\x00\x00"
"\x1c\x14\x00\x00\x00\x00\x00\x00\x72\x14\x00\x00\x00\x00\x00\x00"
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xfb\x12\x00\x00\x00\x00\x00\x00\x09\x13\x00\x00\x00\x00\x00\x00"
"\x0c\x13\x00\x00\x00\x00\x00\x00\xcb\x13\x00\x00\x00\x00\x00\x00"
"\x29\x14\x00\x00\x00\x00\x00\x00\x4e\x14\x00\x00\x00\x00\x00\x00"
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xfb\x12\x00\x00\x00\x00\x00\x00\x09\x13\x00\x00\x00\x00\x00\x00"
"\x67\x13\x00\x00\x00\x00\x00\x00\xcb\x13\x00\x00\x00\x00\x00\x00"
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x5f\x0b\x00\x00\x00\x00\x00\x00\x6c\x0b\x00\x00\x00\x00\x00\x00"
"\x7d\x0b\x00\x00\x00\x00\x00\x00\x7e\x0c\x00\x00\x00\x00\x00\x00"
"\x38\x0f\x00\x00\x00\x00\x00\x00\x5c\x0f\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x83\x0c\x00\x00\x00\x00\x00\x00\xfa\x0c\x00\x00\x00\x00\x00\x00"
"\xfd\x0d\x00\x00\x00\x00\x00\x00\xef\x0e\x00\x00\x00\x00\x00\x00"
"\x14\x0f\x00\x00\x00\x00\x00\x00\x38\x0f\x00\x00\x00\x00\x00\x00"
"\x9f\x0f\x00\x00\x00\x00\x00\x00\xac\x0f\x00\x00\x00\x00\x00\x00"
"\xdb\x0f\x00\x00\x00\x00\x00\x00\xff\x0f\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xfd\x0d\x00\x00\x00\x00\x00\x00\xd8\x0e\x00\x00\x00\x00\x00\x00"
"\x9f\x0f\x00\x00\x00\x00\x00\x00\xac\x0f\x00\x00\x00\x00\x00\x00"
"\xdb\x0f\x00\x00\x00\x00\x00\x00\xff\x0f\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\xfa\x0c\x00\x00\x00\x00\x00\x00\xea\x0d\x00\x00\x00\x00\x00\x00"
"\xef\x0e\x00\x00\x00\x00\x00\x00\x14\x0f\x00\x00\x00\x00\x00\x00"
"\x5c\x0f\x00\x00\x00\x00\x00\x00\x9f\x0f\x00\x00\x00\x00\x00\x00"
"\xac\x0f\x00\x00\x00\x00\x00\x00\xdb\x0f\x00\x00\x00\x00\x00\x00"
"\xff\x0f\x00\x00\x00\x00\x00\x00\x2c\x10\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x60\x11\x00\x00\x00\x00\x00\x00\xd1\x16\x00\x00\x00\x00\x00\x00"
"\x40\x0b\x00\x00\x00\x00\x00\x00\x2c\x10\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x7a\x00\x00\x00\x00\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x00\x00"
"\x9f\x01\x00\x00\x00\x00\x00\x00\xa7\x01\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x7a\x00\x00\x00\x00\x00\x00\x00\xa9\x00\x00\x00\x00\x00\x00\x00"
"\x9f\x01\x00\x00\x00\x00\x00\x00\xa7\x01\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"),
672,
("\x28\xb5\x2f\xfd\x64\xa0\x01\x2d\x05\x00\xc4\x04\xcc\x11\x00\xd5"
"\x13\x00\x1c\x14\x00\x72\x9d\xd5\xfb\x12\x00\x09\x0c\x13\xcb\x13"
"\x29\x4e\x67\x5f\x0b\x6c\x0b\x7d\x0b\x7e\x0c\x38\x0f\x5c\x0f\x83"
"\x0c\xfa\x0c\xfd\x0d\xef\x0e\x14\x38\x9f\x0f\xac\x0f\xdb\x0f\xff"
"\x0f\xd8\x9f\xac\xdb\xff\xea\x5c\x2c\x10\x60\xd1\x16\x40\x0b\x7a"
"\x00\xb6\x00\x9f\x01\xa7\x01\xa9\x36\x20\xa0\x83\x14\x34\x63\x4a"
"\x21\x70\x8c\x07\x46\x03\x4e\x10\x62\x3c\x06\x4e\xc8\x8c\xb0\x32"
"\x2a\x59\xad\xb2\xf1\x02\x82\x7c\x33\xcb\x92\x6f\x32\x4f\x9b\xb0"
"\xa2\x30\xf0\xc0\x06\x1e\x98\x99\x2c\x06\x1e\xd8\xc0\x03\x56\xd8"
"\xc0\x03\x0f\x6c\xe0\x01\xf1\xf0\xee\x9a\xc6\xc8\x97\x99\xd1\x6c"
"\xb4\x21\x45\x3b\x10\xe4\x7b\x99\x4d\x8a\x36\x64\x5c\x77\x08\x02"
"\xcb\xe0\xce"),
179,
}
};
/* Test the hand coded samples. */
static void
test_samples (struct backtrace_state *state)
{
size_t i;
for (i = 0; i < sizeof tests / sizeof tests[0]; ++i)
{
unsigned char *uncompressed;
size_t uncompressed_len;
uncompressed_len = tests[i].uncompressed_len;
if (uncompressed_len == 0)
uncompressed_len = strlen (tests[i].uncompressed);
uncompressed = (unsigned char *) malloc (uncompressed_len);
if (uncompressed == NULL)
{
perror ("malloc");
fprintf (stderr, "test %s: uncompress failed\n", tests[i].name);
++failures;
continue;
}
if (!backtrace_uncompress_zstd (state,
((const unsigned char *)
tests[i].compressed),
tests[i].compressed_len,
error_callback_compress, NULL,
uncompressed, uncompressed_len))
{
fprintf (stderr, "test %s: uncompress failed\n", tests[i].name);
++failures;
}
else
{
if (memcmp (tests[i].uncompressed, uncompressed, uncompressed_len)
!= 0)
{
size_t j;
fprintf (stderr, "test %s: uncompressed data mismatch\n",
tests[i].name);
for (j = 0; j < uncompressed_len; ++j)
if (tests[i].uncompressed[j] != uncompressed[j])
fprintf (stderr, " %zu: got %#x want %#x\n", j,
uncompressed[j], tests[i].uncompressed[j]);
++failures;
}
else
printf ("PASS: uncompress %s\n", tests[i].name);
}
free (uncompressed);
}
}
#ifdef HAVE_ZSTD
/* Given a set of TRIALS timings, discard the lowest and highest
values and return the mean average of the rest. */
static size_t
average_time (const size_t *times, size_t trials)
{
size_t imax;
size_t max;
size_t imin;
size_t min;
size_t i;
size_t sum;
imin = 0;
imax = 0;
min = times[0];
max = times[0];
for (i = 1; i < trials; ++i)
{
if (times[i] < min)
{
imin = i;
min = times[i];
}
if (times[i] > max)
{
imax = i;
max = times[i];
}
}
sum = 0;
for (i = 0; i < trials; ++i)
{
if (i != imax && i != imin)
sum += times[i];
}
return sum / (trials - 2);
}
#endif
/* Test a larger text, if available. */
static void
test_large (struct backtrace_state *state ATTRIBUTE_UNUSED)
{
#ifdef HAVE_ZSTD
unsigned char *orig_buf;
size_t orig_bufsize;
size_t i;
char *compressed_buf;
size_t compressed_bufsize;
size_t compressed_size;
unsigned char *uncompressed_buf;
size_t r;
clockid_t cid;
struct timespec ts1;
struct timespec ts2;
size_t ctime;
size_t ztime;
const size_t trials = 16;
size_t ctimes[16];
size_t ztimes[16];
static const char * const names[] = {
"Isaac.Newton-Opticks.txt",
"../libgo/go/testdata/Isaac.Newton-Opticks.txt",
};
orig_buf = NULL;
orig_bufsize = 0;
uncompressed_buf = NULL;
compressed_buf = NULL;
for (i = 0; i < sizeof names / sizeof names[0]; ++i)
{
size_t len;
char *namebuf;
FILE *e;
struct stat st;
char *rbuf;
size_t got;
len = strlen (SRCDIR) + strlen (names[i]) + 2;
namebuf = malloc (len);
if (namebuf == NULL)
{
perror ("malloc");
goto fail;
}
snprintf (namebuf, len, "%s/%s", SRCDIR, names[i]);
e = fopen (namebuf, "r");
free (namebuf);
if (e == NULL)
continue;
if (fstat (fileno (e), &st) < 0)
{
perror ("fstat");
fclose (e);
continue;
}
rbuf = malloc (st.st_size);
if (rbuf == NULL)
{
perror ("malloc");
goto fail;
}
got = fread (rbuf, 1, st.st_size, e);
fclose (e);
if (got > 0)
{
orig_buf = (unsigned char *) rbuf;
orig_bufsize = got;
break;
}
free (rbuf);
}
if (orig_buf == NULL)
{
/* We couldn't find an input file. */
printf ("UNSUPPORTED: zstd large\n");
return;
}
compressed_bufsize = ZSTD_compressBound (orig_bufsize);
compressed_buf = malloc (compressed_bufsize);
if (compressed_buf == NULL)
{
perror ("malloc");
goto fail;
}
r = ZSTD_compress (compressed_buf, compressed_bufsize,
orig_buf, orig_bufsize,
ZSTD_CLEVEL_DEFAULT);
if (ZSTD_isError (r))
{
fprintf (stderr, "zstd compress failed: %s\n", ZSTD_getErrorName (r));
goto fail;
}
compressed_size = r;
uncompressed_buf = malloc (orig_bufsize);
if (uncompressed_buf == NULL)
{
perror ("malloc");
goto fail;
}
if (!backtrace_uncompress_zstd (state, (unsigned char *) compressed_buf,
compressed_size,
error_callback_compress, NULL,
uncompressed_buf, orig_bufsize))
{
fprintf (stderr, "zstd large: backtrace_uncompress_zstd failed\n");
goto fail;
}
if (memcmp (uncompressed_buf, orig_buf, orig_bufsize) != 0)
{
size_t j;
fprintf (stderr, "zstd large: uncompressed data mismatch\n");
for (j = 0; j < orig_bufsize; ++j)
if (orig_buf[j] != uncompressed_buf[j])
fprintf (stderr, " %zu: got %#x want %#x\n", j,
uncompressed_buf[j], orig_buf[j]);
goto fail;
}
printf ("PASS: zstd large\n");
for (i = 0; i < trials; ++i)
{
cid = ZSTD_CLOCK_GETTIME_ARG;
if (clock_gettime (cid, &ts1) < 0)
{
if (errno == EINVAL)
return;
perror ("clock_gettime");
return;
}
if (!backtrace_uncompress_zstd (state,
(unsigned char *) compressed_buf,
compressed_size,
error_callback_compress, NULL,
uncompressed_buf,
orig_bufsize))
{
fprintf (stderr,
("zstd large: "
"benchmark backtrace_uncompress_zstd failed\n"));
return;
}
if (clock_gettime (cid, &ts2) < 0)
{
perror ("clock_gettime");
return;
}
ctime = (ts2.tv_sec - ts1.tv_sec) * 1000000000;
ctime += ts2.tv_nsec - ts1.tv_nsec;
ctimes[i] = ctime;
if (clock_gettime (cid, &ts1) < 0)
{
perror("clock_gettime");
return;
}
r = ZSTD_decompress (uncompressed_buf, orig_bufsize,
compressed_buf, compressed_size);
if (clock_gettime (cid, &ts2) < 0)
{
perror ("clock_gettime");
return;
}
if (ZSTD_isError (r))
{
fprintf (stderr,
"zstd large: benchmark zlib uncompress failed: %s\n",
ZSTD_getErrorName (r));
return;
}
ztime = (ts2.tv_sec - ts1.tv_sec) * 1000000000;
ztime += ts2.tv_nsec - ts1.tv_nsec;
ztimes[i] = ztime;
}
/* Toss the highest and lowest times and average the rest. */
ctime = average_time (ctimes, trials);
ztime = average_time (ztimes, trials);
printf ("backtrace: %zu ns\n", ctime);
printf ("zstd : %zu ns\n", ztime);
printf ("ratio : %g\n", (double) ztime / (double) ctime);
return;
fail:
printf ("FAIL: zstd large\n");
++failures;
if (orig_buf != NULL)
free (orig_buf);
if (compressed_buf != NULL)
free (compressed_buf);
if (uncompressed_buf != NULL)
free (uncompressed_buf);
#else /* !HAVE_ZSTD */
printf ("UNSUPPORTED: zstd large\n");
#endif /* !HAVE_ZSTD */
}
int
main (int argc ATTRIBUTE_UNUSED, char **argv)
{
struct backtrace_state *state;
state = backtrace_create_state (argv[0], BACKTRACE_SUPPORTS_THREADS,
error_callback_create, NULL);
test_samples (state);
test_large (state);
exit (failures != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}

View File

@ -1,5 +1,5 @@
/* ztest.c -- Test for libbacktrace inflate code.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without