mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
libbacktrace: 0-unstable-2024-03-02 -> 0-unstable-2026-05-03 (#513493)
This commit is contained in:
commit
58e2e87550
3 changed files with 26 additions and 222 deletions
|
|
@ -1,201 +0,0 @@
|
|||
From eadfee17e7d3a1c1bb2a0ff8585772b40331ebd7 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Tojnar <jtojnar@gmail.com>
|
||||
Date: Sat, 24 Dec 2022 15:31:51 +0100
|
||||
Subject: [PATCH 1/4] libbacktrace: avoid libtool wrapping tests
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When `--enable-shared` is used, libtool will produce shell scripts
|
||||
instead of programs, preventing separate debug info from being generated:
|
||||
|
||||
objcopy --only-keep-debug btest btest_gnudebuglink.debug
|
||||
objcopy: btest: file format not recognized
|
||||
make[2]: *** [Makefile:2615: btest_gnudebuglink] Error 1
|
||||
|
||||
Let’s make it properly set rpath with `-no-install` flag,
|
||||
so that wrappers are not needed, as mentioned on
|
||||
https://autotools.info/libtool/wrappers.html
|
||||
---
|
||||
Makefile.am | 28 +++++++++++++++++++++++-----
|
||||
1 file changed, 23 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3d67909..06ccf3f 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -107,6 +107,8 @@ check_DATA =
|
||||
# Flags to use when compiling test programs.
|
||||
libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
|
||||
+libbacktrace_TEST_LDFLAGS = -no-install
|
||||
+
|
||||
if USE_DSYMUTIL
|
||||
|
||||
%.dSYM: %
|
||||
@@ -171,48 +173,56 @@ 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_TEST_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_TEST_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_TEST_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_TEST_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_TEST_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_TEST_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_TEST_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_TEST_LDFLAGS)
|
||||
unittest_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += unittest
|
||||
@@ -254,7 +264,7 @@ if HAVE_OBJCOPY_DEBUGLINK
|
||||
|
||||
b2test_SOURCES = $(btest_SOURCES)
|
||||
b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
-b2test_LDFLAGS = -Wl,--build-id
|
||||
+b2test_LDFLAGS = -Wl,--build-id $(libbacktrace_TEST_LDFLAGS)
|
||||
b2test_LDADD = libbacktrace_elf_for_test.la
|
||||
|
||||
check_PROGRAMS += b2test
|
||||
@@ -264,7 +274,7 @@ if HAVE_DWZ
|
||||
|
||||
b3test_SOURCES = $(btest_SOURCES)
|
||||
b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
-b3test_LDFLAGS = -Wl,--build-id
|
||||
+b3test_LDFLAGS = -Wl,--build-id $(libbacktrace_TEST_LDFLAGS)
|
||||
b3test_LDADD = libbacktrace_elf_for_test.la
|
||||
|
||||
check_PROGRAMS += b3test
|
||||
@@ -278,6 +288,7 @@ endif HAVE_ELF
|
||||
|
||||
btest_SOURCES = btest.c testlib.c
|
||||
btest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
|
||||
+btest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
btest_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += btest
|
||||
@@ -332,6 +343,7 @@ endif HAVE_DWZ
|
||||
|
||||
stest_SOURCES = stest.c
|
||||
stest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
+stest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
stest_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += stest
|
||||
@@ -354,6 +366,7 @@ if HAVE_ELF
|
||||
|
||||
ztest_SOURCES = ztest.c testlib.c
|
||||
ztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
+ztest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
ztest_LDADD = libbacktrace.la
|
||||
ztest_alloc_LDADD = libbacktrace_alloc.la
|
||||
|
||||
@@ -373,6 +386,7 @@ BUILDTESTS += ztest_alloc
|
||||
|
||||
zstdtest_SOURCES = zstdtest.c testlib.c
|
||||
zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
+zstdtest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
zstdtest_LDADD = libbacktrace.la
|
||||
zstdtest_alloc_LDADD = libbacktrace_alloc.la
|
||||
|
||||
@@ -394,6 +408,7 @@ endif HAVE_ELF
|
||||
|
||||
edtest_SOURCES = edtest.c edtest2_build.c testlib.c
|
||||
edtest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
+edtest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
edtest_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += edtest
|
||||
@@ -424,6 +439,7 @@ BUILDTESTS += ttest
|
||||
|
||||
ttest_SOURCES = ttest.c testlib.c
|
||||
ttest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -pthread
|
||||
+ttest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
ttest_LDADD = libbacktrace.la
|
||||
|
||||
if USE_DSYMUTIL
|
||||
@@ -472,12 +488,12 @@ 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_TEST_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_TEST_LDFLAGS)
|
||||
ctesta_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += ctestg ctesta
|
||||
@@ -486,7 +502,7 @@ if HAVE_COMPRESSED_DEBUG_ZSTD
|
||||
|
||||
ctestzstd_SOURCES = btest.c testlib.c
|
||||
ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
-ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd
|
||||
+ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd $(libbacktrace_TEST_LDFLAGS)
|
||||
ctestzstd_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += ctestzstd
|
||||
@@ -533,6 +549,7 @@ endif
|
||||
|
||||
mtest_SOURCES = mtest.c testlib.c
|
||||
mtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
|
||||
+mtest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
mtest_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += mtest
|
||||
@@ -565,6 +582,7 @@ if HAVE_ELF
|
||||
|
||||
xztest_SOURCES = xztest.c testlib.c
|
||||
xztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
+xztest_LDFLAGS = $(libbacktrace_TEST_LDFLAGS)
|
||||
xztest_LDADD = libbacktrace.la
|
||||
|
||||
xztest_alloc_SOURCES = $(xztest_SOURCES)
|
||||
--
|
||||
2.43.1
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From 2ceaa9bc8a9a0c8a02806a92e19bd21b3fccf3a0 Mon Sep 17 00:00:00 2001
|
||||
From f69f2a995d0c5c6bc44fd485a7f5d3b390f26fc4 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Tojnar <jtojnar@gmail.com>
|
||||
Date: Sat, 24 Dec 2022 16:46:18 +0100
|
||||
Subject: [PATCH 2/4] libbacktrace: Allow configuring debug dir
|
||||
Date: Sat, 25 Apr 2026 23:01:23 +0200
|
||||
Subject: [PATCH] libbacktrace: Allow configuring debug dir
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
|
@ -14,13 +14,13 @@ the path can be changed. The same flag is supported by gdb:
|
|||
|
||||
https://github.com/bminor/binutils-gdb/blob/095f84c7e3cf85cd68c657c46b80be078f336bc9/gdb/configure.ac#L113-L115
|
||||
---
|
||||
Makefile.am | 13 +++++++------
|
||||
Makefile.am | 15 ++++++++-------
|
||||
configure.ac | 8 ++++++++
|
||||
elf.c | 4 ++--
|
||||
3 files changed, 17 insertions(+), 8 deletions(-)
|
||||
3 files changed, 18 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 06ccf3f..6304faa 100644
|
||||
index 7b32e23..51431b9 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -33,7 +33,8 @@ ACLOCAL_AMFLAGS = -I config
|
||||
|
|
@ -33,7 +33,7 @@ index 06ccf3f..6304faa 100644
|
|||
|
||||
include_HEADERS = backtrace.h backtrace-supported.h
|
||||
|
||||
@@ -134,7 +135,7 @@ libbacktrace_noformat_la_DEPENDENCIES = $(libbacktrace_noformat_la_LIBADD)
|
||||
@@ -136,7 +137,7 @@ libbacktrace_noformat_la_DEPENDENCIES = $(libbacktrace_noformat_la_LIBADD)
|
||||
if HAVE_ELF
|
||||
if HAVE_OBJCOPY_DEBUGLINK
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ index 06ccf3f..6304faa 100644
|
|||
|
||||
check_LTLIBRARIES += libbacktrace_elf_for_test.la
|
||||
|
||||
@@ -143,8 +144,8 @@ libbacktrace_elf_for_test_la_LIBADD = $(BACKTRACE_FILE) elf_for_test.lo \
|
||||
@@ -145,8 +146,8 @@ libbacktrace_elf_for_test_la_LIBADD = $(BACKTRACE_FILE) elf_for_test.lo \
|
||||
$(VIEW_FILE) $(ALLOC_FILE)
|
||||
|
||||
elf_for_test.c: elf.c
|
||||
|
|
@ -53,7 +53,7 @@ index 06ccf3f..6304faa 100644
|
|||
$(SED) "s%$$SEARCH%$$REPLACE%" \
|
||||
$< \
|
||||
> $@.tmp
|
||||
@@ -474,13 +475,13 @@ endif HAVE_OBJCOPY_DEBUGLINK
|
||||
@@ -484,13 +485,13 @@ endif HAVE_OBJCOPY_DEBUGLINK
|
||||
|
||||
%_buildid: %
|
||||
./install-debuginfo-for-buildid.sh \
|
||||
|
|
@ -69,8 +69,17 @@ index 06ccf3f..6304faa 100644
|
|||
$<
|
||||
$(OBJCOPY) --strip-all $< $@
|
||||
|
||||
@@ -621,7 +622,7 @@ MAKETESTS += m2test_minidebug2
|
||||
$(XZ) $<.mdbg2
|
||||
$(OBJCOPY) --add-section .gnu_debugdata=$<.mdbg2.xz $<.dbg2
|
||||
$(OBJCOPY) --add-section .gnu_debugdata=$<.mdbg2.xz $<.strip2
|
||||
- $(SHELL) ./install-debuginfo-for-buildid.sh $(TEST_BUILD_ID_DIR) $<.dbg2
|
||||
+ $(SHELL) ./install-debuginfo-for-buildid.sh "$(TEST_DEBUG_DIR)/.build-id" $<.dbg2
|
||||
mv $<.strip2 $@
|
||||
|
||||
endif HAVE_OBJCOPY_DEBUGLINK
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 69304ea..aeb2ee9 100644
|
||||
index 2267cc5..15cdc6e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -67,6 +67,14 @@ AM_MAINTAINER_MODE
|
||||
|
|
@ -89,10 +98,10 @@ index 69304ea..aeb2ee9 100644
|
|||
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
||||
# As a side effect, we have to subst CFLAGS ourselves.
|
||||
diff --git a/elf.c b/elf.c
|
||||
index 3ef07bb..21fbe4f 100644
|
||||
index e93729d..4765fae 100644
|
||||
--- a/elf.c
|
||||
+++ b/elf.c
|
||||
@@ -856,7 +856,7 @@ elf_readlink (struct backtrace_state *state, const char *filename,
|
||||
@@ -857,7 +857,7 @@ elf_readlink (struct backtrace_state *state, const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +110,7 @@ index 3ef07bb..21fbe4f 100644
|
|||
|
||||
/* Open a separate debug info file, using the build ID to find it.
|
||||
Returns an open file descriptor, or -1.
|
||||
@@ -870,7 +870,7 @@ elf_open_debugfile_by_buildid (struct backtrace_state *state,
|
||||
@@ -871,7 +871,7 @@ elf_open_debugfile_by_buildid (struct backtrace_state *state,
|
||||
backtrace_error_callback error_callback,
|
||||
void *data)
|
||||
{
|
||||
|
|
@ -111,5 +120,5 @@ index 3ef07bb..21fbe4f 100644
|
|||
const char * const suffix = ".debug";
|
||||
const size_t suffix_len = strlen (suffix);
|
||||
--
|
||||
2.43.1
|
||||
2.51.2
|
||||
|
||||
|
|
|
|||
|
|
@ -10,20 +10,16 @@
|
|||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libbacktrace";
|
||||
version = "0-unstable-2024-03-02";
|
||||
version = "0-unstable-2026-05-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ianlancetaylor";
|
||||
repo = "libbacktrace";
|
||||
rev = "28824f2cc9069e3fdc39d3702acdf753e35c41b4";
|
||||
sha256 = "1k1O1GT22hZAWPF8NYP0y4qe+e3pGfzT9Mz2TH+H/v4=";
|
||||
rev = "96664e69b1ecdb76e824be1d9e8f475b76dd08cf";
|
||||
hash = "sha256-+tV6W8SnFWKweAASvFfb+i6bz73ssVGikNhVpq3YbT4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix tests with shared library.
|
||||
# https://github.com/ianlancetaylor/libbacktrace/pull/99
|
||||
./0001-libbacktrace-avoid-libtool-wrapping-tests.patch
|
||||
|
||||
# Support multiple debug dirs.
|
||||
# https://github.com/ianlancetaylor/libbacktrace/pull/100
|
||||
./0002-libbacktrace-Allow-configuring-debug-dir.patch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue