summaryrefslogtreecommitdiff
path: root/www/firefox
diff options
context:
space:
mode:
authortnn <tnn>2009-08-05 02:37:10 +0000
committertnn <tnn>2009-08-05 02:37:10 +0000
commitf801c8eca259f19368446c66005ee79921cf2053 (patch)
tree942607cee17605c80177dacf9ed4819cd37a6562 /www/firefox
parentced2fee4a3932c8029ada426ad3512eb85a8a89d (diff)
downloadpkgsrc-f801c8eca259f19368446c66005ee79921cf2053.tar.gz
Import firefox-3.5.2 as www/firefox. from pkgsrc-wip.
Firefox 3.5 is based on the Gecko 1.9.1 rendering platform. Firefox 3.5 offers many changes over the previous version, supporting new web technologies, improving performance and ease of use. Some of the notable features are: * Support for the HTML5 <video> and <audio> elements * Improved tools for controlling your private data * Better web application performance using the new TraceMonkey JavaScript engine * The ability to share your location with websites using Location Aware Browsing * Support for native JSON, and web worker threads. * Improvements to the Gecko layout engine, including speculative parsing for faster content rendering. * Support for new web technologies such as: downloadable fonts, CSS media queries, new transformations and properties, JavaScript query selectors, HTML5 local storage and offline application storage, <canvas> text, ICC profiles, and SVG transforms.
Diffstat (limited to 'www/firefox')
-rw-r--r--www/firefox/files/desktop.in191
-rw-r--r--www/firefox/options.mk36
-rw-r--r--www/firefox/patches/patch-ar39
-rw-r--r--www/firefox/patches/patch-as33
-rw-r--r--www/firefox/patches/patch-au26
-rw-r--r--www/firefox/patches/patch-av40
-rw-r--r--www/firefox/patches/patch-ma23
-rw-r--r--www/firefox/patches/patch-mb72
-rw-r--r--www/firefox/patches/patch-md17
-rw-r--r--www/firefox/patches/patch-me15
-rw-r--r--www/firefox/patches/patch-mf21
-rw-r--r--www/firefox/patches/patch-mg90
-rw-r--r--www/firefox/patches/patch-mi15
-rw-r--r--www/firefox/patches/patch-mj15
-rw-r--r--www/firefox/patches/patch-mk19
-rw-r--r--www/firefox/patches/patch-ml16
-rw-r--r--www/firefox/patches/patch-mm19
-rw-r--r--www/firefox/patches/patch-mn15
-rw-r--r--www/firefox/patches/patch-mp26
-rw-r--r--www/firefox/patches/patch-xa119
-rw-r--r--www/firefox/patches/patch-xb91
-rw-r--r--www/firefox/patches/patch-xc73
-rw-r--r--www/firefox/patches/patch-xd126
-rw-r--r--www/firefox/patches/patch-xe77
-rw-r--r--www/firefox/patches/patch-xf43
-rw-r--r--www/firefox/patches/patch-xg33
-rw-r--r--www/firefox/patches/patch-xh181
-rw-r--r--www/firefox/patches/patch-xi213
-rw-r--r--www/firefox/patches/patch-xj129
-rw-r--r--www/firefox/patches/patch-xk156
-rw-r--r--www/firefox/patches/patch-xl200
-rw-r--r--www/firefox/patches/patch-xm49
32 files changed, 2218 insertions, 0 deletions
diff --git a/www/firefox/files/desktop.in b/www/firefox/files/desktop.in
new file mode 100644
index 00000000000..d72090e1aab
--- /dev/null
+++ b/www/firefox/files/desktop.in
@@ -0,0 +1,191 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@MOZILLA_NAME@ Web Browser
+Name[am]=
+Name[ar]=
+Name[az]=@MOZILLA_NAME@ Veb Səyyahı
+Name[be]=
+Name[bg]=Интернет браузър @MOZILLA_NAME@
+Name[bn]=
+Name[bs]=@MOZILLA_NAME@ web preglednik
+Name[ca]=Navegador web @MOZILLA_NAME@
+Name[cs]=Prohlížeč WWW @MOZILLA_NAME@
+Name[cy]=Y Porwr Gwe @MOZILLA_NAME@
+Name[da]=@MOZILLA_NAME@ - internetsurfning
+Name[de]=@MOZILLA_NAME@ Webbrowser
+Name[el]=Περιηγητής Διαδικτύου @MOZILLA_NAME@
+Name[en_CA]=@MOZILLA_NAME@ Web Browser
+Name[en_GB]=@MOZILLA_NAME@ Web Browser
+Name[es]=Navegador Web @MOZILLA_NAME@
+Name[et]=@MOZILLA_NAME@ veebibrauser
+Name[eu]=@MOZILLA_NAME@ web arakatzailea
+Name[fi]=@MOZILLA_NAME@, WWW-selain
+Name[fr]=Navigateur Web @MOZILLA_NAME@
+Name[ga]=Brabhsálaí Lín @MOZILLA_NAME@
+Name[gu]=એપીફની વૅબ બ્રાઉઝર
+Name[he]=דפדפן @MOZILLA_NAME@
+Name[hi]=
+Name[hr]=@MOZILLA_NAME@ Web preglednik
+Name[hu]=@MOZILLA_NAME@ webböngésző
+Name[id]=Web Browser @MOZILLA_NAME@
+Name[it]=Browser web @MOZILLA_NAME@
+Name[ja]=@MOZILLA_NAME@ ウェブ・ブラウザ
+Name[ko]=@MOZILLA_NAME@ 웹 브라우저
+Name[li]=@MOZILLA_NAME@ Web Browser
+Name[lt]=@MOZILLA_NAME@ web naršyklė
+Name[mk]=@MOZILLA_NAME@ веб прелистувач
+Name[ml]=എപ്പിഫാനി വെബ്ബ് ബ്രൌസ‌ര്
+Name[mn]=@MOZILLA_NAME@ веб хөтөч
+Name[ms]=Pelungsur Web @MOZILLA_NAME@
+Name[nb]=@MOZILLA_NAME@ nettleser
+Name[nl]=@MOZILLA_NAME@ Webbrowser
+Name[nn]=@MOZILLA_NAME@ nettlesar
+Name[no]=@MOZILLA_NAME@ nettleser
+Name[pa]=ਏਪੀਫਾਨੀ ਵੈੱਬ ਬਰਾਊਜ਼ਰ
+Name[pl]=Przeglądarka WWW @MOZILLA_NAME@
+Name[pt]=Navegador Web @MOZILLA_NAME@
+Name[pt_BR]=Navegador Web @MOZILLA_NAME@
+Name[ro]=Navigatorul @MOZILLA_NAME@
+Name[ru]=Веб-браузер @MOZILLA_NAME@
+Name[sk]=
+Name[sl]=Spletni brskalnik @MOZILLA_NAME@
+Name[sq]=@MOZILLA_NAME@ - Shfletuesi Web
+Name[sr]=
+Name[sr@Latn]=Veb čitač Spoznaja
+Name[sv]=Webbläsaren @MOZILLA_NAME@
+Name[ta]=எபிபனி வலை உலாவி
+Name[tk]=@MOZILLA_NAME@ Web Ahtarçisi
+Name[tr]=@MOZILLA_NAME@ Web Tarayıcı
+Name[uk]=Переглядач web @MOZILLA_NAME@
+Name[vi]=Trình Duyệt Web @MOZILLA_NAME@
+Name[wa]=Betchteu waibe epiphany
+Name[zh_CN]=@MOZILLA_NAME@ Web 浏览器
+Name[zh_TW]=@MOZILLA_NAME@ 網頁瀏覽器
+GenericName=Web Browser
+GenericName[ar]=متصفّح الانترنت
+GenericName[az]=Veb Səyyahı
+GenericName[be]=Вандроўнік па павуціньню
+GenericName[bg]=Браузър
+GenericName[bn]=ওয়েব ব্রাউজার
+GenericName[bs]=Web preglednik
+GenericName[ca]=Navegador web
+GenericName[cs]=Prohlížeč WWW
+GenericName[cy]=Porwr Gwe
+GenericName[da]=Internetsurfning
+GenericName[de]=Webbrowser
+GenericName[el]=Περιηγητής Ιστοσελίδων
+GenericName[en_CA]=Web Browser
+GenericName[en_GB]=Web Browser
+GenericName[es]=Navegador web
+GenericName[et]=Veebilehitseja
+GenericName[eu]=Web arakatzailea
+GenericName[fi]=WWW-selain
+GenericName[fr]=Navigateur Web @MOZILLA_NAME@
+GenericName[ga]=Brabhsálaí Lín
+GenericName[gu]=વેબ બ્રાઉઝર
+GenericName[he]=דפדפן אינטרנט
+GenericName[hi]=वेब ब्राउज़र
+GenericName[hr]=Web preglednik
+GenericName[hu]=Webböngésző
+GenericName[id]=Browser Web
+GenericName[it]=Browser web
+GenericName[ja]=GNOME ウェブ・ブラウザ
+GenericName[ko]=웹 브라우저
+GenericName[li]=Wèb Browser
+GenericName[lt]=Web naršyklė
+GenericName[mk]=Веб прелистувач
+GenericName[mn]=Веб хөтөч
+GenericName[ms]=Pelungsur Web
+GenericName[nb]=Nettleser
+GenericName[nl]=Web-browser
+GenericName[nn]=Nettlesar
+GenericName[no]=Nettleser
+GenericName[pa]=ਵੈਬ ਬਰਾਊਜ਼
+GenericName[pl]=Przeglądarka WWW
+GenericName[pt]=Navegador Web
+GenericName[pt_BR]=Navegador Web
+GenericName[ro]=Navigator Internet
+GenericName[ru]=Веб-браузер
+GenericName[sk]=WWW prehliadač
+GenericName[sl]=Spletni brskalnik
+GenericName[sq]=Shfletuesi Web
+GenericName[sr]=Веб читач
+GenericName[sr@Latn]=Veb čitač
+GenericName[sv]=Webbläsare
+GenericName[ta]=வலை உலாவி
+GenericName[th]=เว็บบราวเซอร์
+GenericName[tk]=Web Ahtarçysy
+GenericName[tr]=Web Tarayıcı
+GenericName[uk]=Переглядач web-сторінок
+GenericName[vi]=Trình duyệt Web
+GenericName[wa]=Betchteu waibe
+GenericName[zh_CN]=Web 浏览器
+GenericName[zh_TW]=網頁瀏覽器
+Comment=Browse the web
+Comment[ar]=تصفح الانترنت
+Comment[az]=Vebi gəzin
+Comment[be]=Вандраваць па павуціньню
+Comment[bg]=Сърфиране в интернет
+Comment[bn]=ওয়েব ব্রাউজ করুন
+Comment[bs]=Pregledaj na internetu
+Comment[ca]=Navegueu per la web
+Comment[cs]=Prohlížet WWW
+Comment[cy]=Pori'r we
+Comment[da]=Surf på internettet
+Comment[de]=Im Web surfen
+Comment[el]=Περιήγηση στον παγκόσμιο ιστό
+Comment[en_CA]=Browse the web
+Comment[en_GB]=Browse the web
+Comment[es]=Navegar por la web
+Comment[et]=Sirvi veebi
+Comment[eu]=Arakatu web-a
+Comment[fi]=Selaa WWW:tä
+Comment[fr]=Naviguer sur Internet
+Comment[ga]=Brabhsáil an Líon
+Comment[gu]=વેબમાં શોધો
+Comment[he]=גלוש ברשת
+Comment[hi]=वेब ब्राउज़ करें
+Comment[hr]=Pregledaj Web
+Comment[hu]=A világháló böngészése
+Comment[id]=Jelajah web
+Comment[it]=Esplora il web
+Comment[ja]=ウェブを閲覧します
+Comment[ko]=웹을 돌아 다닙니다
+Comment[li]=Blajere op internet
+Comment[lt]=Naršyti internete
+Comment[mk]=Прелистувајте на веб
+Comment[ml]=വലക്കെട്ട് തിരയുക
+Comment[mn]=Веб броузе хийх
+Comment[ms]=Layari web
+Comment[nb]=Surf på nettet
+Comment[nl]=Websurfen
+Comment[nn]=Surf på nettet
+Comment[no]=Surf på nettet
+Comment[pa]=ਵੈਬ ਬਰਾਊਜ਼
+Comment[pl]=Przeglądanie stron WWW
+Comment[pt]=Navegar na web
+Comment[pt_BR]=Navegar na web
+Comment[ro]=Navigare Internet
+Comment[ru]=Веб-браузер
+Comment[sk]=Prehliadať internet
+Comment[sl]=Brskaj po spletu
+Comment[sq]=Eksploro web-in
+Comment[sr]=Прегледај веб
+Comment[sr@Latn]=Pregledaj veb
+Comment[sv]=Surfa på nätet
+Comment[ta]=வலையில் உலாவு
+Comment[th]=ใช้งานเว็บบราวเซอร์ @MOZILLA_NAME@
+Comment[tk]=Webi Ahtar
+Comment[tr]=Web'e Gözat
+Comment[uk]=Програма перегляду web-сторінок
+Comment[vi]=Duyệt web
+Comment[wa]=Naivyî avå les waibes
+Comment[zh_CN]=浏览 Web
+Comment[zh_TW]=瀏覽網頁
+Exec=@MOZILLA@ %u
+Icon=@FIREFOX_ICON@
+StartupNotify=false
+Terminal=false
+Type=Application
+Categories=Application;Network;
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
diff --git a/www/firefox/options.mk b/www/firefox/options.mk
new file mode 100644
index 00000000000..38e639047e0
--- /dev/null
+++ b/www/firefox/options.mk
@@ -0,0 +1,36 @@
+# $NetBSD: options.mk,v 1.1.1.1 2009/08/05 02:37:10 tnn Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.firefox
+PKG_SUPPORTED_OPTIONS= debug official-mozilla-branding mozilla-jemalloc
+
+PLIST_VARS+= jemalloc branding
+
+.include "../../mk/bsd.options.mk"
+
+.if ${OPSYS} == "Linux" || ${OPSYS} == "SunOS"
+PKG_SUGGESTED_OPTIONS+= mozilla-jemalloc
+.endif
+
+.if !empty(PKG_OPTIONS:Mmozilla-jemalloc)
+CONFIGURE_ARGS+= --enable-jemalloc
+. if ${OPSYS} == "SunOS"
+PLIST.jemalloc= yes
+. endif
+.else
+CONFIGURE_ARGS+= --disable-jemalloc
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+= --enable-debug
+.else
+CONFIGURE_ARGS+= --disable-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mofficial-mozilla-branding)
+CONFIGURE_ARGS+= --enable-official-branding
+PLIST.branding= yes
+LICENSE= mozilla-trademark-license
+RESTRICTED= Trademark holder prohibits distribution of modified versions.
+NO_BIN_ON_CDROM= ${RESTRICTED}
+NO_BIN_ON_FTP= ${RESTRICTED}
+.endif
diff --git a/www/firefox/patches/patch-ar b/www/firefox/patches/patch-ar
new file mode 100644
index 00000000000..e4f0069de00
--- /dev/null
+++ b/www/firefox/patches/patch-ar
@@ -0,0 +1,39 @@
+$NetBSD: patch-ar,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Enable the sunaudio module to build on NetBSD.
+
+--- media/libsydneyaudio/src/sydney_audio_sunaudio.c.orig 2009-06-29 18:15:03.000000000 +0200
++++ media/libsydneyaudio/src/sydney_audio_sunaudio.c
+@@ -38,9 +38,14 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#if defined(__NetBSD__)
++#include <sys/ioctl.h>
++#include <sys/audioio.h>
++#else
+ #include <stropts.h>
+ #include <sys/audio.h>
+ #include <sys/mixer.h>
++#endif
+ #include <errno.h>
+ #include <stdio.h>
+ #include <pthread.h>
+@@ -197,7 +202,7 @@ sa_stream_open(sa_stream_t *s)
+ s->default_rate = audio_info.play.sample_rate;
+ s->default_precision = audio_info.play.precision;
+
+- AUDIO_INITINFO(&audio_info)
++ AUDIO_INITINFO(&audio_info);
+
+ audio_info.play.sample_rate = s->rate;
+ audio_info.play.channels = s->n_channels;
+@@ -210,7 +215,7 @@ sa_stream_open(sa_stream_t *s)
+ if (err== -1)
+ return SA_ERROR_NOT_SUPPORTED;
+
+- AUDIO_INITINFO(&audio_info)
++ AUDIO_INITINFO(&audio_info);
+ err=ioctl(fd,AUDIO_GETINFO,&audio_info);
+ if (err== -1)
+ {
diff --git a/www/firefox/patches/patch-as b/www/firefox/patches/patch-as
new file mode 100644
index 00000000000..aaa6c6e1890
--- /dev/null
+++ b/www/firefox/patches/patch-as
@@ -0,0 +1,33 @@
+$NetBSD: patch-as,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Treat DragonFly like FreeBSD.
+
+--- js/src/configure.in.orig 2009-06-29 18:14:51.000000000 +0200
++++ js/src/configure.in
+@@ -1693,7 +1693,7 @@ case "$target" in
+ fi
+ ;;
+
+-*-freebsd*)
++*-freebsd*|*-dragonfly*)
+ if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
+ DLL_SUFFIX=".so.1.0"
+ DSO_LDOPTS="-shared"
+@@ -2504,7 +2504,7 @@ darwin*)
+ solaris*)
+ AC_DEFINE(AVMPLUS_UNIX)
+ ;;
+-freebsd*|kfreebsd*)
++freebsd*|kfreebsd*|netbsd*|dragonfly*)
+ AC_DEFINE(AVMPLUS_UNIX)
+ ;;
+ *cygwin*|*mingw*|*mks*|*msvc*|*wince)
+@@ -4185,7 +4185,7 @@ if test "$MOZ_MEMORY"; then
+ darwin*)
+ AC_DEFINE(MOZ_MEMORY_DARWIN)
+ ;;
+- *freebsd*)
++ *freebsd*|dragonfly*)
+ AC_DEFINE(MOZ_MEMORY_BSD)
+ ;;
+ *linux*)
diff --git a/www/firefox/patches/patch-au b/www/firefox/patches/patch-au
new file mode 100644
index 00000000000..8bd9fc68545
--- /dev/null
+++ b/www/firefox/patches/patch-au
@@ -0,0 +1,26 @@
+$NetBSD: patch-au,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+SOUND_VERSION just isn't a reliable way to detect features supported by
+particular OSS implementation.
+
+--- media/libsydneyaudio/src/sydney_audio_oss.c.orig 2009-06-29 18:15:03.000000000 +0200
++++ media/libsydneyaudio/src/sydney_audio_oss.c
+@@ -51,9 +51,9 @@
+ // support only versions newer than 3.6.1
+ #define SUPP_OSS_VERSION OSS_VERSION(3,6,1)
+
+-#if (SOUND_VERSION < SUPP_OSS_VERSION)
+-#error Unsupported OSS Version
+-#else
++//#if (SOUND_VERSION < SUPP_OSS_VERSION)
++//#error Unsupported OSS Version
++//#else
+
+ typedef struct sa_buf sa_buf;
+ struct sa_buf {
+@@ -716,4 +716,4 @@ UNSUPPORTED(int sa_stream_drain(sa_strea
+
+ const char *sa_strerror(int code) { return NULL; }
+
+-#endif
++//#endif
diff --git a/www/firefox/patches/patch-av b/www/firefox/patches/patch-av
new file mode 100644
index 00000000000..cc7488460d0
--- /dev/null
+++ b/www/firefox/patches/patch-av
@@ -0,0 +1,40 @@
+$NetBSD: patch-av,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+--- browser/app/nsBrowserApp.cpp.orig 2009-06-29 18:14:40.000000000 +0200
++++ browser/app/nsBrowserApp.cpp
+@@ -44,6 +44,27 @@
+
+ #include <stdio.h>
+ #include <stdarg.h>
++#include <sys/resource.h>
++/*
++ * On netbsd-4, ulimit -n is 64 by default; too few for us.
++ */
++static void netbsd_fixrlimit(void) {
++ struct rlimit rlp;
++ if (getrlimit(RLIMIT_NOFILE, &rlp) == -1) {
++ fprintf(stderr, "warning: getrlimit failed\n");
++ return;
++ }
++ if (rlp.rlim_cur >= 512)
++ return;
++ if (rlp.rlim_max < 512) {
++ fprintf(stderr, "warning: hard limit of 'ulimit -n' too low\n");
++ rlp.rlim_cur = rlp.rlim_max;
++ }
++ else
++ rlp.rlim_cur = 512;
++ if (setrlimit(RLIMIT_NOFILE, &rlp) == -1)
++ fprintf(stderr, "warning: setrlimit failed\n");
++}
+
+ #include "plstr.h"
+ #include "prprf.h"
+@@ -106,6 +127,7 @@ public:
+
+ int main(int argc, char* argv[])
+ {
++ netbsd_fixrlimit();
+ ScopedLogging log;
+
+ nsCOMPtr<nsILocalFile> appini;
diff --git a/www/firefox/patches/patch-ma b/www/firefox/patches/patch-ma
new file mode 100644
index 00000000000..c5b7cea6754
--- /dev/null
+++ b/www/firefox/patches/patch-ma
@@ -0,0 +1,23 @@
+$NetBSD: patch-ma,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+--- config/autoconf.mk.in.orig 2009-06-29 18:14:41.000000000 +0200
++++ config/autoconf.mk.in
+@@ -57,14 +57,14 @@ MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+-includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
++includedir = @includedir@/$(MOZILLA_PKG_NAME)
+ libdir = @libdir@
+ datadir = @datadir@
+ mandir = @mandir@
+-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
++idldir = @datadir@/idl/$(MOZILLA_PKG_NAME)
+
+-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
++installdir = $(libdir)/$(MOZILLA_PKG_NAME)
++sdkdir = $(libdir)/$(MOZILLA_PKG_NAME)-sdk
+
+ DIST = $(DEPTH)/dist
+ LIBXUL_SDK = @LIBXUL_SDK@
diff --git a/www/firefox/patches/patch-mb b/www/firefox/patches/patch-mb
new file mode 100644
index 00000000000..41ffa4e8714
--- /dev/null
+++ b/www/firefox/patches/patch-mb
@@ -0,0 +1,72 @@
+$NetBSD: patch-mb,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2009-06-29 18:15:32.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -64,14 +64,21 @@ include $(topsrcdir)/config/config.mk
+ #
+ # Lots of Unixish x86 flavors
+ #
+-ifneq (,$(filter FreeBSD NetBSD OpenBSD BSD_OS Darwin,$(OS_ARCH)))
++ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD BSD_OS Darwin,$(OS_ARCH)))
++ifeq (x86_64,$(OS_TEST))
++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp
++else
+ ifeq (86,$(findstring 86,$(OS_TEST)))
+ CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp
++endif
++ifeq (amd64,$(OS_TEST))
++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp
++endif
++endif
+ ifeq (Darwin,$(OS_ARCH))
+ DEFINES += -DKEEP_STACK_16_BYTE_ALIGNED
+ endif
+ endif
+-endif
+ #
+ # New code for Linux, et. al., with gcc
+ # Migrate other platforms here after testing
+@@ -185,7 +192,7 @@ endif
+ # NetBSD/ARM
+ #
+ ifeq ($(OS_ARCH),NetBSD)
+-ifneq (,$(filter arm% sa110,$(OS_TEST)))
++ifneq (,$(filter arm%,$(TARGET_CPU)))
+ CPPSRCS := xptcinvoke_arm_netbsd.cpp xptcstubs_arm_netbsd.cpp
+ endif
+ endif
+@@ -240,7 +247,7 @@ endif
+ # NetBSD/m68k
+ #
+ ifeq ($(OS_ARCH),NetBSD)
+-ifneq (,$(filter amiga atari hp300 mac68k mvme68k next68k sun3 sun3x x68k,$(OS_TEST)))
++ifneq (,$(filter m68k,$(TARGET_CPU)))
+ CPPSRCS := xptcinvoke_netbsd_m68k.cpp xptcstubs_netbsd_m68k.cpp
+ endif
+ endif
+@@ -325,9 +332,10 @@ endif
+ #
+ # NetBSD/PPC
+ #
+-ifneq (,$(filter NetBSDmacppc NetBSDbebox NetBSDofppc NetBSDprep NetBSDamigappc,$(OS_ARCH)$(OS_TEST)))
++ifeq ($(OS_ARCH)$(OS_TEST),NetBSDpowerpc)
+ CPPSRCS := xptcinvoke_ppc_netbsd.cpp xptcstubs_ppc_netbsd.cpp
+ ASFILES := xptcinvoke_asm_ppc_netbsd.s xptcstubs_asm_ppc_netbsd.s
++AS := $(CC) -c -x assembler-with-cpp
+ endif
+
+ #
+@@ -399,6 +407,13 @@ CPPSRCS := xptcinvoke_sparc64_openbsd.c
+ 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_netbsd.cpp
++ASFILES := xptcinvoke_asm_sparc64_netbsd.s xptcstubs_asm_sparc64_netbsd.s
++endif
++#
+ # Solaris/SPARC
+ #
+ ifeq ($(OS_ARCH),SunOS)
diff --git a/www/firefox/patches/patch-md b/www/firefox/patches/patch-md
new file mode 100644
index 00000000000..14c5c35a72a
--- /dev/null
+++ b/www/firefox/patches/patch-md
@@ -0,0 +1,17 @@
+$NetBSD: patch-md,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+???. from www/firefox/patch-ax.
+
+--- security/coreconf/SunOS5.mk.orig 2009-06-29 18:15:11.000000000 +0200
++++ security/coreconf/SunOS5.mk
+@@ -156,6 +156,10 @@ endif
+ endif
+ DSO_LDOPTS += -z combreloc -z defs -z ignore
+
++ifdef LIBRUNPATH
++DSO_LDOPTS += -R$(LIBRUNPATH)
++endif
++
+ # -KPIC generates position independent code for use in shared libraries.
+ # (Similarly for -fPIC in case of gcc.)
+ ifdef NS_USE_GCC
diff --git a/www/firefox/patches/patch-me b/www/firefox/patches/patch-me
new file mode 100644
index 00000000000..284a8eeebc4
--- /dev/null
+++ b/www/firefox/patches/patch-me
@@ -0,0 +1,15 @@
+$NetBSD: patch-me,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Add DragonFly support.
+
+--- security/nss/lib/freebl/Makefile.orig 2009-06-29 18:15:13.000000000 +0200
++++ security/nss/lib/freebl/Makefile
+@@ -212,7 +212,7 @@ endif
+ # to bind the blapi function references in FREEBLVector vector
+ # (ldvector.c) to the blapi functions defined in the freebl
+ # shared libraries.
+-ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
++ifeq (,$(filter-out BSD_OS DragonFly FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
+ MKSHLIB += -Wl,-Bsymbolic
+ endif
+
diff --git a/www/firefox/patches/patch-mf b/www/firefox/patches/patch-mf
new file mode 100644
index 00000000000..c752b6dcaab
--- /dev/null
+++ b/www/firefox/patches/patch-mf
@@ -0,0 +1,21 @@
+$NetBSD: patch-mf,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Add DragonFly support.
+Make sure nss libraries have a run path defined.
+
+--- security/coreconf/config.mk.orig 2009-07-30 17:30:28.000000000 +0200
++++ security/coreconf/config.mk
+@@ -63,7 +63,7 @@ endif
+ #######################################################################
+
+ TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
+- OpenVMS AIX RISCOS WINNT WIN95 WINCE
++ OpenVMS AIX RISCOS DragonFly WINNT WIN95 WINCE
+
+ ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
+ include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
+@@ -207,3 +207,4 @@ endif
+ DEFINES += -DUSE_UTIL_DIRECTLY
+ USE_UTIL_DIRECTLY = 1
+
++EXTRA_SHARED_LIBS += -Wl,-R${PREFIX}/lib/${MOZILLA_PKG_NAME}
diff --git a/www/firefox/patches/patch-mg b/www/firefox/patches/patch-mg
new file mode 100644
index 00000000000..f6a38b96787
--- /dev/null
+++ b/www/firefox/patches/patch-mg
@@ -0,0 +1,90 @@
+$NetBSD: patch-mg,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Add DragonFly support.
+
+--- security/coreconf/DragonFly.mk.orig 2009-06-30 22:20:24.000000000 +0200
++++ security/coreconf/DragonFly.mk
+@@ -0,0 +1,83 @@
++#
++# The contents of this file are subject to the Mozilla 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/MPL/
++#
++# 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 the Netscape security libraries.
++#
++# The Initial Developer of the Original Code is Netscape
++# Communications Corporation. Portions created by Netscape are
++# Copyright (C) 1994-2000 Netscape Communications Corporation. All
++# Rights Reserved.
++#
++# Contributor(s):
++#
++# Alternatively, the contents of this file may be used under the
++# terms of the GNU General Public License Version 2 or later (the
++# "GPL"), in which case the provisions of the GPL are applicable
++# instead of those above. If you wish to allow use of your
++# version of this file only under the terms of the GPL and not to
++# allow others to use your version of this file under the MPL,
++# indicate your decision by deleting the provisions above and
++# replace them with the notice and other provisions required by
++# the GPL. If you do not delete the provisions above, a recipient
++# may use your version of this file under either the MPL or the
++# GPL.
++#
++# Config stuff for DragonFly
++#
++
++include $(CORE_DEPTH)/coreconf/UNIX.mk
++
++DEFAULT_COMPILER = gcc
++CC = gcc
++CCC = g++
++RANLIB = ranlib
++
++ifeq ($(OS_TEST),alpha)
++CPU_ARCH = alpha
++else
++CPU_ARCH = x86
++endif
++
++OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
++
++DSO_CFLAGS = -fPIC
++DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
++
++#
++# The default implementation strategy for FreeBSD is pthreads.
++#
++ifndef CLASSIC_NSPR
++USE_PTHREADS = 1
++DEFINES += -D_THREAD_SAFE -D_REENTRANT
++OS_LIBS += -pthread
++DSO_LDOPTS += -pthread
++endif
++
++ARCH = freebsd
++
++MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
++
++DLL_SUFFIX = so
++
++ifdef LIBRUNPATH
++DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
++endif
++
++MKSHLIB = $(CC) $(DSO_LDOPTS)
++ifdef MAPFILE
++# Add LD options to restrict exported symbols to those in the map file
++endif
++# Change PROCESS to put the mapfile in the correct format for this platform
++PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
++
++G++INCLUDES = -I/usr/include/g++
++
++INCLUDES += -I/usr/X11R6/include
diff --git a/www/firefox/patches/patch-mi b/www/firefox/patches/patch-mi
new file mode 100644
index 00000000000..72e98fcde73
--- /dev/null
+++ b/www/firefox/patches/patch-mi
@@ -0,0 +1,15 @@
+$NetBSD: patch-mi,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Add DragonFly support.
+
+--- config/config.mk.orig 2009-06-29 18:14:41.000000000 +0200
++++ config/config.mk
+@@ -133,7 +133,7 @@ endif
+ # but save the version to allow multiple versions of the same base
+ # platform to be built in the same tree.
+ #
+-ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
++ifneq (,$(filter DragonFly FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
+ OS_RELEASE := $(basename $(OS_RELEASE))
+
+ # Allow the user to ignore the OS_VERSION, which is usually irrelevant.
diff --git a/www/firefox/patches/patch-mj b/www/firefox/patches/patch-mj
new file mode 100644
index 00000000000..581e7bc5be1
--- /dev/null
+++ b/www/firefox/patches/patch-mj
@@ -0,0 +1,15 @@
+$NetBSD: patch-mj,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Add DragonFly support.
+
+--- security/coreconf/arch.mk.orig 2009-06-29 18:15:11.000000000 +0200
++++ security/coreconf/arch.mk
+@@ -146,7 +146,7 @@ endif
+ # IRIX 6.5-ALPHA-1289139620.
+ #
+
+-ifeq (,$(filter-out Linux FreeBSD IRIX,$(OS_ARCH)))
++ifeq (,$(filter-out Linux DragonFly FreeBSD IRIX,$(OS_ARCH)))
+ OS_RELEASE := $(shell echo $(OS_RELEASE) | sed 's/-.*//')
+ endif
+
diff --git a/www/firefox/patches/patch-mk b/www/firefox/patches/patch-mk
new file mode 100644
index 00000000000..4a0e99235df
--- /dev/null
+++ b/www/firefox/patches/patch-mk
@@ -0,0 +1,19 @@
+$NetBSD: patch-mk,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Treat DragonFly like FreeBSD.
+
+--- config/rules.mk.orig 2009-06-29 18:14:41.000000000 +0200
++++ config/rules.mk
+@@ -592,6 +592,12 @@ EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
+ endif
+ endif
+
++ifeq ($(OS_ARCH),DragonFly)
++ifdef IS_COMPONENT
++EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
++endif
++endif
++
+ ifeq ($(OS_ARCH),NetBSD)
+ ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips,$(OS_TEST)))
+ ifeq ($(MODULE),layout)
diff --git a/www/firefox/patches/patch-ml b/www/firefox/patches/patch-ml
new file mode 100644
index 00000000000..66e12450a34
--- /dev/null
+++ b/www/firefox/patches/patch-ml
@@ -0,0 +1,16 @@
+$NetBSD: patch-ml,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Treat DragonFly like FreeBSD.
+
+--- js/src/Makefile.in.orig 2009-06-29 18:14:51.000000000 +0200
++++ js/src/Makefile.in
+@@ -429,6 +429,9 @@ endif # WINNT
+ ifeq ($(OS_ARCH),FreeBSD)
+ EXTRA_LIBS += -pthread
+ endif
++ifeq ($(OS_ARCH),DragonFly)
++EXTRA_LIBS += -pthread
++endif
+ ifeq ($(OS_ARCH),IRIX)
+ ifdef USE_N32
+ DASH_R += -n32
diff --git a/www/firefox/patches/patch-mm b/www/firefox/patches/patch-mm
new file mode 100644
index 00000000000..52240105496
--- /dev/null
+++ b/www/firefox/patches/patch-mm
@@ -0,0 +1,19 @@
+$NetBSD: patch-mm,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Don't link with -lCstd on Solaris when using GCC. From Tim Zingelman.
+part of PR pkg/39085
+
+--- toolkit/library/Makefile.in.orig 2009-06-29 18:15:25.000000000 +0200
++++ toolkit/library/Makefile.in
+@@ -252,7 +252,10 @@ EXTRA_DSO_LDOPTS += -lbe -ltracker
+ endif
+
+ ifeq ($(OS_ARCH),SunOS)
+-EXTRA_DSO_LDOPTS += -lelf -ldemangle -lCstd
++EXTRA_DSO_LDOPTS += -lelf -ldemangle
++ifndef GNU_CC
++EXTRA_DSO_LDOPTS += -lCstd
++endif
+ endif
+
+ ifeq ($(OS_ARCH),WINNT)
diff --git a/www/firefox/patches/patch-mn b/www/firefox/patches/patch-mn
new file mode 100644
index 00000000000..fa735ff4658
--- /dev/null
+++ b/www/firefox/patches/patch-mn
@@ -0,0 +1,15 @@
+$NetBSD: patch-mn,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Make sure we link correctly with sqlite3 from pkgsrc.
+
+--- security/nss/lib/softoken/config.mk.orig 2009-06-29 18:15:14.000000000 +0200
++++ security/nss/lib/softoken/config.mk
+@@ -86,7 +86,7 @@ else
+ EXTRA_SHARED_LIBS += \
+ -L$(DIST)/lib \
+ -lnssutil3 \
+- -lsqlite3 \
++ `pkg-config --libs sqlite3` \
+ -L$(NSPR_LIB_DIR) \
+ -lplc4 \
+ -lplds4 \
diff --git a/www/firefox/patches/patch-mp b/www/firefox/patches/patch-mp
new file mode 100644
index 00000000000..eda0f228920
--- /dev/null
+++ b/www/firefox/patches/patch-mp
@@ -0,0 +1,26 @@
+$NetBSD: patch-mp,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+Use Sun audio on NetBSD and OSS on DragonFlyBSD.
+
+--- media/libsydneyaudio/src/Makefile.in.orig 2009-06-29 18:15:03.000000000 +0200
++++ media/libsydneyaudio/src/Makefile.in
+@@ -65,12 +65,18 @@ CSRCS = \
+ OS_LIBS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
+ endif
+
+-ifeq ($(OS_ARCH),SunOS)
++ifneq (,$(filter SunOS NetBSD,$(OS_ARCH)))
+ CSRCS = \
+ sydney_audio_sunaudio.c \
+ $(NULL)
+ endif
+
++ifeq ($(OS_ARCH),DragonFly)
++CSRCS = \
++ sydney_audio_oss.c \
++ $(NULL)
++endif
++
+ ifeq ($(OS_ARCH),WINNT)
+ OS_LIBS += winmm.lib
+ endif
diff --git a/www/firefox/patches/patch-xa b/www/firefox/patches/patch-xa
new file mode 100644
index 00000000000..dd4499c40df
--- /dev/null
+++ b/www/firefox/patches/patch-xa
@@ -0,0 +1,119 @@
+$NetBSD: patch-xa,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_netbsd.s.orig 2009-07-09 10:12:51.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_netbsd.s
+@@ -0,0 +1,112 @@
++/* -*- 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 */
++ .global NS_InvokeByIndex_P
++ .type NS_InvokeByIndex_P, #function
++/*
++ NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount, nsXPTCVariant* params);
++
++*/
++/*
++ * Note: To simplify stack handling we allocate an extra stack
++ * frame here. In principle invoke_copy_to_stack() could
++ * save the parameters our caller's frame and we could
++ * reclaim the stackframe and do a tail call to the
++ * function. However, this gets complicated....
++ *
++ * The vtable consist of be:
++ *
++ * struct {
++ * short __delta;
++ * short __index;
++ * union {
++ * P __pfn;
++ * short __delta2;
++ * } __pfn_or_delta2;
++ * };
++ *
++ * See gcc/cp/cp-tree.h
++ */
++
++NS_InvokeByIndex_P:
++ save %sp,-(128 + 64),%sp ! room for the register window and
++ ! struct pointer, rounded up to 0 % 64
++ sll %i2,4,%l0 ! assume the worst case
++ ! paramCount * 2 * 8 bytes
++ cmp %l0, 0 ! are there any args? If not,
++ be .invoke ! no need to copy args to stack
++ nop
++
++ sub %sp,%l0,%sp ! create the additional stack space
++ add %sp,0x7ff+136,%o0 ! step past the register window, the
++ ! struct result pointer and the 'this' slot
++ mov %i2,%o1 ! paramCount
++ call invoke_copy_to_stack
++ mov %i3,%o2 ! params
++
++!
++! load arguments from stack into the outgoing registers
++! BIAS is 0x7ff (2047)
++!
++
++! load the %o1..5 64bit (extended word) output registers registers
++ ldx [%sp + 0x7ff + 136],%o1 ! %i1
++ ldx [%sp + 0x7ff + 144],%o2 ! %i2
++ ldx [%sp + 0x7ff + 152],%o3 ! %i3
++ ldx [%sp + 0x7ff + 160],%o4 ! %i4
++ ldx [%sp + 0x7ff + 168],%o5 ! %i5
++
++! load the even number double registers starting with %f2
++ ldd [%sp + 0x7ff + 136],%f2
++ ldd [%sp + 0x7ff + 144],%f4
++ ldd [%sp + 0x7ff + 152],%f6
++ ldd [%sp + 0x7ff + 160],%f8
++ ldd [%sp + 0x7ff + 168],%f10
++ ldd [%sp + 0x7ff + 176],%f12
++ ldd [%sp + 0x7ff + 184],%f14
++ ldd [%sp + 0x7ff + 192],%f16
++ ldd [%sp + 0x7ff + 200],%f18
++ ldd [%sp + 0x7ff + 208],%f20
++ ldd [%sp + 0x7ff + 216],%f22
++ ldd [%sp + 0x7ff + 224],%f24
++ ldd [%sp + 0x7ff + 232],%f26
++ ldd [%sp + 0x7ff + 240],%f28
++ ldd [%sp + 0x7ff + 248],%f30
++
++!
++! calculate the target address from the vtable
++!
++.invoke:
++ sll %i1,3,%l0 ! index *= 8
++ ldx [%i0],%l1 ! *this --> address of vtable
++ ldx [%l0 + %l1],%l0 ! this->vtable[index] --> address
++
++ jmpl %l0,%o7 ! call the routine
++ mov %i0,%o0 ! move 'this' pointer to out register
++
++ mov %o0,%i0 ! propagate return value
++ ret
++ restore
++
++ .size NS_InvokeByIndex_P, .-NS_InvokeByIndex_P
diff --git a/www/firefox/patches/patch-xb b/www/firefox/patches/patch-xb
new file mode 100644
index 00000000000..05fadc14980
--- /dev/null
+++ b/www/firefox/patches/patch-xb
@@ -0,0 +1,91 @@
+$NetBSD: patch-xb,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_netbsd.cpp.orig 2009-07-09 10:12:51.000000000 +0200
++++ xpcom/reflect/xptcall/src/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/www/firefox/patches/patch-xc b/www/firefox/patches/patch-xc
new file mode 100644
index 00000000000..d791a50abec
--- /dev/null
+++ b/www/firefox/patches/patch-xc
@@ -0,0 +1,73 @@
+$NetBSD: patch-xc,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_netbsd.s.orig 2009-07-09 10:12:51.000000000 +0200
++++ xpcom/reflect/xptcall/src/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
diff --git a/www/firefox/patches/patch-xd b/www/firefox/patches/patch-xd
new file mode 100644
index 00000000000..81956ca8bab
--- /dev/null
+++ b/www/firefox/patches/patch-xd
@@ -0,0 +1,126 @@
+$NetBSD: patch-xd,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_netbsd.cpp.orig 2009-07-09 10:12:51.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_netbsd.cpp
+@@ -0,0 +1,119 @@
++/* -*- 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):
++ */
++
++/* Implement shared vtbl methods. */
++
++#include "xptcprivate.h"
++#include "xptiprivate.h"
++
++#if defined(sparc) || defined(__sparc__)
++
++extern "C" nsresult
++PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args)
++{
++
++#define PARAM_BUFFER_COUNT 16
++
++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
++ nsXPTCMiniVariant* dispatchParams = NULL;
++ const nsXPTMethodInfo* info;
++ PRUint8 paramCount;
++ PRUint8 i;
++ nsresult result = NS_ERROR_FAILURE;
++
++ NS_ASSERTION(self,"no self");
++
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
++ NS_ASSERTION(info,"no interface info");
++
++ paramCount = info->GetParamCount();
++
++ // setup variant array pointer
++ if(paramCount > PARAM_BUFFER_COUNT)
++ dispatchParams = new nsXPTCMiniVariant[paramCount];
++ else
++ dispatchParams = paramBuffer;
++ NS_ASSERTION(dispatchParams,"no place for params");
++ if (!dispatchParams)
++ return NS_ERROR_OUT_OF_MEMORY;
++
++ PRUint64* ap = args;
++ for(i = 0; i < paramCount; i++, ap++)
++ {
++ const nsXPTParamInfo& param = info->GetParam(i);
++ const nsXPTType& type = param.GetType();
++ nsXPTCMiniVariant* dp = &dispatchParams[i];
++
++ if(param.IsOut() || !type.IsArithmetic())
++ {
++ dp->val.p = (void*) *ap;
++ continue;
++ }
++ // else
++ switch(type)
++ {
++ case nsXPTType::T_BOOL : dp->val.b = *((PRInt64*) ap); break;
++ case nsXPTType::T_CHAR : dp->val.c = *((PRUint64*) ap); break;
++ case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt64*) ap); break;
++ case nsXPTType::T_I8 : dp->val.i8 = *((PRInt64*) ap); break;
++ case nsXPTType::T_I16 : dp->val.i16 = *((PRInt64*) ap); break;
++ case nsXPTType::T_I32 : dp->val.i32 = *((PRInt64*) ap); break;
++ case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break;
++ case nsXPTType::T_U8 : dp->val.u8 = *((PRUint64*) ap); break;
++ case nsXPTType::T_U16 : dp->val.u16 = *((PRUint64*)ap); break;
++ case nsXPTType::T_U32 : dp->val.u32 = *((PRUint64*)ap); break;
++ case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break;
++ case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break;
++ case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break;
++ default:
++ NS_ASSERTION(0, "bad type");
++ break;
++ }
++ }
++
++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
++
++ if(dispatchParams != paramBuffer)
++ delete [] dispatchParams;
++
++ return result;
++}
++
++extern "C" int SharedStub(int, int*);
++
++#define STUB_ENTRY(n) \
++nsresult nsXPTCStubBase::Stub##n() \
++{ \
++ int dummy; /* defeat tail-call optimization */ \
++ return SharedStub(n, &dummy); \
++}
++
++#define SENTINEL_ENTRY(n) \
++nsresult nsXPTCStubBase::Sentinel##n() \
++{ \
++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
++ return NS_ERROR_NOT_IMPLEMENTED; \
++}
++
++#include "xptcstubsdef.inc"
++
++#endif /* sparc || __sparc__ */
diff --git a/www/firefox/patches/patch-xe b/www/firefox/patches/patch-xe
new file mode 100644
index 00000000000..fd6783a010a
--- /dev/null
+++ b/www/firefox/patches/patch-xe
@@ -0,0 +1,77 @@
+$NetBSD: patch-xe,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/m68k xptcall support code. From pkgsrc/www/firefox/patch-ad.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp
+@@ -132,6 +132,15 @@ extern "C" {
+ }
+ }
+
++/*
++ * SYMBOL PREFIX must be "_" for aout symbols and "" for ELF
++ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
++
+ XPTC_PUBLIC_API(nsresult)
+ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
+ PRUint32 paramCount, nsXPTCVariant* params)
+@@ -139,30 +148,30 @@ XPTC_InvokeByIndex(nsISupports* that, PR
+ PRUint32 result;
+
+ __asm__ __volatile__(
+- "movl %4, sp@-\n\t"
+- "movl %3, sp@-\n\t"
+- "jbsr _invoke_count_words\n\t" /* count words */
+- "addql #8, sp\n\t"
+- "lsll #2, d0\n\t" /* *= 4 */
+- "movl sp, a2\n\t" /* save original sp */
+- "subl d0, sp\n\t" /* make room for params */
+- "movl sp, a0\n\t"
+- "movl %4, sp@-\n\t"
+- "movl %3, sp@-\n\t"
+- "movl a0, sp@-\n\t"
+- "jbsr _invoke_copy_to_stack\n\t" /* copy params */
+- "addl #12, sp\n\t"
+- "movl %1, a0\n\t"
+- "movl a0@, a1\n\t"
+- "movl %2, d0\n\t" /* function index */
+- "movl a0, d1\n\t"
+- "movw a1@(8,d0:l:8), a0\n\t"
+- "addl a0, d1\n\t"
+- "movl a1@(12,d0:l:8), a1\n\t"
+- "movl d1, sp@-\n\t"
+- "jbsr a1@\n\t"
+- "movl a2, sp\n\t" /* restore original sp */
+- "movl d0, %0\n\t"
++ "movl %4, %%sp@-\n\t"
++ "movl %3, %%sp@-\n\t"
++ "jbsr "SYMBOLPREFIX"invoke_count_words\n\t" /* count words */
++ "addql #8, %%sp\n\t"
++ "lsll #2, %%d0\n\t" /* *= 4 */
++ "movl %%sp, %%a2\n\t" /* save original sp */
++ "subl %%d0, %%sp\n\t" /* make room for params */
++ "movl %%sp, %%a0\n\t"
++ "movl %4, %%sp@-\n\t"
++ "movl %3, %%sp@-\n\t"
++ "movl %%a0, %%sp@-\n\t"
++ "jbsr "SYMBOLPREFIX"invoke_copy_to_stack\n\t" /* copy params */
++ "addl #12, %%sp\n\t"
++ "movl %1, %%a0\n\t"
++ "movl %%a0@, %%a1\n\t"
++ "movl %2, %%d0\n\t" /* function index */
++ "movl %%a0, %%d1\n\t"
++ "movw %%a1@(8,%%d0:l:8), %%a0\n\t"
++ "addl %%a0, %%d1\n\t"
++ "movl %%a1@(12,%%d0:l:8), %%a1\n\t"
++ "movl %%d1, %%sp@-\n\t"
++ "jbsr %%a1@\n\t"
++ "movl %%a2, %%sp\n\t" /* restore original sp */
++ "movl %%d0, %0\n\t"
+ : "=g" (result) /* %0 */
+ : "g" (that), /* %1 */
+ "g" (methodIndex), /* %2 */
diff --git a/www/firefox/patches/patch-xf b/www/firefox/patches/patch-xf
new file mode 100644
index 00000000000..10851289f15
--- /dev/null
+++ b/www/firefox/patches/patch-xf
@@ -0,0 +1,43 @@
+$NetBSD: patch-xf,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/amd64 xptcall support code. From pkgsrc/www/firefox/patch-ae.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
+@@ -123,17 +123,27 @@ extern "C" {
+ }
+ }
+
++/*
++ * Beware: use % instead of %% for register identifiers in a preprocessor macro
++ * SYMBOL PREFIX must be "_" for aout and "" for ELF
++ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
++
+ #define STUB_ENTRY(n) \
+ __asm__( \
+- ".global _Stub"#n"__14nsXPTCStubBase\n\t" \
+-"_Stub"#n"__14nsXPTCStubBase:\n\t" \
+- "link a6,#0 \n\t" \
+- "lea a6@(12), a0 \n\t" /* pointer to args */ \
+- "movl a0, sp@- \n\t" \
+- "movl #"#n", sp@- \n\t" /* method index */ \
+- "movl a6@(8), sp@- \n\t" /* this */ \
+- "jbsr _PrepareAndDispatch \n\t" \
+- "unlk a6 \n\t" \
++ ".global "SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase\n\t" \
++SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase:\n\t" \
++ "link %a6,#0 \n\t" \
++ "lea %a6@(12), %a0 \n\t" /* pointer to args */ \
++ "movl %a0, %sp@- \n\t" \
++ "movl #"#n", %sp@- \n\t" /* method index */ \
++ "movl %a6@(8), %sp@- \n\t" /* this */ \
++ "jbsr "SYMBOLPREFIX"PrepareAndDispatch\n\t" \
++ "unlk %a6 \n\t" \
+ "rts \n\t" \
+ );
+
diff --git a/www/firefox/patches/patch-xg b/www/firefox/patches/patch-xg
new file mode 100644
index 00000000000..b145086abbc
--- /dev/null
+++ b/www/firefox/patches/patch-xg
@@ -0,0 +1,33 @@
+$NetBSD: patch-xg,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/arm xptcall support code. From pkgsrc/www/firefox/patch-bm.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
+@@ -118,18 +118,23 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ * so they are contiguous with values passed on the stack, and then calls
+ * PrepareAndDispatch() to do the dirty work.
+ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
+
+ #define STUB_ENTRY(n) \
+ __asm__( \
+- ".global _Stub"#n"__14nsXPTCStubBase\n\t" \
+-"_Stub"#n"__14nsXPTCStubBase:\n\t" \
++ ".global "SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase\n\t" \
++SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase:\n\t" \
+ "stmfd sp!, {r1, r2, r3} \n\t" \
+ "mov ip, sp \n\t" \
+ "stmfd sp!, {fp, ip, lr, pc} \n\t" \
+ "sub fp, ip, #4 \n\t" \
+ "mov r1, #"#n" \n\t" /* = methodIndex */ \
+ "add r2, sp, #16 \n\t" \
+- "bl _PrepareAndDispatch__FP14nsXPTCStubBaseUiPUi \n\t" \
++ "bl "SYMBOLPREFIX"PrepareAndDispatch__FP14nsXPTCStubBaseUiPUi \n\t" \
+ "ldmea fp, {fp, sp, lr} \n\t" \
+ "add sp, sp, #12 \n\t" \
+ "mov pc, lr \n\t" \
diff --git a/www/firefox/patches/patch-xh b/www/firefox/patches/patch-xh
new file mode 100644
index 00000000000..d6379cc2965
--- /dev/null
+++ b/www/firefox/patches/patch-xh
@@ -0,0 +1,181 @@
+$NetBSD: patch-xh,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/amd64 xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_amd64.cpp.orig 2009-06-30 22:20:24.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_amd64.cpp
+@@ -0,0 +1,174 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++// Platform specific code to invoke XPCOM methods on native objects
++
++#include "xptcprivate.h"
++
++// 6 integral parameters are passed in registers
++const PRUint32 GPR_COUNT = 6;
++
++// 8 floating point parameters are passed in SSE registers
++const PRUint32 FPR_COUNT = 8;
++
++// Remember that these 'words' are 64-bit long
++static inline void
++invoke_count_words(PRUint32 paramCount, nsXPTCVariant * s,
++ PRUint32 & nr_gpr, PRUint32 & nr_fpr, PRUint32 & nr_stack)
++{
++ nr_gpr = 1; // skip one GP register for 'that'
++ nr_fpr = 0;
++ nr_stack = 0;
++
++ /* Compute number of eightbytes of class MEMORY. */
++ for (uint32 i = 0; i < paramCount; i++, s++) {
++ if (!s->IsPtrData()
++ && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
++ if (nr_fpr < FPR_COUNT)
++ nr_fpr++;
++ else
++ nr_stack++;
++ }
++ else {
++ if (nr_gpr < GPR_COUNT)
++ nr_gpr++;
++ else
++ nr_stack++;
++ }
++ }
++}
++
++static void
++invoke_copy_to_stack(PRUint64 * d, PRUint32 paramCount, nsXPTCVariant * s,
++ PRUint64 * gpregs, double * fpregs)
++{
++ PRUint32 nr_gpr = 1; // skip one GP register for 'that'
++ PRUint32 nr_fpr = 0;
++ PRUint64 value;
++
++ for (uint32 i = 0; i < paramCount; i++, s++) {
++ if (s->IsPtrData())
++ value = (PRUint64) s->ptr;
++ else {
++ switch (s->type) {
++ case nsXPTType::T_FLOAT: break;
++ case nsXPTType::T_DOUBLE: break;
++ case nsXPTType::T_I8: value = s->val.i8; break;
++ case nsXPTType::T_I16: value = s->val.i16; break;
++ case nsXPTType::T_I32: value = s->val.i32; break;
++ case nsXPTType::T_I64: value = s->val.i64; break;
++ case nsXPTType::T_U8: value = s->val.u8; break;
++ case nsXPTType::T_U16: value = s->val.u16; break;
++ case nsXPTType::T_U32: value = s->val.u32; break;
++ case nsXPTType::T_U64: value = s->val.u64; break;
++ case nsXPTType::T_BOOL: value = s->val.b; break;
++ case nsXPTType::T_CHAR: value = s->val.c; break;
++ case nsXPTType::T_WCHAR: value = s->val.wc; break;
++ default: value = (PRUint64) s->val.p; break;
++ }
++ }
++
++ if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
++ if (nr_fpr < FPR_COUNT)
++ fpregs[nr_fpr++] = s->val.d;
++ else {
++ *((double *)d) = s->val.d;
++ d++;
++ }
++ }
++ else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
++ if (nr_fpr < FPR_COUNT)
++ // The value in %xmm register is already prepared to
++ // be retrieved as a float. Therefore, we pass the
++ // value verbatim, as a double without conversion.
++ fpregs[nr_fpr++] = s->val.d;
++ else {
++ *((float *)d) = s->val.f;
++ d++;
++ }
++ }
++ else {
++ if (nr_gpr < GPR_COUNT)
++ gpregs[nr_gpr++] = value;
++ else
++ *d++ = value;
++ }
++ }
++}
++
++extern "C"
++XPTC_PUBLIC_API(nsresult)
++XPTC_InvokeByIndex(nsISupports * that, PRUint32 methodIndex,
++ PRUint32 paramCount, nsXPTCVariant * params)
++{
++ PRUint32 nr_gpr, nr_fpr, nr_stack;
++ invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
++
++ // Stack, if used, must be 16-bytes aligned
++ if (nr_stack)
++ nr_stack = (nr_stack + 1) & ~1;
++
++ // Load parameters to stack, if necessary
++ PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8);
++ PRUint64 gpregs[GPR_COUNT];
++ double fpregs[FPR_COUNT];
++ invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
++
++ // Load FPR registers from fpregs[]
++ register double d0 asm("xmm0");
++ register double d1 asm("xmm1");
++ register double d2 asm("xmm2");
++ register double d3 asm("xmm3");
++ register double d4 asm("xmm4");
++ register double d5 asm("xmm5");
++ register double d6 asm("xmm6");
++ register double d7 asm("xmm7");
++
++ switch (nr_fpr) {
++#define ARG_FPR(N) \
++ case N+1: d##N = fpregs[N];
++ ARG_FPR(7);
++ ARG_FPR(6);
++ ARG_FPR(5);
++ ARG_FPR(4);
++ ARG_FPR(3);
++ ARG_FPR(2);
++ ARG_FPR(1);
++ ARG_FPR(0);
++ case 0:;
++#undef ARG_FPR
++ }
++
++ // Load GPR registers from gpregs[]
++ register PRUint64 a0 asm("rdi");
++ register PRUint64 a1 asm("rsi");
++ register PRUint64 a2 asm("rdx");
++ register PRUint64 a3 asm("rcx");
++ register PRUint64 a4 asm("r8");
++ register PRUint64 a5 asm("r9");
++
++ switch (nr_gpr) {
++#define ARG_GPR(N) \
++ case N+1: a##N = gpregs[N];
++ ARG_GPR(5);
++ ARG_GPR(4);
++ ARG_GPR(3);
++ ARG_GPR(2);
++ ARG_GPR(1);
++ case 1: a0 = (PRUint64) that;
++ case 0:;
++#undef ARG_GPR
++ }
++
++ // Ensure that assignments to SSE registers won't be optimized away
++ asm("" ::
++ "x" (d0), "x" (d1), "x" (d2), "x" (d3),
++ "x" (d4), "x" (d5), "x" (d6), "x" (d7));
++
++ // Get pointer to method
++ PRUint64 methodAddress = *((PRUint64 *)that);
++ methodAddress += 8 * methodIndex;
++ methodAddress = *((PRUint64 *)methodAddress);
++
++ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64);
++ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5);
++ return result;
++}
diff --git a/www/firefox/patches/patch-xi b/www/firefox/patches/patch-xi
new file mode 100644
index 00000000000..f5cacb8a3e4
--- /dev/null
+++ b/www/firefox/patches/patch-xi
@@ -0,0 +1,213 @@
+$NetBSD: patch-xi,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD/amd64 xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_amd64.cpp.orig 2009-06-30 22:20:24.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_amd64.cpp
+@@ -0,0 +1,206 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++
++// Implement shared vtbl methods.
++
++#include "xptcprivate.h"
++
++// The Linux/x86-64 ABI passes the first 6 integral parameters and the
++// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx,
++// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the
++// caller. The rest of the parameters are passed in the callers stack
++// area.
++
++const PRUint32 PARAM_BUFFER_COUNT = 16;
++const PRUint32 GPR_COUNT = 6;
++const PRUint32 FPR_COUNT = 8;
++
++// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
++//
++// - 'args[]' contains the arguments passed on stack
++// - 'gpregs[]' contains the arguments passed in integer registers
++// - 'fpregs[]' contains the arguments passed in floating point registers
++//
++// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
++// and then the method gets called.
++
++extern "C" nsresult
++PrepareAndDispatch(nsXPTCStubBase * self, PRUint32 methodIndex,
++ PRUint64 * args, PRUint64 * gpregs, double *fpregs)
++{
++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
++ nsXPTCMiniVariant* dispatchParams = NULL;
++ nsIInterfaceInfo* iface_info = NULL;
++ const nsXPTMethodInfo* info;
++ PRUint32 paramCount;
++ PRUint32 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(PRUint16(methodIndex), &info);
++ NS_ASSERTION(info,"no method info");
++ if (! info)
++ return NS_ERROR_UNEXPECTED;
++
++ paramCount = info->GetParamCount();
++
++ // setup variant array pointer
++ if(paramCount > PARAM_BUFFER_COUNT)
++ dispatchParams = new nsXPTCMiniVariant[paramCount];
++ else
++ dispatchParams = paramBuffer;
++
++ NS_ASSERTION(dispatchParams,"no place for params");
++ if (! dispatchParams)
++ return NS_ERROR_OUT_OF_MEMORY;
++
++ PRUint64* ap = args;
++ PRUint32 nr_gpr = 1; // skip one GPR register for 'that'
++ PRUint32 nr_fpr = 0;
++ PRUint64 value;
++
++ for(i = 0; i < paramCount; i++) {
++ const nsXPTParamInfo& param = info->GetParam(i);
++ const nsXPTType& type = param.GetType();
++ nsXPTCMiniVariant* dp = &dispatchParams[i];
++
++ if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
++ if (nr_fpr < FPR_COUNT)
++ dp->val.d = fpregs[nr_fpr++];
++ else
++ dp->val.d = *(double*) ap++;
++ continue;
++ }
++ else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
++ if (nr_fpr < FPR_COUNT)
++ // The value in %xmm register is already prepared to
++ // be retrieved as a float. Therefore, we pass the
++ // value verbatim, as a double without conversion.
++ dp->val.d = *(double*) ap++;
++ else
++ dp->val.f = *(float*) ap++;
++ continue;
++ }
++ else {
++ if (nr_gpr < GPR_COUNT)
++ value = gpregs[nr_gpr++];
++ else
++ value = *ap++;
++ }
++
++ if (param.IsOut() || !type.IsArithmetic()) {
++ dp->val.p = (void*) value;
++ continue;
++ }
++
++ switch (type) {
++ case nsXPTType::T_I8: dp->val.i8 = (PRInt8) value; break;
++ case nsXPTType::T_I16: dp->val.i16 = (PRInt16) value; break;
++ case nsXPTType::T_I32: dp->val.i32 = (PRInt32) value; break;
++ case nsXPTType::T_I64: dp->val.i64 = (PRInt64) value; break;
++ case nsXPTType::T_U8: dp->val.u8 = (PRUint8) value; break;
++ case nsXPTType::T_U16: dp->val.u16 = (PRUint16) value; break;
++ case nsXPTType::T_U32: dp->val.u32 = (PRUint32) value; break;
++ case nsXPTType::T_U64: dp->val.u64 = (PRUint64) value; break;
++ case nsXPTType::T_BOOL: dp->val.b = (PRBool) value; break;
++ case nsXPTType::T_CHAR: dp->val.c = (char) value; break;
++ case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) value; break;
++
++ default:
++ NS_ASSERTION(0, "bad type");
++ break;
++ }
++ }
++
++ result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams);
++
++ NS_RELEASE(iface_info);
++
++ if (dispatchParams != paramBuffer)
++ delete [] dispatchParams;
++
++ return result;
++}
++
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++// Linux/x86-64 uses gcc >= 3.1
++#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" \
++ "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
++ ".elseif " #n " < 100\n\t" \
++ ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
++ ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
++ "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
++ ".elseif " #n " < 1000\n\t" \
++ ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
++ ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
++ "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
++ ".else\n\t" \
++ ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \
++ ".endif\n\t" \
++ "movl $" #n ", %eax\n\t" \
++ "jmp SharedStub\n\t" \
++ ".if " #n " < 10\n\t" \
++ ".size _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
++ ".elseif " #n " < 100\n\t" \
++ ".size _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
++ ".else\n\t" \
++ ".size _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
++ ".endif");
++
++// static nsresult SharedStub(PRUint32 methodIndex)
++asm(".section \".text\"\n\t"
++ ".align 2\n\t"
++ ".type SharedStub,@function\n\t"
++ "SharedStub:\n\t"
++ // make room for gpregs (48), fpregs (64)
++ "pushq %rbp\n\t"
++ "movq %rsp,%rbp\n\t"
++ "subq $112,%rsp\n\t"
++ // save GP registers
++ "movq %rdi,-112(%rbp)\n\t"
++ "movq %rsi,-104(%rbp)\n\t"
++ "movq %rdx, -96(%rbp)\n\t"
++ "movq %rcx, -88(%rbp)\n\t"
++ "movq %r8 , -80(%rbp)\n\t"
++ "movq %r9 , -72(%rbp)\n\t"
++ "leaq -112(%rbp),%rcx\n\t"
++ // save FP registers
++ "movsd %xmm0,-64(%rbp)\n\t"
++ "movsd %xmm1,-56(%rbp)\n\t"
++ "movsd %xmm2,-48(%rbp)\n\t"
++ "movsd %xmm3,-40(%rbp)\n\t"
++ "movsd %xmm4,-32(%rbp)\n\t"
++ "movsd %xmm5,-24(%rbp)\n\t"
++ "movsd %xmm6,-16(%rbp)\n\t"
++ "movsd %xmm7, -8(%rbp)\n\t"
++ "leaq -64(%rbp),%r8\n\t"
++ // rdi has the 'self' pointer already
++ "movl %eax,%esi\n\t"
++ "leaq 16(%rbp),%rdx\n\t"
++ "call PrepareAndDispatch\n\t"
++ "leave\n\t"
++ "ret\n\t"
++ ".size SharedStub,.-SharedStub");
++
++#define SENTINEL_ENTRY(n) \
++nsresult nsXPTCStubBase::Sentinel##n() \
++{ \
++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
++ return NS_ERROR_NOT_IMPLEMENTED; \
++}
++
++#include "xptcstubsdef.inc"
++
++#else
++#error "can't find a compiler to use"
++#endif /* __GNUC__ */
diff --git a/www/firefox/patches/patch-xj b/www/firefox/patches/patch-xj
new file mode 100644
index 00000000000..cc0275a7362
--- /dev/null
+++ b/www/firefox/patches/patch-xj
@@ -0,0 +1,129 @@
+$NetBSD: patch-xj,v 1.1.1.1 2009/08/05 02:37:11 tnn Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp
+@@ -41,6 +41,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
+@@ -71,7 +72,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ {
+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
+ nsXPTCMiniVariant* dispatchParams = NULL;
+- nsIInterfaceInfo* iface_info = NULL;
+ const nsXPTMethodInfo* info;
+ PRUint32 paramCount;
+ PRUint32 i;
+@@ -79,12 +79,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+
+ 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(PRUint16(methodIndex), &info);
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
+ NS_ASSERTION(info,"no method info");
+ if (! info)
+ return NS_ERROR_UNEXPECTED;
+@@ -119,8 +114,10 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ if ((PRUint32) ap & 4) ap++; // doubles are 8-byte aligned on stack
+ dp->val.d = *(double*) ap;
+ ap += 2;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 2;
++#endif
+ }
+ continue;
+ }
+@@ -130,8 +127,10 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ else {
+ dp->val.f = *(float*) ap;
+ ap += 1;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 1;
++#endif
+ }
+ continue;
+ }
+@@ -179,9 +178,9 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ }
+ }
+
+- result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams);
+-
+- NS_RELEASE(iface_info);
++ result = self->mOuter->CallMethod((PRUint16) methodIndex,
++ info,
++ dispatchParams);
+
+ if (dispatchParams != paramBuffer)
+ delete [] dispatchParams;
+@@ -195,7 +194,9 @@ 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) \
++#if __GXX_ABI_VERSION < 100
++// gcc-2 version
++# define STUB_ENTRY(n) \
+ __asm__ ( \
+ ".section \".text\" \n\t" \
+ ".align 2 \n\t" \
+@@ -206,6 +207,46 @@ __asm__ (
+ "li 11,"#n" \n\t" \
+ "b SharedStub@local \n" \
+ );
++#else
++// 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__ ( \
++ ".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" \
++);
++#endif
+
+ #define SENTINEL_ENTRY(n) \
+ nsresult nsXPTCStubBase::Sentinel##n() \
diff --git a/www/firefox/patches/patch-xk b/www/firefox/patches/patch-xk
new file mode 100644
index 00000000000..86cf8523c30
--- /dev/null
+++ b/www/firefox/patches/patch-xk
@@ -0,0 +1,156 @@
+$NetBSD: patch-xk,v 1.1.1.1 2009/08/05 02:37:12 tnn Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_netbsd.s.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_netbsd.s
+@@ -1,43 +1,43 @@
+-# -*- Mode: Asm -*-
+-#
+-# ***** BEGIN LICENSE BLOCK *****
+-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+-#
+-# The contents of this file are subject to the Mozilla 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/MPL/
+-#
+-# 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 the Initial Developer are Copyright (C) 1999
+-# the Initial Developer. All Rights Reserved.
+-#
+-# Contributor(s):
+-# Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
+-# beard@netscape.com (Patrick Beard)
+-# waterson@netscape.com (Chris Waterson)
+-#
+-# Alternatively, the contents of this file may be used under the terms of
+-# either the GNU General Public License Version 2 or later (the "GPL"), or
+-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+-# in which case the provisions of the GPL or the LGPL are applicable instead
+-# of those above. If you wish to allow use of your version of this file only
+-# under the terms of either the GPL or the LGPL, and not to allow others to
+-# use your version of this file under the terms of the MPL, indicate your
+-# decision by deleting the provisions above and replace them with the notice
+-# and other provisions required by the GPL or the LGPL. If you do not delete
+-# the provisions above, a recipient may use your version of this file under
+-# the terms of any one of the MPL, the GPL or the LGPL.
+-#
+-# ***** END LICENSE BLOCK *****
++// -*- Mode: Asm -*-
++//
++// ***** BEGIN LICENSE BLOCK *****
++// Version: MPL 1.1/GPL 2.0/LGPL 2.1
++//
++// The contents of this file are subject to the Mozilla 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/MPL/
++//
++// 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 the Initial Developer are Copyright (C) 1999
++// the Initial Developer. All Rights Reserved.
++//
++// Contributor(s):
++// Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
++// beard@netscape.com (Patrick Beard)
++// waterson@netscape.com (Chris Waterson)
++//
++// Alternatively, the contents of this file may be used under the terms of
++// either the GNU General Public License Version 2 or later (the "GPL"), or
++// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++// in which case the provisions of the GPL or the LGPL are applicable instead
++// of those above. If you wish to allow use of your version of this file only
++// under the terms of either the GPL or the LGPL, and not to allow others to
++// use your version of this file under the terms of the MPL, indicate your
++// decision by deleting the provisions above and replace them with the notice
++// and other provisions required by the GPL or the LGPL. If you do not delete
++// the provisions above, a recipient may use your version of this file under
++// the terms of any one of the MPL, the GPL or the LGPL.
++//
++// ***** END LICENSE BLOCK *****
+
+ .set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
+ .set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+@@ -60,23 +60,23 @@
+ .type SharedStub,@function
+
+ SharedStub:
+- stwu sp,-112(sp) # room for
+- # linkage (8),
+- # gprData (32),
+- # fprData (64),
+- # stack alignment(8)
++ stwu sp,-112(sp) // room for
++ // linkage (8),
++ // gprData (32),
++ // fprData (64),
++ // stack alignment(8)
+ mflr r0
+- stw r0,116(sp) # save LR backchain
++ stw r0,116(sp) // save LR backchain
+
+- stw r4,12(sp) # save GP registers
+- stw r5,16(sp) # (n.b. that we don't save r3
+- stw r6,20(sp) # because PrepareAndDispatch() is savvy)
++ stw r4,12(sp) // save GP registers
++ stw r5,16(sp) // (n.b. that we don't save r3
++ stw r6,20(sp) // because PrepareAndDispatch() is savvy)
+ stw r7,24(sp)
+ stw r8,28(sp)
+ stw r9,32(sp)
+ stw r10,36(sp)
+
+- stfd f1,40(sp) # save FP registers
++ stfd f1,40(sp) // save FP registers
+ stfd f2,48(sp)
+ stfd f3,56(sp)
+ stfd f4,64(sp)
+@@ -85,21 +85,21 @@ SharedStub:
+ stfd f7,88(sp)
+ stfd f8,96(sp)
+
+- # r3 has the 'self' pointer already
++ // r3 has the 'self' pointer already
+
+- mr r4,r11 # r4 <= methodIndex selector, passed
+- # via r11 in the nsXPTCStubBase::StubXX() call
++ mr r4,r11 // r4 <= methodIndex selector, passed
++ // via r11 in the nsXPTCStubBase::StubXX() call
+
+- addi r5,sp,120 # r5 <= pointer to callers args area,
+- # beyond r3-r10/f1-f8 mapped range
++ addi r5,sp,120 // r5 <= pointer to callers args area,
++ // beyond r3-r10/f1-f8 mapped range
+
+- addi r6,sp,8 # r6 <= gprData
+- addi r7,sp,40 # r7 <= fprData
++ addi r6,sp,8 // r6 <= gprData
++ addi r7,sp,40 // r7 <= fprData
+
+- bl PrepareAndDispatch@local # Go!
++ bl PrepareAndDispatch@local // Go!
+
+- lwz r0,116(sp) # restore LR
++ lwz r0,116(sp) // restore LR
+ mtlr r0
+- la sp,112(sp) # clean up the stack
++ la sp,112(sp) // clean up the stack
+ blr
+
diff --git a/www/firefox/patches/patch-xl b/www/firefox/patches/patch-xl
new file mode 100644
index 00000000000..944b0bb4bc2
--- /dev/null
+++ b/www/firefox/patches/patch-xl
@@ -0,0 +1,200 @@
+$NetBSD: patch-xl,v 1.1.1.1 2009/08/05 02:37:12 tnn Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_netbsd.s.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_netbsd.s
+@@ -1,43 +1,43 @@
+-# -*- Mode: Asm -*-
+-#
+-# ***** BEGIN LICENSE BLOCK *****
+-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+-#
+-# The contents of this file are subject to the Mozilla 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/MPL/
+-#
+-# 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 the Initial Developer are Copyright (C) 1999
+-# the Initial Developer. All Rights Reserved.
+-#
+-# Contributor(s):
+-# Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
+-# beard@netscape.com (Patrick Beard)
+-# waterson@netscape.com (Chris Waterson)
+-#
+-# Alternatively, the contents of this file may be used under the terms of
+-# either the GNU General Public License Version 2 or later (the "GPL"), or
+-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+-# in which case the provisions of the GPL or the LGPL are applicable instead
+-# of those above. If you wish to allow use of your version of this file only
+-# under the terms of either the GPL or the LGPL, and not to allow others to
+-# use your version of this file under the terms of the MPL, indicate your
+-# decision by deleting the provisions above and replace them with the notice
+-# and other provisions required by the GPL or the LGPL. If you do not delete
+-# the provisions above, a recipient may use your version of this file under
+-# the terms of any one of the MPL, the GPL or the LGPL.
+-#
+-# ***** END LICENSE BLOCK *****
++// -*- Mode: Asm -*-
++//
++// ***** BEGIN LICENSE BLOCK *****
++// Version: MPL 1.1/GPL 2.0/LGPL 2.1
++//
++// The contents of this file are subject to the Mozilla 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/MPL/
++//
++// 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 the Initial Developer are Copyright (C) 1999
++// the Initial Developer. All Rights Reserved.
++//
++// Contributor(s):
++// Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
++// beard@netscape.com (Patrick Beard)
++// waterson@netscape.com (Chris Waterson)
++//
++// Alternatively, the contents of this file may be used under the terms of
++// either the GNU General Public License Version 2 or later (the "GPL"), or
++// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++// in which case the provisions of the GPL or the LGPL are applicable instead
++// of those above. If you wish to allow use of your version of this file only
++// under the terms of either the GPL or the LGPL, and not to allow others to
++// use your version of this file under the terms of the MPL, indicate your
++// decision by deleting the provisions above and replace them with the notice
++// and other provisions required by the GPL or the LGPL. If you do not delete
++// the provisions above, a recipient may use your version of this file under
++// the terms of any one of the MPL, the GPL or the LGPL.
++//
++// ***** END LICENSE BLOCK *****
+ .set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
+ .set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+ .set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+@@ -55,41 +55,41 @@
+
+ .section ".text"
+ .align 2
+- .globl XPTC_InvokeByIndex
+- .type XPTC_InvokeByIndex,@function
++ .globl NS_InvokeByIndex_P
++ .type NS_InvokeByIndex_P,@function
+
+-#
+-# XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
+-# PRUint32 paramCount, nsXPTCVariant* params)
+-#
+-
+-XPTC_InvokeByIndex:
+- stwu sp,-32(sp) # setup standard stack frame
+- mflr r0 # save LR
+- stw r3,8(sp) # r3 <= that
+- stw r4,12(sp) # r4 <= methodIndex
++//
++// NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++// PRUint32 paramCount, nsXPTCVariant* params)
++//
++
++NS_InvokeByIndex_P:
++ stwu sp,-32(sp) // setup standard stack frame
++ mflr r0 // save LR
++ stw r3,8(sp) // r3 <= that
++ stw r4,12(sp) // r4 <= methodIndex
+ stw r30,16(sp)
+ stw r31,20(sp)
+
+- stw r0,36(sp) # store LR backchain
++ stw r0,36(sp) // store LR backchain
+ mr r31,sp
+
+- rlwinm r10,r5,3,0,27 # r10 = (ParamCount * 2 * 4) & ~0x0f
+- addi r0,r10,96 # reserve stack for GPR and FPR register save area r0 = r10 + 96
+- lwz r9,0(sp) # r9 = backchain
++ rlwinm r10,r5,3,0,27 // r10 = (ParamCount * 2 * 4) & ~0x0f
++ addi r0,r10,96 // reserve stack for GPR and FPR register save area r0 = r10 + 96
++ lwz r9,0(sp) // r9 = backchain
+ neg r0,r0
+- stwux r9,sp,r0 # reserve stack sapce and save SP backchain
++ stwux r9,sp,r0 // reserve stack sapce and save SP backchain
+
+- addi r3,sp,8 # r3 <= args
+- mr r4,r5 # r4 <= paramCount
+- mr r5,r6 # r5 <= params
+- add r6,r3,r10 # r6 <= gpregs ( == args + r10 )
+- mr r30,r6 # store in r30 for use later...
+- addi r7,r6,32 # r7 <= fpregs ( == gpregs + 32 )
++ addi r3,sp,8 // r3 <= args
++ mr r4,r5 // r4 <= paramCount
++ mr r5,r6 // r5 <= params
++ add r6,r3,r10 // r6 <= gpregs ( == args + r10 )
++ mr r30,r6 // store in r30 for use later...
++ addi r7,r6,32 // r7 <= fpregs ( == gpregs + 32 )
+
+- bl invoke_copy_to_stack@local # (args, paramCount, params, gpregs, fpregs)
++ bl invoke_copy_to_stack@local // (args, paramCount, params, gpregs, fpregs)
+
+- lfd f1,32(r30) # load FP registers with method parameters
++ lfd f1,32(r30) // load FP registers with method parameters
+ lfd f2,40(r30)
+ lfd f3,48(r30)
+ lfd f4,56(r30)
+@@ -98,18 +98,13 @@ XPTC_InvokeByIndex:
+ lfd f7,80(r30)
+ lfd f8,88(r30)
+
+- lwz r3,8(r31) # r3 <= that
+- lwz r4,12(r31) # r4 <= methodIndex
+- lwz r5,0(r3) # r5 <= vtable ( == *that )
+- slwi r4,r4,3 # convert to offset ( *= 8 )
+- addi r4,r4,8 # skip first two vtable entries
+- add r4,r4,r5
+- lhz r0,0(r4) # virtual base offset
+- extsh r0,r0
+- add r3,r3,r0
+- lwz r0,4(r4) # r0 <= methodpointer ( == vtable + offset )
++ lwz r3,8(r31) // r3 <= that
++ lwz r4,12(r31) // r4 <= methodIndex
++ lwz r5,0(r3) // r5 <= vtable ( == *that )
++ slwi r4,r4,2 // convert to offset ( *= 4 )
++ lwzx r0,r4,r5 // r0 <= methodpointer ( == vtable + offset )
+
+- lwz r4,4(r30) # load GP regs with method parameters
++ lwz r4,4(r30) // load GP regs with method parameters
+ lwz r5,8(r30)
+ lwz r6,12(r30)
+ lwz r7,16(r30)
+@@ -117,13 +112,13 @@ XPTC_InvokeByIndex:
+ lwz r9,24(r30)
+ lwz r10,28(r30)
+
+- mtlr r0 # copy methodpointer to LR
+- blrl # call method
++ mtlr r0 // copy methodpointer to LR
++ blrl // call method
+
+- lwz r30,16(r31) # restore r30 & r31
++ lwz r30,16(r31) // restore r30 & r31
+ lwz r31,20(r31)
+
+- lwz r11,0(sp) # clean up the stack
++ lwz r11,0(sp) // clean up the stack
+ lwz r0,4(r11)
+ mtlr r0
+ mr sp,r11
diff --git a/www/firefox/patches/patch-xm b/www/firefox/patches/patch-xm
new file mode 100644
index 00000000000..0cdf36b9d1d
--- /dev/null
+++ b/www/firefox/patches/patch-xm
@@ -0,0 +1,49 @@
+$NetBSD: patch-xm,v 1.1.1.1 2009/08/05 02:37:12 tnn Exp $
+
+NetBSD/ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp.orig 2009-06-29 18:15:33.000000000 +0200
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp
+@@ -40,9 +40,9 @@
+
+ // 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
+ // 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
+ // 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
+@@ -104,8 +104,10 @@ invoke_copy_to_stack(PRUint32* d,
+ if ((PRUint32) d & 4) d++; // doubles are 8-byte aligned on stack
+ *((double*) d) = s->val.d;
+ d += 2;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 2;
++#endif
+ }
+ }
+ else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
+@@ -114,8 +116,10 @@ invoke_copy_to_stack(PRUint32* d,
+ else {
+ *((float*) d) = s->val.f;
+ d += 1;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 1;
++#endif
+ }
+ }
+ else if (!s->IsPtrData() && (s->type == nsXPTType::T_I64
+@@ -142,6 +146,6 @@ invoke_copy_to_stack(PRUint32* d,
+ }
+
+ extern "C"
+-XPTC_PUBLIC_API(nsresult)
+-XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
++EXPORT_XPCOM_API(nsresult)
++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
+ PRUint32 paramCount, nsXPTCVariant* params);