void-packages/srcpkgs/openlierox/patches/ppc-musl.patch
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: convert patches to -Np1
```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

24 lines
687 B
Diff

--- a/src/client/CrashHandler.cpp
+++ b/src/client/CrashHandler.cpp
@@ -23,6 +23,9 @@
#include "../breakpad/BreakPad.h"
+#if defined(__linux__) && defined(__powerpc__)
+#include <asm/ptrace.h>
+#endif
#ifdef NBREAKPAD
@@ -320,7 +322,11 @@ public:
pnt = (void*) uc->uc_mcontext.sc_iaoq[0] & ~0x3UL ;
# elif (defined (__ppc__)) || (defined (__powerpc__))
ucontext_t* uc = (ucontext_t*) secret;
+# if !defined(__GLIBC__) && !defined(__powerpc64__)
+ pnt = (void*) ((struct pt_regs *)uc->uc_regs)->nip ;
+# else
pnt = (void*) uc->uc_mcontext.regs->nip ;
+# endif
# elif defined(__sparc__)
struct sigcontext* sc = (struct sigcontext*) secret;
# if __WORDSIZE == 64