void-packages/srcpkgs/firefox-esr/patches/ppc32-fix-build.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

36 lines
1.2 KiB
Diff

This is not a complete/correct patch, but it makes firefox build. For now
mostly for tracking, so a real fix can be made, but right now it still
segfaults on start.
Ref: https://hg.mozilla.org/mozilla-central/rev/08339a56f3ae
Ref: https://hg.mozilla.org/mozilla-central/rev/d16fcad6aa60
Ref: https://hg.mozilla.org/mozilla-central/rev/ab87611d012e
Ref: https://hg.mozilla.org/mozilla-central/file/tip/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_linux.cpp
--- a/xpcom/reflect/xptcall/xptcall.h
+++ b/xpcom/reflect/xptcall/xptcall.h
@@ -71,6 +71,11 @@ struct nsXPTCVariant {
ExtendedVal ext;
};
+#if defined(__powerpc__) && !defined(__powerpc64__)
+ // this field is still necessary on ppc32, as an address
+ // to it is taken certain places in xptcall
+ void *ptr;
+#endif
nsXPTType type;
uint8_t flags;
@@ -91,7 +96,12 @@ struct nsXPTCVariant {
};
void ClearFlags() { flags = 0; }
+#if defined(__powerpc__) && !defined(__powerpc64__)
+ void SetIndirect() { ptr = &val; flags |= IS_INDIRECT; }
+ bool IsPtrData() const { return IsIndirect(); }
+#else
void SetIndirect() { flags |= IS_INDIRECT; }
+#endif
bool IsIndirect() const { return 0 != (flags & IS_INDIRECT); }