void-packages/srcpkgs/nspr/patches/ppc64-default-stack-size.diff
Đoàn Trần Công Danh 65749575ab srcpkgs/n*: 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

22 lines
855 B
Diff

set a minimum stack size on ppc64 to prevent crashes
Firefox, a user of nspr, attempts to set a stack size of 32k in its
JS watchdog, which the pthreads impl doesn't like and fails.
Coincidentally, nspr here is compiled with debug on, which means it has
assertions turned on; under normal circumstances, those would be disabled,
the stack size set call would fail and everything would fall back on the
default 2M stacksize, but it would still be wrong - therefore, establish
a minimum, just like for aarch64.
--- a/nspr/pr/include/md/_linux.h
+++ b/nspr/pr/include/md/_linux.h
@@ -71,7 +71,7 @@
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
-#if defined(__aarch64__) || defined(__mips__)
+#if defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
#define _MD_MINIMUM_STACK_SIZE 0x20000
#endif