From 03662a248a3852b9a7b6944b5f2c2f51c5f89a73 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 5 Feb 2021 22:43:10 +0100 Subject: [PATCH] firefox-esr: add ppc64 xptcall patch too --- .../patches/ff85-ppc64-xptcall.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 srcpkgs/firefox-esr/patches/ff85-ppc64-xptcall.patch diff --git a/srcpkgs/firefox-esr/patches/ff85-ppc64-xptcall.patch b/srcpkgs/firefox-esr/patches/ff85-ppc64-xptcall.patch new file mode 100644 index 0000000000..b270d836f2 --- /dev/null +++ b/srcpkgs/firefox-esr/patches/ff85-ppc64-xptcall.patch @@ -0,0 +1,63 @@ +diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp +--- xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp ++++ xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc64_linux.cpp +@@ -91,7 +91,13 @@ + if (!s->IsIndirect() && s->type == nsXPTType::T_DOUBLE) { + if (nr_fpr < FPR_COUNT) { + fpregs[nr_fpr++] = s->val.d; +- nr_gpr++; ++ // Even if we have enough FPRs, still skip space in ++ // the parameter area if we ran out of placeholder GPRs. ++ if (nr_gpr < GPR_COUNT) { ++ nr_gpr++; ++ } else { ++ d++; ++ } + } else { + *((double *)d) = s->val.d; + d++; +@@ -101,7 +107,11 @@ + if (nr_fpr < FPR_COUNT) { + // Single-precision floats are passed in FPRs too. + fpregs[nr_fpr++] = s->val.f; +- nr_gpr++; ++ if (nr_gpr < GPR_COUNT) { ++ nr_gpr++; ++ } else { ++ d++; ++ } + } else { + #ifdef __LITTLE_ENDIAN__ + *((float *)d) = s->val.f; +diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp +--- xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp ++++ xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp +@@ -103,7 +103,13 @@ + if (!param.IsOut() && type == nsXPTType::T_DOUBLE) { + if (nr_fpr < FPR_COUNT) { + dp->val.d = fpregs[nr_fpr++]; +- nr_gpr++; ++ // Even if we have enough FPRs, still skip space in ++ // the parameter area if we ran out of placeholder GPRs. ++ if (nr_gpr < GPR_COUNT) { ++ nr_gpr++; ++ } else { ++ ap++; ++ } + } else { + dp->val.d = *(double*)ap++; + } +@@ -113,7 +119,11 @@ + if (nr_fpr < FPR_COUNT) { + // Single-precision floats are passed in FPRs too. + dp->val.f = (float)fpregs[nr_fpr++]; +- nr_gpr++; ++ if (nr_gpr < GPR_COUNT) { ++ nr_gpr++; ++ } else { ++ ap++; ++ } + } else { + #ifdef __LITTLE_ENDIAN__ + dp->val.f = *(float*)ap++; +