void-packages/srcpkgs/proot/patches/musl_execinfo.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par 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

28 lines
858 B
Diff

--- a/src/cli/cli.c 2014-12-15 15:18:11.000000000 +0100
+++ b/src/cli/cli.c 2015-07-12 13:18:46.548115003 +0200
@@ -30,7 +30,9 @@
#include <sys/types.h> /* getpid(2), */
#include <unistd.h> /* getpid(2), */
#include <errno.h> /* errno(3), */
+#if defined(__GLIBC__)
#include <execinfo.h> /* backtrace_symbols(3), */
+#endif
#include <limits.h> /* INT_MAX, */
#include "cli/cli.h"
@@ -555,6 +557,7 @@
void __cyg_profile_func_enter(void *this_function, void *call_site) DONT_INSTRUMENT;
void __cyg_profile_func_enter(void *this_function, void *call_site)
{
+#if defined(__GLIBC__)
void *const pointers[] = { this_function, call_site };
char **symbols = NULL;
@@ -567,6 +570,7 @@
end:
if (symbols != NULL)
free(symbols);
+#endif /* defined(__GLIBC__) */
if (indent_level < INT_MAX)
indent_level++;