aboutsummaryrefslogtreecommitdiffstats
path: root/mail/thunderbird/files
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2004-02-28 09:14:52 +0800
committermarcus <marcus@FreeBSD.org>2004-02-28 09:14:52 +0800
commite313e437347cbb027059349509dcf286ab874cb5 (patch)
tree103fe6c78147bd32facb72cc4382294f7fb57c45 /mail/thunderbird/files
parentf5c818093c44ef47024157b75247bcaa6c30cf50 (diff)
downloadfreebsd-ports-gnome-e313e437347cbb027059349509dcf286ab874cb5.tar.gz
freebsd-ports-gnome-e313e437347cbb027059349509dcf286ab874cb5.tar.zst
freebsd-ports-gnome-e313e437347cbb027059349509dcf286ab874cb5.zip
* Update to 0.5
* Fix a potential hang with esound * Fix some potential pthread issues * Add more platform compatibility patches * Fix libiconv support * Pull in some patches from firefox to shorten the plist some Special thanks to ale for getting a clean source tarball and hosting it. For the details on what's new in the release, please see: http://www.mozilla.org/projects/thunderbird/release-notes.html
Diffstat (limited to 'mail/thunderbird/files')
-rw-r--r--mail/thunderbird/files/mozconfig.in1
-rw-r--r--mail/thunderbird/files/patch-build_unix_run-mozilla.sh15
-rw-r--r--mail/thunderbird/files/patch-config-mkdepend-imakemdep.h10
-rw-r--r--mail/thunderbird/files/patch-config-rules.mk14
-rw-r--r--mail/thunderbird/files/patch-config_preprocess.pl56
-rw-r--r--mail/thunderbird/files/patch-configure38
-rw-r--r--mail/thunderbird/files/patch-directory-c-sdk-ldap-libraries-liblber-lber-int.h30
-rw-r--r--mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp46
-rw-r--r--mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h12
-rw-r--r--mail/thunderbird/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp48
-rw-r--r--mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.cfg161
-rw-r--r--mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.h13
-rw-r--r--mail/thunderbird/files/patch-nsprpub-pr-src-io-prprf.c12
-rw-r--r--mail/thunderbird/files/patch-security-coreconf-FreeBSD.mk12
-rw-r--r--mail/thunderbird/files/patch-sparc6457
-rw-r--r--mail/thunderbird/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc11
-rw-r--r--mail/thunderbird/files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in54
-rw-r--r--mail/thunderbird/files/patch-xptcall-alpha (renamed from mail/thunderbird/files/patch-alpha)33
-rw-r--r--mail/thunderbird/files/patch-xptcall-amd64386
-rw-r--r--mail/thunderbird/files/patch-xptcall-ia6438
-rw-r--r--mail/thunderbird/files/patch-xptcall-sparc6418
21 files changed, 841 insertions, 224 deletions
diff --git a/mail/thunderbird/files/mozconfig.in b/mail/thunderbird/files/mozconfig.in
index 8d2ab306729c..baeba727c18d 100644
--- a/mail/thunderbird/files/mozconfig.in
+++ b/mail/thunderbird/files/mozconfig.in
@@ -51,6 +51,7 @@ if test -n "$WITH_DEBUG"; then
ac_add_options --enable-debug
else
ac_add_options --disable-debug
+ ac_add_options --enable-optimize
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
diff --git a/mail/thunderbird/files/patch-build_unix_run-mozilla.sh b/mail/thunderbird/files/patch-build_unix_run-mozilla.sh
index e7b80ed29c53..72a40e1f9ec4 100644
--- a/mail/thunderbird/files/patch-build_unix_run-mozilla.sh
+++ b/mail/thunderbird/files/patch-build_unix_run-mozilla.sh
@@ -1,5 +1,5 @@
---- build/unix/run-mozilla.sh.orig Fri Apr 18 23:12:28 2003
-+++ build/unix/run-mozilla.sh Sat May 31 19:03:29 2003
+--- build/unix/run-mozilla.sh.orig Mon Dec 15 18:27:28 2003
++++ build/unix/run-mozilla.sh Fri Feb 27 11:54:10 2004
@@ -355,7 +355,7 @@
fi
##
@@ -9,16 +9,7 @@
if [ -n "$LD_LIBRARYN32_PATH" ]
then
LD_LIBRARYN32_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARYN32_PATH+":$LD_LIBRARYN32_PATH"}
-@@ -402,7 +402,7 @@
- fi
- fi
- # Font path for Xft
--FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
-+FONTCONFIG_PATH="%%PREFIX%%/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
- export FONTCONFIG_PATH
-
- if [ "$moz_debug" -eq 1 ]
-@@ -445,6 +445,9 @@
+@@ -442,6 +442,9 @@
#
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
diff --git a/mail/thunderbird/files/patch-config-mkdepend-imakemdep.h b/mail/thunderbird/files/patch-config-mkdepend-imakemdep.h
new file mode 100644
index 000000000000..b688e664475d
--- /dev/null
+++ b/mail/thunderbird/files/patch-config-mkdepend-imakemdep.h
@@ -0,0 +1,10 @@
+--- config/mkdepend/imakemdep.h Fri Sep 4 21:22:25 1998
++++ config/mkdepend/imakemdep.h Thu Oct 16 22:43:25 2003
+@@ -278,4 +278,7 @@
+ "-D__i386__",
+ # endif
++# if defined(__amd64__) || defined(__x86_64__)
++ "-D__amd64__ -D__x86_64__",
++# endif
+ # ifdef __GNUC__
+ "-traditional",
diff --git a/mail/thunderbird/files/patch-config-rules.mk b/mail/thunderbird/files/patch-config-rules.mk
new file mode 100644
index 000000000000..ecc3c8194dcc
--- /dev/null
+++ b/mail/thunderbird/files/patch-config-rules.mk
@@ -0,0 +1,14 @@
+--- config/rules.mk.orig Tue Aug 26 13:28:47 2003
++++ config/rules.mk Sun Feb 1 15:11:41 2004
+@@ -444,7 +444,11 @@
+
+ ifeq ($(OS_ARCH),FreeBSD)
+ ifdef IS_COMPONENT
++ifneq (,$(filter alpha ia64,$(OS_TEST)))
++EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic -lc
++else
+ EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
++endif
+ endif
+ endif
+
diff --git a/mail/thunderbird/files/patch-config_preprocess.pl b/mail/thunderbird/files/patch-config_preprocess.pl
deleted file mode 100644
index 390f4700dd53..000000000000
--- a/mail/thunderbird/files/patch-config_preprocess.pl
+++ /dev/null
@@ -1,56 +0,0 @@
---- config/preprocessor.pl.orig Fri Oct 24 18:17:32 2003
-+++ config/preprocessor.pl Sun Dec 7 15:17:57 2003
-@@ -76,16 +76,40 @@
- ########################################################################
-
- package main;
--use File::Spec 0.8;
-+use File::Spec;
- use File::Spec::Unix; # on all platforms, because the #include syntax is unix-based
-+use File::Basename;
-+use Cwd;
-+
-+# This code is taken from File::Spec::Unix 0.8.
-+sub rel2abs {
-+ my ($path, $base) = @_;
-+
-+ if ( ! File::Spec->file_name_is_absolute( $path ) ) {
-+ if ( !defined( $base ) || $base eq '' ) {
-+ $base = cwd() ;
-+ }
-+ elsif ( ! File::Spec->file_name_is_absolute( $base ) ) {
-+ $base = rel2abs( $base );
-+ }
-+ else {
-+ $base = File::Spec->canonpath( $base );
-+ }
-+
-+ $path = File::Spec->catdir( $base, $path );
-+ }
-+
-+ return File::Spec->canonpath( $path );
-+}
-+# End code from File::Spec::Unix
-+
-
- sub include {
- my($stack, $filename) = @_;
- my $directory = $stack->{'variables'}->{'DIRECTORY'};
- if ($filename ne '-') {
-- $filename = File::Spec->rel2abs($filename, $directory);
-- my($volume, $path) = File::Spec->splitpath($filename);
-- $directory = File::Spec->catpath($volume, $path, '');
-+ $filename = rel2abs($filename, $directory);
-+ $directory = File::Spec->catdir(dirname($filename));
- }
- local $stack->{'variables'}->{'DIRECTORY'} = $directory;
- local $stack->{'variables'}->{'FILE'} = $filename;
-@@ -395,7 +419,7 @@
- my $stack = shift;
- return if $stack->disabled;
- die "argument expected\n" unless @_;
-- my $filename = File::Spec->catpath(File::Spec::Unix->splitpath(@_));
-+ my $filename = File::Spec->catpath(dirname(@_), basename(@_));
- if ($stack->{'dependencies'}) {
- $stack->visit($filename);
- } else {
diff --git a/mail/thunderbird/files/patch-configure b/mail/thunderbird/files/patch-configure
new file mode 100644
index 000000000000..9e60372adb33
--- /dev/null
+++ b/mail/thunderbird/files/patch-configure
@@ -0,0 +1,38 @@
+--- configure.orig Fri Feb 13 01:06:29 2004
++++ configure Fri Feb 13 01:07:17 2004
+@@ -9181,7 +9181,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+-LIBS="-liconv $LIBS"
++LIBS="-L$LOCALBASE/lib -liconv $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 9187 "configure"
+ #include "confdefs.h"
+@@ -9212,7 +9212,7 @@
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+- _ICONV_LIBS="$_ICONV_LIBS -liconv"
++ _ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv"
+ else
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6
+@@ -9222,7 +9222,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+-LIBS="-liconv $LIBS"
++LIBS="-L$LOCALBASE/lib -liconv $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 9228 "configure"
+ #include "confdefs.h"
+@@ -9253,7 +9253,7 @@
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+- _ICONV_LIBS="$_ICONV_LIBS -liconv"
++ _ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv"
+ else
+ echo "$ac_t""no" 1>&6
+ fi
diff --git a/mail/thunderbird/files/patch-directory-c-sdk-ldap-libraries-liblber-lber-int.h b/mail/thunderbird/files/patch-directory-c-sdk-ldap-libraries-liblber-lber-int.h
new file mode 100644
index 000000000000..edc10f32f824
--- /dev/null
+++ b/mail/thunderbird/files/patch-directory-c-sdk-ldap-libraries-liblber-lber-int.h
@@ -0,0 +1,30 @@
+--- directory/c-sdk/ldap/libraries/liblber/lber-int.h Tue Mar 26 13:53:23 2002
++++ directory/c-sdk/ldap/libraries/liblber/lber-int.h Sat Dec 13 13:02:49 2003
+@@ -236,15 +236,15 @@
+ (((_l)&0xff0000)>>8) + (((_l)&0xff000000)>>24))
+ #define LBER_NTOHL(_l) LBER_HTONL(_l)
+
+-#elif !defined(__alpha) || defined(VMS)
++#elif !defined(__amd64__) && (!defined(__alpha) || defined(VMS))
+
+ #define LBER_HTONL( l ) htonl( l )
+ #define LBER_NTOHL( l ) ntohl( l )
+
+ #else /* __alpha */
+ /*
+- * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
+- * lower-order 32-bits of a (64-bit) long, so we define correct versions
++ * htonl and ntohl on the 64 bit UNIX platforms only swap the lower-order
++ * 32-bits of a (64-bit) long, so we define correct versions
+ * here.
+ */
+ #define LBER_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
+@@ -252,7 +252,7 @@
+
+ #define LBER_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
+ | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
+-#endif /* __alpha */
++#endif /* __alpha || __amd64__ */
+
+
+ /* function prototypes */
diff --git a/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp b/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp
new file mode 100644
index 000000000000..41c462d74f62
--- /dev/null
+++ b/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp
@@ -0,0 +1,46 @@
+--- extensions/typeaheadfind/src/nsTypeAheadFind.cpp.orig Wed Nov 19 01:20:47 2003
++++ extensions/typeaheadfind/src/nsTypeAheadFind.cpp Tue Feb 10 02:52:26 2004
+@@ -323,11 +323,11 @@
+ prefBranch->GetBoolPref("accessibility.typeaheadfind.startlinksonly",
+ &mStartLinksOnlyPref);
+
+- PRBool isSoundEnabled = PR_TRUE;
++ mIsSoundEnabled = PR_TRUE;
+ prefBranch->GetBoolPref("accessibility.typeaheadfind.enablesound",
+- &isSoundEnabled);
++ &mIsSoundEnabled);
+ nsXPIDLCString soundStr;
+- if (isSoundEnabled) {
++ if (mIsSoundEnabled && mIsSoundEnabled) {
+ prefBranch->GetCharPref("accessibility.typeaheadfind.soundURL",
+ getter_Copies(soundStr));
+ }
+@@ -758,7 +758,7 @@
+ }
+ else {
+ // No find string to backspace in!
+- if (mIsBackspaceProtectOn) {
++ if (mIsBackspaceProtectOn && mIsSoundEnabled) {
+ // This flag should be on only if the last key was a backspace.
+ // It keeps us from accidentally hitting backspace too many times and
+ // going back in history when we really just wanted to clear
+@@ -1012,7 +1012,9 @@
+
+ // Error sound (don't fire when backspace is pressed, they're
+ // trying to correct the mistake!)
+- PlayNotFoundSound();
++ if (mIsSoundEnabled) {
++ PlayNotFoundSound();
++ }
+
+ // Remove bad character from buffer, so we can continue typing from
+ // last matched character
+@@ -1059,7 +1061,7 @@
+ void
+ nsTypeAheadFind::PlayNotFoundSound()
+ {
+- if (mNotFoundSoundURL.IsEmpty()) // no sound
++ if (mNotFoundSoundURL.IsEmpty() || !mIsSoundEnabled) // no sound
+ return;
+ if (!mSoundInterface) {
+ mSoundInterface = do_CreateInstance("@mozilla.org/sound;1");
diff --git a/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h b/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h
new file mode 100644
index 000000000000..07ad43b4334d
--- /dev/null
+++ b/mail/thunderbird/files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h
@@ -0,0 +1,12 @@
+--- extensions/typeaheadfind/src/nsTypeAheadFind.h.orig Fri May 23 22:00:33 2003
++++ extensions/typeaheadfind/src/nsTypeAheadFind.h Mon Feb 9 22:21:43 2004
+@@ -194,6 +194,9 @@
+
+ nsCString mNotFoundSoundURL;
+
++ // Move the sound enabled boolean out for all methods to access.
++ PRBool mIsSoundEnabled;
++
+ // PRBool's are used instead of PRPackedBool's where the address of the
+ // boolean variable is getting passed into a method. For example:
+ // GetBoolPref("accessibility.typeaheadfind.linksonly", &mLinksOnlyPref);
diff --git a/mail/thunderbird/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp b/mail/thunderbird/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp
deleted file mode 100644
index 2adcd3412e13..000000000000
--- a/mail/thunderbird/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
---- gfx/src/gtk/nsFontMetricsXft.cpp.orig Tue Nov 25 21:44:50 2003
-+++ gfx/src/gtk/nsFontMetricsXft.cpp Sun Dec 7 15:20:48 2003
-@@ -105,6 +105,7 @@
- FcPattern *mPattern;
- FcPattern *mFontName;
- FcCharSet *mCharset;
-+ int mNotXft;
- };
-
- class nsFontXftInfo;
-@@ -1093,7 +1094,7 @@
-
- for (PRInt32 i = 1, end = mLoadedFonts.Count(); i < end; ++i) {
- nsFontXft *font = (nsFontXft *)mLoadedFonts.ElementAt(i);
-- if (font->HasChar(PRUint32(aChar)))
-+ if (font->HasChar(PRUint32(aChar)) && font->GetXftFont())
- return font;
- }
-
-@@ -1960,6 +1961,7 @@
- FcPatternReference(mFontName);
-
- mXftFont = nsnull;
-+ mNotXft = 0;
-
- // set up our charset
- mCharset = nsnull;
-@@ -1986,7 +1988,7 @@
- XftFont *
- nsFontXft::GetXftFont(void)
- {
-- if (!mXftFont) {
-+ if (!mXftFont && !mNotXft) {
- FcPattern *pat = FcFontRenderPrepare(0, mPattern, mFontName);
- if (!pat)
- return nsnull;
-@@ -2005,8 +2007,10 @@
- FcPatternDel(pat, FC_SPACING);
-
- mXftFont = XftFontOpenPattern(GDK_DISPLAY(), pat);
-- if (!mXftFont)
-+ if (!mXftFont) {
- FcPatternDestroy(pat);
-+ mNotXft = 1;
-+ }
- }
-
- return mXftFont;
diff --git a/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.cfg b/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.cfg
new file mode 100644
index 000000000000..3ac9a34fbc70
--- /dev/null
+++ b/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.cfg
@@ -0,0 +1,161 @@
+--- nsprpub/pr/include/md/_freebsd.cfg.orig Wed Jan 2 18:38:25 2002
++++ nsprpub/pr/include/md/_freebsd.cfg Sun Feb 1 15:09:53 2004
+@@ -91,7 +91,7 @@
+ #define PR_ALIGN_OF_DOUBLE 4
+ #define PR_ALIGN_OF_POINTER 4
+
+-#elif defined(__alpha)
++#elif defined(__alpha__)
+
+ #define IS_LITTLE_ENDIAN 1
+ #undef IS_BIG_ENDIAN
+@@ -138,6 +138,149 @@
+ #define PR_ALIGN_OF_DOUBLE 8
+ #define PR_ALIGN_OF_POINTER 8
+
++#elif defined(__sparc64__)
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_DOUBLE 8
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_POINTER 8
++
++#define HAVE_LONG_LONG
++#define HAVE_ALIGNED_DOUBLES
++#define HAVE_ALIGNED_LONGLONGS
++
++#elif defined(__ia64__)
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#define HAVE_LONG_LONG
++#define HAVE_ALIGNED_DOUBLES
++#define HAVE_ALIGNED_LONGLONGS
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__amd64__)
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#define HAVE_LONG_LONG
++#define HAVE_ALIGNED_DOUBLES
++#define HAVE_ALIGNED_LONGLONGS
+ #else
+
+ #error "Unknown CPU architecture"
diff --git a/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.h b/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.h
new file mode 100644
index 000000000000..38f21b2ddd6d
--- /dev/null
+++ b/mail/thunderbird/files/patch-nsprpub-pr-include-md-_freebsd.h
@@ -0,0 +1,13 @@
+--- nsprpub/pr/include/md/_freebsd.h.orig Sat Nov 15 23:36:13 2003
++++ nsprpub/pr/include/md/_freebsd.h Mon Feb 9 22:24:39 2004
+@@ -50,6 +50,10 @@
+ #define _PR_SI_ARCHITECTURE "alpha"
+ #elif defined(__sparc__)
+ #define _PR_SI_ARCHITECTURE "sparc"
++#elif defined(__ia64__)
++#define _PR_SI_ARCHITECTURE "ia64"
++#elif defined(__amd64__)
++#define _PR_SI_ARCHITECTURE "amd64"
+ #else
+ #error "Unknown CPU architecture"
+ #endif
diff --git a/mail/thunderbird/files/patch-nsprpub-pr-src-io-prprf.c b/mail/thunderbird/files/patch-nsprpub-pr-src-io-prprf.c
new file mode 100644
index 000000000000..8c48ad1e08fb
--- /dev/null
+++ b/mail/thunderbird/files/patch-nsprpub-pr-src-io-prprf.c
@@ -0,0 +1,12 @@
+--- nsprpub/pr/src/io/prprf.c Wed Feb 26 15:53:42 2003
++++ nsprpub/pr/src/io/prprf.c Thu Oct 16 22:50:40 2003
+@@ -52,5 +52,8 @@
+ ** and requires array notation.
+ */
+-#if (defined(LINUX) && defined(__powerpc__)) || \
++#if defined(__amd64__)
++#include <stdarg.h>
++#define VARARGS_ASSIGN(foo, bar) va_copy((foo), (bar))
++#elif (defined(LINUX) && defined(__powerpc__)) || \
+ (defined(LINUX) && defined(__s390__)) || \
+ (defined(LINUX) && defined(__s390x__)) || \
diff --git a/mail/thunderbird/files/patch-security-coreconf-FreeBSD.mk b/mail/thunderbird/files/patch-security-coreconf-FreeBSD.mk
new file mode 100644
index 000000000000..4f6bccff7cec
--- /dev/null
+++ b/mail/thunderbird/files/patch-security-coreconf-FreeBSD.mk
@@ -0,0 +1,12 @@
+--- security/coreconf/FreeBSD.mk Thu Oct 16 23:03:47 2003
++++ security/coreconf/FreeBSD.mk Thu Oct 16 22:53:11 2003
+@@ -44,5 +44,9 @@
+ CPU_ARCH = alpha
+ else
++ifeq ($(OS_TEST),amd64)
++CPU_ARCH = amd64
++else
+ CPU_ARCH = x86
++endif
+ endif
+
diff --git a/mail/thunderbird/files/patch-sparc64 b/mail/thunderbird/files/patch-sparc64
deleted file mode 100644
index e875857c4306..000000000000
--- a/mail/thunderbird/files/patch-sparc64
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -ru ./nsprpub/pr/include/md/_freebsd.cfg ../../work~/mozilla/nsprpub/pr/include/md/_freebsd.cfg
---- ./nsprpub/pr/include/md/_freebsd.cfg Wed Jan 2 18:38:25 2002
-+++ ../../work~/mozilla/nsprpub/pr/include/md/_freebsd.cfg Tue May 20 21:27:31 2003
-@@ -138,6 +138,53 @@
- #define PR_ALIGN_OF_DOUBLE 8
- #define PR_ALIGN_OF_POINTER 8
-
-+#elif defined(__sparc__)
-+
-+#undef IS_LITTLE_ENDIAN
-+#define IS_BIG_ENDIAN 1
-+#define HAVE_LONG_LONG
-+#define HAVE_ALIGNED_DOUBLES
-+#define HAVE_ALIGNED_LONGLONGS
-+#define IS_64
-+
-+#define PR_BYTES_PER_BYTE 1
-+#define PR_BYTES_PER_SHORT 2
-+#define PR_BYTES_PER_INT 4
-+#define PR_BYTES_PER_INT64 8
-+#define PR_BYTES_PER_LONG 8
-+#define PR_BYTES_PER_FLOAT 4
-+#define PR_BYTES_PER_DOUBLE 8
-+#define PR_BYTES_PER_WORD 8
-+#define PR_BYTES_PER_DWORD 8
-+#define PR_BYTES_PER_WORD_LOG2 3
-+#define PR_BYTES_PER_DWORD_LOG2 3
-+
-+#define PR_BITS_PER_BYTE 8
-+#define PR_BITS_PER_SHORT 16
-+#define PR_BITS_PER_INT 32
-+#define PR_BITS_PER_INT64 64
-+#define PR_BITS_PER_LONG 64
-+#define PR_BITS_PER_FLOAT 32
-+#define PR_BITS_PER_DOUBLE 64
-+#define PR_BITS_PER_WORD 64
-+
-+#define PR_BITS_PER_BYTE_LOG2 3
-+#define PR_BITS_PER_SHORT_LOG2 4
-+#define PR_BITS_PER_INT_LOG2 5
-+#define PR_BITS_PER_INT64_LOG2 6
-+#define PR_BITS_PER_LONG_LOG2 6
-+#define PR_BITS_PER_FLOAT_LOG2 5
-+#define PR_BITS_PER_DOUBLE_LOG2 6
-+#define PR_BITS_PER_WORD_LOG2 6
-+
-+#define PR_ALIGN_OF_SHORT 2
-+#define PR_ALIGN_OF_INT 4
-+#define PR_ALIGN_OF_LONG 8
-+#define PR_ALIGN_OF_INT64 8
-+#define PR_ALIGN_OF_FLOAT 4
-+#define PR_ALIGN_OF_DOUBLE 8
-+#define PR_ALIGN_OF_POINTER 8
-+
- #else
-
- #error "Unknown CPU architecture"
diff --git a/mail/thunderbird/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc b/mail/thunderbird/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc
new file mode 100644
index 000000000000..94ae99042c41
--- /dev/null
+++ b/mail/thunderbird/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc
@@ -0,0 +1,11 @@
+--- xpcom/reflect/xptcall/public/xptcstubsdecl.inc.orig Sun Feb 1 15:39:59 2004
++++ xpcom/reflect/xptcall/public/xptcstubsdecl.inc Sun Feb 1 15:40:11 2004
+@@ -8,7 +8,7 @@
+ * 1 is AddRef
+ * 2 is Release
+ */
+-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))
++#if !defined(__ia64)
+ XPTC_EXPORT NS_IMETHOD Stub3();
+ XPTC_EXPORT NS_IMETHOD Stub4();
+ XPTC_EXPORT NS_IMETHOD Stub5();
diff --git a/mail/thunderbird/files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in b/mail/thunderbird/files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in
new file mode 100644
index 000000000000..fcde57b85b3a
--- /dev/null
+++ b/mail/thunderbird/files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in
@@ -0,0 +1,54 @@
+--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig Thu Aug 14 21:00:23 2003
++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in Sun Feb 1 15:06:40 2004
+@@ -49,6 +49,9 @@
+ ifeq (86,$(findstring 86,$(OS_TEST)))
+ CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp
+ endif
++ifeq (amd64,$(OS_TEST))
++CPPSRCS := xptcinvoke_amd64_freebsd.cpp xptcstubs_amd64_freebsd.cpp
++endif
+ endif
+ #
+ # New code for Linux, et. al., with gcc
+@@ -60,7 +63,7 @@
+ endif
+ endif
+ # IA64 Linux
+-ifneq (,$(filter Linux,$(OS_ARCH)))
++ifneq (,$(filter Linux FreeBSD,$(OS_ARCH)))
+ ifneq (,$(findstring ia64,$(OS_TEST)))
+ CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp
+ ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
+@@ -106,9 +109,15 @@
+ ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s
+ endif
+ #
++# FreeBSD/Alpha
++#
++ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha)
++CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp
++endif
++#
+ # Linux/Alpha
+ #
+-ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
++ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
+ CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp
+ endif
+ #
+@@ -294,6 +303,15 @@
+ ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc)
+ CPPSRCS := xptcinvoke_sparc_netbsd.cpp xptcstubs_sparc_netbsd.cpp
+ ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s
++endif
++#
++# FreeBSD/SPARC64
++#
++ifeq ($(OS_ARCH),FreeBSD)
++ifneq (,$(findstring sparc,$(OS_TEST)))
++CPPSRCS := xptcinvoke_sparc64_freebsd.cpp xptcstubs_sparc64_freebsd.cpp
++ASFILES := xptcinvoke_asm_sparc64_freebsd.s xptcstubs_asm_sparcv9_solaris.s
++endif
+ endif
+ #
+ # Solaris/SPARC
diff --git a/mail/thunderbird/files/patch-alpha b/mail/thunderbird/files/patch-xptcall-alpha
index f8c1b081c9fa..29631a98e61e 100644
--- a/mail/thunderbird/files/patch-alpha
+++ b/mail/thunderbird/files/patch-xptcall-alpha
@@ -1,36 +1,3 @@
---- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig Mon Jan 27 22:52:51 2003
-+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in Tue May 27 01:41:12 2003
-@@ -100,9 +100,15 @@
- ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s
- endif
- #
-+# FreeBSD/Alpha
-+#
-+ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha)
-+CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp
-+endif
-+#
- # Linux/Alpha
- #
--ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
-+ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
- CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp
- endif
- #
---- config/rules.mk.orig Mon May 5 21:04:55 2003
-+++ config/rules.mk Tue May 27 01:33:11 2003
-@@ -444,7 +444,11 @@
-
- ifeq ($(OS_ARCH),FreeBSD)
- ifdef IS_COMPONENT
-+ifneq (,$(filter alpha,$(OS_TEST)))
-+EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic -lc
-+else
- EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
-+endif
- endif
- endif
-
--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp.orig Tue May 27 01:37:25 2003
+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp Tue May 27 01:37:00 2003
@@ -0,0 +1,184 @@
diff --git a/mail/thunderbird/files/patch-xptcall-amd64 b/mail/thunderbird/files/patch-xptcall-amd64
new file mode 100644
index 000000000000..3227cad02182
--- /dev/null
+++ b/mail/thunderbird/files/patch-xptcall-amd64
@@ -0,0 +1,386 @@
+--- /dev/null Wed Dec 31 16:00:00 1969
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_freebsd.cpp Thu Oct 16 22:59:43 2003
+@@ -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;
++}
+--- /dev/null Wed Dec 31 16:00:00 1969
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_freebsd.cpp Thu Oct 16 23:01:08 2003
+@@ -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/mail/thunderbird/files/patch-xptcall-ia64 b/mail/thunderbird/files/patch-xptcall-ia64
new file mode 100644
index 000000000000..9cd07f7ddbb2
--- /dev/null
+++ b/mail/thunderbird/files/patch-xptcall-ia64
@@ -0,0 +1,38 @@
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf64.s.orig Sun Jul 20 00:05:32 2003
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf64.s Sun Jul 20 00:06:37 2003
+@@ -8,6 +8,7 @@
+ // Section has executable code
+ .section .text, "ax","progbits"
+ // procedure named 'XPTC_InvokeByIndex'
++ .global XPTC_InvokeByIndex
+ .proc XPTC_InvokeByIndex
+ // manual bundling
+ .explicit
+@@ -24,7 +25,7 @@
+
+ // XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
+ // PRUint32 paramCount, nsXPTCVariant* params);
+-XPTC_InvokeByIndex::
++XPTC_InvokeByIndex:
+ .prologue
+ .save ar.pfs, r37
+ // allocate 4 input args, 6 local args, and 8 output args
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ipf64.s.orig Sun Jul 20 00:02:02 2003
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ipf64.s Sun Jul 20 00:02:40 2003
+@@ -6,6 +6,7 @@
+ // Section has executable code
+ .section .text, "ax","progbits"
+ // procedure named 'SharedStub'
++ .global SharedStub
+ .proc SharedStub
+ // manual bundling
+ .explicit
+@@ -14,7 +15,7 @@
+ // .exclass PrepareAndDispatch, @fullyvisible
+ .type PrepareAndDispatch,@function
+
+-SharedStub::
++SharedStub:
+ // 9 arguments, first 8 are the input arguments of previous
+ // function call. The last one is methodIndex, and is passed in memory
+ .prologue
diff --git a/mail/thunderbird/files/patch-xptcall-sparc64 b/mail/thunderbird/files/patch-xptcall-sparc64
index ea2773ced7d9..9599a8a71336 100644
--- a/mail/thunderbird/files/patch-xptcall-sparc64
+++ b/mail/thunderbird/files/patch-xptcall-sparc64
@@ -1,21 +1,3 @@
---- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig Mon May 26 13:26:01 2003
-+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in Mon May 26 13:30:04 2003
-@@ -287,6 +287,15 @@
- ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s
- endif
- #
-+# FreeBSD/SPARC64
-+#
-+ifeq ($(OS_ARCH),FreeBSD)
-+ifneq (,$(findstring sparc,$(OS_TEST)))
-+CPPSRCS := xptcinvoke_sparc64_freebsd.cpp xptcstubs_sparc64_freebsd.cpp
-+ASFILES := xptcinvoke_asm_sparc64_freebsd.s xptcstubs_asm_sparcv9_solaris.s
-+endif
-+endif
-+#
- # Solaris/SPARC
- #
- ifeq ($(OS_ARCH),SunOS)
--- /dev/null Mon May 26 13:22:00 2003
+++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_freebsd.cpp Mon May 26 04:12:55 2003
@@ -0,0 +1,123 @@