From 7dca0ec25c2f3c57717247fd4431b8c3b21f0f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 1 Nov 2018 23:07:50 +0100 Subject: [PATCH 1/2] Fix crash during start on ppc64le (rhbz#1643729) --- firefox.spec | 2 + mozilla-1498938.patch | 93 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 mozilla-1498938.patch diff --git a/firefox.spec b/firefox.spec index c375334..0d9d5d4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -126,6 +126,7 @@ Patch41: build-disable-elfhack.patch Patch42: prio-nss-build.patch Patch43: mozilla-1500366.patch Patch44: mozilla-1494037.patch +Patch45: mozilla-1498938.patch # Fedora specific patches Patch215: firefox-enable-addons.patch @@ -333,6 +334,7 @@ This package contains results of tests executed during build. %patch42 -p1 -b .nss-build %patch43 -p1 -b .1500366 %patch44 -p1 -b .1494037 +%patch45 -p1 -b .1498938 # Fedora patches %patch215 -p1 -b .addons diff --git a/mozilla-1498938.patch b/mozilla-1498938.patch new file mode 100644 index 0000000..9748670 --- /dev/null +++ b/mozilla-1498938.patch @@ -0,0 +1,93 @@ + +# HG changeset patch +# User A. Wilcox +# Date 1539817971 0 +# Node ID 06e5a5bfd05ef276dce035af837f2ba76e9a55a4 +# Parent 0ef00ee6c5312035280635f06e4790abd8b13729 +Bug 1498938 - Support [implicit_jscontext] XPIDL calls on Linux/PPC64.; r=froydnj + +diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp +--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp ++++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp +@@ -61,43 +61,52 @@ PrepareAndDispatch(nsXPTCStubBase* self, + + NS_ASSERTION(dispatchParams,"no place for params"); + if (! dispatchParams) + return NS_ERROR_OUT_OF_MEMORY; + + const uint8_t indexOfJSContext = info->IndexOfJSContext(); + + uint64_t* ap = args; ++ uint32_t iCount = 0; ++ uint32_t fpCount = 0; + uint64_t tempu64; + + for(i = 0; i < paramCount; i++) { + const nsXPTParamInfo& param = info->GetParam(i); + const nsXPTType& type = param.GetType(); + nsXPTCMiniVariant* dp = &dispatchParams[i]; + +- MOZ_CRASH("NYI: support implicit JSContext*, bug 1475699"); ++ if (i == indexOfJSContext) { ++ if (iCount < GPR_COUNT) ++ iCount++; ++ else ++ ap++; ++ } + + if (!param.IsOut() && type == nsXPTType::T_DOUBLE) { +- if (i < FPR_COUNT) +- dp->val.d = fprData[i]; ++ if (fpCount < FPR_COUNT) { ++ dp->val.d = fprData[fpCount++]; ++ } + else + dp->val.d = *(double*) ap; + } else if (!param.IsOut() && type == nsXPTType::T_FLOAT) { +- if (i < FPR_COUNT) +- dp->val.f = (float) fprData[i]; // in registers floats are passed as doubles ++ if (fpCount < FPR_COUNT) { ++ dp->val.f = (float) fprData[fpCount++]; // in registers floats are passed as doubles ++ } + else { + float *p = (float *)ap; + #ifndef __LITTLE_ENDIAN__ + p++; + #endif + dp->val.f = *p; + } + } else { /* integer type or pointer */ +- if (i < GPR_COUNT) +- tempu64 = gprData[i]; ++ if (iCount < GPR_COUNT) ++ tempu64 = gprData[iCount]; + else + tempu64 = *ap; + + if (param.IsOut() || !type.IsArithmetic()) + dp->val.p = (void*) tempu64; + else if (type == nsXPTType::T_I8) + dp->val.i8 = (int8_t) tempu64; + else if (type == nsXPTType::T_I16) +@@ -119,17 +128,19 @@ PrepareAndDispatch(nsXPTCStubBase* self, + else if (type == nsXPTType::T_CHAR) + dp->val.c = (char) tempu64; + else if (type == nsXPTType::T_WCHAR) + dp->val.wc = (wchar_t) tempu64; + else + NS_ERROR("bad type"); + } + +- if (i >= 7) ++ if (iCount < GPR_COUNT) ++ iCount++; // gprs are skipped for fp args, so this always needs inc ++ else + ap++; + } + + nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info, + dispatchParams); + + if (dispatchParams != paramBuffer) + delete [] dispatchParams; + From 561a9b5ad9a414b912dbae6223f1f1b106122841 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 2 Nov 2018 09:49:59 +0100 Subject: [PATCH 2/2] Added fixes for ppc64le --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 0d9d5d4..78473c2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -87,7 +87,7 @@ Summary: Mozilla Firefox Web browser Name: firefox Version: 63.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -910,6 +910,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Nov 2 2018 Dan Horak - 63.0.1-3 +- Added fixes for ppc64le + * Thu Nov 1 2018 Martin Stransky - 63.0.1-2 - Fixed typo on man page (rhbz#1643766)