diff options
author | he <he@pkgsrc.org> | 2017-08-26 10:36:01 +0000 |
---|---|---|
committer | he <he@pkgsrc.org> | 2017-08-26 10:36:01 +0000 |
commit | cdfecbd03215233d31c2e90151a65a713d3dba76 (patch) | |
tree | 0d5c1b034d2a06b19cb14a405f21f7d4904cac2f /www/firefox | |
parent | df591777081e96ffbe337d9eb950e905dd93fd99 (diff) | |
download | pkgsrc-cdfecbd03215233d31c2e90151a65a713d3dba76.tar.gz |
Add some patches to get us closer to building on NetBSD/powerpc:
* moz.build: CONFIG['OS_TEST'] is apparently PCU, not MACHINE, so use
'powerpc' instead of the longish list of powerpc ports.
* xptcinvoke_asm_ppc_netbsd.s: adapt to use of NS_InvokeByIndex()
* xptcinvoke_ppc_netbsd.cpp: adapt to use of NS_InvokeByIndex()
* xptcstubs_ppc_netbsd.cpp: adapt in the direction of xptcstubs_ppc_linux.cpp;
this has apparently not been build-tested in a while.
The current stumbling block is the lack of 64-bit atomic operations.
No PKGREVISION bump as this is a partial build fix only for NetBSD/powerpc.
Diffstat (limited to 'www/firefox')
4 files changed, 134 insertions, 9 deletions
diff --git a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build new file mode 100644 index 00000000000..b925b9c5cf5 --- /dev/null +++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build @@ -0,0 +1,16 @@ +$NetBSD: patch-xpcom_reflect_xptcall_md_unix_moz.build,v 1.8 2017/08/26 10:36:01 he Exp $ + +CONFIG['OS_TEST'] is apparently CPU, not MACHINE, so use 'powerpc' +instead of the longish list of powerpc ports. + +--- work/firefox-55.0.2/xpcom/reflect/xptcall/md/unix/moz.build.orig 2017-06-15 20:52:36.000000000 +0000 ++++ work/firefox-55.0.2/xpcom/reflect/xptcall/md/unix/moz.build +@@ -221,7 +221,7 @@ if CONFIG['OS_TEST'] in ('powerpc64', 'p + 'xptcstubs_ppc64_linux.cpp', + ] + +-if CONFIG['OS_TEST'] in ('macppc', 'bebox', 'ofppc', 'prep', 'amigappc'): ++if CONFIG['OS_TEST'] in ('powerpc'): + if CONFIG['OS_ARCH'] == 'NetBSD': + SOURCES += [ + 'xptcinvoke_asm_ppc_netbsd.s', diff --git a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s index 3556e49ae49..a1468538d8a 100644 --- a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s +++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s @@ -1,4 +1,6 @@ -$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s,v 1.1 2014/10/15 13:43:32 ryoon Exp $ +$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s,v 1.2 2017/08/26 10:36:01 he Exp $ + +Adapt to the use of NS_InvokeByIndex instead of XPTC_InvokeByIndex. --- xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_netbsd.s.orig 2014-10-11 09:06:50.000000000 +0000 +++ xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_netbsd.s @@ -8,18 +10,18 @@ $NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s,v 1. .align 2 - .globl XPTC_InvokeByIndex - .type XPTC_InvokeByIndex,@function -+ .globl NS_InvokeByIndex_P -+ .type NS_InvokeByIndex_P,@function ++ .globl NS_InvokeByIndex ++ .type NS_InvokeByIndex,@function # -# XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex, -# uint32_t paramCount, nsXPTCVariant* params) -+# NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, ++# NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, +# PRUint32 paramCount, nsXPTCVariant* params) # -XPTC_InvokeByIndex: -+NS_InvokeByIndex_P: ++NS_InvokeByIndex: stwu sp,-32(sp) # setup standard stack frame mflr r0 # save LR stw r3,8(sp) # r3 <= that diff --git a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp index 3c8a6c3a976..731635f2be2 100644 --- a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp +++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp @@ -1,4 +1,7 @@ -$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp,v 1.1 2014/10/15 13:43:32 ryoon Exp $ +$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp,v 1.2 2017/08/26 10:36:01 he Exp $ + +Adapt to the use of NS_InvokeByIndex() instead of XPTC_InvokeByIndex(). +Also a conditional on __GXX_ABI_VERSION < 100. --- xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_netbsd.cpp.orig 2014-10-11 09:06:50.000000000 +0000 +++ xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_netbsd.cpp @@ -7,10 +10,10 @@ $NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp,v 1.1 2 // Platform specific code to invoke XPCOM methods on native objects -// The purpose of XPTC_InvokeByIndex() is to map a platform -+// The purpose of NS_InvokeByIndex_P() is to map a platform ++// The purpose of NS_InvokeByIndex() is to map a platform // indepenpent call to the platform ABI. To do that, -// XPTC_InvokeByIndex() has to determine the method to call via vtable -+// NS_InvokeByIndex_P() has to determine the method to call via vtable ++// NS_InvokeByIndex() has to determine the method to call via vtable // access. The parameters for the method are read from the // nsXPTCVariant* and prepared for the native ABI. For the Linux/PPC // ABI this means that the first 8 integral and floating point @@ -43,5 +46,5 @@ $NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp,v 1.1 2 -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex, +EXPORT_XPCOM_API(nsresult) -+NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, ++NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, uint32_t paramCount, nsXPTCVariant* params); diff --git a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp new file mode 100644 index 00000000000..52bbd41eb26 --- /dev/null +++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp @@ -0,0 +1,104 @@ +$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp,v 1.1 2017/08/26 10:36:01 he Exp $ + +Adapt in the direction of xptcstubs_ppc_linux.cpp. +This apparently hasn't built for a while. + +--- xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_netbsd.cpp.orig 2017-06-15 20:52:36.000000000 +0000 ++++ xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_netbsd.cpp +@@ -6,6 +6,7 @@ + // Implement shared vtbl methods. + + #include "xptcprivate.h" ++#include "xptiprivate.h" + + // The Linux/PPC ABI (aka PPC/SYSV ABI) passes the first 8 integral + // parameters and the first 8 floating point parameters in registers +@@ -36,20 +37,14 @@ PrepareAndDispatch(nsXPTCStubBase* self, + { + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; + nsXPTCMiniVariant* dispatchParams = nullptr; +- nsIInterfaceInfo* iface_info = nullptr; +- const nsXPTMethodInfo* info; ++ const nsXPTMethodInfo* info = nullptr; + uint32_t paramCount; + uint32_t i; + nsresult result = NS_ERROR_FAILURE; + + NS_ASSERTION(self,"no self"); + +- self->GetInterfaceInfo(&iface_info); +- NS_ASSERTION(iface_info,"no interface info"); +- if (! iface_info) +- return NS_ERROR_UNEXPECTED; +- +- iface_info->GetMethodInfo(uint16_t(methodIndex), &info); ++ self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info); + NS_ASSERTION(info,"no method info"); + if (! info) + return NS_ERROR_UNEXPECTED; +@@ -147,9 +142,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, + } + } + +- result = self->CallMethod((uint16_t) methodIndex, info, dispatchParams); +- +- NS_RELEASE(iface_info); ++ result = self->mOuter->CallMethod((uint16_t) methodIndex, info, dispatchParams); + + if (dispatchParams != paramBuffer) + delete [] dispatchParams; +@@ -163,16 +156,44 @@ PrepareAndDispatch(nsXPTCStubBase* self, + // however, it's quick, dirty, and'll break when the ABI changes on + // us, which is what we want ;-). + +-#define STUB_ENTRY(n) \ +-__asm__ ( \ +- ".section \".text\" \n\t" \ +- ".align 2 \n\t" \ +- ".globl Stub"#n"__14nsXPTCStubBase \n\t" \ +- ".type Stub"#n"__14nsXPTCStubBase,@function \n\n" \ +- \ +-"Stub"#n"__14nsXPTCStubBase: \n\t" \ +- "li 11,"#n" \n\t" \ +- "b SharedStub@local \n" \ ++// gcc-3 version ++// ++// As G++3 ABI contains the length of the functionname in the mangled ++// name, it is difficult to get a generic assembler mechanism like ++// in the G++ 2.95 case. ++// Create names would be like: ++// _ZN14nsXPTCStubBase5Stub1Ev ++// _ZN14nsXPTCStubBase6Stub12Ev ++// _ZN14nsXPTCStubBase7Stub123Ev ++// _ZN14nsXPTCStubBase8Stub1234Ev ++// etc. ++// Use assembler directives to get the names right... ++ ++#define STUB_ENTRY(n) \ ++__asm__ ( \ ++ ".section \".text\" \n\t" \ ++ ".align 2 \n\t" \ ++ ".if "#n" < 10 \n\t" \ ++ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \ ++ ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \ ++"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \ ++ \ ++ ".elseif "#n" < 100 \n\t" \ ++ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \ ++ ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \ ++"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \ ++ \ ++ ".elseif "#n" < 1000 \n\t" \ ++ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \ ++ ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \ ++"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \ ++ \ ++ ".else \n\t" \ ++ ".err \"stub number "#n" >= 1000 not yet supported\"\n" \ ++ ".endif \n\t" \ ++ \ ++ "li 11,"#n" \n\t" \ ++ "b SharedStub@local \n" \ + ); + + #define SENTINEL_ENTRY(n) \ |