void-packages/srcpkgs/freecad/patches/002-execinfo.patch
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc 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

31 lines
754 B
Diff

--- a/src/App/Application.cpp 2020-01-22 23:27:42.709273087 +0100
+++ b/src/App/Application.cpp 2020-01-22 23:50:53.915075955 +0100
@@ -1485,7 +1485,9 @@
#endif
#if defined(FC_OS_LINUX)
+#ifdef __GLIBC__
#include <execinfo.h>
+#endif
#include <dlfcn.h>
#include <cxxabi.h>
@@ -1497,6 +1499,7 @@
// This function produces a stack backtrace with demangled function & method names.
void printBacktrace(size_t skip=0)
{
+#ifdef __GLIBC__
void *callstack[128];
size_t nMaxFrames = sizeof(callstack) / sizeof(callstack[0]);
size_t nFrames = backtrace(callstack, nMaxFrames);
@@ -1527,6 +1530,9 @@
}
free(symbols);
+#else
+ std::cerr << "sorry, no backtrace on musl libc";
+#endif
}
#endif