diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-09-28 10:37:19 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-09-28 10:40:07 +0000 |
commit | 468182e256345aed0fc640168b7a6bde5935fd6c (patch) | |
tree | b17fb98431de93d9cdace57a6ef1b5583dabeb48 /testing/tmate | |
parent | ae7fb669b2b01c6039e0f8a3990a0f8989813f1f (diff) | |
download | aports-468182e256345aed0fc640168b7a6bde5935fd6c.tar.bz2 aports-468182e256345aed0fc640168b7a6bde5935fd6c.tar.xz |
testing/tmate: cleanup backtrace patch
sent upstream: https://github.com/tmate-io/tmate/pull/117
Diffstat (limited to 'testing/tmate')
-rw-r--r-- | testing/tmate/0001-Fix-building-with-or-without-backtrace-3.patch | 75 | ||||
-rw-r--r-- | testing/tmate/APKBUILD | 11 | ||||
-rw-r--r-- | testing/tmate/remove-backtrace-musl.patch | 28 |
3 files changed, 81 insertions, 33 deletions
diff --git a/testing/tmate/0001-Fix-building-with-or-without-backtrace-3.patch b/testing/tmate/0001-Fix-building-with-or-without-backtrace-3.patch new file mode 100644 index 0000000000..bebb41a374 --- /dev/null +++ b/testing/tmate/0001-Fix-building-with-or-without-backtrace-3.patch @@ -0,0 +1,75 @@ +From c56f00dd22611274fd6ac7626d85ceca8692abf6 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 28 Sep 2017 10:28:42 +0000 +Subject: [PATCH] Fix building with or without backtrace(3) + +backtrace(3) and execinfo.h are GNU extensions and may or may not be +available, and they may be provided via libexecinfo. + +Fix detection of libexecinfo and allow building without any support of +backtrace, in which case we let kernel create core dump. + +Fixes #116 +--- + configure.ac | 5 +++++ + tmate-debug.c | 10 ++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 02d2872b..05c1c482 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -102,6 +102,7 @@ AC_CHECK_HEADERS( + bitstring.h \ + curses.h \ + dirent.h \ ++ execinfo.h \ + fcntl.h \ + inttypes.h \ + libutil.h \ +@@ -121,9 +122,13 @@ AC_CHECK_HEADERS( + # Look for library needed for flock. + AC_SEARCH_LIBS(flock, bsd) + ++# Look for library needed for backtrace ++AC_SEARCH_LIBS(backtrace, execinfo) ++ + # Check for some functions that are replaced or omitted. + AC_CHECK_FUNCS( + [ \ ++ backtrace \ + dirfd \ + flock \ + setproctitle \ +diff --git a/tmate-debug.c b/tmate-debug.c +index f1fd971f..f58efe0e 100644 +--- a/tmate-debug.c ++++ b/tmate-debug.c +@@ -1,10 +1,19 @@ ++#ifdef HAVE_EXECINFO_H + #include <execinfo.h> ++#endif + #include <stdio.h> + #include <stdlib.h> + #include <regex.h> + #include <signal.h> + #include "tmate.h" + ++#ifndef HAVE_BACKTRACE ++ ++void tmate_print_stack_trace(void) {} ++void tmate_catch_sigsegv(void) {} ++ ++#else ++ + #if DEBUG + + static int print_resolved_stack_frame(const char *frame) +@@ -88,3 +97,4 @@ void tmate_catch_sigsegv(void) + { + signal(SIGSEGV, handle_sigsegv); + } ++#endif +-- +2.14.1 + diff --git a/testing/tmate/APKBUILD b/testing/tmate/APKBUILD index 82e4bdf021..fc9e7ddd12 100644 --- a/testing/tmate/APKBUILD +++ b/testing/tmate/APKBUILD @@ -1,25 +1,26 @@ # Maintainer: Daniel Isaksen <d@duniel.no> pkgname=tmate pkgver=2.2.1 -pkgrel=0 +pkgrel=1 pkgdesc="Instant Terminal Sharing" url="https://tmate.io/" arch="all" license="ISC" depends="ncurses-terminfo" makedepends="ncurses-dev libevent-dev autoconf automake bsd-compat-headers - libtool zlib-dev libssh-dev msgpack-c-dev libexecinfo-dev" + libtool zlib-dev libssh-dev msgpack-c-dev" install= subpackages="$pkgname-doc" source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname-io/$pkgname/archive/$pkgver.tar.gz - remove-backtrace-musl.patch" + 0001-Fix-building-with-or-without-backtrace-3.patch + " builddir="$srcdir/"$pkgname-$pkgver build() { cd "$builddir" - ./autogen.sh || return 1 + ./autogen.sh ./configure \ --build=$CBUILD \ @@ -48,4 +49,4 @@ package() { } sha512sums="3d4ce7510cd8da39bc4fe63f2a64179846a813bb3560ca811d9e1e2a28b06d95a9033047a900d76bda069c249d7ebbe1143daa082b23212c5d32a50bf1819d2d tmate-2.2.1.tar.gz -530f17f86688980fb3e0d48adaff70cc413efafda7025be4f1dfaaf5a3d71ab21ee923a1d658d30691464e375aea73ba1b06a4b5545998c4a7df9dc19fc91561 remove-backtrace-musl.patch" +e530890d9771af22f99b6903bd37690a6cb58a3df8950dfc2159f383ed286541e12beeedd0d9752e3830799a43d12cf4f742ab64807aeef966c40ef556d9ed87 0001-Fix-building-with-or-without-backtrace-3.patch" diff --git a/testing/tmate/remove-backtrace-musl.patch b/testing/tmate/remove-backtrace-musl.patch deleted file mode 100644 index 650634855b..0000000000 --- a/testing/tmate/remove-backtrace-musl.patch +++ /dev/null @@ -1,28 +0,0 @@ -This is a quite ugly hack to make it compile. - -TODO: use libunwind instead. - ---- ---- a/tmate-debug.c -+++ b/tmate-debug.c -@@ -60,18 +60,17 @@ void tmate_print_stack_trace(void) - char **strings; - size_t i; - -+#if 0 - size = backtrace (array, 20); - strings = backtrace_symbols (array, size); - - tmate_info ("============ %zd stack frames ============", size); - - for (i = 1; i < size; i++) { --#if DEBUG - if (print_resolved_stack_frame(strings[i]) < 0) --#endif - tmate_info("%s", strings[i]); - } -- -+#endif - free (strings); - } - |