pkgsrc-WIP-changes archive

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

firefox45-hg: add sparc64 support and fix some build issues



Module Name:	pkgsrc-wip
Committed By:	Martin Husemann <martin%NetBSD.org@localhost>
Pushed By:	martin
Date:		Mon Feb 1 21:24:31 2016 +0100
Changeset:	061ad0f4e2063b33b797863edbc36c7754b82293

Modified Files:
	firefox45-hg/distinfo
Added Files:
	firefox45-hg/patches/patch-config_external_nspr_pr_moz.build
	firefox45-hg/patches/patch-config_external_nspr_prcpucfg.h
	firefox45-hg/patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_platform_macros.h
	firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_Makefile.in
	firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp
	firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s

Log Message:
firefox45-hg: add sparc64 support and fix some build issues

Work in progress.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=061ad0f4e2063b33b797863edbc36c7754b82293

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 firefox45-hg/distinfo                              |  6 ++
 .../patch-config_external_nspr_pr_moz.build        | 56 ++++++++++++++
 .../patches/patch-config_external_nspr_prcpucfg.h  | 33 ++++++++
 ...buf_src_google_protobuf_stubs_platform_macros.h | 28 +++++++
 ...patch-xpcom_reflect_xptcall_md_unix_Makefile.in | 48 ++++++++++++
 ...xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp | 89 ++++++++++++++++++++++
 ...tcall_md_unix_xptcstubs__asm__sparc64__netbsd.s | 71 +++++++++++++++++
 7 files changed, 331 insertions(+)

diffs:
diff --git a/firefox45-hg/distinfo b/firefox45-hg/distinfo
index b0b9a7b..385d30d 100644
--- a/firefox45-hg/distinfo
+++ b/firefox45-hg/distinfo
@@ -11,6 +11,8 @@ SHA1 (patch-browser_installer_package-manifest.in) = 5a96a90a2c14c419ccab4de2e68
 SHA1 (patch-build_autoconf_nss.m4) = 53e8c6844fc0095237ee07df3ab3791edd248fc2
 SHA1 (patch-build_gyp.mozbuild) = 2842da0783d344dd12e86adde447f7cda6191518
 SHA1 (patch-config_Makefile.in) = 816e6dc2ffe5ce5e817ce9494a55938ec0a7be5e
+SHA1 (patch-config_external_nspr_pr_moz.build) = 6e14bb13d8eb72e6cc4ca99ae5bdfb18610803c1
+SHA1 (patch-config_external_nspr_prcpucfg.h) = 874650fe410b1190064d7ed64bfcb8d41a897fe3
 SHA1 (patch-config_rules.mk) = debd5acd52f4f7593ea4e54dd0fdad91eeb46839
 SHA1 (patch-config_system-headers) = 8324b6229bd88453ff6426b013b58bf7c6216faf
 SHA1 (patch-dom_base_moz.build) = c0d68528c487a9f06fed2a886ceafd7d904cc8a5
@@ -30,13 +32,17 @@ SHA1 (patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__captur
 SHA1 (patch-mfbt_Alignment.h) = 1d97ee858b62c31112fe90ebb2d8fe430c95ed56
 SHA1 (patch-mfbt_Attributes.h) = b587038d2f41d3cd4dbc346ac591088b2f36750c
 SHA1 (patch-ostream) = 593a114a31a0117af6c00cd12e3aed4565571288
+SHA1 (patch-toolkit_components_protobuf_src_google_protobuf_stubs_platform_macros.h) = 4abe361ffcab9f923e9ae7b9bdc0dfdb9ddce820
 SHA1 (patch-toolkit_library_moz.build) = 57017a6766a7d7a075bcd01d713c34cab5f45f2a
 SHA1 (patch-toolkit_toolkit.mozbuild) = a92b9f5114c3eab2c8e9f1d0eb21926235d2203a
 SHA1 (patch-unwind.h) = c7a606c83cb60d0d6bcc7babad8157097d9036a8
 SHA1 (patch-xg) = 2b472858270a109c2b317bb08698c12717174510
 SHA1 (patch-xl) = 337960ba518f1f142b45ae91d3f122ee5e0c9da3
 SHA1 (patch-xm) = 85000d412a7e7aa9ea8c337c9bc72b55d9e7ca63
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_Makefile.in) = 6083e298140357bc5f2fa018885fed42eecb1ac4
 SHA1 (patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__asm__mips.S) = 17becf7433af427289ee1e25c16600df468e2540
 SHA1 (patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp) = 4d93c465be5fb5e6aaf0b12707a116c6b3ed4be8
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp) = 0792c2c626d906e71c5183994cb32bf8cdb3e239
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s) = 522bc237bc90d85c98b61a467a431fddd91d8c3c
 SHA1 (patch-xptcinvoke__sparc64__netbsd.cpp) = a292378e1a882b273616f2b749d7785fda2ddf54
 SHA1 (patch-xptcstubs__asm__sparc64__netbsd.s) = 6df4c709e79320562c0fb544421fe53176da6b48
diff --git a/firefox45-hg/patches/patch-config_external_nspr_pr_moz.build b/firefox45-hg/patches/patch-config_external_nspr_pr_moz.build
new file mode 100644
index 0000000..0617567
--- /dev/null
+++ b/firefox45-hg/patches/patch-config_external_nspr_pr_moz.build
@@ -0,0 +1,56 @@
+# HG changeset patch
+# User Landry Breuil <landry%openbsd.org@localhost>
+# Date 1454101563 0
+#      Fri Jan 29 21:06:03 2016 +0000
+# Node ID 91d69babe26a073e195768359a94cd7518be1d1c
+# Parent  50b6f681c7ed32eb71fdfc9d4583b7ad1fda18c8
+Bug 1243493 - Add BSDs to NSPR moz.build. r?ted
+
+diff --git a/config/external/nspr/pr/moz.build b/config/external/nspr/pr/moz.build
+--- config/external/nspr/pr/moz.build
++++ config/external/nspr/pr/moz.build
+@@ -24,16 +24,23 @@ if CONFIG['OS_ARCH'] == 'Linux':
+     SOURCES += ['/nsprpub/pr/src/md/unix/linux.c']
+     if CONFIG['CPU_ARCH'] == 'x86_64':
+         SOURCES += ['/nsprpub/pr/src/md/unix/os_Linux_x86_64.s']
+     elif CONFIG['CPU_ARCH'] == 'x86':
+         DEFINES['i386'] = True
+         SOURCES += ['/nsprpub/pr/src/md/unix/os_Linux_x86.s']
+     elif CONFIG['CPU_ARCH'] == 'ppc':
+         SOURCES += ['/nsprpub/pr/src/md/unix/os_Linux_ppc.s']
++elif CONFIG['OS_TARGET'] in ('FreeBSD', 'OpenBSD', 'NetBSD'):
++    DEFINES.update(
++        HAVE_BSD_FLOCK=True,
++        HAVE_SOCKLEN_T=True,
++    )
++    DEFINES[CONFIG['OS_TARGET'].upper()] = True
++    SOURCES += ['/nsprpub/pr/src/md/unix/%s.c' % CONFIG['OS_TARGET'].lower()]
+ elif CONFIG['OS_TARGET'] == 'Darwin':
+     DEFINES.update(
+         DARWIN=True,
+         HAVE_BSD_FLOCK=True,
+         HAVE_SOCKLEN_T=True,
+     )
+     SOURCES += [
+         '/nsprpub/pr/src/md/unix/darwin.c',
+@@ -205,17 +212,20 @@ EXPORTS.nspr += [
+     '/nsprpub/pr/include/prtrace.h',
+     '/nsprpub/pr/include/prtypes.h',
+     '/nsprpub/pr/include/prvrsion.h',
+     '/nsprpub/pr/include/prwin16.h',
+ ]
+ 
+ EXPORTS.nspr.md += [
+     '/nsprpub/pr/include/md/_darwin.cfg',
++    '/nsprpub/pr/include/md/_freebsd.cfg',
+     '/nsprpub/pr/include/md/_linux.cfg',
++    '/nsprpub/pr/include/md/_netbsd.cfg',
++    '/nsprpub/pr/include/md/_openbsd.cfg',
+     '/nsprpub/pr/include/md/_win95.cfg',
+ ]
+ 
+ EXPORTS.nspr.private += [
+     '/nsprpub/pr/include/private/pprio.h',
+     '/nsprpub/pr/include/private/pprthred.h',
+     '/nsprpub/pr/include/private/prpriv.h',
+ ]
diff --git a/firefox45-hg/patches/patch-config_external_nspr_prcpucfg.h b/firefox45-hg/patches/patch-config_external_nspr_prcpucfg.h
new file mode 100644
index 0000000..45184e0
--- /dev/null
+++ b/firefox45-hg/patches/patch-config_external_nspr_prcpucfg.h
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Landry Breuil <landry%openbsd.org@localhost>
+# Date 1454101563 0
+#      Fri Jan 29 21:06:03 2016 +0000
+# Node ID 91d69babe26a073e195768359a94cd7518be1d1c
+# Parent  50b6f681c7ed32eb71fdfc9d4583b7ad1fda18c8
+Bug 1243493 - Add BSDs to NSPR moz.build. r?ted
+
+diff --git a/config/external/nspr/prcpucfg.h b/config/external/nspr/prcpucfg.h
+--- config/external/nspr/prcpucfg.h
++++ config/external/nspr/prcpucfg.h
+@@ -9,15 +9,21 @@
+ /*
+  * Need to support conditionals that are defined in both the top-level build
+  * system as well as NSS' build system for now.
+  */
+ #if defined(XP_DARWIN) || defined(DARWIN)
+ #include "md/_darwin.cfg"
+ #elif defined(XP_WIN) || defined(_WINDOWS)
+ #include "md/_win95.cfg"
++#elif defined(__FreeBSD__)
++#include "md/_freebsd.cfg"
++#elif defined(__NetBSD__)
++#include "md/_netbsd.cfg"
++#elif defined(__OpenBSD__)
++#include "md/_openbsd.cfg"
+ #elif defined(__linux__)
+ #include "md/_linux.cfg"
+ #else
+ #error "Unsupported platform!"
+ #endif
+ 
+ #endif /* NSPR_PRCPUCFG_H_ */
diff --git a/firefox45-hg/patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_platform_macros.h b/firefox45-hg/patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_platform_macros.h
new file mode 100644
index 0000000..d69ab51
--- /dev/null
+++ b/firefox45-hg/patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_platform_macros.h
@@ -0,0 +1,28 @@
+$NetBSD$
+
+# see upstream pull request #780 : not all __sparc__ are running Solaris
+# https://github.com/google/protobuf/pull/780
+
+--- toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h.orig	2016-01-21 15:05:05.000000000 +0100
++++ toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h	2016-01-21 16:17:05.000000000 +0100
+@@ -67,11 +67,20 @@
+ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
+ #elif defined(sparc)
+ #define GOOGLE_PROTOBUF_ARCH_SPARC 1
++#ifdef sun
+ #ifdef SOLARIS_64BIT_ENABLED
+ #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
+ #else
+ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
+ #endif
++#else
++// sparc, but not solaris
++# if __LP64__
++#  define GOOGLE_PROTOBUF_ARCH_64_BIT 1
++# else
++#  define GOOGLE_PROTOBUF_ARCH_32_BIT 1
++# endif
++#endif
+ #elif defined(__GNUC__)
+ # if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
+ // We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h
diff --git a/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_Makefile.in b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_Makefile.in
new file mode 100644
index 0000000..78fc6f7
--- /dev/null
+++ b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_Makefile.in
@@ -0,0 +1,48 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_Makefile.in,v 1.2 2015/09/23 06:44:42 ryoon Exp $
+
+--- xpcom/reflect/xptcall/md/unix/Makefile.in.orig	2015-08-24 21:53:22.000000000 +0000
++++ xpcom/reflect/xptcall/md/unix/Makefile.in
+@@ -42,6 +42,43 @@ ifeq ($(OS_ARCH),AIX)
+ CXXFLAGS 	:=  $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
+ endif
+ 
++######################################################################
++# SPARC
++######################################################################
++#
++# Linux/SPARC
++#
++ifeq ($(OS_ARCH),Linux)
++ifneq (,$(findstring sparc,$(OS_TEST)))
++ASFILES		:= xptcinvoke_asm_sparc_linux_GCC3.s xptcstubs_asm_sparc_solaris.s
++endif
++endif
++#
++# NetBSD/SPARC
++#
++ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc)
++ASFILES		:= xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s
++endif
++#
++# OpenBSD/SPARC
++#
++ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc)
++ASFILES		:= xptcinvoke_asm_sparc_openbsd.s xptcstubs_asm_sparc_openbsd.s
++endif
++#
++# OpenBSD/SPARC64
++#
++ifneq (,$(filter OpenBSDsparc64 FreeBSDsparc64,$(OS_ARCH)$(OS_TEST)))
++ASFILES		:= xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
++endif
++#
++# NetBSD/SPARC64
++#
++ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc64)
++CPPSRCS                := xptcinvoke_sparc64_netbsd.cpp xptcstubs_sparc64_openbsd.cpp
++ASFILES                := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_netbsd.s
++endif
++
+ include $(topsrcdir)/config/rules.mk
+ 
+ ifeq ($(OS_ARCH),Linux)
diff --git a/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp
new file mode 100644
index 0000000..4f1d2a4
--- /dev/null
+++ b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp
@@ -0,0 +1,89 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__sparc64__netbsd.cpp,v 1.1 2014/10/15 13:43:32 ryoon Exp $
+
+--- xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_netbsd.cpp.orig	2014-10-14 18:49:14.000000000 +0000
++++ xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_netbsd.cpp
+@@ -0,0 +1,84 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ *
++ * The contents of this file are subject to the Netscape Public
++ * License Version 1.1 (the "License"); you may not use this file
++ * except in compliance with the License. You may obtain a copy of
++ * the License at http://www.mozilla.org/NPL/
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is Netscape
++ * Communications Corporation.  Portions created by Netscape are
++ * Copyright (C) 1998 Netscape Communications Corporation. All
++ * Rights Reserved.
++ *
++ * Contributor(s): 
++ */
++
++/* Platform specific code to invoke XPCOM methods on native objects */
++
++#include "xptcprivate.h"
++
++#if !defined(__sparc64__) && !defined(_LP64)
++#error "This code is for Sparc64 only"
++#endif
++
++extern "C" PRUint32
++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s)
++{
++  /*
++    We need to copy the parameters for this function to locals and use them
++    from there since the parameters occupy the same stack space as the stack
++    we're trying to populate.
++  */
++  PRUint64 *l_d = d;
++  nsXPTCVariant *l_s = s;
++  PRUint64 l_paramCount = paramCount;
++  PRUint64 regCount = 0;  // return the number of registers to load from the stack
++
++  for(PRUint64 i = 0; i < l_paramCount; i++, l_d++, l_s++)
++  {
++    if (regCount < 5) regCount++;
++
++    if (l_s->IsPtrData())
++    {
++      *l_d = (PRUint64)l_s->ptr;
++      continue;
++    }
++    switch (l_s->type)
++    {
++      case nsXPTType::T_I8    : *((PRInt64*)l_d)     = l_s->val.i8;    break;
++      case nsXPTType::T_I16   : *((PRInt64*)l_d)     = l_s->val.i16;   break;
++      case nsXPTType::T_I32   : *((PRInt64*)l_d)     = l_s->val.i32;   break;
++      case nsXPTType::T_I64   : *((PRInt64*)l_d)     = l_s->val.i64;   break;
++      
++      case nsXPTType::T_U8    : *((PRUint64*)l_d)    = l_s->val.u8;    break;
++      case nsXPTType::T_U16   : *((PRUint64*)l_d)    = l_s->val.u16;   break;
++      case nsXPTType::T_U32   : *((PRUint64*)l_d)    = l_s->val.u32;   break;
++      case nsXPTType::T_U64   : *((PRUint64*)l_d)    = l_s->val.u64;   break;
++
++      /* in the case of floats, we want to put the bits in to the
++         64bit space right justified... floats in the paramter array on
++         sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip
++         the space that would be occupied by %f0, %f2, etc.
++      */
++      case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f;     break;
++      case nsXPTType::T_DOUBLE: *((double*)l_d)      = l_s->val.d;     break;
++      case nsXPTType::T_BOOL  : *((PRInt64*)l_d)      = l_s->val.b;     break;
++      case nsXPTType::T_CHAR  : *((PRUint64*)l_d)    = l_s->val.c;     break;
++      case nsXPTType::T_WCHAR : *((PRInt64*)l_d)     = l_s->val.wc;    break;
++
++      default:
++        // all the others are plain pointer types
++        *((void**)l_d) = l_s->val.p;
++        break;
++    }
++  }
++  
++  return regCount;
++}
diff --git a/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s
new file mode 100644
index 0000000..32e6044
--- /dev/null
+++ b/firefox45-hg/patches/patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s
@@ -0,0 +1,71 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_xptcstubs__asm__sparc64__netbsd.s,v 1.1 2014/10/15 13:43:32 ryoon Exp $
+
+--- xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc64_netbsd.s.orig	2014-10-14 18:49:14.000000000 +0000
++++ xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc64_netbsd.s
+@@ -0,0 +1,66 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ *
++ * The contents of this file are subject to the Netscape Public
++ * License Version 1.1 (the "License"); you may not use this file
++ * except in compliance with the License. You may obtain a copy of
++ * the License at http://www.mozilla.org/NPL/
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is Netscape
++ * Communications Corporation.  Portions created by Netscape are
++ * Copyright (C) 1999 Netscape Communications Corporation. All
++ * Rights Reserved.
++ *
++ * Contributor(s): 
++ */
++
++        .global SharedStub
++
++/*
++    in the frame for the function that called SharedStub are the
++    rest of the parameters we need
++
++*/
++
++SharedStub:
++! we don't create a new frame yet, but work within the frame of the calling
++! function to give ourselves the other parameters we want
++
++	mov	%o0, %o1	       ! shuffle the index up to 2nd place
++	mov	%i0, %o0	       ! the original 'this'
++	add	%fp, 0x7ff + 136, %o2  ! previous stack top adjusted to the first argument slot (beyond 'this')
++
++! save off the original incoming parameters that arrived in 
++! registers, the ABI guarantees the space for us to do this
++	stx	%i1, [%fp + 0x7ff + 136]
++	stx	%i2, [%fp + 0x7ff + 144]
++	stx	%i3, [%fp + 0x7ff + 152]
++	stx	%i4, [%fp + 0x7ff + 160]
++	stx	%i5, [%fp + 0x7ff + 168]
++! now we can build our own stack frame
++	save	%sp,-(128 + 64),%sp    ! room for the register window and
++				       ! struct pointer, rounded up to 0 % 64
++! our function now appears to have been called
++! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args)
++! so we can just copy these through
++
++	mov	%i0, %o0
++	mov	%i1, %o1
++	mov	%i2, %o2
++	call	PrepareAndDispatch
++	 nop
++	mov	%o0,%i0 	    ! propagate return value
++	b .LL1
++	 nop
++.LL1:
++	ret
++	 restore
++
++       .size	SharedStub, .-SharedStub
++       .type	SharedStub, #function


Home | Main Index | Thread Index | Old Index