void-packages/srcpkgs/a2jmidid/patches/musl-ppc.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

18 lines
727 B
Diff

This fixes build on ppc32/musl but also fixes incorrect usage of uc_regs
on glibc (uc_regs is an mcontext_t pointer, you can't index it directly)
--- a/sigsegv.c
+++ b/sigsegv.c
@@ -97,7 +97,11 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) {
for(i = 0; i < NGREG; i++)
a2j_error("reg[%02d] = 0x" REGFORMAT, i,
#if defined(__powerpc__) && !defined(__powerpc64__)
- ucontext->uc_mcontext.uc_regs[i]
+#if defined(__GLIBC__)
+ ucontext->uc_mcontext.uc_regs->gregs[i]
+#else
+ ucontext->uc_mcontext.gregs[i]
+#endif
#elif defined(__powerpc64__)
ucontext->uc_mcontext.gp_regs[i]
#elif defined(__sparc__) && defined(__arch64__)