void-packages/srcpkgs/a2jmidid/patches/musl-no-execinfo.patch
Đoàn Trần Công Danh ae69000001 srcpkgs/a*: convert patches to -Np1
* arduino and antiword is kept at -Np0

```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

30 lines
721 B
Diff

--- a/sigsegv.c 2016-06-06 15:56:47.355074711 +0200
+++ b/sigsegv.c 2016-06-06 15:55:40.740071274 +0200
@@ -28,7 +28,9 @@
#include <signal.h>
#include <ucontext.h>
#include <dlfcn.h>
+#if defined(__GLIBC__)
#include <execinfo.h>
+#endif
#include <errno.h>
#ifndef NO_CPP_DEMANGLE
//#include <cxxabi.h>
@@ -145,13 +147,15 @@
ip = bp[1];
bp = (void**)bp[0];
}
-#else
+#elif defined(__GLIBC__)
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]);
+#else
+ a2j_error("Stack trace unavailable");
#endif
a2j_error("End of stack trace");
exit (-1);