wavpack: properly wrap help text
[buildroot-gz.git] / package / jack2 / 0002-Make-backtrace-support-depends-on-execinfo.h-existen.patch
blob719c6a83ba1983a2b9735a773850d98ba21ca223
1 From 4b2c73ad056aa327dc3b505410da68cf384317ba Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Mon, 16 May 2016 22:26:05 +0200
4 Subject: [PATCH] Make backtrace support depends on execinfo.h existence
6 In some C-libraries (like uclibc), backtrace support is optional, so the
7 execinfo.h file may not exist.
9 This change adds the check for execinfo.h header and conditionnaly enable
10 backtrace support.
12 This issue has been triggered by Buildroot farms:
13 http://autobuild.buildroot.org/results/391/391e71a988250ea66ec4dbee6f60fdce9eaf2766/build-end.log
15 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
16 ---
17 dbus/sigsegv.c | 8 +++++++-
18 wscript | 1 +
19 2 files changed, 8 insertions(+), 1 deletion(-)
21 diff --git a/dbus/sigsegv.c b/dbus/sigsegv.c
22 index ee12f91..0b31d89 100644
23 --- a/dbus/sigsegv.c
24 +++ b/dbus/sigsegv.c
25 @@ -27,7 +27,9 @@
26 #include <stdio.h>
27 #include <signal.h>
28 #include <dlfcn.h>
29 -#include <execinfo.h>
30 +#if defined(HAVE_EXECINFO_H)
31 +# include <execinfo.h>
32 +#endif /* defined(HAVE_EXECINFO_H) */
33 #include <errno.h>
34 #ifndef NO_CPP_DEMANGLE
35 char * __cxa_demangle(const char * __mangled_name, char * __output_buffer, size_t * __length, int * __status);
36 @@ -161,12 +163,16 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) {
37 bp = (void**)bp[0];
39 #else
40 +# if defined(HAVE_EXECINFO_H)
41 jack_error("Stack trace (non-dedicated):");
42 sz = backtrace(bt, 20);
43 strings = backtrace_symbols(bt, sz);
45 for(i = 0; i < sz; ++i)
46 jack_error("%s", strings[i]);
47 +# else /* defined(HAVE_EXECINFO_H) */
48 + jack_error("Stack trace not available");
49 +# endif /* defined(HAVE_EXECINFO_H) */
50 #endif
51 jack_error("End of stack trace");
52 exit (-1);
53 diff --git a/wscript b/wscript
54 index aef4bd8..63ba3aa 100644
55 --- a/wscript
56 +++ b/wscript
57 @@ -166,6 +166,7 @@ def configure(conf):
58 if conf.env['BUILD_JACKDBUS'] != True:
59 conf.fatal('jackdbus was explicitly requested but cannot be built')
61 + conf.check_cc(header_name='execinfo.h', define_name="HAVE_EXECINFO_H", mandatory=False)
62 conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE")
64 if conf.is_defined('HAVE_SAMPLERATE'):
65 --
66 2.8.2