pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox/patches Add some patches to get us closer ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e710c15f1090
branches:  trunk
changeset: 367224:e710c15f1090
user:      he <he%pkgsrc.org@localhost>
date:      Sat Aug 26 10:36:01 2017 +0000

description:
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:

 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build                      |   16 +
 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s |   12 +-
 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp    |   11 +-
 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp     |  104 ++++++++++
 4 files changed, 134 insertions(+), 9 deletions(-)

diffs (194 lines):

diff -r 9b919eb52448 -r e710c15f1090 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build Sat Aug 26 10:36:01 2017 +0000
@@ -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 -r 9b919eb52448 -r e710c15f1090 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s
--- a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s    Sat Aug 26 10:07:45 2017 +0000
+++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__ppc__netbsd.s    Sat Aug 26 10:36:01 2017 +0000
@@ -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 @@
        .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 -r 9b919eb52448 -r e710c15f1090 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp
--- a/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp       Sat Aug 26 10:07:45 2017 +0000
+++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__ppc__netbsd.cpp       Sat Aug 26 10:36:01 2017 +0000
@@ -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 @@
  // 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 @@
 -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 -r 9b919eb52448 -r e710c15f1090 www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__ppc__netbsd.cpp        Sat Aug 26 10:36:01 2017 +0000
@@ -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)                            \



Home | Main Index | Thread Index | Old Index