aboutsummaryrefslogtreecommitdiffstats
path: root/testing/a2jmidid/check-for-libc-backtrace.patch
diff options
context:
space:
mode:
authorKevin Thomas <me@kevinthomas.dev>2021-04-28 00:11:23 -0700
committerMichał Polański <michal@polanski.me>2021-04-28 21:14:57 +0000
commit2e5a9aa6c530417a2ee4f9828b7721de436b5a07 (patch)
treee91224d04bc2a51bf338b0b4fadf451717955e83 /testing/a2jmidid/check-for-libc-backtrace.patch
parentd9df353983bd821b66ca0cfe0e6e17ba907dd923 (diff)
downloadaports-2e5a9aa6c530417a2ee4f9828b7721de436b5a07.tar.gz
aports-2e5a9aa6c530417a2ee4f9828b7721de436b5a07.tar.bz2
aports-2e5a9aa6c530417a2ee4f9828b7721de436b5a07.tar.xz
testing/a2jmidid: new aport
https://github.com/jackaudio/a2jmidid ALSA sequencer to JACK MIDI bridging
Diffstat (limited to 'testing/a2jmidid/check-for-libc-backtrace.patch')
-rw-r--r--testing/a2jmidid/check-for-libc-backtrace.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/a2jmidid/check-for-libc-backtrace.patch b/testing/a2jmidid/check-for-libc-backtrace.patch
new file mode 100644
index 0000000000..774914cf6b
--- /dev/null
+++ b/testing/a2jmidid/check-for-libc-backtrace.patch
@@ -0,0 +1,34 @@
+Check if libc supports error backtracing from execinfo.h before attempting
+to use it (musl does not support this).
+--- a2jmidid-9/sigsegv.c
++++ a2jmidid-9/sigsegv.c
+@@ -28,7 +28,9 @@
+ #include <signal.h>
+ #include <ucontext.h>
+ #include <dlfcn.h>
++#ifdef LIBC_HAS_BACKTRACE
+ #include <execinfo.h>
++#endif
+ #include <errno.h>
+ #ifndef NO_CPP_DEMANGLE
+ //#include <cxxabi.h>
+@@ -148,12 +150,14 @@
+ bp = (void**)bp[0];
+ }
+ #else
+- a2j_error("Stack trace (non-dedicated):");
+- sz = backtrace(bt, 20);
+- strings = backtrace_symbols(bt, sz);
++ #ifdef LIBC_HAS_BACKTRACE
++ a2j_error("Stack trace (non-dedicated):");
++ sz = backtrace(bt, 20);
++ strings = backtrace_symbols(bt, sz);
+
+- for(i = 0; i < sz; ++i)
+- a2j_error("%s", strings[i]);
++ for(i = 0; i < sz; ++i)
++ a2j_error("%s", strings[i]);
++ #endif
+ #endif
+ a2j_error("End of stack trace");
+ exit (-1);