21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
authorStacy Yeh <stacy.yeh@oracle.com>
Tue, 01 Mar 2016 12:56:53 -0800
changeset 5527 611b2d6efdfe
parent 5526 570ac9aab8b2
child 5528 f2f5af510081
21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes 22757279 Update Thunderbird to version 38.5.0 22613259 thunderbird lightning extension is missing l10n after moved to userland 21133062 problem in TBIRD/MAILER
components/desktop/firefox/Makefile
components/desktop/firefox/firefox.license
components/desktop/firefox/firefox.p5m
components/desktop/firefox/patches/firefox-00-locale.patch
components/desktop/firefox/patches/firefox-01-cairo-perf.patch
components/desktop/firefox/patches/firefox-02-libnspr_flt4.patch
components/desktop/firefox/patches/firefox-03-strcasestr.patch
components/desktop/firefox/patches/firefox-04-check_test.patch
components/desktop/firefox/patches/firefox-05-sqlite3-unix-excl.patch
components/desktop/firefox/patches/firefox-06-hnjfile.patch
components/desktop/firefox/patches/firefox-07-nsMathUtils.patch
components/desktop/firefox/patches/firefox-08-skip_mozbuild_test.patch
components/desktop/firefox/patches/firefox-09-gthread-dlopen.patch
components/desktop/firefox/patches/firefox-10-webaudio_math.patch
components/desktop/firefox/patches/firefox-11-donot-delay-stopping-realplayer.patch
components/desktop/firefox/patches/firefox-12-package_warning.patch
components/desktop/firefox/patches/firefox-13-LocalFileUnix.patch
components/desktop/firefox/patches/firefox-14-uname.patch
components/desktop/firefox/patches/firefox-15-ion_AsmJS_x86.patch
components/desktop/firefox/patches/firefox-16-mftt_infinity.patch
components/desktop/firefox/patches/firefox-17-xpt-as-flag.patch
components/desktop/firefox/patches/firefox-18-libvpx_compile.patch
components/desktop/firefox/patches/firefox-19-cubeb.patch
components/desktop/firefox/patches/firefox-20-gfx.patch
components/desktop/firefox/patches/firefox-21-mozconfig_loader_bash.patch
components/desktop/firefox/patches/firefox-22-snappy.patch
components/desktop/firefox/patches/firefox-23-skia_gpu.patch
components/desktop/firefox/patches/firefox-24-test.patch
components/desktop/firefox/patches/firefox-25-rules_mk.patch
components/desktop/firefox/patches/firefox-26-jit-test-multi-processes.patch
components/desktop/firefox/patches/firefox-27-stacksize.patch
components/desktop/firefox/patches/firefox-28-configure.patch
components/desktop/firefox/patches/firefox-29-sparc-xptcall.patch
components/desktop/firefox/patches/firefox-30-other-buildissue.patch
components/desktop/firefox/patches/firefox-31-urlbar-sparc.patch
components/desktop/firefox/patches/firefox-32-solaris_jemalloc_linkage.patch
components/desktop/firefox/patches/firefox-33-ycbcr2.patch
components/desktop/firefox/patches/firefox-34-lz4-restrict-keyword.patch
components/desktop/firefox/patches/firefox-35-mozalloc.patch
components/desktop/firefox/patches/firefox-36-xpopen.patch
components/desktop/firefox/patches/firefox-37-ipc.patch
components/desktop/firefox/patches/firefox-38-sparc-align.patch
components/desktop/firefox/patches/firefox-39-gc-memory.patch
components/desktop/firefox/patches/firefox-40-libstagefright.patch
components/desktop/firefox/patches/firefox-41-static-xul-components.patch
components/desktop/firefox/patches/firefox-42-libxul.patch
components/desktop/firefox/patches/firefox-43-xpcom.patch
components/desktop/firefox/patches/firefox-44-readahead.patch
components/desktop/firefox/patches/firefox-45-wifi-scanner.patch
components/desktop/firefox/patches/firefox-46-dtrace.patch
components/desktop/firefox/patches/firefox-47-unreachable.patch
components/desktop/firefox/patches/firefox100-39-cairo-perf.patch
components/desktop/firefox/patches/firefox12-00-libnspr_flt4.patch
components/desktop/firefox/patches/firefox16-48-sparc-lea.patch
components/desktop/firefox/patches/firefox18-93-libffi-sparc.patch
components/desktop/firefox/patches/firefox20-24-stackwalk_compile.patch
components/desktop/firefox/patches/firefox20-46-strcasestr.patch
components/desktop/firefox/patches/firefox20-52-check_test.patch
components/desktop/firefox/patches/firefox20-82-sqlite3-unix-excl.patch
components/desktop/firefox/patches/firefox21-49-hnjfile.patch
components/desktop/firefox/patches/firefox21-50-nsMathUtils.patch
components/desktop/firefox/patches/firefox22-76-skip_mozbuild_test.patch
components/desktop/firefox/patches/firefox22-79-gthread-dlopen.patch
components/desktop/firefox/patches/firefox25-07-webaudio_math.patch
components/desktop/firefox/patches/firefox26-06-donot-delay-stopping-realplayer.patch
components/desktop/firefox/patches/firefox26-36-package_warning.patch
components/desktop/firefox/patches/firefox26-99-LocalFileUnix.patch
components/desktop/firefox/patches/firefox27-206-build-config.patch
components/desktop/firefox/patches/firefox27-47-uname.patch
components/desktop/firefox/patches/firefox27-67-ion_AsmJS_x86.patch
components/desktop/firefox/patches/firefox27-80-mftt_infinity.patch
components/desktop/firefox/patches/firefox28-217-xpt-as-flag.patch
components/desktop/firefox/patches/firefox28-88-libvpx_compile.patch
components/desktop/firefox/patches/firefox28-90-cubeb.patch
components/desktop/firefox/patches/firefox28-96-MediaDecoder.patch
components/desktop/firefox/patches/firefox29-214-gfx.patch
components/desktop/firefox/patches/firefox29-313-mozconfig_loader_bash.patch
components/desktop/firefox/patches/firefox29-45-snappy.patch
components/desktop/firefox/patches/firefox30-05-skia_gpu.patch
components/desktop/firefox/patches/firefox30-205-test.patch
components/desktop/firefox/patches/firefox30-29-rules_mk.patch
components/desktop/firefox/patches/firefox30-61-skia-endian.patch
components/desktop/firefox/patches/firefox31-01-locale.patch
components/desktop/firefox/patches/firefox31-03-g11n-nav-lang.patch
components/desktop/firefox/patches/firefox31-13-jit-test-multi-processes.patch
components/desktop/firefox/patches/firefox31-199-stacksize.patch
components/desktop/firefox/patches/firefox31-30-configure.patch
components/desktop/firefox/patches/firefox31-317-sparc-xptcall.patch
components/desktop/firefox/patches/firefox31-401-other-buildissue.patch
components/desktop/firefox/patches/firefox31-405-cpu.patch
components/desktop/firefox/patches/firefox31-408-urlbar-sparc.patch
components/desktop/firefox/patches/firefox31-409-thumbnail-sparc.patch
components/desktop/firefox/patches/firefox31-43-solaris_jemalloc_linkage.patch
components/desktop/firefox/patches/firefox31-60-Yarr_SPARC.patch
components/desktop/firefox/patches/firefox31-69-ipcv2.patch
components/desktop/firefox/patches/firefox31-92-dtrace.patch
components/desktop/firefox/patches/firefox31-97-ycbcr2.patch
components/desktop/firefox/patches/firefox31-gnu-105-lz4-restrict-keyword.patch
components/desktop/firefox/patches/firefox31-gnu-125-mozalloc.patch
components/desktop/firefox/patches/firefox31-gnu-130-xopen.patch
components/desktop/firefox/patches/firefox31-gnu-ReadAheadFile.patch
components/desktop/firefox/patches/firefox31-sparc-ta-6.patch
components/desktop/firefox/test/results-32.master
components/desktop/thunderbird/Makefile
components/desktop/thunderbird/patches/firefox100-39-cairo-perf.patch
components/desktop/thunderbird/patches/firefox12-00-libnspr_flt4.patch
components/desktop/thunderbird/patches/firefox16-48-sparc-lea.patch
components/desktop/thunderbird/patches/firefox18-93-libffi-sparc.patch
components/desktop/thunderbird/patches/firefox20-24-stackwalk_compile.patch
components/desktop/thunderbird/patches/firefox20-46-strcasestr.patch
components/desktop/thunderbird/patches/firefox20-52-check_test.patch
components/desktop/thunderbird/patches/firefox20-82-sqlite3-unix-excl.patch
components/desktop/thunderbird/patches/firefox21-49-hnjfile.patch
components/desktop/thunderbird/patches/firefox21-50-nsMathUtils.patch
components/desktop/thunderbird/patches/firefox22-76-skip_mozbuild_test.patch
components/desktop/thunderbird/patches/firefox22-79-gthread-dlopen.patch
components/desktop/thunderbird/patches/firefox25-07-webaudio_math.patch
components/desktop/thunderbird/patches/firefox26-06-donot-delay-stopping-realplayer.patch
components/desktop/thunderbird/patches/firefox26-36-package_warning.patch
components/desktop/thunderbird/patches/firefox26-99-LocalFileUnix.patch
components/desktop/thunderbird/patches/firefox27-206-build-config.patch
components/desktop/thunderbird/patches/firefox27-47-uname.patch
components/desktop/thunderbird/patches/firefox27-67-ion_AsmJS_x86.patch
components/desktop/thunderbird/patches/firefox27-80-mftt_infinity.patch
components/desktop/thunderbird/patches/firefox28-217-xpt-as-flag.patch
components/desktop/thunderbird/patches/firefox28-88-libvpx_compile.patch
components/desktop/thunderbird/patches/firefox28-90-cubeb.patch
components/desktop/thunderbird/patches/firefox28-96-MediaDecoder.patch
components/desktop/thunderbird/patches/firefox29-214-gfx.patch
components/desktop/thunderbird/patches/firefox29-313-mozconfig_loader_bash.patch
components/desktop/thunderbird/patches/firefox29-45-snappy.patch
components/desktop/thunderbird/patches/firefox30-05-skia_gpu.patch
components/desktop/thunderbird/patches/firefox30-205-test.patch
components/desktop/thunderbird/patches/firefox30-29-rules_mk.patch
components/desktop/thunderbird/patches/firefox30-61-skia-endian.patch
components/desktop/thunderbird/patches/firefox31-13-jit-test-multi-processes.patch
components/desktop/thunderbird/patches/firefox31-199-stacksize.patch
components/desktop/thunderbird/patches/firefox31-30-configure.patch
components/desktop/thunderbird/patches/firefox31-317-sparc-xptcall.patch
components/desktop/thunderbird/patches/firefox31-401-other-buildissue.patch
components/desktop/thunderbird/patches/firefox31-405-cpu.patch
components/desktop/thunderbird/patches/firefox31-408-urlbar-sparc.patch
components/desktop/thunderbird/patches/firefox31-409-thumbnail-sparc.patch
components/desktop/thunderbird/patches/firefox31-43-solaris_jemalloc_linkage.patch
components/desktop/thunderbird/patches/firefox31-60-Yarr_SPARC.patch
components/desktop/thunderbird/patches/firefox31-69-ipcv2.patch
components/desktop/thunderbird/patches/firefox31-92-dtrace.patch
components/desktop/thunderbird/patches/firefox31-97-ycbcr2.patch
components/desktop/thunderbird/patches/firefox31-gnu-105-lz4-restrict-keyword.patch
components/desktop/thunderbird/patches/firefox31-gnu-125-mozalloc.patch
components/desktop/thunderbird/patches/firefox31-gnu-130-xopen.patch
components/desktop/thunderbird/patches/firefox31-sparc-ta-6.patch
components/desktop/thunderbird/patches/thunderbird-01-libnspr_flt4.patch
components/desktop/thunderbird/patches/thunderbird-01-locale.patch
components/desktop/thunderbird/patches/thunderbird-02-sqlite3-unix-excl.patch
components/desktop/thunderbird/patches/thunderbird-03-package-warning.patch
components/desktop/thunderbird/patches/thunderbird-04-dup-ctime-def-removal.patch
components/desktop/thunderbird/patches/thunderbird-05-update-packaging.patch
components/desktop/thunderbird/patches/thunderbird-06-enable-extensions.patch
components/desktop/thunderbird/patches/thunderbird-07-ldap.patch
components/desktop/thunderbird/patches/thunderbird-31-gnu-ReadAheadFile.patch
components/desktop/thunderbird/patches/thunderbird12-00-libnspr_flt4.patch
components/desktop/thunderbird/patches/thunderbird17-jemalloc_linkage.patch
components/desktop/thunderbird/patches/thunderbird20-78-sqlite3-unix-excl.patch
components/desktop/thunderbird/patches/thunderbird21-103-package-warning.patch
components/desktop/thunderbird/patches/thunderbird31-41-updateurl.patch
components/desktop/thunderbird/patches/thunderbird31-501-dup-ctime-def-removal.patch
components/desktop/thunderbird/patches/thunderbird31-502-update-packaging.patch
components/desktop/thunderbird/patches/thunderbird31-503-append-ffssi2-symbol.patch
components/desktop/thunderbird/patches/thunderbird31-504-append-pulseaudio-symbols.patch
components/desktop/thunderbird/patches/thunderbird31-508-lightning-l10-build-all.patch
components/desktop/thunderbird/patches/thunderbird31-509-enable-extensions.patch
components/desktop/thunderbird/patches/thunderbird31-99-mozfind.patch
components/desktop/thunderbird/test/results-32.master
components/desktop/thunderbird/thunderbird-lightning.p5m
components/desktop/thunderbird/thunderbird.p5m
transforms/locale
--- a/components/desktop/firefox/Makefile	Tue Mar 01 10:33:35 2016 -0800
+++ b/components/desktop/firefox/Makefile	Tue Mar 01 12:56:53 2016 -0800
@@ -31,20 +31,20 @@
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME =		firefox
-COMPONENT_VERSION =		31.8.0esr
+COMPONENT_VERSION =		38.5.0esr
 COMPONENT_PROJECT_URL =		http://www.mozilla.com/firefox
-COMPONENT_SRC =			mozilla-esr31
+COMPONENT_SRC =			mozilla-esr38
 COMPONENT_SRC_NAME =		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE =		$(COMPONENT_SRC_NAME).source.tar.bz2
 COMPONENT_ARCHIVE_HASH = \
-    sha256:4c14021637ba61690ac2b52eff31c9bb96e4a04d334bf934d33932c9c382c50c
+	sha256:2a1f90cfe390ab20be88fed38cb9f61a18281cfbee47505c67e0254d339cdb20
 MOZILLA_FTP = 		        http://ftp.mozilla.org/pub/mozilla.org/$(COMPONENT_NAME)/releases/$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE_URL =		$(MOZILLA_FTP)/source/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB =		firefox/browser
 
-TPNO=				23616	
+TPNO=				26828	
 
-IPS_COMPONENT_VERSION =		31.8.0
+IPS_COMPONENT_VERSION =		38.5.0
 
 # There are a set of .xpi files (as given in the LANG_LIST definition below)
 # that we need. These are available under:
@@ -53,9 +53,9 @@
 # a compressed tarball of them, and made that available locally for download.
 # Downloading them individually can be a problem because firefox/thunderbird 
 # collide due to different files with identical .xpi names.
-COMPONENT_ARCHIVE_1 =           firefox-31.8.0esr-xpi.tar.gz
+COMPONENT_ARCHIVE_1 =           $(COMPONENT_SRC_NAME)-xpi.tar.gz
 COMPONENT_ARCHIVE_HASH_1 = \
-    sha256:f4be660e98f4bfac9e8b1a5ba39f74dc201697fe857b4f7c5dd8f3204837df54
+	sha256:1fe09d5540167cbda3029f4e02640498fbb98ad7b47cdb6b8872e6dcf522a3e1
 COMPONENT_ARCHIVE_URL_1 =       $(INTERNAL_ARCHIVE_MIRROR)/source-archives/$(COMPONENT_ARCHIVE_1)
 
 LANG_LIST = ar be bg ca cs da de el es-AR es-CL es-ES et fi \
@@ -101,15 +101,20 @@
 	echo "ac_add_options --enable-ipc" >> $(MOZCONFIG) ; \
 	echo "ac_add_options --enable-system-pixman" >> $(MOZCONFIG) ; \
 	echo "ac_add_options --enable-startup-notification" >> $(MOZCONFIG) ; \
-	echo "ac_add_options --enable-dtrace" >> $(MOZCONFIG) ;
+	echo "ac_add_options --enable-dtrace" >> $(MOZCONFIG) ; \
+	echo "ac_add_options --enable-replace-malloc" >> $(MOZCONFIG) ;
 
-CXXFLAGS +=	-Wno-invalid-offsetof -fpermissive
-CC +=		$(CC_BITS)
-CXX +=		$(CC_BITS)
-
+CXXFLAGS +=     -Wno-invalid-offsetof -fpermissive
+CC +=           $(CC_BITS)
+CXX +=          $(CC_BITS)
 
 CONFIGURE_ENV +=	PKG_CONFIG_PATH=$(CONFIGURE_LIBDIR.$(BITS))/pkgconfig
 CONFIGURE_ENV +=	OS_DEFINES="-D__USE_LEGACY_PROTOTYPES__"
+CONFIGURE_ENV +=        CXXFLAGS='-xlibmil -xlibmopt -lCrun -lCstd -features=tmplrefstatic,no%except -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -template=no%extdef'
+# -L.../dist/lib needs to be set otherwise it will report missing libnss3.so, 
+# libssl3.so, etc, while linking.
+CONFIGURE_ENV +=        LDFLAGS="-z ignore -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
+
 
 CONFIGURE_ENV +=	MOZCONFIG=$(MOZCONFIG)
 CONFIGURE_ENV +=	"CC=$(CC)"
@@ -180,6 +185,7 @@
 REQUIRED_PACKAGES += library/graphics/pixman
 REQUIRED_PACKAGES += library/libevent
 REQUIRED_PACKAGES += library/libffi
+REQUIRED_PACKAGES += library/nspr
 REQUIRED_PACKAGES += library/zlib
 REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/fontconfig
@@ -192,4 +198,4 @@
 REQUIRED_PACKAGES += x11/library/libx11
 REQUIRED_PACKAGES += x11/library/libxext
 REQUIRED_PACKAGES += x11/library/libxrender
-REQUIRED_PACKAGES += x11/library/toolkit/libxt 
+REQUIRED_PACKAGES += x11/library/toolkit/libxt
--- a/components/desktop/firefox/firefox.license	Tue Mar 01 10:33:35 2016 -0800
+++ b/components/desktop/firefox/firefox.license	Tue Mar 01 12:56:53 2016 -0800
@@ -1,5 +1,3 @@
-Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
-
 Mozilla Public License 2.0 
 Android Open Source License 
 ANGLE License 
@@ -408,7 +406,7 @@
 
 Apple/Mozilla NPRuntime License
 This license applies to the file dom/plugins/base/npruntime.h.
-Copyright ? 2004, Apple Computer, Inc. and The Mozilla Foundation. 
+Copyright © 2004, Apple Computer, Inc. and The Mozilla Foundation. 
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -484,7 +482,7 @@
 1987, 1988, 1989 Digital Equipment Corporation, Maynard, Massachusetts. 
 1998 Keith Packard 
 2003 Richard Henderson 
-Copyright ? <date> <copyright holder>
+Copyright © <date> <copyright holder>
 
 Permission to use, copy, modify, distribute, and sell this software
 and its documentation for any purpose is hereby granted without
@@ -1004,7 +1002,7 @@
 
 libnestegg License
 This license applies to certain files in the directory media/libnestegg. 
-Copyright ? 2010 Mozilla Foundation
+Copyright © 2010 Mozilla Foundation
 
 Permission to use, copy, modify, and distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
@@ -1020,7 +1018,7 @@
 
 libsoundtouch License
 This license applies to certain files in the directory media/libsoundtouch/src/. 
-The SoundTouch Library Copyright ? Olli Parviainen 2001-2012
+The SoundTouch Library Copyright © Olli Parviainen 2001-2012
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -1263,7 +1261,7 @@
 
 Unicode License
 This license applies to certain files in the directories intl/icu and js/src/vm. 
-Copyright ? 1991-2012 Unicode, Inc. All rights reserved. Distributed
+Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed
 under the Terms of Use in http://www.unicode.org/copyright.html.
 
 Permission is hereby granted, free of charge, to any person obtaining a
--- a/components/desktop/firefox/firefox.p5m	Tue Mar 01 10:33:35 2016 -0800
+++ b/components/desktop/firefox/firefox.p5m	Tue Mar 01 12:56:53 2016 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 # pkg.linted actions are needed to prevent bad RUNPATH lint errors.
@@ -115,6 +115,9 @@
 file path=usr/lib/firefox/firefox mode=0555 pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/firefox-bin mode=0555 \
     pkg.linted.userland.action001.3=true
+file path=usr/lib/firefox/gmp-clearkey/0.1/clearkey.info
+file path=usr/lib/firefox/gmp-clearkey/0.1/libclearkey.so mode=0555 \
+    pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libfreebl3.chk variant.arch=i386
 file path=usr/lib/firefox/libfreebl3.so com.oracle.elfsign=false \
     pkg.linted.userland.action001.3=true variant.arch=i386
@@ -134,19 +137,18 @@
 file path=usr/lib/firefox/libnssutil3.so pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libplc4.so pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libplds4.so pkg.linted.userland.action001.3=true
+file path=usr/lib/firefox/libreplace_jemalloc.so \
+    pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libsmime3.so pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libsoftokn3.chk
 file path=usr/lib/firefox/libsoftokn3.so com.oracle.elfsign=false \
     pkg.depend.bypass-generate=.* pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libssl3.so pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/libxul.so pkg.linted.userland.action001.3=true
-file path=usr/lib/firefox/mozilla-xremote-client mode=0555 \
-    pkg.linted.userland.action001.3=true
 file path=usr/lib/firefox/omni.ja
 file path=usr/lib/firefox/platform.ini
 file path=usr/lib/firefox/plugin-container mode=0555 \
     pkg.linted.userland.action001.3=true
-file path=usr/lib/firefox/precomplete
 file path=usr/lib/firefox/removed-files
 file path=usr/lib/firefox/run-mozilla.sh mode=0555
 file path=usr/lib/firefox/webapprt-stub mode=0555 \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-00-locale.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,14 @@
+Matches the OS locale. We need to determine if this patch should be sent
+upstream. 
+
+--- mozilla-esr38/modules/libpref/init/all.js.orig      2015-02-18 16:39:16.189950136 +0530
++++ mozilla-esr38/modules/libpref/init/all.js   2015-02-18 16:40:56.002524458 +0530
[email protected]@ -1461,7 +1461,7 @@ pref("intl.charset.detector",
+ pref("intl.charset.fallback.override",      "");
+ pref("intl.charset.fallback.tld",           true);
+ pref("intl.ellipsis",                       "chrome://global-platform/locale/intl.properties");
+-pref("intl.locale.matchOS",                 false);
++pref("intl.locale.matchOS",                 true);
+ // fallback charset list for Unicode conversion (converting from Unicode)
+ // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes)
+ // for ISO-8859-1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-01-cairo-perf.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,34 @@
+This enables tracking of ARGB values for image masks, since some machines do
+not use ARGB values.
+See Mozilla bug #716462 - Performance regression with xBGR visual and no
+RENDER extension.
+We would like to try to get this upstream in the future.
+
+diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c
+--- a/gfx/cairo/cairo/src/cairo-xlib-surface.c
++++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c
[email protected]@ -2325,6 +2325,7 @@
+                           cairo_region_t *clip_region)
+ {
+     cairo_image_surface_t *image;
++    cairo_format_masks_t image_masks;
+     cairo_rectangle_int_t extents;
+     cairo_status_t status;
+     int tx, ty;
[email protected]@ -2341,6 +2342,16 @@
+            (image->base.content & CAIRO_CONTENT_ALPHA) == 0)))
+        return CAIRO_INT_STATUS_UNSUPPORTED;
+ 
++    if (image->base.backend->type == CAIRO_SURFACE_TYPE_IMAGE) {
++       if (_pixman_format_to_masks (image->pixman_format, &image_masks)) {
++           if (! ((image_masks.alpha_mask == surface->a_mask || surface->a_mask == 0) &&
++                  (image_masks.red_mask   == surface->r_mask || surface->r_mask == 0) &&
++                  (image_masks.green_mask == surface->g_mask || surface->g_mask == 0) &&
++                  (image_masks.blue_mask  == surface->b_mask || surface->b_mask == 0)))
++               return CAIRO_INT_STATUS_UNSUPPORTED;
++       }
++    }
++
+     if (image->base.backend->type != CAIRO_SURFACE_TYPE_IMAGE) {
+        if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
+            image = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) image)->target;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-02-libnspr_flt4.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+This adds a library necessary for sparc. 
+This will not be sent upstream because it would be difficult to
+add a sparc-only ifdef condition for this.
+
+diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
+--- a/browser/installer/package-manifest.in
++++ b/browser/installer/package-manifest.in
[email protected]@ -804,6 +804,7 @@
+ bin/libfreebl_32fpu_3.so
+ bin/libfreebl_32int_3.so
+ bin/libfreebl_32int64_3.so
++bin/cpu/sparcv8plus/libnspr_flt4.so
+ #endif
+ 
+ ; [Updater]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-03-strcasestr.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+The 'uname' part is necessary because the uname() function returns a
+non-negative value.
+
+diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp
+--- a/widget/GfxInfoX11.cpp
++++ b/widget/GfxInfoX11.cpp
[email protected]@ -135,7 +136,7 @@
+     // only useful for Linux kernel version check for FGLRX driver.
+     // assumes X client == X server, which is sad.
+     struct utsname unameobj;
+-    if (!uname(&unameobj))
++    if (uname(&unameobj) >= 0)
+     {
+       mOS.Assign(unameobj.sysname);
+       mOSRelease.Assign(unameobj.release);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-04-check_test.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,14 @@
+This patch is for testing. Potential for sending upstream. 
+
+diff --git a/testing/runcppunittests.py b/testing/runcppunittests.py
+--- a/testing/runcppunittests.py
++++ b/testing/runcppunittests.py
[email protected]@ -103,6 +103,8 @@
+         libpath = self.xre_path
+         if mozinfo.os == "linux":
+             pathvar = "LD_LIBRARY_PATH"
++        if mozinfo.os == "unix":
++            pathvar = "LD_LIBRARY_PATH"
+         elif mozinfo.os == "mac":
+             applibpath = os.path.join(os.path.dirname(libpath), 'MacOS')
+             if os.path.exists(applibpath):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-05-sqlite3-unix-excl.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,17 @@
+This provides the option to set the indicator for a NFS profile to true.
+It may be necessary for users on NFS to use bookmarks/logging.
+Will not be sending upstream.
+
+diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
+--- a/browser/app/profile/firefox.js
++++ b/browser/app/profile/firefox.js
[email protected]@ -1075,6 +1075,9 @@
+ // allow META refresh by default
+ pref("accessibility.blockautorefresh", false);
+ 
++// Whether profile is on NFS
++pref("storage.nfs_filesystem", true);
++            
+ // Whether history is enabled or not.
+ pref("places.history.enabled", true);
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-06-hnjfile.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+This allows us to access some function from wchar.h that other platforms
+can get from stdio.h. 
+Potentially add an ifdef Solaris statement to try and send upstream.
+
+diff --git a/intl/hyphenation/hnjalloc.h b/intl/hyphenation/hnjalloc.h
+--- a/intl/hyphenation/hnjalloc.h
++++ b/intl/hyphenation/hnjalloc.h
[email protected]@ -24,6 +24,7 @@
+  */
+ 
+ #include <stdio.h> /* ensure stdio.h is loaded before our macros */
++#include <wchar.h>
+ 
+ #undef FILE 
+ #define FILE hnjFile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-07-nsMathUtils.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+This allows us to get some function from math.h that other platforms are
+getting from ieeefp.h.
+Can send upstream since it already has an ifdef statement for Solaris.
+
+diff --git a/xpcom/ds/nsMathUtils.h b/xpcom/ds/nsMathUtils.h
+--- a/xpcom/ds/nsMathUtils.h
++++ b/xpcom/ds/nsMathUtils.h
[email protected]@ -13,6 +13,7 @@
+ #include <float.h>
+ 
+ #ifdef SOLARIS
++#include <math.h>
+ #include <ieeefp.h>
+ #endif
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-08-skip_mozbuild_test.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,25 @@
+For testing. Runs the test from a different environment than the Mozilla
+default.
+
+diff --git a/python/mozbuild/mozbuild/test/test_base.py b/python/mozbuild/mozbuild/test/test_base.py
+--- a/python/mozbuild/mozbuild/test/test_base.py
++++ b/python/mozbuild/mozbuild/test/test_base.py
[email protected]@ -393,5 +393,5 @@
+         self.assertEqual(p.srcdir_path(), "/src/foo/bar")
+         self.assertEqual(p.objdir_path(), "/src/obj/foo/bar")
+ 
+-if __name__ == '__main__':
+-    main()
++#if __name__ == '__main__':
++#    main()
+diff --git a/python/mozbuild/mozbuild/test/test_mozconfig.py b/python/mozbuild/mozbuild/test/test_mozconfig.py
+--- a/python/mozbuild/mozbuild/test/test_mozconfig.py
++++ b/python/mozbuild/mozbuild/test/test_mozconfig.py
[email protected]@ -477,5 +477,5 @@
+             self.assertEquals(e.exception.output, ['hello world'])
+ 
+ 
+-if __name__ == '__main__':
+-    main()
++#if __name__ == '__main__':
++#    main()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-09-gthread-dlopen.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+See Mozilla bug #675585 - crash [@ g_slice_free1] when run firefox-bin -no-
+remote -process-updates.
+
+diff --git a/xpcom/glue/standalone/nsXPCOMGlue.cpp b/xpcom/glue/standalone/nsXPCOMGlue.cpp
+--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp
++++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp
[email protected]@ -386,6 +386,8 @@
+     }   
+   }
+ 
++  static void* gthreadso = dlopen("libgthread-2.0.so.0", RTLD_GLOBAL | RTLD_LAZY);
++
+   GetFrozenFunctionsFunc sym =
+     (GetFrozenFunctionsFunc)GetSymbol(sTop->libHandle,
+                                       LEADING_UNDERSCORE "NS_GetFrozenFunctions");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-10-webaudio_math.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,26 @@
+This allows us to get some function from math.h that other platforms are
+getting elsewhere.
+Can potentially send upstream with ifdef Solaris statement.
+
+diff --git a/dom/media/webaudio/ThreeDPoint.h b/dom/media/webaudio/ThreeDPoint.h
+--- a/dom/media/webaudio/ThreeDPoint.h
++++ b/dom/media/webaudio/ThreeDPoint.h
[email protected]@ -8,6 +8,7 @@
+ #define ThreeDPoint_h_
+  
+ #include <cmath>
++#include <math.h>
+ #include <algorithm>
+ 
+ namespace mozilla {
+diff --git a/dom/media/webaudio/blink/DenormalDisabler.h b/dom/media/webaudio/blink/DenormalDisabler.h        
+--- a/dom/media/webaudio/blink/DenormalDisabler.h
++++ b/dom/media/webaudio/blink/DenormalDisabler.h
[email protected]@ -27,6 +27,7 @@
+ 
+ #define _USE_MATH_DEFINES
+ #include <cmath>
++#include <math.h>
+ #include <float.h>
+ 
+ namespace WebCore {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-11-donot-delay-stopping-realplayer.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,27 @@
+See Mozilla bug #451007 - Reload page causing problems with
+RealPlayer/Helix plugin.
+We can potentially drop this patch since RealPlayer is no longer being
+supported, but some people may still be using it.
+
+diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp
+--- a/dom/base/nsObjectLoadingContent.cpp
++++ b/dom/base/nsObjectLoadingContent.cpp
[email protected]@ -2902,7 +2902,8 @@
+               bool aDelayedStop)
+ {
+   // Don't delay stopping QuickTime (bug 425157), Flip4Mac (bug 426524),
+-  // XStandard (bug 430219), CMISS Zinc (bug 429604).
++  // XStandard (bug 430219), CMISS Zinc (bug 429604),
++  // RealPlayer/Helix (bug 451007).
+   if (aDelayedStop
+ #if !(defined XP_WIN || defined MOZ_X11)
+       && !aInstanceOwner->MatchPluginName("QuickTime")
[email protected]@ -2910,6 +2911,8 @@
+       && !aInstanceOwner->MatchPluginName("XStandard plugin")
+       && !aInstanceOwner->MatchPluginName("CMISS Zinc Plugin")
+ #endif
++      && !aInstanceOwner->MatchPluginName("RealPlayer")
++      && !aInstanceOwner->MatchPluginName("Helix")
+       ) {
+     nsCOMPtr<nsIRunnable> evt =
+       new nsStopPluginRunnable(aInstanceOwner, aContent);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-12-package_warning.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,17 @@
+Disables fatal warnings. Inside package-manifest.in, there is a sparc-specific
+line that we can't ifdef out. So we want to make sure this doesn't exit on
+an error for x86.  
+We will want to redo this patch with an ifdef for x86 vs sparc.
+
+diff --git a/browser/installer/Makefile.in b/browser/installer/Makefile.in
+--- a/browser/installer/Makefile.in
++++ b/browser/installer/Makefile.in
[email protected]@ -17,7 +17,7 @@
+ 
+ # Some files have been already bundled with xulrunner
+ ifndef MOZ_MULET
+-MOZ_PKG_FATAL_WARNINGS = 1
++# MOZ_PKG_FATAL_WARNINGS = 1
+ endif
+ 
+ DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-13-LocalFileUnix.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+Another ifdef Solaris patch. Some function is defined in limits.h that other 
+platforms can get elsewhere.  
+Can potentially send upstream with ifdef Solaris statement.
+
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
[email protected]@ -14,6 +14,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
++#include <limits.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <utime.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-14-uname.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+The uname() function on Solaris can return a non-negative value.
+Solaris specific patch, will not send upstream
+
+diff --git a/toolkit/components/startup/nsUserInfoUnix.cpp b/toolkit/components/startup/nsUserInfoUnix.cpp
+--- a/toolkit/components/startup/nsUserInfoUnix.cpp
++++ b/toolkit/components/startup/nsUserInfoUnix.cpp
[email protected]@ -106,7 +106,7 @@
+     char *domainname = nullptr;
+ 
+     // is this portable?  that is a POSIX compliant call, but I need to check
+-    if (uname(&buf)) { 
++    if (uname(&buf) < 0) { 
+         return rv;
+     }
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-15-ion_AsmJS_x86.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,16 @@
+REG_EIP is already defined elsewhere for Linux.
+Can potentially send upstream.
+
+diff --git a/js/src/asmjs/AsmJSSignalHandlers.cpp b/js/src/asmjs/AsmJSSignalHandlers.cpp
+--- a/js/src/asmjs/AsmJSSignalHandlers.cpp
++++ b/js/src/asmjs/AsmJSSignalHandlers.cpp
[email protected]@ -116,6 +116,9 @@
+ # define R14_sig(p) ((p)->sc_r14)
+ # define R15_sig(p) ((p)->sc_r15)
+ #elif defined(__linux__) || defined(SOLARIS)
++# if defined(SOLARIS)
++#  define REG_EIP EIP
++# endif 
+ # if defined(__linux__)
+ #  define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i])
+ #  define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-16-mftt_infinity.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,33 @@
+We use a different function from the one in ieeefp.h.
+This may be a studio specific patch. Need to investigate if this can be
+removed.
+
+diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
+--- a/mfbt/decimal/Decimal.cpp
++++ b/mfbt/decimal/Decimal.cpp
[email protected]@ -33,6 +33,7 @@
+ 
+ #include <algorithm>
+ #include <float.h>
++#include <ieeefp.h>
+ 
+ using namespace moz_decimal_utils;
+ 
[email protected]@ -686,13 +687,13 @@
+ 
+ Decimal Decimal::fromDouble(double doubleValue)
+ {
+-    if (std::isfinite(doubleValue))
++    if (finite(doubleValue))
+         return fromString(mozToString(doubleValue));
+ 
+-    if (std::isinf(doubleValue))
+-        return infinity(doubleValue < 0 ? Negative : Positive);
++    if (isnand(doubleValue))
++        return nan();
+ 
+-    return nan();
++    return infinity(doubleValue < 0 ? Negative : Positive);
+ }
+ 
+ Decimal Decimal::fromString(const String& str)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-17-xpt-as-flag.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,38 @@
+We need the xptcstubsdef_asm file for Sun Studio, but not necessary for GCC. 
+One of the files was placed in the wrong location and needs to be moved. This 
+part can probably be sent upstream. 
+
+diff --git a/xpcom/reflect/xptcall/md/unix/Makefile.in b/xpcom/reflect/xptcall/md/unix/Makefile.in
+--- a/xpcom/reflect/xptcall/md/unix/Makefile.in
++++ b/xpcom/reflect/xptcall/md/unix/Makefile.in
[email protected]@ -98,6 +98,7 @@
+ 	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
+ 	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
+ 	$(DIST)/include/xptcstubsdef.inc > [email protected]
++ASFLAGS += -I.
+ ifeq (x86_64,$(OS_TEST))
+ ASFLAGS += -xarch=amd64
+ endif
+diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build
+--- a/xpcom/reflect/xptcall/md/unix/moz.build
++++ b/xpcom/reflect/xptcall/md/unix/moz.build
[email protected]@ -68,6 +68,9 @@
+                 'xptcstubs_gcc_x86_unix.cpp'
+             ]
+         else:
++            GENERATED_FILES = [
++                'xptcstubsdef_asm.solx86',
++            ]
+             SOURCES += [
+                 'xptcinvoke_asm_x86_solaris_SUNW.s',
+                 'xptcinvoke_x86_solaris.cpp',
[email protected]@ -267,9 +270,6 @@
+     ]
+ 
+ if CONFIG['OS_ARCH'] == 'SunOS' and CONFIG['OS_TEST'].find('86') == -1:
+-    GENERATED_FILES = [
+-        'xptcstubsdef_asm.solx86',
+-    ]
+     if CONFIG['HAVE_64BIT_BUILD']:
+         SOURCES += [
+             'xptcinvoke_sparcv9_solaris.cpp',
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-18-libvpx_compile.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,56 @@
+Can probably send upstream. 
+
+diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in
+--- a/media/libvpx/Makefile.in
++++ b/media/libvpx/Makefile.in
[email protected]@ -14,6 +14,10 @@
+   ASFLAGS += -D__ANDROID__
+ endif
+ 
++ifeq ($(OS_TARGET),SunOS)
++ASFLAGS+=-DSOLARIS=1
++endif  
++
+ ifdef VPX_ARM_ASM
+ # Building on an ARM platform with a supported assembler, include
+ # the optimized assembly in the build.
[email protected]@ -121,7 +125,7 @@
+ # Workaround a bug of Sun Studio (CR 6963410)
+ ifdef SOLARIS_SUNPRO_CC
+ ifeq (86,$(findstring 86,$(OS_TEST)))
+-filter.o: filter.c Makefile.in
++filter.o: vp8/common/filter.c Makefile.in
+ 	$(REPORT_BUILD)
+ 	@$(MAKE_DEPS_AUTO_CC)
+ 	$(CC) -o [email protected] -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
+diff --git a/media/libvpx/vpx_ports/x86_abi_support.asm b/media/libvpx/vpx_ports/x86_abi_support.asm
+--- a/media/libvpx/vpx_ports/x86_abi_support.asm
++++ b/media/libvpx/vpx_ports/x86_abi_support.asm
[email protected]@ -225,9 +225,13 @@
+   %ifdef CHROMIUM
+     %ifidn __OUTPUT_FORMAT__,macho32
+       %define HIDDEN_DATA(x) x:private_extern
++    %elifidn SOLARIS,1
++      %define HIDDEN_DATA(x) x:data hidden
+     %else
+       %define HIDDEN_DATA(x) x
+     %endif
++  %elifidn SOLARIS,1
++    %define HIDDEN_DATA(x) x:data hidden
+   %else
+     %define HIDDEN_DATA(x) x
+   %endif
[email protected]@ -244,9 +248,13 @@
+   %elifidn __OUTPUT_FORMAT__,macho64
+     %ifdef CHROMIUM
+       %define HIDDEN_DATA(x) x:private_extern
++    %elifidn SOLARIS,1
++      %define HIDDEN_DATA(x) x:data hidden
+     %else
+       %define HIDDEN_DATA(x) x
+     %endif
++  %elifidn SOLARIS,1
++    %define HIDDEN_DATA(x) x:data hidden
+   %else
+     %define HIDDEN_DATA(x) x
+   %endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-19-cubeb.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,547 @@
+For SunAudio audio playback. We need to investigate whether we care about
+this or whether we are just going to support PulseAudio.
+
+diff --git a/media/libcubeb/src/cubeb.c b/media/libcubeb/src/cubeb.c
+--- a/media/libcubeb/src/cubeb.c
++++ b/media/libcubeb/src/cubeb.c
[email protected]@ -56,6 +56,9 @@
+ #if defined(USE_AUDIOTRACK)
+ int audiotrack_init(cubeb ** context, char const * context_name);
+ #endif
++#if defined(USE_SUN)
++int sunaudio_init(cubeb ** context, char const * context_name);
++#endif
+ 
+ int
+ validate_stream_params(cubeb_stream_params stream_params)
[email protected]@ -122,6 +125,9 @@
+ #if defined(USE_AUDIOTRACK)
+     audiotrack_init,
+ #endif
++#if defined(USE_SUN)
++    sunaudio_init,
++#endif
+   };
+   int i;
+ 
+diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build
+--- a/media/libcubeb/src/moz.build
++++ b/media/libcubeb/src/moz.build
[email protected]@ -31,6 +31,12 @@
+     ]
+     DEFINES['USE_SNDIO'] = True
+ 
++if CONFIG['OS_ARCH'] == 'SunOS':
++    SOURCES += [
++        'cubeb_sun.c',
++    ]
++    DEFINES['USE_SUN'] = True
++
+ if CONFIG['OS_TARGET'] == 'Darwin':
+     SOURCES += [
+         'cubeb_audiounit.c',
+diff --git a/media/libcubeb/src/cubeb_sun.c b/media/libcubeb/src/cubeb_sun.c
+new file mode 100644
+--- /dev/null
++++ b/media/libcubeb/src/cubeb_sun.c
[email protected]@ -0,0 +1,500 @@
++/*
++ * Copyright (c) 2013 Ginn Chen <[email protected]>
++ *
++ * This program is made available under an ISC-style license.  See the
++ * accompanying file LICENSE for details.
++ */
++#include <poll.h>
++#include <pthread.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <sys/audio.h>
++#include <sys/stat.h>
++#include <unistd.h>
++#include <sys/stropts.h>
++#include "cubeb/cubeb.h"
++#include "cubeb-internal.h"
++
++/* Macros copied from audio_oss.h */
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++/*
++ * Copyright (C) 4Front Technologies 1996-2008.
++ *
++ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
++ * Use is subject to license terms.
++ */
++#define OSSIOCPARM_MASK 0x1fff          /* parameters must be < 8192 bytes */
++#define OSSIOC_VOID     0x00000000      /* no parameters */
++#define OSSIOC_OUT      0x20000000      /* copy out parameters */
++#define OSSIOC_IN       0x40000000      /* copy in parameters */
++#define OSSIOC_INOUT    (OSSIOC_IN|OSSIOC_OUT)
++#define OSSIOC_SZ(t)    ((sizeof (t) & OSSIOCPARM_MASK) << 16)
++#define __OSSIO(x, y)           ((int)(OSSIOC_VOID|(x<<8)|y))
++#define __OSSIOR(x, y, t)       ((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y))
++#define __OSSIOWR(x, y, t)      ((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y))
++#define SNDCTL_DSP_SPEED        __OSSIOWR('P', 2, int)
++#define SNDCTL_DSP_CHANNELS     __OSSIOWR('P', 6, int)
++#define SNDCTL_DSP_SETFMT       __OSSIOWR('P', 5, int)  /* Selects ONE fmt */
++#define SNDCTL_DSP_GETODELAY    __OSSIOR('P', 23, int)
++#define SNDCTL_DSP_HALT_OUTPUT  __OSSIO('P', 34)
++#define AFMT_S16_LE     0x00000010
++#define AFMT_S16_BE     0x00000020
++
++#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
++#define AFMT_S16_NE    AFMT_S16_BE
++#else
++#define AFMT_S16_NE    AFMT_S16_LE
++#endif
++
++#define DEFAULT_AUDIO_DEVICE "/dev/audio"
++#define DEFAULT_DSP_DEVICE   "/dev/dsp"
++
++#define BUF_SIZE_MS 10
++
++#if defined(CUBEB_SUNAUDIO_DEBUG)
++#define DPR(...) fprintf(stderr, __VA_ARGS__);
++#else
++#define DPR(...) do {} while(0)
++#endif
++
++static struct cubeb_ops const sunaudio_ops;
++
++struct cubeb {
++  struct cubeb_ops const * ops;
++};
++
++struct cubeb_stream {
++  cubeb * context;
++  pthread_t th;			  /* to run real-time audio i/o */
++  pthread_mutex_t mutex;	  /* protects fd and frm_played */
++  int fd;			  /* link us to sunaudio */
++  int active;			  /* cubec_start() called */
++  int conv;			  /* need float->s16 conversion */
++  int using_oss;
++  unsigned char *buf;		  /* data is prepared here */
++  unsigned int rate;
++  unsigned int n_channles;
++  unsigned int bytes_per_ch;
++  unsigned int n_frm;
++  unsigned int buffer_size;
++  int64_t frm_played;
++  cubeb_data_callback data_cb;    /* cb to preapare data */
++  cubeb_state_callback state_cb;  /* cb to notify about state changes */
++  void *arg;			  /* user arg to {data,state}_cb */
++};
++
++static void
++float_to_s16(void *ptr, long nsamp)
++{
++  int16_t *dst = ptr;
++  float *src = ptr;
++
++  while (nsamp-- > 0)
++    *(dst++) = *(src++) * 32767;
++}
++
++static void *
++sunaudio_mainloop(void *arg)
++{
++  struct cubeb_stream *s = arg;
++  int state;
++
++  DPR("sunaudio_mainloop()\n");
++
++  s->state_cb(s, s->arg, CUBEB_STATE_STARTED);
++
++  pthread_mutex_lock(&s->mutex);
++  DPR("sunaudio_mainloop(), started\n");
++
++  for (;;) {
++    if (!s->active) {
++      DPR("sunaudio_mainloop() stopped\n");
++      state = CUBEB_STATE_STOPPED;
++      break;
++    }
++
++    if (!s->using_oss) {
++      audio_info_t info;
++      ioctl(s->fd, AUDIO_GETINFO, &info);
++      if (s->frm_played > info.play.samples + 3 * s->n_frm) {
++        pthread_mutex_unlock(&s->mutex);
++        struct timespec ts = {0, 10000}; // 10 ms
++        nanosleep(&ts, NULL);
++        pthread_mutex_lock(&s->mutex);
++        continue;
++      }
++    }
++
++    pthread_mutex_unlock(&s->mutex);
++    unsigned int got = s->data_cb(s, s->arg, s->buf, s->n_frm);
++    DPR("sunaudio_mainloop() ask %d got %d\n", s->n_frm, got);
++    pthread_mutex_lock(&s->mutex);
++
++    if (got < 0) {
++      DPR("sunaudio_mainloop() cb err\n");
++      state = CUBEB_STATE_ERROR;
++      break;
++    }
++
++    if (s->conv) {
++      float_to_s16(s->buf, got * s->n_channles);
++    }
++
++    unsigned int avail = got * 2 * s->n_channles; // coverted to s16
++    unsigned int pos = 0;
++
++    while (avail > 0 && s->active) {
++      int written = write(s->fd, s->buf + pos, avail);
++      if (written == -1) {
++        if (errno != EINTR && errno != EWOULDBLOCK) {
++          DPR("sunaudio_mainloop() write err\n");
++          state = CUBEB_STATE_ERROR;
++          break;
++        }
++        pthread_mutex_unlock(&s->mutex);
++        struct timespec ts = {0, 10000}; // 10 ms
++        nanosleep(&ts, NULL);
++        pthread_mutex_lock(&s->mutex);
++      } else {
++        pos += written;
++        DPR("sunaudio_mainloop() write %d pos %d\n", written, pos);
++        s->frm_played += written / 2 / s->n_channles;
++        avail -= written;
++      }
++    }
++
++    if ((got  < s->n_frm)) {
++      DPR("sunaudio_mainloop() drained\n");
++      state = CUBEB_STATE_DRAINED;
++      break;
++    }
++  }
++
++  pthread_mutex_unlock(&s->mutex);
++  s->state_cb(s, s->arg, state);
++
++  return NULL;
++}
++
++/*static*/ int
++sunaudio_init(cubeb **context, char const *context_name)
++{
++  DPR("sunaudio_init(%s)\n", context_name);
++  *context = malloc(sizeof(*context));
++  (*context)->ops = &sunaudio_ops;
++  (void)context_name;
++  return CUBEB_OK;
++}
++
++static char const *
++sunaudio_get_backend_id(cubeb *context)
++{
++  return "sunaudio";
++}
++
++static void
++sunaudio_destroy(cubeb *context)
++{
++  DPR("sunaudio_destroy()\n");
++  free(context);
++}
++
++static int
++sunaudio_stream_init(cubeb *context,
++                  cubeb_stream **stream,
++                  char const *stream_name,
++                  cubeb_stream_params stream_params, unsigned int latency,
++                  cubeb_data_callback data_callback,
++                  cubeb_state_callback state_callback,
++                  void *user_ptr)
++{
++  struct cubeb_stream *s;
++  DPR("sunaudio_stream_init(%s)\n", stream_name);
++  size_t size;
++
++  s = malloc(sizeof(struct cubeb_stream));
++  if (s == NULL)
++    return CUBEB_ERROR;
++  s->context = context;
++
++  // If UTAUDIODEV is set, use it with Sun Audio interface
++  char * sa_device_name = getenv("UTAUDIODEV");
++  char * dsp_device_name = NULL;
++  if (!sa_device_name) {
++    dsp_device_name = getenv("AUDIODSP");
++    if (!dsp_device_name) {
++      dsp_device_name = DEFAULT_DSP_DEVICE;
++    }
++    sa_device_name = getenv("AUDIODEV");
++    if (!sa_device_name) {
++      sa_device_name = DEFAULT_AUDIO_DEVICE;
++    }
++  }
++
++  s->using_oss = 0;
++  // Try to use OSS if available
++  if (dsp_device_name) {
++    s->fd = open(dsp_device_name, O_WRONLY | O_NONBLOCK);
++    if (s->fd >= 0) {
++      s->using_oss = 1;
++    }
++  }
++
++  // Try Sun Audio
++  if (!s->using_oss) {
++    s->fd = open(sa_device_name, O_WRONLY | O_NONBLOCK);
++  }
++
++  if (s->fd < 0) {
++    free(s);
++    DPR("sunaudio_stream_init(), open() failed\n");
++    return CUBEB_ERROR;
++  }
++
++  if (s->using_oss) {
++    if (ioctl(s->fd, SNDCTL_DSP_SPEED, &stream_params.rate) < 0) {
++      DPR("ioctl SNDCTL_DSP_SPEED failed.\n");
++      close(s->fd);
++      free(s);
++      return CUBEB_ERROR_INVALID_FORMAT;
++    }
++
++    if (ioctl(s->fd, SNDCTL_DSP_CHANNELS, &stream_params.channels) < 0) {
++      DPR("ioctl SNDCTL_DSP_CHANNELS failed.\n");
++      close(s->fd);
++      free(s);
++      return CUBEB_ERROR_INVALID_FORMAT;
++    }
++
++    int format = AFMT_S16_NE;
++    if (ioctl(s->fd, SNDCTL_DSP_SETFMT, &format) < 0) {
++      DPR("ioctl SNDCTL_DSP_SETFMT failed.\n");
++      close(s->fd);
++      free(s);
++      return CUBEB_ERROR_INVALID_FORMAT;
++    }
++  } else {
++    audio_info_t audio_info;
++    AUDIO_INITINFO(&audio_info)
++    audio_info.play.sample_rate = stream_params.rate;
++    audio_info.play.channels = stream_params.channels;
++    audio_info.play.encoding = AUDIO_ENCODING_LINEAR;
++    audio_info.play.precision = 16;
++    if (ioctl(s->fd, AUDIO_SETINFO, &audio_info) == -1) {
++      DPR("ioctl AUDIO_SETINFO failed.\n");
++      close(s->fd);
++      free(s);
++      return CUBEB_ERROR_INVALID_FORMAT;
++    }
++  }
++
++  s->conv = 0;
++  switch (stream_params.format) {
++    case CUBEB_SAMPLE_S16NE:
++      s->bytes_per_ch = 2;
++      break;
++    case CUBEB_SAMPLE_FLOAT32NE:
++      s->bytes_per_ch = 4;
++      s->conv = 1;
++      break;
++    default:
++      DPR("sunaudio_stream_init() unsupported format\n");
++      close(s->fd);
++      free(s);
++      return CUBEB_ERROR_INVALID_FORMAT;
++  }
++
++  s->active = 0;
++  s->rate = stream_params.rate;
++  s->n_channles = stream_params.channels;
++  s->data_cb = data_callback;
++  s->state_cb = state_callback;
++  s->arg = user_ptr;
++  if (pthread_mutex_init(&s->mutex, NULL) != 0) {
++    free(s);
++    return CUBEB_ERROR;
++  }
++  s->frm_played = 0;
++  s->n_frm = s->rate * BUF_SIZE_MS / 1000;
++  s->buffer_size = s->bytes_per_ch * s->n_channles * s->n_frm;
++  s->buf = malloc(s->buffer_size);
++  if (s->buf == NULL) {
++    close(s->fd);
++    free(s);
++    return CUBEB_ERROR;
++  }
++
++  *stream = s;
++  DPR("sunaudio_stream_init() end, ok\n");
++  return CUBEB_OK;
++}
++
++static void
++sunaudio_stream_destroy(cubeb_stream *s)
++{
++  DPR("sunaudio_stream_destroy()\n");
++  if (s->fd > 0) {
++    // Flush buffer
++    if (s->using_oss) {
++      ioctl(s->fd, SNDCTL_DSP_HALT_OUTPUT);
++    } else {
++      ioctl(s->fd, I_FLUSH);
++    }
++    close(s->fd);
++  }
++  free(s->buf);
++  free(s);
++}
++
++static int
++sunaudio_stream_start(cubeb_stream *s)
++{
++  int err;
++
++  DPR("sunaudio_stream_start()\n");
++  s->active = 1;
++  err = pthread_create(&s->th, NULL, sunaudio_mainloop, s);
++  if (err) {
++    s->active = 0;
++    return CUBEB_ERROR;
++  }
++  return CUBEB_OK;
++}
++
++static int
++sunaudio_stream_stop(cubeb_stream *s)
++{
++  void *dummy;
++
++  DPR("sunaudio_stream_stop()\n");
++  if (s->active) {
++    s->active = 0;
++    pthread_join(s->th, &dummy);
++  }
++  return CUBEB_OK;
++}
++
++static int
++sunaudio_stream_get_position(cubeb_stream *s, uint64_t *p)
++{
++  int rv = CUBEB_OK;
++  pthread_mutex_lock(&s->mutex);
++  if (s->active && s->fd > 0) {
++    if (s->using_oss) {
++      int delay;
++      ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay);
++      int64_t t = s->frm_played - delay / s->n_channles / 2;
++      if (t < 0) {
++        *p = 0;
++      } else {
++        *p = t;
++      }
++    } else {
++      audio_info_t info;
++      ioctl(s->fd, AUDIO_GETINFO, &info);
++      *p = info.play.samples;
++    }
++    DPR("sunaudio_stream_get_position() %lld\n", *p);
++  } else {
++    rv = CUBEB_ERROR;
++  }
++  pthread_mutex_unlock(&s->mutex);
++  return rv;
++}
++
++static int
++sunaudio_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
++{
++  if (!ctx || !max_channels)
++    return CUBEB_ERROR;
++
++  *max_channels = 2;
++
++  return CUBEB_OK;
++}
++
++static int
++sunaudio_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate)
++{
++  if (!ctx || !rate)
++    return CUBEB_ERROR;
++
++  // XXX Not yet implemented.
++  *rate = 44100;
++
++  return CUBEB_OK;
++}
++
++static int
++sunaudio_get_min_latency(cubeb * ctx, cubeb_stream_params params, uint32_t * latency_ms)
++{
++  if (!ctx || !latency_ms)
++    return CUBEB_ERROR;
++
++  // XXX Not yet implemented.
++  *latency_ms = 20;
++
++  return CUBEB_OK;
++}
++
++static int
++sunaudio_stream_get_latency(cubeb_stream * s, uint32_t * latency)
++{
++  if (!s || !latency)
++    return CUBEB_ERROR;
++
++  int rv = CUBEB_OK;
++  pthread_mutex_lock(&s->mutex);
++  if (s->active && s->fd > 0) {
++    if (s->using_oss) {
++      int delay;
++      ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay);
++      *latency = delay / s->n_channles / 2 / s->rate;
++    } else {
++      audio_info_t info;
++      ioctl(s->fd, AUDIO_GETINFO, &info);
++      *latency = (s->frm_played - info.play.samples) / s->rate;
++    }
++    DPR("sunaudio_stream_get_position() %lld\n", *p);
++  } else {
++    rv = CUBEB_ERROR;
++  }
++  pthread_mutex_unlock(&s->mutex);
++  return rv;
++}
++
++static struct cubeb_ops const sunaudio_ops = {
++  .init = sunaudio_init,
++  .get_backend_id = sunaudio_get_backend_id,
++  .destroy = sunaudio_destroy,
++  .get_preferred_sample_rate = sunaudio_get_preferred_sample_rate,
++  .stream_init = sunaudio_stream_init,
++  .stream_destroy = sunaudio_stream_destroy,
++  .stream_start = sunaudio_stream_start,
++  .stream_stop = sunaudio_stream_stop,
++  .stream_get_position = sunaudio_stream_get_position,
++  .get_max_channel_count = sunaudio_get_max_channel_count,
++  .get_min_latency = sunaudio_get_min_latency,
++  .stream_get_latency = sunaudio_stream_get_latency
++};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-20-gfx.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,28 @@
+Compiler specific. Can potentially send upstream with an ifdef Solaris
+statement. 
+
+diff --git a/gfx/2d/FilterProcessingSIMD-inl.h b/gfx/2d/FilterProcessingSIMD-inl.h
+--- a/gfx/2d/FilterProcessingSIMD-inl.h
++++ b/gfx/2d/FilterProcessingSIMD-inl.h
[email protected]@ -490,7 +490,7 @@
+   // int16_t rows_ra[8] == { rB, rG, rR, rA, aB, aG, aR, aA }.
+   // int32_t bias[4] == { _B, _G, _R, _A }.
+ 
+-  i32x4_t sum = bias;
++  i32x4_t sum = (i32x4_t)bias;
+ 
+   // int16_t bg[8] = { b, g, b, g, b, g, b, g };
+   i16x8_t bg = simd::ShuffleHi16<1,0,1,0>(simd::ShuffleLo16<1,0,1,0>(p));
+diff --git a/gfx/2d/SIMD.h b/gfx/2d/SIMD.h
+--- a/gfx/2d/SIMD.h
++++ b/gfx/2d/SIMD.h
[email protected]@ -10,8 +10,8 @@
+  * Consumers of this file need to #define SIMD_COMPILE_SSE2 before including it
+  * if they want access to the SSE2 functions.
+  */
+-
+ #ifdef SIMD_COMPILE_SSE2
++#include <emmintrin.h>
+ #include <xmmintrin.h>
+ #endif
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-21-mozconfig_loader_bash.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,12 @@
+This patch is needed because the default shell on Solaris has issues. 
+Still needed for ksh93 on S11 and S12.
+
+diff --git a/python/mozbuild/mozbuild/mozconfig_loader b/python/mozbuild/mozbuild/mozconfig_loader
+--- a/python/mozbuild/mozbuild/mozconfig_loader
++++ b/python/mozbuild/mozbuild/mozconfig_loader
[email protected]@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-22-snappy.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,25 @@
+Defined Endians.
+Can potentially go upstream.
+
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
[email protected]@ -9620,6 +9620,18 @@
+ #define SOLARIS 1
+ EOF
+ 
++    if test "$CPU_ARCH" = "sparc"; then
++ cat >> confdefs.pytmp <<\EOF
++  (''' WORDS_BIGENDIAN ''', ' 1 ')
++  (''' IS_BIG_ENDIAN ''', ' 1 ')
++EOF
++cat >> confdefs.h <<\EOF
++#define WORDS_BIGENDIAN 1
++#define IS_BIG_ENDIAN 1
++EOF
++
++    fi
++
+     TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
+     MOZ_FIX_LINK_PATHS=
+     # $ORIGIN/.. is for shared libraries under components/ to locate shared
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-23-skia_gpu.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,20 @@
+Returns an error if big endian. We probably don't need to worry about this
+since we don't use Skia gpu.
+Seems sparc specific. To be investigated.
+
+diff --git a/gfx/skia/trunk/include/gpu/GrTypes.h b/gfx/skia/trunk/include/gpu/GrTypes.h
+--- a/gfx/skia/trunk/include/gpu/GrTypes.h
++++ b/gfx/skia/trunk/include/gpu/GrTypes.h
[email protected]@ -309,9 +309,9 @@
+ static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
+ 
+ // Aliases for pixel configs that match skia's byte order.
+-#ifndef SK_CPU_LENDIAN
+-    #error "Skia gpu currently assumes little endian"
+-#endif
++// #ifndef SK_CPU_LENDIAN
++//    #error "Skia gpu currently assumes little endian"
++// #endif
+ #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
+     static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
+ #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-24-test.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,47 @@
+For testing. Commented out some tests that are known not to work on Solaris. 
+Solaris-specific patch.
+
+diff --git a/docshell/test/unit/test_bug414201_jfif.js b/docshell/test/unit/test_bug414201_jfif.js
+--- a/docshell/test/unit/test_bug414201_jfif.js
++++ b/docshell/test/unit/test_bug414201_jfif.js
[email protected]@ -20,8 +20,9 @@
+     /* Check whether the primary extension is what we'd expect */
+     for (var mimetype in types) {
+         var exts = types[mimetype];
+-        var primary = ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase();
++// Known issue on Solaris
++//        var primary = ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase();
+ 
+-        do_check_true (exts.indexOf(primary) != -1);
++//        do_check_true (exts.indexOf(primary) != -1);
+     }
+ }
+diff --git a/dom/tests/unit/test_geolocation_provider.js b/dom/tests/unit/test_geolocation_provider.js
+--- a/dom/tests/unit/test_geolocation_provider.js
++++ b/dom/tests/unit/test_geolocation_provider.js
[email protected]@ -70,6 +70,7 @@
+     // needs a place where it can store databases.
+     do_get_profile();
+ 
++/* Network issue
+     // only kill this test when shutdown is called on the provider.
+     do_test_pending();
+ 
[email protected]@ -89,4 +90,5 @@
+ 
+     geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
+     watchID = geolocation.watchPosition(successCallback, errorCallback);
++*/
+ }
+diff --git a/gfx/tests/gtest/TestLayers.cpp b/gfx/tests/gtest/TestLayers.cpp
+--- a/gfx/tests/gtest/TestLayers.cpp
++++ b/gfx/tests/gtest/TestLayers.cpp
[email protected]@ -102,7 +102,7 @@
+ 
+ TEST(Layers, Defaults) {
+   TestContainerLayer layer(nullptr);
+-  ASSERT_EQ(1.0, layer.GetOpacity());
++  ASSERT_EQ(1.0f, layer.GetOpacity());
+   ASSERT_EQ(1.0f, layer.GetPostXScale());
+   ASSERT_EQ(1.0f, layer.GetPostYScale());
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-25-rules_mk.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+The ninstall... function is not callable for some reason, so we need to copy
+the definition when using install_cmd.
+
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
[email protected]@ -1402,7 +1402,7 @@
+ nsinstall_is_usable = $(if $(wildcard $(DEPTH)/config/nsinstall$(HOST_BIN_SUFFIX)),yes)
+     
+ define install_cmd_override
+-$(1): install_cmd = $$(if $$(nsinstall_is_usable),$$(INSTALL),$$(NSINSTALL_PY) -t) $$(1)
++$(1): install_cmd = $$(if $(wildcard $(DIST)/bin/nsinstall$(HOST_BIN_SUFFIX)),$$(INSTALL),$$(NSINSTALL_PY) -t) $$(1)
+ endef
+ endif
+ endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-26-jit-test-multi-processes.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,16 @@
+For testing. This reduces memory needed for JIT test. The -f flag will print
+the full patch of failures (want to keep this).
+In-house patch for testing.
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
[email protected]@ -134,7 +134,7 @@
+ 
+ check-jit-test::
+ 	$(JITTEST_ASAN_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
+-	        --no-slow --no-progress --format=automation --jitflags=all \
++	        --no-slow --no-progress --format=automation --jitflags=all -j 2 -f \
+ 			$(JITTEST_VALGRIND_FLAG) \
+ 			$(JITTEST_EXTRA_ARGS) \
+                	$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-27-stacksize.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,16 @@
+For sparc. Our function frame is very big, so on sparc we need more stack size.
+Potentially send upstream. 
+
+diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
+--- a/js/src/jsapi.cpp
++++ b/js/src/jsapi.cpp
[email protected]@ -1491,6 +1491,9 @@
+ static void
+ SetNativeStackQuotaAndLimit(JSRuntime* rt, StackKind kind, size_t stackSize)
+ {
++#ifdef JS_CPU_SPARC
++    stackSize = stackSize * 8 < 7 * 1024 * 1024 ? stackSize * 8 : 7 * 1024 * 1024;
++#endif
+     rt->nativeStackQuota[kind] = stackSize;
+      
+ #if JS_STACK_GROWTH_DIRECTION > 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-28-configure.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,55 @@
+Shell translations. 
+
+diff --git a/js/src/configure b/js/src/configure
+--- a/js/src/configure
++++ b/js/src/configure
[email protected]@ -1230,7 +1230,7 @@
+   fi
+ 
+     fi
+-    IS_GCC=$($CC -v 2>&1 | grep gcc)
++    IS_GCC=`$CC -v 2>&1 | grep gcc`
+     if test -n "$IS_GCC"
+     then
+       echo gcc is known to be broken on OS X, please use clang.
[email protected]@ -4426,7 +4426,7 @@
+ for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
+   possible=$base/python/mozbuild/mozbuild/virtualenv.py
+ 
+-  if test -e $possible; then
++  if test -f $possible; then
+     _virtualenv_topsrcdir=$base
+     _virtualenv_populate_path=$possible
+     break
[email protected]@ -8743,12 +8743,12 @@
+ 
+ if test "$GNU_CC" -a -n "$MOZ_FORCE_GOLD"; then
+             if $CC -Wl,--version 2>&1 | grep -q "GNU ld"; then
+-        GOLD=$($CC -print-prog-name=ld.gold)
++        GOLD=`$CC -print-prog-name=ld.gold`
+         case "$GOLD" in
+         /*)
+             ;;
+         *)
+-            GOLD=$(which $GOLD)
++            GOLD=`which $GOLD`
+             ;;
+         esac
+         if test -n "$GOLD"; then
[email protected]@ -16322,9 +16322,12 @@
+ 
+ 
+ rm -fr confdefs* $ac_clean_files
+-if test "$no_create" != yes && ! ${PYTHON} $CONFIG_STATUS; then
++if test "$no_create" != yes; then
++  ${PYTHON} $CONFIG_STATUS
++  if test "$?" != 0; then
+     trap '' EXIT
+     exit 1
+-fi
+-
+-fi
++  fi
++fi
++
++fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-29-sparc-xptcall.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,55 @@
+See Mozilla bug #1153707 - [JavaScript Error: "invalid 'in' operand
+aLivemarkInfo"] when calling method: [mozIAsyncLivemarks::getLivemark].
+Has been sent upstream in the past but does not seem to have been accepted.
+
+diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp
+--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
++++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
[email protected]@ -1295,21 +1295,9 @@
+                 break;
+         }
+ 
+-// see bug #961488
+-#if (defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(_AIX)) && \
+-    ((defined(__sparc) && !defined(__sparcv9) && !defined(__sparcv9__)) || \
+-    (defined(__powerpc__) && !defined (__powerpc64__)))
+-        if (type_tag == nsXPTType::T_JSVAL) {
+-            if (!XPCConvert::JSData2Native(*(void**)(&pv->val), val, type,
+-                                           &param_iid, nullptr))
+-                break;
+-        } else
+-#endif
+-        {
+-            if (!XPCConvert::JSData2Native(&pv->val, val, type,
+-                                           &param_iid, nullptr))
+-                break;
+-        }
++        if (!XPCConvert::JSData2Native(&pv->val, val, type,
++                                       &param_iid, nullptr))
++            break;
+     }
+ 
+     // if any params were dependent, then we must iterate again to convert them.
+diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
+--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
++++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
[email protected]@ -52,13 +52,17 @@
+
+         if(param.IsOut() || !type.IsArithmetic())
+         {
+-            dp->val.p = (void*) *ap;
++            if (type == nsXPTType::T_JSVAL)
++                dp->val.p = *((void**)*ap);
++            else
++                dp->val.p = (void*) *ap;
++
+             continue;
+         }
+         // else
+         switch(type)
+         {
+-        case nsXPTType::T_I8     : dp->val.i8  = *((int32_t*)  ap);       break;
++        case nsXPTType::T_I8     : dp->val.i8  = *((int32_t*) ap);       break;
+         case nsXPTType::T_I16    : dp->val.i16 = *((int32_t*) ap);       break;
+         case nsXPTType::T_I32    : dp->val.i32 = *((int32_t*) ap);       break;
+         case nsXPTType::T_DOUBLE :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-30-other-buildissue.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,104 @@
+Various ifdef Solaris fixes. 
+Recast for getpid() because it requires an int. 
+Changing default flags for compiling on SSE. We can try removing these or add
+them to the config lines in Makefile. 
+
+diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild
+--- a/build/gyp.mozbuild
++++ b/build/gyp.mozbuild
[email protected]@ -45,6 +45,7 @@
+     'moz_widget_toolkit_gonk': 0,
+     'moz_webrtc_omx': 0,
+ 
++    'use_official_google_api_keys': 0,
+     # (for vp8) chromium sets to 0 also
+     'use_temporal_layers': 0,
+ 
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
[email protected]@ -9650,8 +9650,8 @@
+        CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
+        LDFLAGS="-xildoff $LDFLAGS"
+        MMX_FLAGS="-xarch=mmx -xO4"
+-       SSE_FLAGS="-xarch=sse"
+-       SSE2_FLAGS="-xarch=ssei2 -xO4"
++       SSE_FLAGS="-xarch=sse -xO4"
++       SSE2_FLAGS="-xarch=sse2 -xO4"
+        if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
+            _SAVE_LDFLAGS=$LDFLAGS
+            LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
+diff --git a/media/libsoundtouch/src/FIRFilter.cpp b/media/libsoundtouch/src/FIRFilter.cpp
+--- a/media/libsoundtouch/src/FIRFilter.cpp
++++ b/media/libsoundtouch/src/FIRFilter.cpp
[email protected]@ -46,6 +46,10 @@
+ #include "FIRFilter.h"
+ #include "cpu_detect.h"
+ 
++#ifdef __sun
++#include <alloca.h>
++#endif
++
+ #ifdef _MSC_VER
+ #include <malloc.h>
+ #define alloca _alloca
+diff --git a/media/libsoundtouch/src/SoundTouch.cpp b/media/libsoundtouch/src/SoundTouch.cpp
+--- a/media/libsoundtouch/src/SoundTouch.cpp
++++ b/media/libsoundtouch/src/SoundTouch.cpp
[email protected]@ -80,6 +80,10 @@
+ #include "RateTransposer.h"
+ #include "cpu_detect.h"
+ 
++#ifdef __sun
++#include <alloca.h>
++#endif
++
+ #ifdef _MSC_VER
+ #include <malloc.h>
+ #define alloca _alloca
+diff --git a/media/webrtc/trunk/build/common.gypi b/media/webrtc/trunk/build/common.gypi
+--- a/media/webrtc/trunk/build/common.gypi
++++ b/media/webrtc/trunk/build/common.gypi
[email protected]@ -917,11 +917,16 @@
+     'android_app_version_name%': 'Developer Build',
+     'android_app_version_code%': 0,
+ 
+-    'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
+-    'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
++    'conditions': [
++      ['OS=="win"', {
++        'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
++        'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
++      }],
++    ],
+ 
+     'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
+     'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
++    'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
+ 
+     'conditions': [
+       ['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
+diff --git a/memory/volatile/VolatileBufferFallback.cpp b/memory/volatile/VolatileBufferFallback.cpp
+--- a/memory/volatile/VolatileBufferFallback.cpp
++++ b/memory/volatile/VolatileBufferFallback.cpp
[email protected]@ -7,7 +7,7 @@
+ #include "mozilla/mozalloc.h"
+ 
+ #ifdef MOZ_MEMORY
+-int posix_memalign(void** memptr, size_t alignment, size_t size);
++extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size);
+ #endif
+ 
+ namespace mozilla {
+diff --git a/xpcom/base/nsStatusReporterManager.cpp b/xpcom/base/nsStatusReporterManager.cpp
+--- a/xpcom/base/nsStatusReporterManager.cpp
++++ b/xpcom/base/nsStatusReporterManager.cpp
[email protected]@ -148,7 +148,7 @@
+   nsresult rv;
+ 
+   nsCString filename("status-reports-");
+-  filename.AppendInt(getpid());
++  filename.AppendInt((int)getpid());
+   filename.Append('-');
+   filename.AppendInt(number++);
+   filename.AppendLiteral(".json");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-31-urlbar-sparc.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,17 @@
+For the font in the URL bar. Can try to send upstream.
+
+diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c
+--- a/gfx/cairo/cairo/src/cairo-xlib-surface.c
++++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c
[email protected]@ -1310,7 +1310,11 @@
+ 		int a, r, g, b;
+ 
+ 		if (image_masks.bpp == 1)
++#ifdef WORDS_BIGENDIAN
++		    in_pixel = !! (((uint8_t*)row)[x/8] & (1 << (7 - (x & 7))));
++#else
+		    in_pixel = !! (((uint8_t*)row)[x/8] & (1 << (x & 7)));
++#endif
+ 		else if (image_masks.bpp <= 8)
+ 		    in_pixel = ((uint8_t*)row)[x];
+ 		else if (image_masks.bpp <= 16)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-32-solaris_jemalloc_linkage.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,124 @@
+This patch makes it so jemalloc is not included in firefox. Not accepted by 
+the upstream community. 
+Put jemalloc inside libxul. Then need firefox to depend on libxul
+and build jemalloc library.
+Remove lines - do not include memory for every program
+Need to create/add our own versions of the functions malloc_usable, jemalloc_stats, etc.
+Remove mozalloc library
+Check if we have jemalloc; if not, skip it.
+Build libxul and use flags -Wl,-z,interpose, needed to build the library.
+
+diff --git a/config/jemalloc_solaris.map b/config/jemalloc_solaris.map
+new file mode 100644
+--- /dev/null
++++ b/config/jemalloc_solaris.map
[email protected]@ -0,0 +1,12 @@
++{
++    global:
++        calloc             = NODIRECT;
++        free               = NODIRECT;
++        jemalloc_stats     = NODIRECT;
++        malloc             = NODIRECT;
++        malloc_usable_size = NODIRECT;
++        memalign           = NODIRECT;
++        posix_memalign     = NODIRECT;
++        realloc            = NODIRECT;
++        valloc             = NODIRECT;
++};
+diff --git a/memory/mozalloc/mozalloc.cpp b/memory/mozalloc/mozalloc.cpp
+--- a/memory/mozalloc/mozalloc.cpp
++++ b/memory/mozalloc/mozalloc.cpp
[email protected]@ -200,6 +200,14 @@
+ }
+ #endif // if defined(HAVE_VALLOC)
+ 
++#if defined(MOZ_MEMORY_SOLARIS)
++#include "jemalloc_types.h"
++extern "C" {
++extern size_t malloc_usable_size(const void *ptr);
++extern void jemalloc_stats(jemalloc_stats_t* stats);
++}
++#endif
++
+ size_t
+ moz_malloc_usable_size(void *ptr)
+ {
[email protected]@ -209,7 +217,22 @@
+ #if defined(XP_MACOSX)
+     return malloc_size(ptr);
+ #elif defined(HAVE_MALLOC_USABLE_SIZE) || defined(MOZ_MEMORY)
++#if defined(SOLARIS)
++    static bool checked = false;
++    static bool using_jemalloc = false;
++    if (!checked) {
++        checked = true;
++        jemalloc_stats_t stats;
++        jemalloc_stats(&stats);
++        using_jemalloc = stats.allocated;
++    }
++    if (using_jemalloc)
++        return malloc_usable_size(ptr);
++    else
++        return 0;
++#else
+     return malloc_usable_size(ptr);
++#endif
+ #elif defined(XP_WIN)
+     return _msize(ptr);
+ #else
+diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp
+--- a/storage/src/mozStorageService.cpp
++++ b/storage/src/mozStorageService.cpp
[email protected]@ -514,9 +514,14 @@
+   int rc;
+ 
+ #ifdef MOZ_STORAGE_MEMORY
+-  rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
+-  if (rc != SQLITE_OK)
+-    return convertResultCode(rc);
++  // in case other malloc library is PRELOAD-ed
++  void *test_jemalloc = malloc(4);
++  if (::moz_malloc_usable_size(test_jemalloc)) {
++    rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
++    if (rc != SQLITE_OK)
++      return convertResultCode(rc);
++  }
++  free(test_jemalloc);
+ #endif
+ 
+   // Explicitly initialize sqlite3.  Although this is implicitly called by
+diff --git a/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in b/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in
+--- a/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in
++++ b/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in
[email protected]@ -165,16 +165,19 @@ static const bool config_ivsalloc =
+  *   JEMALLOC_H_INLINES : Inline functions.
+  */
+ /******************************************************************************/
+ #define	JEMALLOC_H_TYPES
+ 
+ #include "jemalloc/internal/jemalloc_internal_macros.h"
+ 
+ /* Size class index type. */
++#ifdef __sun
++#define index_t je_index_t
++#endif
+ typedef unsigned index_t;
+ 
+ #define	MALLOCX_ARENA_MASK	((int)~0xff)
+ #define	MALLOCX_LG_ALIGN_MASK	((int)0x3f)
+ /* Use MALLOCX_ALIGN_GET() if alignment may not be specified in flags. */
+ #define	MALLOCX_ALIGN_GET_SPECIFIED(flags)				\
+     (ZU(1) << (flags & MALLOCX_LG_ALIGN_MASK))
+ #define	MALLOCX_ALIGN_GET(flags)					\
+--- a/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in	2015-09-15 13:37:17.326056000 +0800
++++ b/memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in	2015-09-15 13:37:51.959830000 +0800
[email protected]@ -204,6 +204,9 @@
+ #  ifdef __alpha__
+ #    define LG_QUANTUM		4
+ #  endif
++#  ifdef __sparc__
++#    define LG_QUANTUM		4
++#  endif
+ #  ifdef __sparc64__
+ #    define LG_QUANTUM		4
+ #  endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-33-ycbcr2.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,30 @@
+EMMS() is not in sparc. 
+
+diff --git a/gfx/ycbcr/yuv_convert.cpp b/gfx/ycbcr/yuv_convert.cpp
+--- a/gfx/ycbcr/yuv_convert.cpp
++++ b/gfx/ycbcr/yuv_convert.cpp
[email protected]@ -105,9 +105,11 @@
+     }
+   }
+ 
++#ifdef ARCH_CPU_X86_FAMILY
+   // MMX used for FastConvertYUVToRGB32Row requires emms instruction.
+   if (has_sse)
+     EMMS();
++#endif
+ }
+ 
+ // C version does 8 at a time to mimic MMX code
[email protected]@ -348,9 +350,12 @@
+ #endif
+     }
+   }
++
++#ifdef ARCH_CPU_X86_FAMILY
+   // MMX used for FastConvertYUVToRGB32Row and FilterRows requires emms.
+   if (has_mmx)
+     EMMS();
++#endif
+ }
+ 
+ }  // namespace gfx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-34-lz4-restrict-keyword.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,16 @@
+Correctly recognize the "restrict" keyword for the lz4.c file included in
+Compression.cpp
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57025
+
+diff --git a/mfbt/lz4.c b/mfbt/lz4.c
+--- a/mfbt/lz4.c
++++ b/mfbt/lz4.c
[email protected]@ -104,7 +104,7 @@
+ /**************************************
+  Compiler Options
+ **************************************/
+-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)   /* C99 */
++#if defined(__STDC_VERSION__) && !defined(__cplusplus) && (__STDC_VERSION__ >= 199901L)   /* C99 */
+ /* "restrict" is a known keyword */
+ #else
+ #  define restrict /* Disable restrict */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-35-mozalloc.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,31 @@
+Correctly define malloc_usable_size
+
+Get correct abort() function definition for Solaris.
+
+diff --git a/memory/mozalloc/mozalloc.cpp b/memory/mozalloc/mozalloc.cpp
+--- a/memory/mozalloc/mozalloc.cpp
++++ b/memory/mozalloc/mozalloc.cpp
[email protected]@ -208,6 +208,8 @@
+ }
+ #endif
+
++extern "C" size_t malloc_usable_size(const void *ptr);
++
+ size_t
+ moz_malloc_usable_size(void *ptr)
+ {
+diff --git a/memory/mozalloc/mozalloc_abort.cpp b/memory/mozalloc/mozalloc_abort.cpp
+--- a/memory/mozalloc/mozalloc_abort.cpp
++++ b/memory/mozalloc/mozalloc_abort.cpp
[email protected]@ -63,7 +63,11 @@
+ // Define abort() here, so that it is used instead of the system abort(). This
+ // lets us control the behavior when aborting, in order to get better results
+ // on *NIX platforms. See mozalloc_abort for details.
++#if defined(SOLARIS)
++void std::abort(void)
++#else
+ void abort(void)
++#endif
+ {
+ #ifdef MOZ_WIDGET_ANDROID
+     char msg[64] = {};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-36-xpopen.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,15 @@
+Prevent:
+error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications
+
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
[email protected]@ -9759,6 +9759,8 @@
+ cross_compiling=$ac_cv_prog_cc_cross
+ 
+     else
++       CFLAGS="$CFLAGS -D_XPG6 -D__EXTENSIONS__"
++       CXXFLAGS="$CXXFLAGS -D_XPG6 -D__EXTENSIONS__"
+        LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
+        LIBS="-lc $LIBS"
+        MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-37-ipc.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,2005 @@
+There are a lot of separate ipcv2 patches collected here in one file.
+Some of them are Studio specific and can hopefully be removed.
+
+In more detail: 
+
+First part is for studio, we may be able to remove. 
+Need to keep the if defined(OS_LINUX)... parts, should try to send upstream. 
+Using evpoll/devpoll instead of epoll may be Studio specific. 
+asm_volatile changes may also be studio specific. 
+
+For Solaris, we have no proc/self/exe location so we get the name of the 
+process some other way. Should be able to send this part upstream. 
+
+Patch to use FTS (tool for traversing tool hierarchies). We have these
+functions but they're not in libraries for C. This part is included in firefox
+40. 
+
+ENABLE_XSS_SUPPORT links XSS libraries; needs further investigation. 
+
+In Solaris, the queue can be too long so we have it read 32 bits only (?) for
+the wakeup_pip_read function. 
+
+DCHECK(std::find...) may be because we couldn't compile it otherwise. Needs
+namespace added. 
+
+We can remove the part for wstring because it's for studio. 
+
+Solaris specific change for adding definition of thr_self. 
+
+Differing memory for munmap((caddr_t)... patch
+
+We don't have timestruct defined in solaris (#ifndef SOLARIS...timstruct...)
+
+event2/event-config.h: Adds a new file so that libevent will compile on Solaris.In the .mozconfig file, we are using system libevent, so this shouldn't be necessary.
+
+IPC_RMID -- shared memory; on solaris, need to detach the shared memory first. So we move that segment of code up. If we detach the memory in Solaris, we cannot do a new attach.
+
+Add flags for Studio compiler. (CXXFLAGS)
+
+extern *C* int madvise(...) not defined , so we need to define it.
+
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
[email protected]@ -9647,7 +9647,7 @@
+ EOF
+ 
+        CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
+-       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
++       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
+        LDFLAGS="-xildoff $LDFLAGS"
+        MMX_FLAGS="-xarch=mmx -xO4"
+        SSE_FLAGS="-xarch=sse -xO4"
+diff --git a/dom/plugins/ipc/PluginMessageUtils.cpp b/dom/plugins/ipc/PluginMessageUtils.cpp
+--- a/dom/plugins/ipc/PluginMessageUtils.cpp
++++ b/dom/plugins/ipc/PluginMessageUtils.cpp
[email protected]@ -85,7 +85,7 @@
+   }
+ }
+ 
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+ static string
+ ReplaceAll(const string& haystack, const string& needle, const string& with)
+ {
[email protected]@ -104,7 +104,7 @@
+ string
+ MungePluginDsoPath(const string& path)
+ {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   // https://bugzilla.mozilla.org/show_bug.cgi?id=519601
+   return ReplaceAll(path, "netscape", "[email protected]");
+ #else
[email protected]@ -115,7 +115,7 @@
+ string
+ UnmungePluginDsoPath(const string& munged)
+ {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   return ReplaceAll(munged, "[email protected]", "netscape");
+ #else
+   return munged;
+diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
+--- a/dom/plugins/ipc/PluginModuleChild.cpp
++++ b/dom/plugins/ipc/PluginModuleChild.cpp
[email protected]@ -320,7 +320,7 @@
+ 
+     // TODO: use PluginPRLibrary here
+ 
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+     mShutdownFunc =
+         (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
+ 
[email protected]@ -351,9 +351,11 @@
+ }
+ 
+ #if defined(MOZ_WIDGET_GTK)
++extern "C" {
+ typedef void (*GObjectDisposeFn)(GObject*);
+ typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
+ typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
++}
+ 
+ static GObjectDisposeFn real_gtk_plug_dispose;
+ static GtkPlugEmbeddedFn real_gtk_plug_embedded;
[email protected]@ -1882,7 +1884,7 @@
+     AssertPluginThread();
+     MOZ_ASSERT(mIsChrome);
+ 
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+     return true;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+     *_retval = mGetEntryPointsFunc(&mFunctions);
[email protected]@ -1927,7 +1929,7 @@
+ #endif
+ 
+     NPError result;
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+     result = mInitializeFunc(&sBrowserFuncs, &mFunctions);
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+     result = mInitializeFunc(&sBrowserFuncs);
+diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
+--- a/dom/plugins/ipc/PluginModuleChild.h
++++ b/dom/plugins/ipc/PluginModuleChild.h
[email protected]@ -328,7 +328,7 @@
+ 
+     // we get this from the plugin
+     NP_PLUGINSHUTDOWN mShutdownFunc;
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+     NP_PLUGINUNIXINIT mInitializeFunc;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+     NP_PLUGININIT mInitializeFunc;
+diff --git a/dom/plugins/ipc/PluginProcessParent.cpp b/dom/plugins/ipc/PluginProcessParent.cpp
+--- a/dom/plugins/ipc/PluginProcessParent.cpp
++++ b/dom/plugins/ipc/PluginProcessParent.cpp
[email protected]@ -143,6 +143,9 @@
+         else if (base::PROCESS_ARCH_ARM & pluginLibArchitectures & containerArchitectures) {
+           selectedArchitecture = base::PROCESS_ARCH_ARM;
+         }
++        else if (base::PROCESS_ARCH_SPARC & pluginLibArchitectures & containerArchitectures) {
++          selectedArchitecture = base::PROCESS_ARCH_SPARC;
++        }
+         else {
+             return false;
+         }
+diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild
+--- a/ipc/chromium/chromium-config.mozbuild
++++ b/ipc/chromium/chromium-config.mozbuild
[email protected]@ -45,6 +45,9 @@
+     if CONFIG['OS_ARCH'] == 'Darwin':
+         DEFINES['OS_MACOSX'] = 1
+ 
++    elif CONFIG['OS_ARCH'] == 'SunOS':
++        DEFINES['OS_SOLARIS'] = 1
++
+     elif CONFIG['OS_ARCH'] == 'DragonFly':
+         DEFINES.update({
+             'OS_DRAGONFLY': 1,
+diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build
+--- a/ipc/chromium/moz.build
++++ b/ipc/chromium/moz.build
[email protected]@ -205,17 +205,25 @@
+             'moc_message_pump_qt.cc',
+         ]
+     if not CONFIG['MOZ_NATIVE_LIBEVENT']:
+-        if CONFIG['OS_TARGET'] != 'Android':
++        if CONFIG['OS_TARGET'] != 'SunOS':
++            if CONFIG['OS_TARGET'] != 'Android':
++                SOURCES += [
++                    'src/third_party/libevent/epoll_sub.c',
++                ]
+             SOURCES += [
+-                'src/third_party/libevent/epoll_sub.c',
++                'src/third_party/libevent/epoll.c',
+             ]
+-        SOURCES += [
+-            'src/third_party/libevent/epoll.c',
+-        ]
+         if CONFIG['OS_TARGET'] == 'Android':
+             LOCAL_INCLUDES += ['src/third_party/libevent/android']
+         else:
+-            LOCAL_INCLUDES += ['src/third_party/libevent/linux']
++            if CONFIG['OS_TARGET'] != 'SunOS':
++                LOCAL_INCLUDES += ['src/third_party/libevent/linux']
++            else:
++                LOCAL_INCLUDES += ['src/third_party/libevent/solaris']
++                SOURCES += [
++                    'src/third_party/libevent/devpoll.c',
++                    'src/third_party/libevent/evport.c',
++                ]
+ 
+ if os_bsd:
+     SOURCES += [
+diff --git a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc
+--- a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc
++++ b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc
[email protected]@ -19,13 +19,13 @@
+ // Inline cpuid instruction.  In PIC compilations, %ebx contains the address
+ // of the global offset table.  To avoid breaking such executables, this code
+ // must preserve that register's value across cpuid instructions.
+-#if defined(__i386__)
++#if defined(__i386__) || defined (__i386)
+ #define cpuid(a, b, c, d, inp) \
+   asm ("mov %%ebx, %%edi\n"    \
+        "cpuid\n"               \
+        "xchg %%edi, %%ebx\n"   \
+        : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
+-#elif defined (__x86_64__)
++#elif defined (__x86_64__) || defined(__x86_64)
+ #define cpuid(a, b, c, d, inp) \
+   asm ("mov %%rbx, %%rdi\n"    \
+        "cpuid\n"               \
+diff --git a/ipc/chromium/src/base/atomicops_internals_x86_gcc.h b/ipc/chromium/src/base/atomicops_internals_x86_gcc.h
+--- a/ipc/chromium/src/base/atomicops_internals_x86_gcc.h
++++ b/ipc/chromium/src/base/atomicops_internals_x86_gcc.h
[email protected]@ -29,18 +29,18 @@
+                                          Atomic32 old_value,
+                                          Atomic32 new_value) {
+   Atomic32 prev;
+-  __asm__ __volatile__("lock; cmpxchgl %1,%2"
++  __asm__ __volatile__("lock; cmpxchgl %1,(%2)"
+                        : "=a" (prev)
+-                       : "q" (new_value), "m" (*ptr), "0" (old_value)
++                       : "q" (new_value), "r" (ptr), "0" (old_value)
+                        : "memory");
+   return prev;
+ }
+ 
+ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+                                          Atomic32 new_value) {
+-  __asm__ __volatile__("xchgl %1,%0"  // The lock prefix is implicit for xchg.
++  __asm__ __volatile__("xchgl (%1),%0"  // The lock prefix is implicit for xchg.
+                        : "=r" (new_value)
+-                       : "m" (*ptr), "0" (new_value)
++                       : "r" (ptr), "0" (new_value)
+                        : "memory");
+   return new_value;  // Now it's the previous value.
+ }
[email protected]@ -48,8 +48,8 @@
+ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+                                           Atomic32 increment) {
+   Atomic32 temp = increment;
+-  __asm__ __volatile__("lock; xaddl %0,%1"
+-                       : "+r" (temp), "+m" (*ptr)
++  __asm__ __volatile__("lock; xaddl %0,(%1)"
++                       : "+r" (temp), "+r" (ptr)
+                        : : "memory");
+   // temp now holds the old value of *ptr
+   return temp + increment;
[email protected]@ -58,8 +58,8 @@
+ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                         Atomic32 increment) {
+   Atomic32 temp = increment;
+-  __asm__ __volatile__("lock; xaddl %0,%1"
+-                       : "+r" (temp), "+m" (*ptr)
++  __asm__ __volatile__("lock; xaddl %0,(%1)"
++                       : "+r" (temp), "+r" (ptr)
+                        : : "memory");
+   // temp now holds the old value of *ptr
+   if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
[email protected]@ -153,18 +153,18 @@
+                                          Atomic64 old_value,
+                                          Atomic64 new_value) {
+   Atomic64 prev;
+-  __asm__ __volatile__("lock; cmpxchgq %1,%2"
++  __asm__ __volatile__("lock; cmpxchgq %1,(%2)"
+                        : "=a" (prev)
+-                       : "q" (new_value), "m" (*ptr), "0" (old_value)
++                       : "q" (new_value), "r" (ptr), "0" (old_value)
+                        : "memory");
+   return prev;
+ }
+ 
+ inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
+                                          Atomic64 new_value) {
+-  __asm__ __volatile__("xchgq %1,%0"  // The lock prefix is implicit for xchg.
++  __asm__ __volatile__("xchgq (%1),%0"  // The lock prefix is implicit for xchg.
+                        : "=r" (new_value)
+-                       : "m" (*ptr), "0" (new_value)
++                       : "r" (ptr), "0" (new_value)
+                        : "memory");
+   return new_value;  // Now it's the previous value.
+ }
[email protected]@ -172,8 +172,8 @@
+ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
+                                           Atomic64 increment) {
+   Atomic64 temp = increment;
+-  __asm__ __volatile__("lock; xaddq %0,%1"
+-                       : "+r" (temp), "+m" (*ptr)
++  __asm__ __volatile__("lock; xaddq %0,(%1)"
++                       : "+r" (temp), "+r" (ptr)
+                        : : "memory");
+   // temp now contains the previous value of *ptr
+   return temp + increment;
[email protected]@ -182,8 +182,8 @@
+ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
+                                         Atomic64 increment) {
+   Atomic64 temp = increment;
+-  __asm__ __volatile__("lock; xaddq %0,%1"
+-                       : "+r" (temp), "+m" (*ptr)
++  __asm__ __volatile__("lock; xaddq %0,(%1)"
++                       : "+r" (temp), "+r" (ptr)
+                        : : "memory");
+   // temp now contains the previous value of *ptr
+   if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
+diff --git a/ipc/chromium/src/base/file_util.cc b/ipc/chromium/src/base/file_util.cc
+--- a/ipc/chromium/src/base/file_util.cc
++++ b/ipc/chromium/src/base/file_util.cc
[email protected]@ -245,4 +245,25 @@
+ int WriteFile(const std::wstring& filename, const char* data, int size) {
+   return WriteFile(FilePath::FromWStringHack(filename), data, size);
+ }
++
++#ifdef OS_SOLARIS
++
++bool IsDot(const FilePath& path) {
++  return FILE_PATH_LITERAL(".") == path.BaseName().value();
++}
++
++bool IsDotDot(const FilePath& path) {
++  return FILE_PATH_LITERAL("..") == path.BaseName().value();
++}
++
++///////////////////////////////////////////////
++// FileEnumerator
++//
++// Note: the main logic is in file_util_<platform>.cc
++
++bool FileEnumerator::ShouldSkip(const FilePath& path) {
++  FilePath::StringType basename = path.BaseName().value();
++  return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_));
++}
++#endif
+ }  // namespace
+diff --git a/ipc/chromium/src/base/file_util.h b/ipc/chromium/src/base/file_util.h
+--- a/ipc/chromium/src/base/file_util.h
++++ b/ipc/chromium/src/base/file_util.h
[email protected]@ -12,7 +12,7 @@
+ 
+ #if defined(OS_WIN)
+ #include <windows.h>
+-#elif defined(ANDROID)
++#elif defined(ANDROID) || defined(OS_SOLARIS)
+ #include <sys/stat.h>
+ #elif defined(OS_POSIX) 
+ #include <sys/types.h>
[email protected]@ -240,6 +240,103 @@
+ // Deprecated temporary compatibility function.
+ bool SetCurrentDirectory(const std::wstring& current_directory);
+ 
++#ifdef OS_SOLARIS
++// A class for enumerating the files in a provided path. The order of the
++// results is not guaranteed.
++//
++// DO NOT USE FROM THE MAIN THREAD of your application unless it is a test
++// program where latency does not matter. This class is blocking.
++class FileEnumerator {
++ public:
++  typedef struct {
++    struct stat stat;
++    std::string filename;
++  } FindInfo;
++
++  enum FILE_TYPE {
++    FILES                 = 1 << 0,
++    DIRECTORIES           = 1 << 1,
++    INCLUDE_DOT_DOT       = 1 << 2,
++    SHOW_SYM_LINKS        = 1 << 4,
++  };
++
++  // |root_path| is the starting directory to search for. It may or may not end
++  // in a slash.
++  //  
++  // If |recursive| is true, this will enumerate all matches in any
++  // subdirectories matched as well. It does a breadth-first search, so all
++  // files in one directory will be returned before any files in a
++  // subdirectory.
++  //
++  // |file_type| specifies whether the enumerator should match files,
++  // directories, or both.
++  //
++  // |pattern| is an optional pattern for which files to match. This
++  // works like shell globbing. For example, "*.txt" or "Foo???.doc".
++  // However, be careful in specifying patterns that aren't cross platform
++  // since the underlying code uses OS-specific matching routines.  In general,
++  // Windows matching is less featureful than others, so test there first.
++  // If unspecified, this will match all files.
++  // NOTE: the pattern only matches the contents of root_path, not files in
++  // recursive subdirectories.
++  // TODO(erikkay): Fix the pattern matching to work at all levels.
++  FileEnumerator(const FilePath& root_path,
++                 bool recursive,
++                 FileEnumerator::FILE_TYPE file_type);
++  FileEnumerator(const FilePath& root_path,
++                 bool recursive,
++                 FileEnumerator::FILE_TYPE file_type,
++                 const FilePath::StringType& pattern);
++  ~FileEnumerator();
++
++  // Returns an empty string if there are no more results.
++  FilePath Next();
++
++  // Write the file info into |info|.
++  void GetFindInfo(FindInfo* info);
++
++  // Looks inside a FindInfo and determines if it's a directory.
++  static bool IsDirectory(const FindInfo& info);
++
++  static FilePath GetFilename(const FindInfo& find_info);
++
++ private:
++  // Returns true if the given path should be skipped in enumeration.
++  bool ShouldSkip(const FilePath& path);
++
++
++  typedef struct {
++    FilePath filename;
++    struct stat stat;
++  } DirectoryEntryInfo;
++
++  // Read the filenames in source into the vector of DirectoryEntryInfo's
++  static bool ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
++                            const FilePath& source, bool show_links);
++
++  // The files in the current directory
++  std::vector<DirectoryEntryInfo> directory_entries_;
++
++  // The next entry to use from the directory_entries_ vector
++  size_t current_directory_entry_;
++
++  FilePath root_path_;
++  bool recursive_;
++  FILE_TYPE file_type_;
++  FilePath::StringType pattern_;  // Empty when we want to find everything.
++
++  // Set to true when there is a find operation open. This way, we can lazily
++  // start the operations when the caller calls Next().
++  bool is_in_find_op_;
++
++  // A stack that keeps track of which subdirectories we still need to
++  // enumerate in the breadth-first search.
++  std::stack<FilePath> pending_paths_;
++
++  DISALLOW_COPY_AND_ASSIGN(FileEnumerator);
++};
++#endif
++
+ }  // namespace file_util
+ 
+ #endif  // BASE_FILE_UTIL_H_
+diff --git a/ipc/chromium/src/base/file_util_posix.cc b/ipc/chromium/src/base/file_util_posix.cc
+--- a/ipc/chromium/src/base/file_util_posix.cc
++++ b/ipc/chromium/src/base/file_util_posix.cc
[email protected]@ -8,7 +8,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+-#ifndef ANDROID
++#if !defined(ANDROID) && !defined(OS_SOLARIS)
+ #include <fts.h>
+ #endif
+ #include <libgen.h>
[email protected]@ -67,9 +67,34 @@
+   if (!recursive)
+     return (rmdir(path_str) == 0);
+ 
+-#ifdef ANDROID
++#if defined(ANDROID)
+   // XXX Need ftsless impl for bionic
+   return false;
++#elif defined(OS_SOLARIS)
++  bool success = true;
++  std::stack<std::string> directories;
++  directories.push(path.value());
++  FileEnumerator traversal(path, true, static_cast<FileEnumerator::FILE_TYPE>(
++        FileEnumerator::FILES | FileEnumerator::DIRECTORIES |
++        FileEnumerator::SHOW_SYM_LINKS));
++  for (FilePath current = traversal.Next(); success && !current.empty();
++       current = traversal.Next()) {
++    FileEnumerator::FindInfo info;
++    traversal.GetFindInfo(&info);
++
++    if (S_ISDIR(info.stat.st_mode))
++      directories.push(current.value());
++    else
++      success = (unlink(current.value().c_str()) == 0);
++  }
++
++  while (success && !directories.empty()) {
++    FilePath dir = FilePath(directories.top());
++    directories.pop();
++    success = (rmdir(dir.value().c_str()) == 0);
++  }
++
++  return success; 
+ #else
+   bool success = true;
+   int ftsflags = FTS_PHYSICAL | FTS_NOSTAT;
[email protected]@ -140,14 +165,98 @@
+     return false;
+   }
+ 
+-#ifdef ANDROID
++#if defined(ANDROID)
+   // XXX Need ftsless impl for bionic
+   return false;
++#elif defined(OS_SOLARIS)
++  // This function does not properly handle destinations within the source
++  FilePath real_to_path = to_path;
++  if (PathExists(real_to_path)) {
++    if (!AbsolutePath(&real_to_path))
++      return false;
++  } else {
++    real_to_path = real_to_path.DirName();
++    if (!AbsolutePath(&real_to_path))
++      return false;
++  }
++  FilePath real_from_path = from_path;
++  if (!AbsolutePath(&real_from_path))
++    return false;
++  if (real_to_path.value().size() >= real_from_path.value().size() &&
++      real_to_path.value().compare(0, real_from_path.value().size(),
++      real_from_path.value()) == 0)
++    return false;
++
++  bool success = true;
++  FileEnumerator::FILE_TYPE traverse_type =
++      static_cast<FileEnumerator::FILE_TYPE>(FileEnumerator::FILES |
++      FileEnumerator::SHOW_SYM_LINKS);
++  if (recursive)
++    traverse_type = static_cast<FileEnumerator::FILE_TYPE>(
++        traverse_type | FileEnumerator::DIRECTORIES);
++  FileEnumerator traversal(from_path, recursive, traverse_type);
++
++  // We have to mimic windows behavior here. |to_path| may not exist yet,
++  // start the loop with |to_path|.
++  FileEnumerator::FindInfo info;
++  FilePath current = from_path;
++  if (stat(from_path.value().c_str(), &info.stat) < 0) {
++    CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't stat source directory: " <<
++        from_path.value() << " errno = " << errno;
++    success = false;
++  }
++  struct stat to_path_stat;
++  FilePath from_path_base = from_path;
++  if (recursive && stat(to_path.value().c_str(), &to_path_stat) == 0 &&
++      S_ISDIR(to_path_stat.st_mode)) {
++    // If the destination already exists and is a directory, then the
++    // top level of source needs to be copied.
++    from_path_base = from_path.DirName();
++  }
++
++  // The Windows version of this function assumes that non-recursive calls
++  // will always have a directory for from_path.
++  DCHECK(recursive || S_ISDIR(info.stat.st_mode));
++
++  while (success && !current.empty()) {
++    // current is the source path, including from_path, so paste
++    // the suffix after from_path onto to_path to create the target_path.
++    std::string suffix(&current.value().c_str()[from_path_base.value().size()]);
++    // Strip the leading '/' (if any).
++    if (!suffix.empty()) {
++      DCHECK_EQ('/', suffix[0]);
++      suffix.erase(0, 1);
++    }
++    const FilePath target_path = to_path.Append(suffix);
++
++    if (S_ISDIR(info.stat.st_mode)) {
++      if (mkdir(target_path.value().c_str(), info.stat.st_mode & 01777) != 0 &&
++          errno != EEXIST) {
++        CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create directory: " <<
++            target_path.value() << " errno = " << errno;
++        success = false;
++      }
++    } else if (S_ISREG(info.stat.st_mode)) {
++      if (!CopyFile(current, target_path)) {
++        CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create file: " <<
++            target_path.value();
++        success = false;
++      }
++    } else {
++      CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping non-regular file: " <<
++          current.value();
++    }
++
++    current = traversal.Next();
++    traversal.GetFindInfo(&info);
++  }
++
++  return success;
+ #else
+   char* dir_list[] = { top_dir, NULL };
+   FTS* fts = fts_open(dir_list, FTS_PHYSICAL | FTS_NOSTAT, NULL);
+   if (!fts) {
+-    CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
++    CHROMIUM_CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
+     return false;
+   }
+ 
[email protected]@ -203,11 +312,11 @@
+         break;
+       case FTS_SL:      // Symlink.
+       case FTS_SLNONE:  // Symlink with broken target.
+-        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
++        CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
+             ent->fts_path;
+         continue;
+       case FTS_DEFAULT:  // Some other sort of file.
+-        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
++        CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
+             ent->fts_path;
+         continue;
+       default:
[email protected]@ -227,7 +336,7 @@
+   }
+ 
+   if (error) {
+-    CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
++    CHROMIUM_CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
+     return false;
+   }
+   return true;
[email protected]@ -446,7 +555,7 @@
+ }
+ 
+ bool GetShmemTempDir(FilePath* path) {
+-#if defined(OS_LINUX) && !defined(ANDROID)
++#if defined(OS_LINUX) && !defined(ANDROID) && !defined(OS_SOLARIS)
+   *path = FilePath("/dev/shm");
+   return true;
+ #else
[email protected]@ -501,4 +610,144 @@
+ }
+ #endif // !defined(OS_MACOSX)
+ 
++#ifdef OS_SOLARIS
++///////////////////////////////////////////////
++// FileEnumerator
++
++FileEnumerator::FileEnumerator(const FilePath& root_path,
++                               bool recursive,
++                               FileEnumerator::FILE_TYPE file_type)
++    : current_directory_entry_(0),
++      root_path_(root_path),
++      recursive_(recursive),
++      file_type_(file_type),
++      is_in_find_op_(false) {
++  // INCLUDE_DOT_DOT must not be specified if recursive.
++  DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_)));
++  pending_paths_.push(root_path);
++}
++
++FileEnumerator::FileEnumerator(const FilePath& root_path,
++                               bool recursive,
++                               FileEnumerator::FILE_TYPE file_type,
++                               const FilePath::StringType& pattern)
++    : current_directory_entry_(0),
++      root_path_(root_path),
++      recursive_(recursive),
++      file_type_(file_type),
++      pattern_(root_path.Append(pattern).value()),
++      is_in_find_op_(false) {
++  // INCLUDE_DOT_DOT must not be specified if recursive.
++  DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_)));
++  // The Windows version of this code appends the pattern to the root_path,
++  // potentially only matching against items in the top-most directory.
++  // Do the same here.
++  if (pattern.size() == 0)
++    pattern_ = FilePath::StringType();
++  pending_paths_.push(root_path);
++}
++
++FileEnumerator::~FileEnumerator() {
++}
++
++void FileEnumerator::GetFindInfo(FindInfo* info) {
++  DCHECK(info);
++
++  if (current_directory_entry_ >= directory_entries_.size())
++    return;
++
++  DirectoryEntryInfo* cur_entry = &directory_entries_[current_directory_entry_];
++  memcpy(&(info->stat), &(cur_entry->stat), sizeof(info->stat));
++  info->filename.assign(cur_entry->filename.value());
++}
++
++bool FileEnumerator::IsDirectory(const FindInfo& info) {
++  return S_ISDIR(info.stat.st_mode);
++}
++
++// static
++FilePath FileEnumerator::GetFilename(const FindInfo& find_info) {
++  return FilePath(find_info.filename);
++}
++
++FilePath FileEnumerator::Next() {
++  ++current_directory_entry_;
++
++  // While we've exhausted the entries in the current directory, do the next
++  while (current_directory_entry_ >= directory_entries_.size()) {
++    if (pending_paths_.empty())
++      return FilePath();
++
++    root_path_ = pending_paths_.top();
++    root_path_ = root_path_.StripTrailingSeparators();
++    pending_paths_.pop();
++
++    std::vector<DirectoryEntryInfo> entries;
++    if (!ReadDirectory(&entries, root_path_, file_type_ & SHOW_SYM_LINKS))
++      continue;
++
++    directory_entries_.clear();
++    current_directory_entry_ = 0;
++    for (std::vector<DirectoryEntryInfo>::const_iterator
++        i = entries.begin(); i != entries.end(); ++i) {
++      FilePath full_path = root_path_.Append(i->filename);
++      if (ShouldSkip(full_path))
++        continue;
++
++      if (pattern_.size() &&
++          fnmatch(pattern_.c_str(), full_path.value().c_str(), FNM_NOESCAPE))
++        continue;
++
++      if (recursive_ && S_ISDIR(i->stat.st_mode))
++        pending_paths_.push(full_path);
++
++      if ((S_ISDIR(i->stat.st_mode) && (file_type_ & DIRECTORIES)) ||
++          (!S_ISDIR(i->stat.st_mode) && (file_type_ & FILES)))
++        directory_entries_.push_back(*i);
++    }
++  }
++
++  return root_path_.Append(directory_entries_[current_directory_entry_
++      ].filename);
++}
++
++bool FileEnumerator::ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
++                                   const FilePath& source, bool show_links) {
++
++  DIR* dir = opendir(source.value().c_str());
++  if (!dir)
++    return false;
++  struct {
++          dirent dent_buffer;
++          char chars[MAXNAMLEN];
++  } dent_buf;
++  struct dirent* dent;
++
++  while (readdir_r(dir, (dirent *)&dent_buf, &dent) == 0 && dent) {
++    DirectoryEntryInfo info;
++    info.filename = FilePath(dent->d_name);
++
++    FilePath full_name = source.Append(dent->d_name);
++    int ret;
++    if (show_links)
++      ret = lstat(full_name.value().c_str(), &info.stat);
++    else
++      ret = stat(full_name.value().c_str(), &info.stat);
++    if (ret < 0) {
++      // Print the stat() error message unless it was ENOENT and we're
++      // following symlinks.
++      if (!(errno == ENOENT && !show_links)) {
++        CHROMIUM_LOG(ERROR) << "Couldn't stat "
++                   << source.Append(dent->d_name).value();
++      }
++      memset(&info.stat, 0, sizeof(info.stat));
++    }
++    entries->push_back(info);
++  }
++
++  closedir(dir);
++  return true;
++}
++#endif
++
+ } // namespace file_util
+diff --git a/ipc/chromium/src/base/idle_timer.cc b/ipc/chromium/src/base/idle_timer.cc
+--- a/ipc/chromium/src/base/idle_timer.cc
++++ b/ipc/chromium/src/base/idle_timer.cc
[email protected]@ -7,13 +7,13 @@
+ // We may not want to port idle_timer to Linux, but we have implemented it
+ // anyway.  Define this to 1 to enable the Linux idle timer and then add the
+ // libs that need to be linked (Xss).
+-#define ENABLE_XSS_SUPPORT 0
++#define ENABLE_XSS_SUPPORT 1
+ 
+ #if defined(OS_MACOSX)
+ #include <ApplicationServices/ApplicationServices.h>
+ #endif
+ 
+-#if defined(OS_LINUX) && ENABLE_XSS_SUPPORT
++#if (defined(OS_LINUX) || defined(OS_SOLARIS)) && ENABLE_XSS_SUPPORT
+ // We may not want to port idle_timer to Linux, but we have implemented it
+ // anyway.  Remove the 0 above if we want it.
+ #include <gdk/gdkx.h>
[email protected]@ -53,7 +53,7 @@
+           kCGAnyInputEventType) * 1000.0;
+   return true;
+ }
+-#elif defined(OS_LINUX) && ENABLE_XSS_SUPPORT
++#elif (defined(OS_LINUX) || defined(OS_SOLARIS)) && ENABLE_XSS_SUPPORT
+ class IdleState {
+  public:
+   IdleState() {
+diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc
+--- a/ipc/chromium/src/base/message_loop.cc
++++ b/ipc/chromium/src/base/message_loop.cc
[email protected]@ -19,7 +19,7 @@
+ #if defined(OS_POSIX)
+ #include "base/message_pump_libevent.h"
+ #endif
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ #if defined(MOZ_WIDGET_GTK)
+ #include "base/message_pump_glib.h"
+ #endif
[email protected]@ -144,9 +144,9 @@
+   if (type_ == TYPE_UI) {
+ #if defined(OS_MACOSX)
+     pump_ = base::MessagePumpMac::Create();
+-#elif defined(OS_LINUX) || defined(OS_BSD)
++#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+     pump_ = new base::MessagePumpForUI();
+-#endif  // OS_LINUX
++#endif  // OS_LINUX || OS_SOLARIS
+   } else if (type_ == TYPE_IO) {
+     pump_ = new base::MessagePumpLibevent();
+   } else {
+diff --git a/ipc/chromium/src/base/message_pump_glib.cc b/ipc/chromium/src/base/message_pump_glib.cc
+--- a/ipc/chromium/src/base/message_pump_glib.cc
++++ b/ipc/chromium/src/base/message_pump_glib.cc
[email protected]@ -128,6 +128,12 @@
+   // Create our wakeup pipe, which is used to flag when work was scheduled.
+   int fds[2];
+   CHECK(pipe(fds) == 0);
++
++  int flags = fcntl(fds[0], F_GETFL, 0);
++  if (flags == -1)
++    flags = 0;
++  fcntl(fds[0], F_SETFL, flags | O_NDELAY);
++
+   wakeup_pipe_read_  = fds[0];
+   wakeup_pipe_write_ = fds[1];
+   wakeup_gpollfd_->fd = wakeup_pipe_read_;
[email protected]@ -234,10 +240,9 @@
+   // are only signaled when the queue went from empty to non-empty.  The glib
+   // poll will tell us whether there was data, so this read shouldn't block.
+   if (wakeup_gpollfd_->revents & G_IO_IN) {
+-    char msg;
+-    if (HANDLE_EINTR(read(wakeup_pipe_read_, &msg, 1)) != 1 || msg != '!') {
+-      NOTREACHED() << "Error reading from the wakeup pipe.";
+-    }
++    char buf[32];
++    while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32)));
++
+     // Since we ate the message, we need to record that we have more work,
+     // because HandleCheck() may be called without HandleDispatch being called
+     // afterwards.
[email protected]@ -301,6 +306,9 @@
+   // variables as we would then need locks all over.  This ensures that if
+   // we are sleeping in a poll that we will wake up.
+   char msg = '!';
++  char buf[32];
++  while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32)));
++
+   if (HANDLE_EINTR(write(wakeup_pipe_write_, &msg, 1)) != 1) {
+     NOTREACHED() << "Could not write to the UI message loop wakeup pipe!";
+   }
+diff --git a/ipc/chromium/src/base/message_pump_libevent.cc b/ipc/chromium/src/base/message_pump_libevent.cc
+--- a/ipc/chromium/src/base/message_pump_libevent.cc
++++ b/ipc/chromium/src/base/message_pump_libevent.cc
[email protected]@ -6,6 +6,10 @@
+ 
+ #include <errno.h>
+ #include <fcntl.h>
++#if defined(OS_SOLARIS)
++#include <unistd.h>
++#include <sys/stat.h>
++#endif
+ #if defined(ANDROID) || defined(OS_POSIX)
+ #include <unistd.h>
+ #endif
+diff --git a/ipc/chromium/src/base/observer_list.h b/ipc/chromium/src/base/observer_list.h
+--- a/ipc/chromium/src/base/observer_list.h
++++ b/ipc/chromium/src/base/observer_list.h
[email protected]@ -88,7 +88,7 @@
+ 
+   // Add an observer to the list.
+   void AddObserver(ObserverType* obs) {
+-    DCHECK(find(observers_.begin(), observers_.end(), obs) == observers_.end())
++    DCHECK(std::find(observers_.begin(), observers_.end(), obs) == observers_.end())
+         << "Observers can only be added once!";
+     observers_.push_back(obs);
+   }
+diff --git a/ipc/chromium/src/base/platform_thread.h b/ipc/chromium/src/base/platform_thread.h
+--- a/ipc/chromium/src/base/platform_thread.h
++++ b/ipc/chromium/src/base/platform_thread.h
[email protected]@ -22,7 +22,7 @@
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__)
++#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
+ #include <unistd.h>
+ typedef pid_t PlatformThreadId;
+ #elif defined(OS_BSD)
+diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc
+--- a/ipc/chromium/src/base/platform_thread_posix.cc
++++ b/ipc/chromium/src/base/platform_thread_posix.cc
[email protected]@ -27,6 +27,12 @@
+ #include <pthread_np.h>
+ #endif
+ 
++#if defined(OS_SOLARIS)
++#include <sys/syscall.h>
++#include <unistd.h>
++#include <thread.h>
++#endif
++
+ #if defined(OS_MACOSX)
+ namespace base {
+ void InitThreading();
[email protected]@ -54,6 +60,8 @@
+ #else
+   return syscall(__NR_gettid);
+ #endif
++#elif defined(OS_SOLARIS)
++  return thr_self();
+ #elif defined(OS_OPENBSD) || defined(__GLIBC__)
+   return (intptr_t) (pthread_self());
+ #elif defined(OS_NETBSD)
[email protected]@ -96,6 +104,7 @@
+ 
+ // static
+ void PlatformThread::SetName(const char* name) {
++#ifndef OS_SOLARIS
+   // On linux we can get the thread names to show up in the debugger by setting
+   // the process name for the LWP.  We don't want to do this for the main
+   // thread because that would rename the process, causing tools like killall
[email protected]@ -116,6 +125,7 @@
+   pthread_set_name_np(pthread_self(), name);
+ #else
+ #endif
++#endif // !OS_SOLARIS
+ }
+ #endif // !OS_MACOSX
+ 
+diff --git a/ipc/chromium/src/base/port.h b/ipc/chromium/src/base/port.h
+--- a/ipc/chromium/src/base/port.h
++++ b/ipc/chromium/src/base/port.h
[email protected]@ -56,7 +56,7 @@
+ // Define an OS-neutral wrapper for shared library entry points
+ #if defined(OS_WIN)
+ #define API_CALL __stdcall
+-#elif defined(OS_LINUX) || defined(OS_MACOSX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_MACOSX)
+ #define API_CALL
+ #endif
+ 
+diff --git a/ipc/chromium/src/base/process_util.h b/ipc/chromium/src/base/process_util.h
+--- a/ipc/chromium/src/base/process_util.h
++++ b/ipc/chromium/src/base/process_util.h
[email protected]@ -25,6 +25,10 @@
+ #include <mach/mach.h>
+ #endif
+ 
++#if defined(OS_SOLARIS)
++#define NAME_MAX 14
++#endif
++
+ #include <map>
+ #include <string>
+ #include <vector>
[email protected]@ -71,7 +75,8 @@
+   PROCESS_ARCH_I386 = 0x1,
+   PROCESS_ARCH_X86_64 = 0x2,
+   PROCESS_ARCH_PPC = 0x4,
+-  PROCESS_ARCH_ARM = 0x8
++  PROCESS_ARCH_ARM = 0x8,
++  PROCESS_ARCH_SPARC = 0x10
+ };
+ 
+ inline ProcessArchitecture GetCurrentProcessArchitecture()
[email protected]@ -85,6 +90,8 @@
+   currentArchitecture = base::PROCESS_ARCH_PPC;
+ #elif defined(ARCH_CPU_ARMEL)
+   currentArchitecture = base::PROCESS_ARCH_ARM;
++#elif defined(ARCH_CPU_SPARC)
++  currentArchitecture = base::PROCESS_ARCH_SPARC;
+ #endif
+   return currentArchitecture;
+ }
+diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc
+--- a/ipc/chromium/src/base/process_util_posix.cc
++++ b/ipc/chromium/src/base/process_util_posix.cc
[email protected]@ -116,7 +116,7 @@
+ #if defined(ANDROID)
+   static const rlim_t kSystemDefaultMaxFds = 1024;
+   static const char kFDDir[] = "/proc/self/fd";
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+   static const rlim_t kSystemDefaultMaxFds = 8192;
+   static const char kFDDir[] = "/proc/self/fd";
+ #elif defined(OS_MACOSX)
[email protected]@ -208,7 +208,7 @@
+ // TODO(agl): Remove this function. It's fundamentally broken for multithreaded
+ // apps.
+ void SetAllFDsToCloseOnExec() {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   const char fd_dir[] = "/proc/self/fd";
+ #elif defined(OS_MACOSX) || defined(OS_BSD)
+   const char fd_dir[] = "/dev/fd";
+diff --git a/ipc/chromium/src/base/shared_memory_posix.cc b/ipc/chromium/src/base/shared_memory_posix.cc
+--- a/ipc/chromium/src/base/shared_memory_posix.cc
++++ b/ipc/chromium/src/base/shared_memory_posix.cc
[email protected]@ -125,9 +125,15 @@
+   if (file_util::GetShmemTempDir(&temp_dir) == false)
+     return false;
+ 
++#ifndef OS_SOLARIS    
+   mem_filename = UTF8ToWide(temp_dir.value());
+   file_util::AppendToPath(&mem_filename, L"com.google.chrome.shmem." + memname);
+   *filename = mem_filename;
++#else  
++  *filename = (temp_dir.Append("com.google.chrome.shmem." +
++                               WideToUTF8(memname))).ToWStringHack();
++#endif                               
++
+   return true;
+ }
+ 
[email protected]@ -247,7 +253,7 @@
+   if (memory_ == NULL)
+     return false;
+ 
+-  munmap(memory_, max_size_);
++  munmap((caddr_t)memory_, max_size_);
+   memory_ = NULL;
+   max_size_ = 0;
+   return true;
+diff --git a/ipc/chromium/src/base/sys_info_posix.cc b/ipc/chromium/src/base/sys_info_posix.cc
+--- a/ipc/chromium/src/base/sys_info_posix.cc
++++ b/ipc/chromium/src/base/sys_info_posix.cc
[email protected]@ -119,7 +119,7 @@
+ 
+ // static
+ std::string SysInfo::OperatingSystemName() {
+-  utsname info;
++  struct utsname info;
+   if (uname(&info) < 0) {
+     NOTREACHED();
+     return "";
[email protected]@ -129,7 +129,7 @@
+ 
+ // static
+ std::string SysInfo::OperatingSystemVersion() {
+-  utsname info;
++  struct utsname info;
+   if (uname(&info) < 0) {
+     NOTREACHED();
+     return "";
[email protected]@ -139,7 +139,7 @@
+ 
+ // static
+ std::string SysInfo::CPUArchitecture() {
+-  utsname info;
++  struct utsname info;
+   if (uname(&info) < 0) {
+     NOTREACHED();
+     return "";
+diff --git a/ipc/chromium/src/base/time.h b/ipc/chromium/src/base/time.h
+--- a/ipc/chromium/src/base/time.h
++++ b/ipc/chromium/src/base/time.h
[email protected]@ -62,6 +62,10 @@
+     return delta_;
+   }
+ 
++#if defined(OS_POSIX)
++  struct timespec ToTimeSpec() const;
++#endif
++
+   // Returns the time delta in some unit. The F versions return a floating
+   // point value, the "regular" versions return a rounded-down value.
+   int InDays() const;
[email protected]@ -224,6 +228,10 @@
+   static Time FromDoubleT(double dt);
+   double ToDoubleT() const;
+ 
++#if defined(OS_POSIX)
++  struct timeval ToTimeVal() const;
++#endif
++
+ 
+ #if defined(OS_WIN)
+   static Time FromFileTime(FILETIME ft);
+diff --git a/ipc/chromium/src/base/time_posix.cc b/ipc/chromium/src/base/time_posix.cc
+--- a/ipc/chromium/src/base/time_posix.cc
++++ b/ipc/chromium/src/base/time_posix.cc
[email protected]@ -65,11 +65,13 @@
+   timestruct.tm_wday   = exploded.day_of_week;  // mktime/timegm ignore this
+   timestruct.tm_yday   = 0;     // mktime/timegm ignore this
+   timestruct.tm_isdst  = -1;    // attempt to figure it out
++#ifndef OS_SOLARIS
+   timestruct.tm_gmtoff = 0;     // not a POSIX field, so mktime/timegm ignore
+   timestruct.tm_zone   = NULL;  // not a POSIX field, so mktime/timegm ignore
+-
++#endif
++  
+   time_t seconds;
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_SOLARIS)
+     seconds = mktime(&timestruct);
+ #else
+   if (is_local)
[email protected]@ -167,7 +169,7 @@
+   // With numer and denom = 1 (the expected case), the 64-bit absolute time
+   // reported in nanoseconds is enough to last nearly 585 years.
+ 
+-#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \
++#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_POSIX) && \
+       defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
+ 
+   struct timespec ts;
[email protected]@ -192,4 +194,25 @@
+   return Now();
+ }
+ 
++struct timespec TimeDelta::ToTimeSpec() const {
++  int64_t microseconds = InMicroseconds();
++  time_t seconds = 0;
++  if (microseconds >= Time::kMicrosecondsPerSecond) {
++    seconds = InSeconds();
++    microseconds -= seconds * Time::kMicrosecondsPerSecond;
++  }
++  struct timespec result =
++      {seconds,
++       microseconds * Time::kNanosecondsPerMicrosecond};
++  return result;
++}
++
++struct timeval Time::ToTimeVal() const {
++  struct timeval result;
++  int64_t us = us_ - kTimeTToMicrosecondsOffset;
++  result.tv_sec = us / Time::kMicrosecondsPerSecond;
++  result.tv_usec = us % Time::kMicrosecondsPerSecond;
++  return result;
++}
++
+ }  // namespace base
+diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
+--- a/ipc/chromium/src/build/build_config.h
++++ b/ipc/chromium/src/build/build_config.h
[email protected]@ -4,9 +4,9 @@
+ 
+ // This file adds defines about the platform we're currently building on.
+ //  Operating System:
+-//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
++//    OS_WIN / OS_MACOSX / OS_LINUX / OS_SOLARIS / OS_POSIX (MACOSX or LINUX)
+ //  Compiler:
+-//    COMPILER_MSVC / COMPILER_GCC
++//    COMPILER_MSVC / COMPILER_GCC / COMPILER_SUNPRO
+ //  Processor:
+ //    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
+ //    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
[email protected]@ -30,6 +30,8 @@
+ #define OS_NETBSD 1
+ #elif defined(__OpenBSD__)
+ #define OS_OPENBSD 1
++#elif defined(__sun__) || defined(__sun)
++#define OS_SOLARIS 1
+ #elif defined(_WIN32)
+ #define OS_WIN 1
+ #else
[email protected]@ -45,13 +47,15 @@
+ 
+ // For access to standard POSIX features, use OS_POSIX instead of a more
+ // specific macro.
+-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ #define OS_POSIX 1
+ #endif
+ 
+ // Compiler detection.
+ #if defined(__GNUC__)
+ #define COMPILER_GCC 1
++#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
++#define COMPILER_SUNPRO 1
+ #elif defined(_MSC_VER)
+ #define COMPILER_MSVC 1
+ #else
[email protected]@ -62,11 +66,11 @@
+ //   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+ //   http://www.agner.org/optimize/calling_conventions.pdf
+ //   or with gcc, run: "echo | gcc -E -dM -"
+-#if defined(_M_X64) || defined(__x86_64__)
++#if defined(_M_X64) || defined(__x86_64__) || defined(__x86_64)
+ #define ARCH_CPU_X86_FAMILY 1
+ #define ARCH_CPU_X86_64 1
+ #define ARCH_CPU_64_BITS 1
+-#elif defined(_M_IX86) || defined(__i386__)
++#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
+ #define ARCH_CPU_X86_FAMILY 1
+ #define ARCH_CPU_X86 1
+ #define ARCH_CPU_32_BITS 1
[email protected]@ -84,7 +88,7 @@
+ #elif defined(__sparc64__)
+ #define ARCH_CPU_SPARC 1
+ #define ARCH_CPU_64_BITS 1
+-#elif defined(__sparc__)
++#elif defined(__sparc__) || defined(__sparc)
+ #define ARCH_CPU_SPARC 1
+ #define ARCH_CPU_32_BITS 1
+ #elif defined(__mips64) && defined(__LP64__)
+diff --git a/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc b/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
+--- a/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
++++ b/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
[email protected]@ -4,6 +4,10 @@
+ 
+ #include "chrome/common/file_descriptor_set_posix.h"
+ 
++#if defined(OS_SOLARIS)
++#include <unistd.h>
++#endif
++
+ #include "base/eintr_wrapper.h"
+ #include "base/logging.h"
+ 
+diff --git a/ipc/chromium/src/chrome/common/transport_dib.h b/ipc/chromium/src/chrome/common/transport_dib.h
+--- a/ipc/chromium/src/chrome/common/transport_dib.h
++++ b/ipc/chromium/src/chrome/common/transport_dib.h
[email protected]@ -13,7 +13,7 @@
+ 
+ #if defined(OS_WIN)
+ #include <windows.h>
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ #include "chrome/common/x11_util.h"
+ #endif
+ 
[email protected]@ -66,7 +66,7 @@
+   typedef base::SharedMemoryHandle Handle;
+   // On Mac, the inode number of the backing file is used as an id.
+   typedef base::SharedMemoryId Id;
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+   typedef int Handle;  // These two ints are SysV IPC shared memory keys
+   typedef int Id;
+ #endif
[email protected]@ -96,7 +96,7 @@
+   // wire to give this transport DIB to another process.
+   Handle handle() const;
+ 
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   // Map the shared memory into the X server and return an id for the shared
+   // segment.
+   XID MapToX(Display* connection);
[email protected]@ -107,7 +107,7 @@
+ #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
+   explicit TransportDIB(base::SharedMemoryHandle dib);
+   base::SharedMemory shared_memory_;
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+   int key_;  // SysV shared memory id
+   void* address_;  // mapped address
+   XID x_shm_;  // X id for the shared segment
+diff --git a/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h b/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h
+new file mode 100644
+--- /dev/null
++++ b/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h
[email protected]@ -0,0 +1,455 @@
++/* event2/event-config.h
++ *
++ * This file was generated by autoconf when libevent was built, and post-
++ * processed by Libevent so that its macros would have a uniform prefix.
++ *
++ * DO NOT EDIT THIS FILE.
++ *
++ * Do not rely on macros in this file existing in later versions.
++ */
++
++#ifndef _EVENT2_EVENT_CONFIG_H_
++#define _EVENT2_EVENT_CONFIG_H_
++
++/* config.h.  Generated from config.h.in by configure.  */
++/* config.h.in.  Generated from configure.in by autoheader.  */
++
++/* Define if libevent should build without support for a debug mode */
++/* #undef _EVENT_DISABLE_DEBUG_MODE */
++
++/* Define if libevent should not allow replacing the mm functions */
++/* #undef _EVENT_DISABLE_MM_REPLACEMENT */
++
++/* Define if libevent should not be compiled with thread support */
++/* #undef _EVENT_DISABLE_THREAD_SUPPORT */
++
++/* Define to 1 if you have the `arc4random' function. */
++/* #undef _EVENT_HAVE_ARC4RANDOM */
++
++/* Define to 1 if you have the `arc4random_buf' function. */
++/* #undef _EVENT_HAVE_ARC4RANDOM_BUF */
++
++/* Define to 1 if you have the <arpa/inet.h> header file. */
++#define _EVENT_HAVE_ARPA_INET_H 1
++
++/* Define to 1 if you have the `clock_gettime' function. */
++#define _EVENT_HAVE_CLOCK_GETTIME 1
++
++/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
++   don't. */
++/* #undef _EVENT_HAVE_DECL_CTL_KERN */
++
++/* Define to 1 if you have the declaration of `KERN_ARND', and to 0 if you
++   don't. */
++/* #undef _EVENT_HAVE_DECL_KERN_ARND */
++
++/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you
++   don't. */
++/* #undef _EVENT_HAVE_DECL_KERN_RANDOM */
++
++/* Define to 1 if you have the declaration of `RANDOM_UUID', and to 0 if you
++   don't. */
++#define _EVENT_HAVE_DECL_RANDOM_UUID 1
++
++/* Define if /dev/poll is available */
++#define _EVENT_HAVE_DEVPOLL 1
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define _EVENT_HAVE_DLFCN_H 1
++
++/* Define if your system supports the epoll system calls */
++/* #undef _EVENT_HAVE_EPOLL */
++
++/* Define to 1 if you have the `epoll_ctl' function. */
++/* #undef _EVENT_HAVE_EPOLL_CTL */
++
++/* Define to 1 if you have the `eventfd' function. */
++/* #undef _EVENT_HAVE_EVENTFD */
++
++/* Define if your system supports event ports */
++#define _EVENT_HAVE_EVENT_PORTS 1
++
++/* Define to 1 if you have the `fcntl' function. */
++#define _EVENT_HAVE_FCNTL 1
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#define _EVENT_HAVE_FCNTL_H 1
++
++/* Define to 1 if the system has the type `fd_mask'. */
++#define _EVENT_HAVE_FD_MASK 1
++
++/* Do we have getaddrinfo()? */
++#define _EVENT_HAVE_GETADDRINFO 1
++
++/* Define to 1 if you have the `getegid' function. */
++#define _EVENT_HAVE_GETEGID 1
++
++/* Define to 1 if you have the `geteuid' function. */
++#define _EVENT_HAVE_GETEUID 1
++
++/* Define this if you have any gethostbyname_r() */
++/* #undef _EVENT_HAVE_GETHOSTBYNAME_R */
++
++/* Define this if gethostbyname_r takes 3 arguments */
++/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_3_ARG */
++
++/* Define this if gethostbyname_r takes 5 arguments */
++/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_5_ARG */
++
++/* Define this if gethostbyname_r takes 6 arguments */
++/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_6_ARG */
++
++/* Define to 1 if you have the `getnameinfo' function. */
++#define _EVENT_HAVE_GETNAMEINFO 1
++
++/* Define to 1 if you have the `getprotobynumber' function. */
++#define _EVENT_HAVE_GETPROTOBYNUMBER 1
++
++/* Define to 1 if you have the `getservbyname' function. */
++/* #undef _EVENT_HAVE_GETSERVBYNAME */
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#define _EVENT_HAVE_GETTIMEOFDAY 1
++
++/* Define to 1 if you have the `inet_aton' function. */
++#define _EVENT_HAVE_INET_ATON 1
++
++/* Define to 1 if you have the `inet_ntop' function. */
++#define _EVENT_HAVE_INET_NTOP 1
++
++/* Define to 1 if you have the `inet_pton' function. */
++#define _EVENT_HAVE_INET_PTON 1
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#define _EVENT_HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the `issetugid' function. */
++#define _EVENT_HAVE_ISSETUGID 1
++
++/* Define to 1 if you have the `kqueue' function. */
++/* #undef _EVENT_HAVE_KQUEUE */
++
++/* Define if the system has zlib */
++#define _EVENT_HAVE_LIBZ 1
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define _EVENT_HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the `mmap' function. */
++#define _EVENT_HAVE_MMAP 1
++
++/* Define to 1 if you have the <netdb.h> header file. */
++#define _EVENT_HAVE_NETDB_H 1
++
++/* Define to 1 if you have the <netinet/in6.h> header file. */
++/* #undef _EVENT_HAVE_NETINET_IN6_H */
++
++/* Define to 1 if you have the <netinet/in.h> header file. */
++#define _EVENT_HAVE_NETINET_IN_H 1
++
++/* Define if the system has openssl */
++#define _EVENT_HAVE_OPENSSL 1
++
++/* Define to 1 if you have the <openssl/bio.h> header file. */
++#define _EVENT_HAVE_OPENSSL_BIO_H 1
++
++/* Define to 1 if you have the `pipe' function. */
++#define _EVENT_HAVE_PIPE 1
++
++/* Define to 1 if you have the `poll' function. */
++#define _EVENT_HAVE_POLL 1
++
++/* Define to 1 if you have the <poll.h> header file. */
++#define _EVENT_HAVE_POLL_H 1
++
++/* Define to 1 if you have the `port_create' function. */
++#define _EVENT_HAVE_PORT_CREATE 1
++
++/* Define to 1 if you have the <port.h> header file. */
++#define _EVENT_HAVE_PORT_H 1
++
++/* Define if you have POSIX threads libraries and header files. */
++/* #undef _EVENT_HAVE_PTHREAD */
++
++/* Define if we have pthreads on this system */
++#define _EVENT_HAVE_PTHREADS 1
++
++/* Define to 1 if you have the `putenv' function. */
++#define _EVENT_HAVE_PUTENV 1
++
++/* Define to 1 if the system has the type `sa_family_t'. */
++#define _EVENT_HAVE_SA_FAMILY_T 1
++
++/* Define to 1 if you have the `select' function. */
++#define _EVENT_HAVE_SELECT 1
++
++/* Define to 1 if you have the `sendfile' function. */
++#define _EVENT_HAVE_SENDFILE 1
++
++/* Define to 1 if you have the `setenv' function. */
++#define _EVENT_HAVE_SETENV 1
++
++/* Define if F_SETFD is defined in <fcntl.h> */
++#define _EVENT_HAVE_SETFD 1
++
++/* Define to 1 if you have the `sigaction' function. */
++#define _EVENT_HAVE_SIGACTION 1
++
++/* Define to 1 if you have the `signal' function. */
++#define _EVENT_HAVE_SIGNAL 1
++
++/* Define to 1 if you have the `splice' function. */
++#define _EVENT_HAVE_SPLICE 1
++
++/* Define to 1 if you have the <stdarg.h> header file. */
++#define _EVENT_HAVE_STDARG_H 1
++
++/* Define to 1 if you have the <stddef.h> header file. */
++#define _EVENT_HAVE_STDDEF_H 1
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#define _EVENT_HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define _EVENT_HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#define _EVENT_HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#define _EVENT_HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strlcpy' function. */
++#define _EVENT_HAVE_STRLCPY 1
++
++/* Define to 1 if you have the `strsep' function. */
++#define _EVENT_HAVE_STRSEP 1
++
++/* Define to 1 if you have the `strtok_r' function. */
++#define _EVENT_HAVE_STRTOK_R 1
++
++/* Define to 1 if you have the `strtoll' function. */
++#define _EVENT_HAVE_STRTOLL 1
++
++/* Define to 1 if the system has the type `struct addrinfo'. */
++#define _EVENT_HAVE_STRUCT_ADDRINFO 1
++
++/* Define to 1 if the system has the type `struct in6_addr'. */
++#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
++
++/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */
++/* #undef _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */
++
++/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */
++/* #undef _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */
++
++/* Define to 1 if the system has the type `struct sockaddr_in6'. */
++#define _EVENT_HAVE_STRUCT_SOCKADDR_IN6 1
++
++/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
++/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
++
++/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
++/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
++
++/* Define to 1 if the system has the type `struct sockaddr_storage'. */
++#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE 1
++
++/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
++#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
++
++/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
++/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
++
++/* Define to 1 if you have the `sysctl' function. */
++/* #undef _EVENT_HAVE_SYSCTL */
++
++/* Define to 1 if you have the <sys/devpoll.h> header file. */
++#define _EVENT_HAVE_SYS_DEVPOLL_H 1
++
++/* Define to 1 if you have the <sys/epoll.h> header file. */
++/* #undef _EVENT_HAVE_SYS_EPOLL_H 1 */
++
++/* Define to 1 if you have the <sys/eventfd.h> header file. */
++/* #define _EVENT_HAVE_SYS_EVENTFD_H 1 */
++
++/* Define to 1 if you have the <sys/event.h> header file. */
++/* #undef _EVENT_HAVE_SYS_EVENT_H */
++
++/* Define to 1 if you have the <sys/ioctl.h> header file. */
++#define _EVENT_HAVE_SYS_IOCTL_H 1
++
++/* Define to 1 if you have the <sys/mman.h> header file. */
++#define _EVENT_HAVE_SYS_MMAN_H 1
++
++/* Define to 1 if you have the <sys/param.h> header file. */
++#define _EVENT_HAVE_SYS_PARAM_H 1
++
++/* Define to 1 if you have the <sys/queue.h> header file. */
++#define _EVENT_HAVE_SYS_QUEUE_H 1
++
++/* Define to 1 if you have the <sys/select.h> header file. */
++#define _EVENT_HAVE_SYS_SELECT_H 1
++
++/* Define to 1 if you have the <sys/sendfile.h> header file. */
++#define _EVENT_HAVE_SYS_SENDFILE_H 1
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#define _EVENT_HAVE_SYS_SOCKET_H 1
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define _EVENT_HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/sysctl.h> header file. */
++/* #undef _EVENT_HAVE_SYS_SYSCTL_H */
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#define _EVENT_HAVE_SYS_TIME_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define _EVENT_HAVE_SYS_TYPES_H 1
++
++/* Define to 1 if you have the <sys/uio.h> header file. */
++#define _EVENT_HAVE_SYS_UIO_H 1
++
++/* Define to 1 if you have the <sys/wait.h> header file. */
++#define _EVENT_HAVE_SYS_WAIT_H 1
++
++/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
++#define _EVENT_HAVE_TAILQFOREACH 1
++
++/* Define if timeradd is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERADD 1
++
++/* Define if timerclear is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERCLEAR 1
++
++/* Define if timercmp is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERCMP 1
++
++/* Define if timerisset is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERISSET 1
++
++/* Define to 1 if the system has the type `uint16_t'. */
++#define _EVENT_HAVE_UINT16_T 1
++
++/* Define to 1 if the system has the type `uint32_t'. */
++#define _EVENT_HAVE_UINT32_T 1
++
++/* Define to 1 if the system has the type `uint64_t'. */
++#define _EVENT_HAVE_UINT64_T 1
++
++/* Define to 1 if the system has the type `uint8_t'. */
++#define _EVENT_HAVE_UINT8_T 1
++
++/* Define to 1 if the system has the type `uintptr_t'. */
++#define _EVENT_HAVE_UINTPTR_T 1
++
++/* Define to 1 if you have the `umask' function. */
++#define _EVENT_HAVE_UMASK 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define _EVENT_HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the `unsetenv' function. */
++#define _EVENT_HAVE_UNSETENV 1
++
++/* Define to 1 if you have the `vasprintf' function. */
++#define _EVENT_HAVE_VASPRINTF 1
++
++/* Define if kqueue works correctly with pipes */
++/* #undef _EVENT_HAVE_WORKING_KQUEUE */
++
++/* Define to 1 if you have the <zlib.h> header file. */
++#define _EVENT_HAVE_ZLIB_H 1
++
++/* Define to the sub-directory in which libtool stores uninstalled libraries.
++   */
++#define _EVENT_LT_OBJDIR ".libs/"
++
++/* Define to 1 if your C compiler doesn't accept -c and -o together. */
++/* #undef _EVENT_NO_MINUS_C_MINUS_O */
++
++/* Numeric representation of the version */
++#define _EVENT_NUMERIC_VERSION 0x02001500
++
++/* Name of package */
++#define _EVENT_PACKAGE "libevent"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define _EVENT_PACKAGE_BUGREPORT ""
++
++/* Define to the full name of this package. */
++#define _EVENT_PACKAGE_NAME ""
++
++/* Define to the full name and version of this package. */
++#define _EVENT_PACKAGE_STRING ""
++
++/* Define to the one symbol short name of this package. */
++#define _EVENT_PACKAGE_TARNAME ""
++
++/* Define to the home page for this package. */
++#define _EVENT_PACKAGE_URL ""
++
++/* Define to the version of this package. */
++#define _EVENT_PACKAGE_VERSION ""
++
++/* Define to necessary symbol if this constant uses a non-standard name on
++   your system. */
++/* #undef _EVENT_PTHREAD_CREATE_JOINABLE */
++
++/* The size of `int', as computed by sizeof. */
++#define _EVENT_SIZEOF_INT 4
++
++/* The size of `long', as computed by sizeof. */
++#define _EVENT_SIZEOF_LONG 4
++
++/* The size of `long long', as computed by sizeof. */
++#define _EVENT_SIZEOF_LONG_LONG 8
++
++/* The size of `pthread_t', as computed by sizeof. */
++#define _EVENT_SIZEOF_PTHREAD_T 4
++
++/* The size of `short', as computed by sizeof. */
++#define _EVENT_SIZEOF_SHORT 2
++
++/* The size of `size_t', as computed by sizeof. */
++#define _EVENT_SIZEOF_SIZE_T 4
++
++/* The size of `void *', as computed by sizeof. */
++#define _EVENT_SIZEOF_VOID_P 4
++
++/* Define to 1 if you have the ANSI C header files. */
++#define _EVENT_STDC_HEADERS 1
++
++/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
++#define _EVENT_TIME_WITH_SYS_TIME 1
++
++/* Version number of package */
++#define _EVENT_VERSION "2.0.21-stable"
++
++/* Define to appropriate substitue if compiler doesnt have __func__ */
++/* #undef _EVENT___func__ */
++
++/* Define to empty if `const' does not conform to ANSI C. */
++/* #undef _EVENT_const */
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++   calls it, or to nothing if 'inline' is not supported under any name.  */
++#ifndef _EVENT___cplusplus
++/* #undef _EVENT_inline */
++#endif
++
++/* Define to `int' if <sys/types.h> does not define. */
++/* #undef _EVENT_pid_t */
++
++/* Define to `unsigned int' if <sys/types.h> does not define. */
++/* #undef _EVENT_size_t */
++
++/* Define to unsigned int if you dont have it */
++/* #undef _EVENT_socklen_t */
++
++/* Define to `int' if <sys/types.h> does not define. */
++/* #undef _EVENT_ssize_t */
++
++#endif /* event2/event-config.h */
+diff --git a/ipc/glue/BrowserProcessSubThread.cpp b/ipc/glue/BrowserProcessSubThread.cpp
+--- a/ipc/glue/BrowserProcessSubThread.cpp
++++ b/ipc/glue/BrowserProcessSubThread.cpp
[email protected]@ -25,7 +25,7 @@
+ //  "Chrome_FileThread",  // FILE
+ //  "Chrome_DBThread",  // DB
+ //  "Chrome_HistoryThread",  // HISTORY
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   "Gecko_Background_X11Thread",  // BACKGROUND_X11
+ #endif
+ };
[email protected]@ -36,7 +36,7 @@
+ //  nullptr,  // FILE
+ //  nullptr,  // DB
+ //  nullptr,  // HISTORY
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+   nullptr,  // BACKGROUND_X11
+ #endif
+ };
+diff --git a/ipc/glue/BrowserProcessSubThread.h b/ipc/glue/BrowserProcessSubThread.h
+--- a/ipc/glue/BrowserProcessSubThread.h
++++ b/ipc/glue/BrowserProcessSubThread.h
[email protected]@ -28,7 +28,7 @@
+       //FILE,
+       //DB,
+       //HISTORY,
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+       // This thread has a second connection to the X server and is used
+       // to process UI requests when routing the request to the UI
+       // thread would risk deadlock.
+diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
+--- a/ipc/glue/GeckoChildProcessHost.cpp
++++ b/ipc/glue/GeckoChildProcessHost.cpp
[email protected]@ -547,12 +547,15 @@
+   // and passing wstrings from one config to the other is unsafe.  So
+   // we split the logic here.
+ 
+-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
+-  base::environment_map newEnvVars;
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS)
+   ChildPrivileges privs = mPrivileges;
+   if (privs == base::PRIVILEGES_DEFAULT) {
+     privs = DefaultChildPrivileges();
+   }
++#endif
++
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
++  base::environment_map newEnvVars;
+   // XPCOM may not be initialized in some subprocesses.  We don't want
+   // to initialize XPCOM just for the directory service, especially
+   // since LD_LIBRARY_PATH is already set correctly in subprocesses
[email protected]@ -686,7 +689,7 @@
+   childArgv.push_back(pidstring);
+ 
+ #if defined(MOZ_CRASHREPORTER)
+-#  if defined(OS_LINUX) || defined(OS_BSD)
++#  if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+   int childCrashFd, childCrashRemapFd;
+   if (!CrashReporter::CreateNotificationPipeForChild(
+         &childCrashFd, &childCrashRemapFd))
[email protected]@ -702,7 +705,7 @@
+   }
+ #  elif defined(MOZ_WIDGET_COCOA)
+   childArgv.push_back(CrashReporter::GetChildNotificationPipe());
+-#  endif  // OS_LINUX
++#  endif  // OS_LINUX || defined(OS_SOLARIS)
+ #endif
+ 
+ #ifdef MOZ_WIDGET_COCOA
[email protected]@ -721,6 +724,8 @@
+   base::LaunchApp(childArgv, mFileMap,
+ #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
+                   newEnvVars, privs,
++#elif defined(OS_SOLARIS)
++                  base::environment_map(), privs,
+ #endif
+                   false, &process, arch);
+ 
+diff --git a/ipc/glue/SharedMemorySysV.h b/ipc/glue/SharedMemorySysV.h
+--- a/ipc/glue/SharedMemorySysV.h
++++ b/ipc/glue/SharedMemorySysV.h
[email protected]@ -8,7 +8,7 @@
+ #ifndef mozilla_ipc_SharedMemorySysV_h
+ #define mozilla_ipc_SharedMemorySysV_h
+ 
+-#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_BSD)
++#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_BSD) || defined(OS_SOLARIS)
+ 
+ // SysV shared memory isn't available on Windows, but we define the
+ // following macro so that #ifdefs are clearer (compared to #ifdef
[email protected]@ -55,6 +55,9 @@
+   virtual ~SharedMemorySysV()
+   {
+     shmdt(mData);
++#ifdef OS_SOLARIS    
++    shmctl(mHandle, IPC_RMID, 0);
++#endif    
+     mHandle = -1;
+     mData = nullptr;
+   }
[email protected]@ -94,7 +97,9 @@
+ 
+     // Mark the handle as deleted so that, should this process go away, the
+     // segment is cleaned up.
++#ifndef OS_SOLARIS
+     shmctl(mHandle, IPC_RMID, 0);
++#endif
+ 
+     mData = mem;
+ 
[email protected]@ -145,6 +150,6 @@
+ } // namespace ipc
+ } // namespace mozilla
+ 
+-#endif // OS_LINUX
++#endif // OS_LINUX || OS_SOLARIS
+ 
+ #endif // ifndef mozilla_ipc_SharedMemorySysV_h
+diff --git a/ipc/ipdl/test/cxx/Makefile.in b/ipc/ipdl/test/cxx/Makefile.in
+--- a/ipc/ipdl/test/cxx/Makefile.in
++++ b/ipc/ipdl/test/cxx/Makefile.in
[email protected]@ -9,6 +9,10 @@
+   TestBridgeSub \
+   $(NULL)
+ 
++ifeq ($(OS_ARCH),SunOS)
++IPDLTESTS += TestSysVShmem
++endif
++
+ IPDLTESTHDRS = $(addprefix $(srcdir)/,$(addsuffix .h,$(IPDLTESTS)))
+ 
+ TESTER_TEMPLATE := $(srcdir)/IPDLUnitTests.template.cpp
+diff --git a/ipc/ipdl/test/cxx/TestShutdown.cpp b/ipc/ipdl/test/cxx/TestShutdown.cpp
+--- a/ipc/ipdl/test/cxx/TestShutdown.cpp
++++ b/ipc/ipdl/test/cxx/TestShutdown.cpp
[email protected]@ -184,6 +184,8 @@
+         // detectors
+         _exit(0);
+     }
++
++    return false;
+ }
+ 
+ void
+diff --git a/js/src/configure b/js/src/configure
+--- a/js/src/configure
++++ b/js/src/configure
[email protected]@ -8219,7 +8219,7 @@
+ EOF
+ 
+        CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
+-       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
++       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
+        LDFLAGS="-xildoff $LDFLAGS"
+        if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
+            _SAVE_LDFLAGS=$LDFLAGS
+diff --git a/mfbt/Poison.cpp b/mfbt/Poison.cpp
+--- a/mfbt/Poison.cpp
++++ b/mfbt/Poison.cpp
[email protected]@ -25,6 +25,7 @@
+ #  endif
+ # endif
+ #endif
++extern "C" int madvise(caddr_t, size_t, int);
+ 
+ extern "C" {
+ uintptr_t gMozillaPoisonValue;
[email protected]@ -129,7 +130,7 @@
+ static bool
+ ProbeRegion(uintptr_t aRegion, uintptr_t aSize)
+ {
+-  if (madvise(reinterpret_cast<void*>(aRegion), aSize, MADV_NORMAL)) {
++  if (madvise(reinterpret_cast<char*>(aRegion), aSize, MADV_NORMAL)) {
+     return true;
+   } else {
+     return false;
+diff --git a/mfbt/tests/TestPoisonArea.cpp b/mfbt/tests/TestPoisonArea.cpp
+--- a/mfbt/tests/TestPoisonArea.cpp
++++ b/mfbt/tests/TestPoisonArea.cpp
[email protected]@ -103,6 +103,7 @@
+ #include <sys/wait.h>
+ 
+ #include <sys/mman.h>
++extern "C" int madvise(caddr_t, size_t, int);
+ #ifndef MAP_ANON
+ #ifdef MAP_ANONYMOUS
+ #define MAP_ANON MAP_ANONYMOUS
+diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp
+--- a/modules/libjar/nsZipArchive.cpp
++++ b/modules/libjar/nsZipArchive.cpp
[email protected]@ -40,7 +40,8 @@
+     #include <sys/stat.h>
+     #include <limits.h>
+     #include <unistd.h>
+-#elif defined(XP_WIN)
++extern "C" int madvise(caddr_t, size_t, int);
++#elif defined(XP_WIN) || defined(XP_OS2)
+     #include <io.h>
+ #endif
+ 
[email protected]@ -612,7 +613,7 @@
+     uint32_t readaheadLength = xtolong(startp);
+     if (readaheadLength) {
+ #if defined(XP_UNIX)
+-      madvise(const_cast<uint8_t*>(startp), readaheadLength, MADV_WILLNEED);
++      madvise((caddr_t)const_cast<uint8_t*>(startp), readaheadLength, MADV_WILLNEED);
+ #elif defined(XP_WIN)
+       if (aFd) {
+         HANDLE hFile = (HANDLE) PR_FileDesc2NativeHandle(aFd);
+diff --git a/config/system-headers b/config/system-headers
+--- a/config/system-headers
++++ b/config/system-headers
[email protected]@ -1,16 +1,17 @@
+ nspr.h
+ plarena.h
+ plarenas.h
+ plbase64.h
+ plerror.h
+ plgetopt.h
+ plhash.h
+ plstr.h
++port.h
+ pratom.h
+ prbit.h
+ prclist.h
+ prcmon.h
+ prcountr.h
+ prcpucfg.h
+ prcvar.h
+ prdtoa.h
[email protected]@ -1040,16 +1041,17 @@ sys/lwp.h
+ sys/machine.h
+ sys/mman.h
+ sys/mmu.h
+ sys/mount.h
+ sys/mpctl.h
+ sys/param.h
+ sys/pda.h
+ sys/poll.h
++sys/port.h
+ sys/ppc.h
+ sys/prctl.h
+ sys/priv.h
+ sys/procfs.h
+ sys/pstat.h
+ sys/ptrace.h
+ sys/queue.h
+ sys/quota.h
+diff --git a/ipc/glue/MessageLink.cpp b/ipc/glue/MessageLink.cpp
+--- a/ipc/glue/MessageLink.cpp
++++ b/ipc/glue/MessageLink.cpp
[email protected]@ -338,17 +338,17 @@ ProcessLink::OnChannelOpened()
+     /*assert*/mTransport->Connect();
+ }
+ 
+ void
+ ProcessLink::OnTakeConnectedChannel()
+ {
+     AssertIOThread();
+ 
+-    queue<Message> pending;
++    std::queue<Message> pending;
+     {
+         MonitorAutoLock lock(*mChan->mMonitor);
+ 
+         mChan->mChannelState = ChannelConnected;
+ 
+         mExistingListener = mTransport->set_listener(this);
+         if (mExistingListener) {
+             mExistingListener->GetQueuedMessages(pending);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-38-sparc-align.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,69 @@
+Adds asm("ta 6") which suppresses bus error caused by misalignment.
+
+diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
+--- a/js/xpconnect/src/XPCShellImpl.cpp
++++ b/js/xpconnect/src/XPCShellImpl.cpp
[email protected]@ -1320,16 +1320,22 @@ GetCurrentWorkingDirectory(nsAString& wo
+     return true;
+ }
+ 
+ static JSSecurityCallbacks shellSecurityCallbacks;
+ 
+ int
+ XRE_XPCShellMain(int argc, char** argv, char** envp)
+ {
++
++#if defined (__GNUC__) && (defined(__sparc) || defined(__sparc__))
++    // make unaligned memory access no crash
++    asm ( "ta 6" );
++#endif
++
+     JSRuntime* rt;
+     JSContext* cx;
+     int result;
+     nsresult rv;
+ 
+     gErrFile = stderr;
+     gOutFile = stdout;
+     gInFile = stdin;
+diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
+--- a/memory/mozjemalloc/jemalloc.c
++++ b/memory/mozjemalloc/jemalloc.c
[email protected]@ -5551,16 +5551,22 @@ malloc_init(void)
+ #endif
+ 
+ #if !defined(MOZ_MEMORY_WINDOWS)
+ static
+ #endif
+ bool
+ malloc_init_hard(void)
+ {
++
++#if defined (__GNUC__) && (defined(__sparc) || defined(__sparc__))
++    // make unaligned memory access no crash
++    asm ( "ta 6" );
++#endif
++
+ 	unsigned i;
+ 	char buf[PATH_MAX + 1];
+ 	const char *opts;
+ 	long result;
+ #ifndef MOZ_MEMORY_WINDOWS
+ 	int linklen;
+ #endif
+ #ifdef MOZ_MEMORY_DARWIN
+diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
+--- a/toolkit/xre/nsAppRunner.cpp
++++ b/toolkit/xre/nsAppRunner.cpp
[email protected]@ -4255,6 +4255,11 @@
+ int
+ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
+ {
++#if defined (__GNUC__) && (defined(__sparc) || defined(__sparc__))
++    // make unaligned memory access no crash
++    asm ( "ta 6" );
++#endif
++
+   char aLocal;
+   GeckoProfilerInitRAII profilerGuard(&aLocal);
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-39-gc-memory.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,137 @@
+Remove unnecessary functions for memory.
+Do not plan to send upstream.
+
+diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
+--- a/js/src/gc/Memory.cpp
++++ b/js/src/gc/Memory.cpp
[email protected]@ -12,21 +12,16 @@
+ #include "js/HeapAPI.h"
+ #include "vm/Runtime.h"
+ 
+ #if defined(XP_WIN)
+ 
+ #include "jswin.h"
+ #include <psapi.h>
+ 
+-#elif defined(SOLARIS)
+-
+-#include <sys/mman.h>
+-#include <unistd.h>
+-
+ #elif defined(XP_UNIX)
+ 
+ #include <algorithm>
+ #include <errno.h>
+ #include <sys/mman.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
[email protected]@ -288,89 +283,16 @@ AllocateMappedContent(int fd, size_t off
+ 
+ // Deallocate mapped memory for object.
+ void
+ DeallocateMappedContent(void* p, size_t length)
+ {
+     // TODO: Bug 988813 - Support memory mapped array buffer for Windows platform.
+ }
+ 
+-#elif defined(SOLARIS)
+-
+-#ifndef MAP_NOSYNC
+-# define MAP_NOSYNC 0
+-#endif
+-
+-void
+-InitMemorySubsystem()
+-{
+-    if (pageSize == 0)
+-        pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
+-}
+-
+-void*
+-MapAlignedPages(size_t size, size_t alignment)
+-{
+-    MOZ_ASSERT(size >= alignment);
+-    MOZ_ASSERT(size % alignment == 0);
+-    MOZ_ASSERT(size % pageSize == 0);
+-    MOZ_ASSERT(alignment % allocGranularity == 0);
+-
+-    int prot = PROT_READ | PROT_WRITE;
+-    int flags = MAP_PRIVATE | MAP_ANON | MAP_ALIGN | MAP_NOSYNC;
+-
+-    void* p = mmap((caddr_t)alignment, size, prot, flags, -1, 0);
+-    if (p == MAP_FAILED)
+-        return nullptr;
+-    return p;
+-}
+-
+-void
+-UnmapPages(void* p, size_t size)
+-{
+-    MOZ_ALWAYS_TRUE(0 == munmap((caddr_t)p, size));
+-}
+-
+-bool
+-MarkPagesUnused(void* p, size_t size)
+-{
+-    MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
+-    return true;
+-}
+-
+-bool
+-MarkPagesInUse(void* p, size_t size)
+-{
+-    if (!DecommitEnabled())
+-        return true;
+-
+-    MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
+-    return true;
+-}
+-
+-size_t
+-GetPageFaultCount()
+-{
+-    return 0;
+-}
+-
+-void*
+-AllocateMappedContent(int fd, size_t offset, size_t length, size_t alignment)
+-{
+-    // Not implemented.
+-    return nullptr;
+-}
+-
+-// Deallocate mapped memory for object.
+-void
+-DeallocateMappedContent(void* p, size_t length)
+-{
+-    // Not implemented.
+-}
+-
+ #elif defined(XP_UNIX)
+ 
+ void
+ InitMemorySubsystem()
+ {
+     if (pageSize == 0)
+         pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
+ }
[email protected]@ -599,17 +521,17 @@ UnmapPages(void* p, size_t size)
+ 
+ bool
+ MarkPagesUnused(void* p, size_t size)
+ {
+     if (!DecommitEnabled())
+         return false;
+ 
+     MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
+-    int result = madvise(p, size, MADV_DONTNEED);
++    int result = madvise((caddr_t)p, size, MADV_DONTNEED);
+     return result != -1;
+ }
+ 
+ bool
+ MarkPagesInUse(void* p, size_t size)
+ {
+     if (!DecommitEnabled())
+         return true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-40-libstagefright.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,75 @@
+Do not use certain header files. We define bswap_16 ourselves.
+Do not plan to send upstream.
+
+diff --git a/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp b/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
+--- a/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
++++ b/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
[email protected]@ -20,17 +20,23 @@
+ #include <utils/Log.h>
+ 
+ #include "../include/ID3.h"
+ 
+ #include <media/stagefright/foundation/ADebug.h>
+ #include <media/stagefright/DataSource.h>
+ #include <media/stagefright/Utils.h>
+ #include <utils/String8.h>
+-#include <byteswap.h>
++//#include <byteswap.h>
++
++#ifndef bswap_16
++# define bswap_16(p) \
++        (((((uint16_t)(p)) & 0x00ff) << 8) | \
++          (((uint16_t)(p))           >> 8));
++#endif
+ 
+ namespace stagefright {
+ 
+ static const size_t kMaxMetadataSize = 3 * 1024 * 1024;
+ 
+ struct MemorySource : public DataSource {
+     MemorySource(const uint8_t *data, size_t size)
+         : mData(data),
+diff --git a/media/libstagefright/moz.build b/media/libstagefright/moz.build
+--- a/media/libstagefright/moz.build
++++ b/media/libstagefright/moz.build
[email protected]@ -2,17 +2,17 @@
+ # vim: set filetype=python:
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ 
+ DEFINES['ANDROID_SMP'] = 0
+ DEFINES['LOG_NDEBUG'] = 1
+ 
+-if CONFIG['OS_TARGET'] != 'WINNT':
++if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['OS_TARGET'] != 'SunOS':
+    DEFINES['_GLIBCXX_OS_DEFINES'] = True
+ 
+ if CONFIG['OS_TARGET'] == 'WINNT':
+     if CONFIG['_MSC_VER']:
+         DEFINES['ssize_t'] = 'intptr_t'
+         DEFINES['off64_t'] = 'int64_t'
+         DEFINES['strcasecmp'] = 'stricmp'
+         DEFINES['strncasecmp'] = 'strnicmp'
+diff --git a/media/libstagefright/system/core/include/cutils/properties.h b/media/libstagefright/system/core/include/cutils/properties.h
+--- a/media/libstagefright/system/core/include/cutils/properties.h
++++ b/media/libstagefright/system/core/include/cutils/properties.h
[email protected]@ -12,17 +12,17 @@
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ 
+ #ifndef __CUTILS_PROPERTIES_H
+ #define __CUTILS_PROPERTIES_H
+ 
+-#include <sys/cdefs.h>
++//#include <sys/cdefs.h>
+ #include <stddef.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
+ /* System properties are *small* name value pairs managed by the
+ ** property service.  If your data doesn't fit in the provided
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-41-static-xul-components.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,27 @@
+Define variables differently for Solaris. 
+Do not plan to send upstream.
+
+diff --git a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp
+--- a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp
++++ b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp
[email protected]@ -5,9 +5,10 @@
+ #ifdef _MSC_VER
+ /* Sections on Windows are in two parts, separated with $. When linking,
+  * sections with the same first part are all grouped, and ordered
+  * alphabetically with the second part as sort key. */
+ #  pragma section(".kPStaticModules$Z", read)
+ #  undef NSMODULE_SECTION
+ #  define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$Z"), dllexport)
+ #endif
+-NSMODULE_DEFN(end_kPStaticModules) = nullptr;
++static const mozilla::Module kEndModule = { 0 };
++NSMODULE_DEFN(end_kPStaticModules) = &kEndModule;
+diff --git a/toolkit/library/StaticXULComponentsStart.cpp b/toolkit/library/StaticXULComponentsStart.cpp
+--- a/toolkit/library/StaticXULComponentsStart.cpp
++++ b/toolkit/library/StaticXULComponentsStart.cpp
[email protected]@ -1,3 +1,4 @@
+ #include "mozilla/Module.h"
+ 
+-NSMODULE_DEFN(start_kPStaticModules) = nullptr;
++static const mozilla::Module kStartModule = { 0 };
++NSMODULE_DEFN(start_kPStaticModules) = &kStartModule;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-42-libxul.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,46 @@
+Solaris specific patches. 
+Do not plan to send upstream.
+
+diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk
+--- a/toolkit/library/libxul.mk
++++ b/toolkit/library/libxul.mk
[email protected]@ -32,16 +32,26 @@ endif
+ ifeq (Linux,$(OS_ARCH))
+ # Create a GDB Python auto-load file alongside the libxul shared library in
+ # the build directory.
+ PP_TARGETS += LIBXUL_AUTOLOAD
+ LIBXUL_AUTOLOAD = $(topsrcdir)/toolkit/library/libxul.so-gdb.py.in
+ LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
+ endif
+ 
++ifdef MOZ_MEMORY
++ifeq ($(OS_ARCH),SunOS)
++OS_LDFLAGS +=  $(LIBXUL_DIST)/lib/libmemory.a
++endif
++endif
++
++ifeq ($(OS_ARCH),SunOS)
++OS_LDFLAGS +=  -lm -Wl,-z,defs
++endif
++
+ # BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
+ # exists. Using an implicit linker script to make it fold that section in
+ # .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
+ # script however makes gold misbehave, first because it doesn't like that
+ # the linker script is given after crtbegin.o, and even past that, replaces
+ # the default section rules with those from the script instead of
+ # supplementing them. Which leads to a lib with a huge load of sections.
+ ifneq (OpenBSD,$(OS_TARGET))
[email protected]@ -58,8 +68,12 @@ else
+ get_first_and_last = $(TOOLCHAIN_PREFIX)nm -g $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
+ endif
+ 
+ LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0
+ 
+ ifeq (Linux,$(OS_ARCH))
+ LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
+ endif
++
++ifeq (SunOS,$(OS_ARCH))
++LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
++endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-43-xpcom.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,25 @@
+Solaris-specific patch. Adds if def(SOLARIS) case.
+Do not plan to send upstream.
+
+diff --git a/xpcom/base/nsUUIDGenerator.cpp b/xpcom/base/nsUUIDGenerator.cpp
+--- a/xpcom/base/nsUUIDGenerator.cpp
++++ b/xpcom/base/nsUUIDGenerator.cpp
[email protected]@ -11,17 +11,17 @@
+ #include <CoreFoundation/CoreFoundation.h>
+ #else
+ #include <stdlib.h>
+ #include "prrng.h"
+ #endif
+ 
+ #include "nsUUIDGenerator.h"
+ 
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(SOLARIS)
+ extern "C" NS_EXPORT void arc4random_buf(void*, size_t);
+ #endif
+ 
+ using namespace mozilla;
+ 
+ NS_IMPL_ISUPPORTS(nsUUIDGenerator, nsIUUIDGenerator)
+ 
+ nsUUIDGenerator::nsUUIDGenerator()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-44-readahead.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,28 @@
+In-house patch for firefox to build with GNU compilers. 
+With GNU compiler, we have hunspell_fopen_hooks.h included 
+through mozilla-config.h.
+But we don't have an implementation for mozilla::ReadAheadFile().
+Do not plan to send upstream.
+
+diff --git a/xpcom/glue/FileUtils.cpp b/xpcom/glue/FileUtils.cpp
+--- a/xpcom/glue/FileUtils.cpp
++++ b/xpcom/glue/FileUtils.cpp
[email protected]@ -481,17 +481,17 @@ mozilla::ReadAheadFile(mozilla::pathstr_
+   }
+   if (fd == INVALID_HANDLE_VALUE) {
+     return;
+   }
+   ReadAhead(fd, aOffset, aCount);
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX) || defined(SOLARIS)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+     }
+     return;
+   }
+   int fd = open(aFilePath, O_RDONLY);
+   if (aOutFd) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-45-wifi-scanner.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,73 @@
+Convert variable int mac_as_int to char. 
+Do not plan to send upstream.
+
+diff --git a/netwerk/wifi/nsWifiScannerSolaris.cpp b/netwerk/wifi/nsWifiScannerSolaris.cpp
+--- a/netwerk/wifi/nsWifiScannerSolaris.cpp
++++ b/netwerk/wifi/nsWifiScannerSolaris.cpp
[email protected]@ -28,47 +28,52 @@ static val_strength_t strength_vals[] = 
+   { "good",      -68 },
+   { "very good", -40 },
+   { "excellent", -16 }
+ };
+ 
+ static nsWifiAccessPoint *
+ do_parse_str(char *bssid_str, char *essid_str, char *strength)
+ {
+-  unsigned char mac_as_int[6] = { 0 };
++  unsigned int mac_as_int[6] = { 0 };
++  unsigned char mac_as_byte[6] = { 0 };
+   sscanf(bssid_str, "%x:%x:%x:%x:%x:%x", &mac_as_int[0], &mac_as_int[1],
+          &mac_as_int[2], &mac_as_int[3], &mac_as_int[4], &mac_as_int[5]);
+ 
++  for (uint32_t i = 0; i < 6; i++) {
++    mac_as_byte[i] = mac_as_int[i];
++  }
++
+   int signal = 0;
+   uint32_t strength_vals_count = sizeof(strength_vals) / sizeof (val_strength_t);
+   for (uint32_t i = 0; i < strength_vals_count; i++) {
+     if (!strncasecmp(strength, strength_vals[i].strength_name, DLADM_STRSIZE)) {
+       signal = strength_vals[i].signal_value;
+       break;
+     }
+   }
+ 
+   nsWifiAccessPoint *ap = new nsWifiAccessPoint();
+   if (ap) {
+-    ap->setMac(mac_as_int);
++    ap->setMac(mac_as_byte);
+     ap->setSignal(signal);
+     ap->setSSID(essid_str, PL_strnlen(essid_str, DLADM_STRSIZE));
+   }
+   return ap;
+ }
+ 
+ static void
+ do_dladm(nsCOMArray<nsWifiAccessPoint> &accessPoints)
+ {
+   GError *err = nullptr;
+   char *sout = nullptr;
+   char *serr = nullptr;
+   int exit_status = 0;
+   char * dladm_args[] = { "/usr/bin/pfexec", "/usr/sbin/dladm",
+-                          "scan-wifi", "-p", "-o", "BSSID,ESSID,STRENGTH" };
++                          "scan-wifi", "-p", "-o", "BSSID,ESSID,STRENGTH", 0 };
+ 
+   gboolean rv = g_spawn_sync("/", dladm_args, nullptr, (GSpawnFlags)0, nullptr,
+                              nullptr, &sout, &serr, &exit_status, &err);
+   if (rv && !exit_status) {
+     char wlan[DLADM_SECTIONS][DLADM_STRSIZE+1];
+     uint32_t section = 0;
+     uint32_t sout_scan = 0;
+     uint32_t wlan_put = 0;
+--- a/dom/system/NetworkGeolocationProvider.js	2015-09-13 14:24:44.290458254 +0800
++++ b/dom/system/NetworkGeolocationProvider.js	2015-09-13 14:24:52.938673937 +0800
[email protected]@ -29,7 +29,7 @@
+    data and xhr it to the location server.
+ */
+ 
+-let gLocationRequestTimeout = 5000;
++let gLocationRequestTimeout = 30000;
+ 
+ let gWifiScanningEnabled = true;
+ let gCellScanningEnabled = false;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-46-dtrace.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,58 @@
+See Mozilla bug #702179 - dtrace probes are not installed on Solaris with
+static js lib.
+dtrace will trim the function name (too long).
+Do not plan to send upstream.
+
+diff -r abcf3e3a52d4 js/src/Makefile.in
+--- a/js/src/Makefile.in	Sat Sep 05 10:14:47 2015 +0800
++++ b/js/src/Makefile.in	Sun Sep 13 12:59:09 2015 +0800
[email protected]@ -16,7 +16,6 @@
+ 
+ run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
+ 
+-DIST_INSTALL = 1
+ NO_EXPAND_LIBS = 1
+ 
+ ifdef JS_HAS_CTYPES
+diff -r abcf3e3a52d4 toolkit/library/libxul.mk
+--- a/toolkit/library/libxul.mk Sat Sep 05 10:14:47 2015 +0800
++++ b/toolkit/library/libxul.mk Sun Sep 13 12:59:09 2015 +0800
[email protected]@ -44,7 +44,7 @@
+ endif
+
+ ifeq ($(OS_ARCH),SunOS)
+-OS_LDFLAGS +=  -lm -Wl,-z,defs
++OS_LDFLAGS +=  -lm -lsendfile -Wl,-z,defs ../../js/src/js-dtrace.o
+ endif
+
+ # BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
+diff -r abcf3e3a52d4 js/src/jsobj.cpp
+--- a/js/src/jsobj.cpp	Sat Sep 05 10:14:47 2015 +0800
++++ b/js/src/jsobj.cpp	Sun Sep 13 12:59:09 2015 +0800
[email protected]@ -1233,6 +1233,8 @@
+            !proto.toObject()->is<GlobalObject>();
+ }
+ 
++#pragma weak _ZN2js29NewObjectWithGivenTaggedProtoEPNS_16ExclusiveContextEPKNS_5ClassEN2JS6HandleINS_11TaggedProtoEEENS6_IP8JSObjectEENS_2gc = _ZN2js29NewObjectWithGivenTaggedProtoEPNS_16ExclusiveContextEPKNS_5ClassEN2JS6HandleINS_11TaggedProtoEEENS6_IP8JSObjectEENS_2gc9AllocKindENS_13NewObjectKindE
++
+ JSObject*
+ js::NewObjectWithGivenTaggedProto(ExclusiveContext* cxArg, const Class* clasp,
+                                   Handle<TaggedProto> proto, HandleObject parentArg,
[email protected]@ -1386,6 +1388,8 @@
+            !cxArg->asJSContext()->compartment()->hasObjectMetadataCallback();
+ }
+ 
++#pragma weak _ZN2js29NewObjectWithClassProtoCommonEPNS_16ExclusiveContextEPKNS_5ClassEN2JS6HandleIP8JSObjectEES9_NS_2gc9AllocKindENS_13NewOb = _ZN2js29NewObjectWithClassProtoCommonEPNS_16ExclusiveContextEPKNS_5ClassEN2JS6HandleIP8JSObjectEES9_NS_2gc9AllocKindENS_13NewObjectKindE
++
+ JSObject*
+ js::NewObjectWithClassProtoCommon(ExclusiveContext* cxArg, const Class* clasp,
+                                   HandleObject protoArg, HandleObject maybeParent,
[email protected]@ -1465,6 +1469,8 @@
+  * Create a plain object with the specified group. This bypasses getNewGroup to
+  * avoid losing creation site information for objects made by scripted 'new'.
+  */
++
++#pragma weak _ZN2js24NewObjectWithGroupCommonEP9JSContextN2JS6HandleIPNS_11ObjectGroupEEENS3_IP8JSObjectEENS_2gc9AllocKindENS_13NewObjectKin = _ZN2js24NewObjectWithGroupCommonEP9JSContextN2JS6HandleIPNS_11ObjectGroupEEENS3_IP8JSObjectEENS_2gc9AllocKindENS_13NewObjectKindE
+ JSObject*
+ js::NewObjectWithGroupCommon(JSContext* cx, HandleObjectGroup group, HandleObject parent,
+                              gc::AllocKind allocKind, NewObjectKind newKind)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-47-unreachable.patch	Tue Mar 01 12:56:53 2016 -0800
@@ -0,0 +1,60 @@
+In house patch, will not send upstream.
+ERR() function is already defined elsewhere. 
+
+--- mozilla-esr38/gfx/angle/src/common/debug.h	2015-10-26 15:49:18.755193254 -0700
++++ mozilla-esr38/gfx/angle/src/common/debug.h	2015-10-26 15:48:39.108802848 -0700
[email protected]@ -57,9 +57,9 @@ namespace gl
+ 
+ // A macro to output a function call and its arguments to the debugging log, in case of error.
+ #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
+-#define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
++#define FFERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
+ #else
+-#define ERR(message, ...) (void(0))
++#define FFERR(message, ...) (void(0))
+ #endif
+ 
+ // A macro to log a performance event around a scope.
[email protected]@ -77,7 +77,7 @@ namespace gl
+ #if !defined(NDEBUG)
+ #define ASSERT(expression) do { \
+     if(!(expression)) \
+-        ERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
++        FFERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
+         assert(expression); \
+     } while(0)
+ #define UNUSED_ASSERTION_VARIABLE(variable)
[email protected]@ -116,11 +116,11 @@ namespace gl
+ // A macro for code which is not expected to be reached under valid assumptions
+ #if !defined(NDEBUG)
+ #define UNREACHABLE() do { \
+-    ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
++    FFERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
+     assert(false); \
+     } while(0)
+ #else
+-    #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__)
++    #define UNREACHABLE() FFERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__)
+ #endif
+ 
+ // A macro that determines whether an object has a given runtime type.
+--- mozilla-esr38/gfx/angle/src/common/winrt/IInspectableNativeWindow.cpp	2015-10-26 15:51:25.857595462 -0700
++++ mozilla-esr38/gfx/angle/src/common/winrt/IInspectableNativeWindow.cpp	2015-10-26 15:50:59.541429136 -0700
[email protected]@ -44,7 +44,7 @@ bool NativeWindow::initialize()
+     }
+     else
+     {
+-        ERR("Invalid IInspectable EGLNativeWindowType detected. Valid IInspectables include ICoreWindow and IPropertySet");
++        FFERR("Invalid IInspectable EGLNativeWindowType detected. Valid IInspectables include ICoreWindow and IPropertySet");
+     }
+ 
+     return false;
[email protected]@ -127,7 +127,7 @@ bool isEGLConfiguredPropertySet(EGLNativ
+     // considered invalid.
+     if (SUCCEEDED(result) && !hasEglNativeWindowPropertyKey)
+     {
+-        ERR("Could not find EGLNativeWindowTypeProperty in IPropertySet. Valid EGLNativeWindowTypeProperty values include ICoreWindow");
++        FFERR("Could not find EGLNativeWindowTypeProperty in IPropertySet. Valid EGLNativeWindowTypeProperty values include ICoreWindow");
+         return false;
+     }
+ 
--- a/components/desktop/firefox/patches/firefox100-39-cairo-perf.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-This enables tracking of ARGB values for image masks, since some machines do 
-not use ARGB values. 
-See Mozilla bug #716462 - Performance regression with xBGR visual and no 
-RENDER extension. 
-We would like to try to get this upstream in the future. 
-
---- mozilla-esr31/gfx/cairo/cairo/src/cairo-xlib-surface.c.orig	2015-06-04 17:42:51.419088049 -0700
-+++ mozilla-esr31/gfx/cairo/cairo/src/cairo-xlib-surface.c	2015-06-04 17:42:51.424665839 -0700
[email protected]@ -2325,6 +2325,7 @@
- 			   cairo_region_t *clip_region)
- {
-     cairo_image_surface_t *image;
-+    cairo_format_masks_t image_masks;
-     cairo_rectangle_int_t extents;
-     cairo_status_t status;
-     int tx, ty;
[email protected]@ -2341,6 +2342,16 @@
- 	    (image->base.content & CAIRO_CONTENT_ALPHA) == 0)))
- 	return CAIRO_INT_STATUS_UNSUPPORTED;
- 
-+    if (image->base.backend->type == CAIRO_SURFACE_TYPE_IMAGE) {
-+	if (_pixman_format_to_masks (image->pixman_format, &image_masks)) {
-+	    if (! ((image_masks.alpha_mask == surface->a_mask || surface->a_mask == 0) &&
-+		   (image_masks.red_mask   == surface->r_mask || surface->r_mask == 0) &&
-+		   (image_masks.green_mask == surface->g_mask || surface->g_mask == 0) &&
-+		   (image_masks.blue_mask  == surface->b_mask || surface->b_mask == 0)))
-+		return CAIRO_INT_STATUS_UNSUPPORTED;
-+	}
-+    }
-+
-     if (image->base.backend->type != CAIRO_SURFACE_TYPE_IMAGE) {
- 	if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
- 	    image = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) image)->target;
--- a/components/desktop/firefox/patches/firefox12-00-libnspr_flt4.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-This adds a library necessary for sparc. 
-This will probably not be sent upstream because it would be difficult to 
-add a sparc-only ifdef condition for this.
-
---- mozilla-esr31/browser/installer/package-manifest.in.orig	2015-06-04 17:42:52.445166224 -0700
-+++ mozilla-esr31/browser/installer/package-manifest.in	2015-06-04 17:42:52.450333944 -0700
[email protected]@ -741,6 +741,7 @@
- bin/libfreebl_32fpu_3.so
- bin/libfreebl_32int_3.so
- bin/libfreebl_32int64_3.so
-+bin/cpu/sparcv8plus/libnspr_flt4.so
- #endif
- 
- ; [Updater]
--- a/components/desktop/firefox/patches/firefox16-48-sparc-lea.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-Implements PolyIC for sparc. 
-This is going away in the future so no need to send upstream. 
-
---- mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h.orig	2015-06-04 17:42:51.582947696 -0700
-+++ mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h	2015-06-04 17:42:51.585565407 -0700
[email protected]@ -1005,9 +1005,12 @@
- 
-         void lea(BaseIndex address, RegisterID dest)
-         {
--            // lea only used by PolyIC.
--            // PolyIC is not enabled for sparc now.
--            ASSERT(0);
-+            move(address.index, dest);
-+            if (address.scale != 0)
-+                lshift32(Imm32(address.scale), dest);
-+            if (address.offset)
-+                add32(Imm32(address.offset), dest);
-+            add32(address.base, dest);
-         }
- 
-         void add32(Imm32 imm, AbsoluteAddress address)
--- a/components/desktop/firefox/patches/firefox18-93-libffi-sparc.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-This is already upstream in libffi, but not yet in Mozilla. 
-
---- mozilla-esr31/js/src/ctypes/libffi/src/sparc/ffi.c.orig	2015-06-04 17:42:52.335127713 -0700
-+++ mozilla-esr31/js/src/ctypes/libffi/src/sparc/ffi.c	2015-06-04 17:42:52.343504239 -0700
[email protected]@ -406,8 +406,50 @@
-       /* We don't yet support calling 32bit code from 64bit */
-       FFI_ASSERT(0);
- #else
--      ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes, 
--		  cif->flags, rvalue, fn);
-+      if (rvalue && (cif->rtype->type == FFI_TYPE_STRUCT
-+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE  
-+	  || cif->flags == FFI_TYPE_LONGDOUBLE
-+#endif
-+	  ))
-+	{
-+	  /* For v8, we need an "unimp" with size of returning struct */
-+	  /* behind "call", so we alloc some executable space for it. */
-+	  /* l7 is used, we need to make sure v8.S doesn't use %l7.   */
-+	  unsigned int *call_struct = NULL;
-+	  ffi_closure_alloc(32, &call_struct);
-+	  if (call_struct)
-+	    {
-+	      unsigned long f = (unsigned long)fn;
-+	      call_struct[0] = 0xae10001f;		 /* mov   %i7, %l7	 */
-+	      call_struct[1] = 0xbe10000f;		 /* mov   %o7, %i7	 */
-+	      call_struct[2] = 0x03000000 | f >> 10;     /* sethi %hi(fn), %g1	 */
-+	      call_struct[3] = 0x9fc06000 | (f & 0x3ff); /* jmp %g1+%lo(fn), %o7 */
-+	      call_struct[4] = 0x01000000;		 /* nop			 */
-+	      if (cif->rtype->size < 0x7f)
-+		call_struct[5] = cif->rtype->size;	 /* unimp		 */
-+	      else
-+		call_struct[5] = 0x01000000;	     	 /* nop			 */
-+	      call_struct[6] = 0x81c7e008;		 /* ret			 */
-+	      call_struct[7] = 0xbe100017;		 /* mov   %l7, %i7	 */
-+	      asm volatile ("iflush %0; iflush %0+8; iflush %0+16; iflush %0+24" : : 
-+			    "r" (call_struct) : "memory");
-+	      /* SPARC v8 requires 5 instructions for flush to be visible */
-+	      asm volatile ("nop; nop; nop; nop; nop");
-+	      ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
-+			  cif->flags, rvalue, call_struct);
-+	      ffi_closure_free(call_struct);
-+	    }
-+	  else
-+	    {
-+	      ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes, 
-+			  cif->flags, rvalue, fn);
-+	    }
-+	}
-+      else
-+	{
-+	  ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes, 
-+		      cif->flags, rvalue, fn);
-+	}
- #endif
-       break;
-     case FFI_V9:
[email protected]@ -468,13 +510,13 @@
-   closure->fun = fun;
-   closure->user_data = user_data;
- 
--  /* Flush the Icache.  FIXME: alignment isn't certain, assume 8 bytes */
-+  /* Flush the Icache.  closure is 8 bytes aligned */
- #ifdef SPARC64
--  asm volatile ("flush	%0" : : "r" (closure) : "memory");
--  asm volatile ("flush	%0" : : "r" (((char *) closure) + 8) : "memory");
-+  asm volatile ("flush	%0; flush %0+8" : : "r" (closure) : "memory");
- #else
--  asm volatile ("iflush	%0" : : "r" (closure) : "memory");
--  asm volatile ("iflush	%0" : : "r" (((char *) closure) + 8) : "memory");
-+  asm volatile ("iflush %0; iflush %0+8" : : "r" (closure) : "memory");
-+  /* SPARC v8 requires 5 instructions for flush to be visible */
-+  asm volatile ("nop; nop; nop; nop; nop");
- #endif
- 
-   return FFI_OK;
---- mozilla-esr31/js/src/ctypes/libffi/configure.orig	2015-06-04 17:42:52.338127066 -0700
-+++ mozilla-esr31/js/src/ctypes/libffi/configure	2015-06-04 17:42:52.344846571 -0700
[email protected]@ -12425,7 +12425,7 @@
- 
- case "$target" in
-      # Darwin 10 (OSX 10.6) and beyond allocate non-executable pages
--     *-apple-darwin1* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
-+     *-apple-darwin1* | *-*-freebsd* | *-*-openbsd* | *-*-solaris*)
- 
- $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
- 
--- a/components/desktop/firefox/patches/firefox20-24-stackwalk_compile.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-Adds an sp argument for the load_address() function. The sp argument is used
-in the NS_WalkStackCallback() function. This is to match a new argument 
-that was added in the function for other platforms. 
-See Mozilla bug #766579. 
-Need more followup to fully understand. 
-
---- mozilla-esr31/xpcom/base/nsStackWalk.cpp.orig	2015-06-04 17:42:51.321202120 -0700
-+++ mozilla-esr31/xpcom/base/nsStackWalk.cpp	2015-06-04 17:42:51.326394782 -0700
[email protected]@ -891,7 +891,7 @@
- #include <sys/regset.h>
- #include <sys/stack.h>
- 
--static int    load_address ( void * pc, void * arg );
-+static int    load_address ( void * pc, void * sp, void * arg );
- static struct bucket * newbucket ( void * pc );
- static struct frame * cs_getmyframeptr ( void );
- static void   cs_walk_stack ( void * (*read_func)(char * address),
[email protected]@ -966,7 +966,7 @@
- 
- 
- static int
--load_address(void * pc, void * arg)
-+load_address(void * pc, void * sp, void * arg )
- {
-     static struct bucket table[2048];
-     static mutex_t lock;
[email protected]@ -988,7 +988,7 @@
-     if (ptr->next) {
-         mutex_unlock(&lock);
-     } else {
--        (args->callback)(pc, args->closure);
-+        (args->callback)(pc, NULL, args->closure);
-         args->numFrames++;
-         if (args->maxFrames != 0 && args->numFrames == args->maxFrames)
-           stop = 1;   // causes us to stop getting frames
--- a/components/desktop/firefox/patches/firefox20-46-strcasestr.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-The strcasestr function is not available in Solaris 10, so this replaces it 
-with an alternate function. This is not necessary for Solaris 12+. 
-The 'uname' part is necessary because the uname() function returns a 
-non-negative value. 
-
---- mozilla-esr31/widget/xpwidgets/GfxInfoX11.cpp.orig	2015-06-04 17:42:51.546213832 -0700
-+++ mozilla-esr31/widget/xpwidgets/GfxInfoX11.cpp	2015-06-04 17:42:51.548646551 -0700
[email protected]@ -12,6 +12,7 @@
- #include <sys/utsname.h>
- #include "nsCRTGlue.h"
- #include "prenv.h"
-+#include "plstr.h"
- 
- #include "GfxInfoX11.h"
- 
[email protected]@ -135,7 +136,7 @@
-     // only useful for Linux kernel version check for FGLRX driver.
-     // assumes X client == X server, which is sad.
-     struct utsname unameobj;
--    if (!uname(&unameobj))
-+    if (uname(&unameobj) >= 0)
-     {
-       mOS.Assign(unameobj.sysname);
-       mOSRelease.Assign(unameobj.release);
[email protected]@ -210,13 +211,13 @@
-         // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get:
-         // there is no actual driver version info.
-         whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa");
--        if (strcasestr(mVendor.get(), "nouveau"))
-+        if (PL_strcasestr(mVendor.get(), "nouveau"))
-             mIsNouveau = true;
--        if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string
-+        if (PL_strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string
-             mIsIntel = true;
--        if (strcasestr(mRenderer.get(), "llvmpipe"))
-+        if (PL_strcasestr(mRenderer.get(), "llvmpipe"))
-             mIsLlvmpipe = true;
--        if (strcasestr(mRenderer.get(), "software rasterizer"))
-+        if (PL_strcasestr(mRenderer.get(), "software rasterizer"))
-             mIsOldSwrast = true;
-     } else if (strstr(mVendor.get(), "NVIDIA Corporation")) {
-         mIsNVIDIA = true;
--- a/components/desktop/firefox/patches/firefox20-52-check_test.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-This patch is for testing. Potential for sending upstream. 
-
---- mozilla-esr31/testing/runcppunittests.py.orig	2015-06-04 17:42:51.633983468 -0700
-+++ mozilla-esr31/testing/runcppunittests.py	2015-06-04 17:42:51.638876910 -0700
[email protected]@ -80,6 +80,8 @@
-         pathvar = ""
-         if mozinfo.os == "linux":
-             pathvar = "LD_LIBRARY_PATH"
-+        if mozinfo.os == "unix":
-+            pathvar = "LD_LIBRARY_PATH"
-         elif mozinfo.os == "mac":
-             pathvar = "DYLD_LIBRARY_PATH"
-         elif mozinfo.os == "win":
--- a/components/desktop/firefox/patches/firefox20-82-sqlite3-unix-excl.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-This provides the option to set the indicator for a NFS profile to true. 
-It may be necessary for users on NFS to use bookmarks/logging. 
-Needs further investigation, will probably be difficult to send upstream. 
-
---- mozilla-esr31/browser/app/profile/firefox.js.orig	2015-06-04 17:42:52.206758105 -0700
-+++ mozilla-esr31/browser/app/profile/firefox.js	2015-06-04 17:42:52.212124280 -0700
[email protected]@ -1022,6 +1022,9 @@
- // allow META refresh by default
- pref("accessibility.blockautorefresh", false);
- 
-+// Whether profile is on NFS
-+pref("storage.nfs_filesystem", true);
-+
- // Whether history is enabled or not.
- pref("places.history.enabled", true);
- 
--- a/components/desktop/firefox/patches/firefox21-49-hnjfile.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-This allows us to access some function from wchar.h that other platforms 
-can get from stdio.h. 
-Potentially send upstream with an ifdef Solaris statement. 
-
---- mozilla-esr31/intl/hyphenation/src/hnjalloc.h.orig	2015-06-04 17:42:51.598696275 -0700
-+++ mozilla-esr31/intl/hyphenation/src/hnjalloc.h	2015-06-04 17:42:51.603672670 -0700
[email protected]@ -24,6 +24,7 @@
-  */
- 
- #include <stdio.h> /* ensure stdio.h is loaded before our macros */
-+#include <wchar.h>
- 
- #undef FILE
- #define FILE hnjFile
--- a/components/desktop/firefox/patches/firefox21-50-nsMathUtils.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-This allows us to get some function from math.h that other platforms are 
-getting from ieeefp.h. 
-Easy to send upstream since it already has ifdef statement. 
-
---- mozilla-esr31/xpcom/ds/nsMathUtils.h.orig	2015-06-04 17:42:51.616409449 -0700
-+++ mozilla-esr31/xpcom/ds/nsMathUtils.h	2015-06-04 17:42:51.621339786 -0700
[email protected]@ -13,6 +13,7 @@
- #include <float.h>
- 
- #ifdef SOLARIS
-+#include <math.h>
- #include <ieeefp.h>
- #endif
- 
--- a/components/desktop/firefox/patches/firefox22-76-skip_mozbuild_test.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-For testing. Runs the test from a different environment than the Mozilla 
-default. Needs further investigation. 
-
---- mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py.orig	2015-06-04 17:42:52.122873933 -0700
-+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py	2015-06-04 17:42:52.133296079 -0700
[email protected]@ -477,5 +477,5 @@
-             self.assertEquals(e.exception.output, ['hello world'])
- 
- 
--if __name__ == '__main__':
--    main()
-+#if __name__ == '__main__':
-+#    main()
---- mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py.orig	2015-06-04 17:42:52.128263022 -0700
-+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py	2015-06-04 17:42:52.133425656 -0700
[email protected]@ -393,5 +393,5 @@
-         self.assertEqual(p.srcdir_path(), "/src/foo/bar")
-         self.assertEqual(p.objdir_path(), "/src/obj/foo/bar")
- 
--if __name__ == '__main__':
--    main()
-+#if __name__ == '__main__':
-+#    main()
--- a/components/desktop/firefox/patches/firefox22-79-gthread-dlopen.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-See Mozilla bug #675585 - crash [@ g_slice_free1] when run firefox-bin
--no-remote -process-updates. Needs further investigation. 
-
---- mozilla-esr31/xpcom/glue/standalone/nsXPCOMGlue.cpp.orig	2015-06-04 17:42:52.147539933 -0700
-+++ mozilla-esr31/xpcom/glue/standalone/nsXPCOMGlue.cpp	2015-06-04 17:42:52.152710273 -0700
[email protected]@ -418,6 +418,8 @@
-         }
-     }
- 
-+    static void* gthreadso = dlopen("libgthread-2.0.so.0", RTLD_GLOBAL | RTLD_LAZY);
-+
-     GetFrozenFunctionsFunc sym =
-         (GetFrozenFunctionsFunc) GetSymbol(sTop->libHandle, LEADING_UNDERSCORE "NS_GetFrozenFunctions");
- 
--- a/components/desktop/firefox/patches/firefox25-07-webaudio_math.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-This allows us to get some function from math.h that other platforms are
-getting elsewhere.
-Can send upstream with ifdef Solaris statement. 
-
---- mozilla-esr31/content/media/webaudio/blink/DenormalDisabler.h.orig	2015-06-04 17:42:51.279492311 -0700
-+++ mozilla-esr31/content/media/webaudio/blink/DenormalDisabler.h	2015-06-04 17:42:51.288558769 -0700
[email protected]@ -27,6 +27,7 @@
- 
- #define _USE_MATH_DEFINES
- #include <cmath>
-+#include <math.h>
- #include <float.h>
- 
- namespace WebCore {
---- mozilla-esr31/content/media/webaudio/ThreeDPoint.h.orig	2015-06-04 17:42:51.286104792 -0700
-+++ mozilla-esr31/content/media/webaudio/ThreeDPoint.h	2015-06-04 17:42:51.288664521 -0700
[email protected]@ -8,6 +8,7 @@
- #define ThreeDPoint_h_
- 
- #include <cmath>
-+#include <math.h>
- #include <algorithm>
- 
- namespace mozilla {
--- a/components/desktop/firefox/patches/firefox26-06-donot-delay-stopping-realplayer.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-See Mozilla bug #451007 - Reload page causing problems with 
-RealPlayer/Helix plugin. 
-We can potentially drop this patch since RealPlayer is no longer being 
-supported. 
-
---- mozilla-esr31/content/base/src/nsObjectLoadingContent.cpp.orig	2015-06-04 17:42:51.184423172 -0700
-+++ mozilla-esr31/content/base/src/nsObjectLoadingContent.cpp	2015-06-04 17:42:51.208745161 -0700
[email protected]@ -2744,7 +2744,8 @@
-               bool aDelayedStop)
- {
-   // Don't delay stopping QuickTime (bug 425157), Flip4Mac (bug 426524),
--  // XStandard (bug 430219), CMISS Zinc (bug 429604).
-+  // XStandard (bug 430219), CMISS Zinc (bug 429604),
-+  // RealPlayer/Helix (bug 451007).
-   if (aDelayedStop
- #if !(defined XP_WIN || defined MOZ_X11)
-       && !aInstanceOwner->MatchPluginName("QuickTime")
[email protected]@ -2752,6 +2753,8 @@
-       && !aInstanceOwner->MatchPluginName("XStandard plugin")
-       && !aInstanceOwner->MatchPluginName("CMISS Zinc Plugin")
- #endif
-+      && !aInstanceOwner->MatchPluginName("RealPlayer")
-+      && !aInstanceOwner->MatchPluginName("Helix")
-       ) {
-     nsCOMPtr<nsIRunnable> evt =
-       new nsStopPluginRunnable(aInstanceOwner, aContent);
--- a/components/desktop/firefox/patches/firefox26-36-package_warning.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-Disables fatal warnings. Inside package-manifest.in, there is a sparc-specific
-line that we can't ifdef out. So we want to make sure this doesn't exit on 
-an error for x86. 
-We will want to redo this patch with an ifdef for x86 vs sparc. 
-
---- mozilla-esr31/browser/installer/Makefile.in.orig	2015-06-04 17:42:51.400825465 -0700
-+++ mozilla-esr31/browser/installer/Makefile.in	2015-06-04 17:42:51.405890984 -0700
[email protected]@ -12,7 +12,7 @@
- MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
- # Some files have been already bundled with xulrunner
- ifndef SYSTEM_LIBXUL
--MOZ_PKG_FATAL_WARNINGS = 1
-+#MOZ_PKG_FATAL_WARNINGS = 1
- endif
- 
- DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
--- a/components/desktop/firefox/patches/firefox26-99-LocalFileUnix.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Another ifdef Solaris patch. Some function is defined in limits.h that other 
-platforms can get elsewhere. 
-Can potentially send upstream with ifdef Solaris statement.
-
---- mozilla-esr31/xpcom/io/nsLocalFileUnix.cpp.orig	2015-06-04 17:42:52.429921172 -0700
-+++ mozilla-esr31/xpcom/io/nsLocalFileUnix.cpp	2015-06-04 17:42:52.432611314 -0700
[email protected]@ -13,6 +13,7 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
-+#include <limits.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <utime.h>
--- a/components/desktop/firefox/patches/firefox27-206-build-config.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-This is used for Sun Studio because the depend files are different. 
-Can potentially remove this patch, but need to investigate to see when 
-link_deps is run. 
-
---- mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py.orig	2015-06-04 17:42:52.548434964 -0700
-+++ mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py	2015-06-04 17:42:52.553642029 -0700
[email protected]@ -129,9 +129,9 @@
-             if deps:
-                 deps = list(self.normpaths(deps))
-                 for t in self.normpaths(rule.targets()):
--                    if t in self._targets:
--                        raise Exception('Found target %s in %s and %s'
--                                        % (t, self._targets[t][0], depfile))
-+#                   if t in self._targets:
-+#                       raise Exception('Found target %s in %s and %s'
-+#                                       % (t, self._targets[t][0], depfile))
-                     self._targets[t] = (depfile, deps)
- 
-     def dump(self, fh, removal_guard=True):
[email protected]@ -216,7 +216,8 @@
-                               group=group,
-                               abspaths=opts.abspaths)
-     for f in opts.dependency_files:
--        linker.add_dependencies(open(f))
-+        if os.path.isfile(f):
-+            linker.add_dependencies(open(f))
- 
-     if opts.output:
-         out = open(opts.output, 'w')
--- a/components/desktop/firefox/patches/firefox27-47-uname.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-The uname() function on Solaris can return a non-negative value. 
-
---- mozilla-esr31/toolkit/components/startup/nsUserInfoUnix.cpp.orig	2015-06-04 17:42:51.565111934 -0700
-+++ mozilla-esr31/toolkit/components/startup/nsUserInfoUnix.cpp	2015-06-04 17:42:51.567398410 -0700
[email protected]@ -106,7 +106,7 @@
-     char *domainname = nullptr;
- 
-     // is this portable?  that is a POSIX compliant call, but I need to check
--    if (uname(&buf)) { 
-+    if (uname(&buf) < 0) { 
-         return rv;
-     }
- 
--- a/components/desktop/firefox/patches/firefox27-67-ion_AsmJS_x86.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-REG_EIP is already defined elsewhere for Linux. 
-
---- mozilla-esr31/js/src/jit/AsmJSSignalHandlers.cpp.orig	2015-06-04 17:42:51.702781399 -0700
-+++ mozilla-esr31/js/src/jit/AsmJSSignalHandlers.cpp	2015-06-04 17:42:51.707794331 -0700
[email protected]@ -58,6 +58,9 @@
- # define R14_sig(p) ((p)->sc_r14)
- # define R15_sig(p) ((p)->sc_r15)
- #elif defined(__linux__) || defined(SOLARIS)
-+# if defined(SOLARIS)
-+#  define REG_EIP EIP
-+# endif
- # if defined(__linux__)
- #  define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i])
- #  define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
--- a/components/desktop/firefox/patches/firefox27-80-mftt_infinity.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-We use a different function from the one in ieeefp.h. 
-This may be a studio specific patch. Need to investigate if this can be 
-removed. 
-
---- mozilla-esr31/mfbt/decimal/Decimal.cpp.orig	2015-06-04 17:42:52.191270749 -0700
-+++ mozilla-esr31/mfbt/decimal/Decimal.cpp	2015-06-04 17:42:52.193703088 -0700
[email protected]@ -33,6 +33,7 @@
- 
- #include <algorithm>
- #include <float.h>
-+#include <ieeefp.h>
- 
- using namespace moz_decimal_utils;
- 
[email protected]@ -686,13 +687,13 @@
- 
- Decimal Decimal::fromDouble(double doubleValue)
- {
--    if (std::isfinite(doubleValue))
-+    if (finite(doubleValue))
-         return fromString(mozToString(doubleValue));
- 
--    if (std::isinf(doubleValue))
--        return infinity(doubleValue < 0 ? Negative : Positive);
-+    if (isnand(doubleValue))
-+        return nan();
- 
--    return nan();
-+    return infinity(doubleValue < 0 ? Negative : Positive);
- }
- 
- Decimal Decimal::fromString(const String& str)
--- a/components/desktop/firefox/patches/firefox28-217-xpt-as-flag.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-We need the xptcstubsdef_asm file for Sun Studio, but not necessary for GCC. 
-One of the files was placed in the wrong location and needs to be moved. This 
-part can probably be sent upstream. 
-
---- mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig	2015-06-04 17:42:52.626316900 -0700
-+++ mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/Makefile.in	2015-06-04 17:42:52.636686080 -0700
[email protected]@ -98,6 +98,7 @@
- 	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
- 	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
- 	$(DIST)/include/xptcstubsdef.inc > [email protected]
-+ASFLAGS += -I.
- ifeq (x86_64,$(OS_TEST))
- ASFLAGS += -xarch=amd64
- endif
---- mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/moz.build.orig	2015-06-04 17:42:52.631590433 -0700
-+++ mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/moz.build	2015-06-04 17:42:52.636848564 -0700
[email protected]@ -74,6 +74,9 @@
-                 'xptcstubs_gcc_x86_unix.cpp'
-             ]
-         else:
-+            GENERATED_FILES = [
-+                'xptcstubsdef_asm.solx86',
-+            ]
-             SOURCES += [
-                 'xptcinvoke_asm_x86_solaris_SUNW.s',
-                 'xptcinvoke_x86_solaris.cpp',
[email protected]@ -273,9 +276,6 @@
-     ]
- 
- if CONFIG['OS_ARCH'] == 'SunOS' and CONFIG['OS_TEST'].find('86') == -1:
--    GENERATED_FILES = [
--        'xptcstubsdef_asm.solx86',
--    ]
-     if CONFIG['HAVE_64BIT_OS']:
-         SOURCES += [
-             'xptcinvoke_sparcv9_solaris.cpp',
--- a/components/desktop/firefox/patches/firefox28-88-libvpx_compile.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-Can probably send upstream. 
-
---- mozilla-esr31/media/libvpx/Makefile.in.orig	2015-06-04 17:42:52.225216512 -0700
-+++ mozilla-esr31/media/libvpx/Makefile.in	2015-06-04 17:42:52.235644957 -0700
[email protected]@ -8,6 +8,10 @@
- AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
- ASM_SUFFIX=$(VPX_ASM_SUFFIX)
- 
-+ifeq ($(OS_TARGET),SunOS)
-+ASFLAGS+=-DSOLARIS=1
-+endif
-+
- ifdef VPX_ARM_ASM
- # Building on an ARM platform with a supported assembler, include
- # the optimized assembly in the build.
[email protected]@ -115,7 +119,7 @@
- # Workaround a bug of Sun Studio (CR 6963410)
- ifdef SOLARIS_SUNPRO_CC
- ifeq (86,$(findstring 86,$(OS_TEST)))
--filter.o: filter.c Makefile.in
-+filter.o: vp8/common/filter.c Makefile.in
- 	$(REPORT_BUILD)
- 	@$(MAKE_DEPS_AUTO_CC)
- 	$(CC) -o [email protected] -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
---- mozilla-esr31/media/libvpx/vpx_ports/x86_abi_support.asm.orig	2015-06-04 17:42:52.233318593 -0700
-+++ mozilla-esr31/media/libvpx/vpx_ports/x86_abi_support.asm	2015-06-04 17:42:52.235792816 -0700
[email protected]@ -225,9 +225,13 @@
-   %ifdef CHROMIUM
-     %ifidn __OUTPUT_FORMAT__,macho32
-       %define HIDDEN_DATA(x) x:private_extern
-+    %elifidn SOLARIS,1
-+      %define HIDDEN_DATA(x) x:data hidden
-     %else
-       %define HIDDEN_DATA(x) x
-     %endif
-+  %elifidn SOLARIS,1
-+    %define HIDDEN_DATA(x) x:data hidden
-   %else
-     %define HIDDEN_DATA(x) x
-   %endif
[email protected]@ -244,9 +248,13 @@
-   %elifidn __OUTPUT_FORMAT__,macho64
-     %ifdef CHROMIUM
-       %define HIDDEN_DATA(x) x:private_extern
-+    %elifidn SOLARIS,1
-+      %define HIDDEN_DATA(x) x:data hidden
-     %else
-       %define HIDDEN_DATA(x) x
-     %endif
-+  %elifidn SOLARIS,1
-+    %define HIDDEN_DATA(x) x:data hidden
-   %else
-     %define HIDDEN_DATA(x) x
-   %endif
--- a/components/desktop/firefox/patches/firefox28-90-cubeb.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,543 +0,0 @@
-For SunAudio audio playback. We need to investigate whether we care about
-this or whether we are just going to support PulseAudio.
-
---- mozilla-esr31/media/libcubeb/src/cubeb.c.orig	2015-06-04 17:42:52.252769663 -0700
-+++ mozilla-esr31/media/libcubeb/src/cubeb.c	2015-06-04 17:42:52.260965308 -0700
[email protected]@ -54,6 +54,9 @@
- #if defined(USE_AUDIOTRACK)
- int audiotrack_init(cubeb ** context, char const * context_name);
- #endif
-+#if defined(USE_SUN)
-+int sunaudio_init(cubeb ** context, char const * context_name);
-+#endif
- 
- int
- validate_stream_params(cubeb_stream_params stream_params)
[email protected]@ -120,6 +123,9 @@
- #if defined(USE_AUDIOTRACK)
-     audiotrack_init,
- #endif
-+#if defined(USE_SUN)
-+    sunaudio_init,
-+#endif
-   };
-   int i;
- 
---- mozilla-esr31/media/libcubeb/src/cubeb_sun.c.orig	1969-12-31 16:00:00.000000000 -0800
-+++ mozilla-esr31/media/libcubeb/src/cubeb_sun.c	2015-06-04 17:42:52.261184916 -0700
[email protected]@ -0,0 +1,500 @@
-+/*
-+ * Copyright (c) 2013 Ginn Chen <[email protected]>
-+ *
-+ * This program is made available under an ISC-style license.  See the
-+ * accompanying file LICENSE for details.
-+ */
-+#include <poll.h>
-+#include <pthread.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <sys/audio.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include <sys/stropts.h>
-+#include "cubeb/cubeb.h"
-+#include "cubeb-internal.h"
-+
-+/* Macros copied from audio_oss.h */
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+/*
-+ * Copyright (C) 4Front Technologies 1996-2008.
-+ *
-+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+#define OSSIOCPARM_MASK 0x1fff          /* parameters must be < 8192 bytes */
-+#define OSSIOC_VOID     0x00000000      /* no parameters */
-+#define OSSIOC_OUT      0x20000000      /* copy out parameters */
-+#define OSSIOC_IN       0x40000000      /* copy in parameters */
-+#define OSSIOC_INOUT    (OSSIOC_IN|OSSIOC_OUT)
-+#define OSSIOC_SZ(t)    ((sizeof (t) & OSSIOCPARM_MASK) << 16)
-+#define __OSSIO(x, y)           ((int)(OSSIOC_VOID|(x<<8)|y))
-+#define __OSSIOR(x, y, t)       ((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y))
-+#define __OSSIOWR(x, y, t)      ((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y))
-+#define SNDCTL_DSP_SPEED        __OSSIOWR('P', 2, int)
-+#define SNDCTL_DSP_CHANNELS     __OSSIOWR('P', 6, int)
-+#define SNDCTL_DSP_SETFMT       __OSSIOWR('P', 5, int)  /* Selects ONE fmt */
-+#define SNDCTL_DSP_GETODELAY    __OSSIOR('P', 23, int)
-+#define SNDCTL_DSP_HALT_OUTPUT  __OSSIO('P', 34)
-+#define AFMT_S16_LE     0x00000010
-+#define AFMT_S16_BE     0x00000020
-+
-+#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
-+#define AFMT_S16_NE    AFMT_S16_BE
-+#else
-+#define AFMT_S16_NE    AFMT_S16_LE
-+#endif
-+
-+#define DEFAULT_AUDIO_DEVICE "/dev/audio"
-+#define DEFAULT_DSP_DEVICE   "/dev/dsp"
-+
-+#define BUF_SIZE_MS 10
-+
-+#if defined(CUBEB_SUNAUDIO_DEBUG)
-+#define DPR(...) fprintf(stderr, __VA_ARGS__);
-+#else
-+#define DPR(...) do {} while(0)
-+#endif
-+
-+static struct cubeb_ops const sunaudio_ops;
-+
-+struct cubeb {
-+  struct cubeb_ops const * ops;
-+};
-+
-+struct cubeb_stream {
-+  cubeb * context;
-+  pthread_t th;			  /* to run real-time audio i/o */
-+  pthread_mutex_t mutex;	  /* protects fd and frm_played */
-+  int fd;			  /* link us to sunaudio */
-+  int active;			  /* cubec_start() called */
-+  int conv;			  /* need float->s16 conversion */
-+  int using_oss;
-+  unsigned char *buf;		  /* data is prepared here */
-+  unsigned int rate;
-+  unsigned int n_channles;
-+  unsigned int bytes_per_ch;
-+  unsigned int n_frm;
-+  unsigned int buffer_size;
-+  int64_t frm_played;
-+  cubeb_data_callback data_cb;    /* cb to preapare data */
-+  cubeb_state_callback state_cb;  /* cb to notify about state changes */
-+  void *arg;			  /* user arg to {data,state}_cb */
-+};
-+
-+static void
-+float_to_s16(void *ptr, long nsamp)
-+{
-+  int16_t *dst = ptr;
-+  float *src = ptr;
-+
-+  while (nsamp-- > 0)
-+    *(dst++) = *(src++) * 32767;
-+}
-+
-+static void *
-+sunaudio_mainloop(void *arg)
-+{
-+  struct cubeb_stream *s = arg;
-+  int state;
-+
-+  DPR("sunaudio_mainloop()\n");
-+
-+  s->state_cb(s, s->arg, CUBEB_STATE_STARTED);
-+
-+  pthread_mutex_lock(&s->mutex);
-+  DPR("sunaudio_mainloop(), started\n");
-+
-+  for (;;) {
-+    if (!s->active) {
-+      DPR("sunaudio_mainloop() stopped\n");
-+      state = CUBEB_STATE_STOPPED;
-+      break;
-+    }
-+
-+    if (!s->using_oss) {
-+      audio_info_t info;
-+      ioctl(s->fd, AUDIO_GETINFO, &info);
-+      if (s->frm_played > info.play.samples + 3 * s->n_frm) {
-+        pthread_mutex_unlock(&s->mutex);
-+        struct timespec ts = {0, 10000}; // 10 ms
-+        nanosleep(&ts, NULL);
-+        pthread_mutex_lock(&s->mutex);
-+        continue;
-+      }
-+    }
-+
-+    pthread_mutex_unlock(&s->mutex);
-+    unsigned int got = s->data_cb(s, s->arg, s->buf, s->n_frm);
-+    DPR("sunaudio_mainloop() ask %d got %d\n", s->n_frm, got);
-+    pthread_mutex_lock(&s->mutex);
-+
-+    if (got < 0) {
-+      DPR("sunaudio_mainloop() cb err\n");
-+      state = CUBEB_STATE_ERROR;
-+      break;
-+    }
-+
-+    if (s->conv) {
-+      float_to_s16(s->buf, got * s->n_channles);
-+    }
-+
-+    unsigned int avail = got * 2 * s->n_channles; // coverted to s16
-+    unsigned int pos = 0;
-+
-+    while (avail > 0 && s->active) {
-+      int written = write(s->fd, s->buf + pos, avail);
-+      if (written == -1) {
-+        if (errno != EINTR && errno != EWOULDBLOCK) {
-+          DPR("sunaudio_mainloop() write err\n");
-+          state = CUBEB_STATE_ERROR;
-+          break;
-+        }
-+        pthread_mutex_unlock(&s->mutex);
-+        struct timespec ts = {0, 10000}; // 10 ms
-+        nanosleep(&ts, NULL);
-+        pthread_mutex_lock(&s->mutex);
-+      } else {
-+        pos += written;
-+        DPR("sunaudio_mainloop() write %d pos %d\n", written, pos);
-+        s->frm_played += written / 2 / s->n_channles;
-+        avail -= written;
-+      }
-+    }
-+
-+    if ((got  < s->n_frm)) {
-+      DPR("sunaudio_mainloop() drained\n");
-+      state = CUBEB_STATE_DRAINED;
-+      break;
-+    }
-+  }
-+
-+  pthread_mutex_unlock(&s->mutex);
-+  s->state_cb(s, s->arg, state);
-+
-+  return NULL;
-+}
-+
-+/*static*/ int
-+sunaudio_init(cubeb **context, char const *context_name)
-+{
-+  DPR("sunaudio_init(%s)\n", context_name);
-+  *context = malloc(sizeof(*context));
-+  (*context)->ops = &sunaudio_ops;
-+  (void)context_name;
-+  return CUBEB_OK;
-+}
-+
-+static char const *
-+sunaudio_get_backend_id(cubeb *context)
-+{
-+  return "sunaudio";
-+}
-+
-+static void
-+sunaudio_destroy(cubeb *context)
-+{
-+  DPR("sunaudio_destroy()\n");
-+  free(context);
-+}
-+
-+static int
-+sunaudio_stream_init(cubeb *context,
-+                  cubeb_stream **stream,
-+                  char const *stream_name,
-+                  cubeb_stream_params stream_params, unsigned int latency,
-+                  cubeb_data_callback data_callback,
-+                  cubeb_state_callback state_callback,
-+                  void *user_ptr)
-+{
-+  struct cubeb_stream *s;
-+  DPR("sunaudio_stream_init(%s)\n", stream_name);
-+  size_t size;
-+
-+  s = malloc(sizeof(struct cubeb_stream));
-+  if (s == NULL)
-+    return CUBEB_ERROR;
-+  s->context = context;
-+
-+  // If UTAUDIODEV is set, use it with Sun Audio interface
-+  char * sa_device_name = getenv("UTAUDIODEV");
-+  char * dsp_device_name = NULL;
-+  if (!sa_device_name) {
-+    dsp_device_name = getenv("AUDIODSP");
-+    if (!dsp_device_name) {
-+      dsp_device_name = DEFAULT_DSP_DEVICE;
-+    }
-+    sa_device_name = getenv("AUDIODEV");
-+    if (!sa_device_name) {
-+      sa_device_name = DEFAULT_AUDIO_DEVICE;
-+    }
-+  }
-+
-+  s->using_oss = 0;
-+  // Try to use OSS if available
-+  if (dsp_device_name) {
-+    s->fd = open(dsp_device_name, O_WRONLY | O_NONBLOCK);
-+    if (s->fd >= 0) {
-+      s->using_oss = 1;
-+    }
-+  }
-+
-+  // Try Sun Audio
-+  if (!s->using_oss) {
-+    s->fd = open(sa_device_name, O_WRONLY | O_NONBLOCK);
-+  }
-+
-+  if (s->fd < 0) {
-+    free(s);
-+    DPR("sunaudio_stream_init(), open() failed\n");
-+    return CUBEB_ERROR;
-+  }
-+
-+  if (s->using_oss) {
-+    if (ioctl(s->fd, SNDCTL_DSP_SPEED, &stream_params.rate) < 0) {
-+      DPR("ioctl SNDCTL_DSP_SPEED failed.\n");
-+      close(s->fd);
-+      free(s);
-+      return CUBEB_ERROR_INVALID_FORMAT;
-+    }
-+
-+    if (ioctl(s->fd, SNDCTL_DSP_CHANNELS, &stream_params.channels) < 0) {
-+      DPR("ioctl SNDCTL_DSP_CHANNELS failed.\n");
-+      close(s->fd);
-+      free(s);
-+      return CUBEB_ERROR_INVALID_FORMAT;
-+    }
-+
-+    int format = AFMT_S16_NE;
-+    if (ioctl(s->fd, SNDCTL_DSP_SETFMT, &format) < 0) {
-+      DPR("ioctl SNDCTL_DSP_SETFMT failed.\n");
-+      close(s->fd);
-+      free(s);
-+      return CUBEB_ERROR_INVALID_FORMAT;
-+    }
-+  } else {
-+    audio_info_t audio_info;
-+    AUDIO_INITINFO(&audio_info)
-+    audio_info.play.sample_rate = stream_params.rate;
-+    audio_info.play.channels = stream_params.channels;
-+    audio_info.play.encoding = AUDIO_ENCODING_LINEAR;
-+    audio_info.play.precision = 16;
-+    if (ioctl(s->fd, AUDIO_SETINFO, &audio_info) == -1) {
-+      DPR("ioctl AUDIO_SETINFO failed.\n");
-+      close(s->fd);
-+      free(s);
-+      return CUBEB_ERROR_INVALID_FORMAT;
-+    }
-+  }
-+
-+  s->conv = 0;
-+  switch (stream_params.format) {
-+    case CUBEB_SAMPLE_S16NE:
-+      s->bytes_per_ch = 2;
-+      break;
-+    case CUBEB_SAMPLE_FLOAT32NE:
-+      s->bytes_per_ch = 4;
-+      s->conv = 1;
-+      break;
-+    default:
-+      DPR("sunaudio_stream_init() unsupported format\n");
-+      close(s->fd);
-+      free(s);
-+      return CUBEB_ERROR_INVALID_FORMAT;
-+  }
-+
-+  s->active = 0;
-+  s->rate = stream_params.rate;
-+  s->n_channles = stream_params.channels;
-+  s->data_cb = data_callback;
-+  s->state_cb = state_callback;
-+  s->arg = user_ptr;
-+  if (pthread_mutex_init(&s->mutex, NULL) != 0) {
-+    free(s);
-+    return CUBEB_ERROR;
-+  }
-+  s->frm_played = 0;
-+  s->n_frm = s->rate * BUF_SIZE_MS / 1000;
-+  s->buffer_size = s->bytes_per_ch * s->n_channles * s->n_frm;
-+  s->buf = malloc(s->buffer_size);
-+  if (s->buf == NULL) {
-+    close(s->fd);
-+    free(s);
-+    return CUBEB_ERROR;
-+  }
-+
-+  *stream = s;
-+  DPR("sunaudio_stream_init() end, ok\n");
-+  return CUBEB_OK;
-+}
-+
-+static void
-+sunaudio_stream_destroy(cubeb_stream *s)
-+{
-+  DPR("sunaudio_stream_destroy()\n");
-+  if (s->fd > 0) {
-+    // Flush buffer
-+    if (s->using_oss) {
-+      ioctl(s->fd, SNDCTL_DSP_HALT_OUTPUT);
-+    } else {
-+      ioctl(s->fd, I_FLUSH);
-+    }
-+    close(s->fd);
-+  }
-+  free(s->buf);
-+  free(s);
-+}
-+
-+static int
-+sunaudio_stream_start(cubeb_stream *s)
-+{
-+  int err;
-+
-+  DPR("sunaudio_stream_start()\n");
-+  s->active = 1;
-+  err = pthread_create(&s->th, NULL, sunaudio_mainloop, s);
-+  if (err) {
-+    s->active = 0;
-+    return CUBEB_ERROR;
-+  }
-+  return CUBEB_OK;
-+}
-+
-+static int
-+sunaudio_stream_stop(cubeb_stream *s)
-+{
-+  void *dummy;
-+
-+  DPR("sunaudio_stream_stop()\n");
-+  if (s->active) {
-+    s->active = 0;
-+    pthread_join(s->th, &dummy);
-+  }
-+  return CUBEB_OK;
-+}
-+
-+static int
-+sunaudio_stream_get_position(cubeb_stream *s, uint64_t *p)
-+{
-+  int rv = CUBEB_OK;
-+  pthread_mutex_lock(&s->mutex);
-+  if (s->active && s->fd > 0) {
-+    if (s->using_oss) {
-+      int delay;
-+      ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay);
-+      int64_t t = s->frm_played - delay / s->n_channles / 2;
-+      if (t < 0) {
-+        *p = 0;
-+      } else {
-+        *p = t;
-+      }
-+    } else {
-+      audio_info_t info;
-+      ioctl(s->fd, AUDIO_GETINFO, &info);
-+      *p = info.play.samples;
-+    }
-+    DPR("sunaudio_stream_get_position() %lld\n", *p);
-+  } else {
-+    rv = CUBEB_ERROR;
-+  }
-+  pthread_mutex_unlock(&s->mutex);
-+  return rv;
-+}
-+
-+static int
-+sunaudio_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
-+{
-+  if (!ctx || !max_channels)
-+    return CUBEB_ERROR;
-+
-+  *max_channels = 2;
-+
-+  return CUBEB_OK;
-+}
-+
-+static int
-+sunaudio_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate)
-+{
-+  if (!ctx || !rate)
-+    return CUBEB_ERROR;
-+
-+  // XXX Not yet implemented.
-+  *rate = 44100;
-+
-+  return CUBEB_OK;
-+}
-+
-+static int
-+sunaudio_get_min_latency(cubeb * ctx, cubeb_stream_params params, uint32_t * latency_ms)
-+{
-+  if (!ctx || !latency_ms)
-+    return CUBEB_ERROR;
-+
-+  // XXX Not yet implemented.
-+  *latency_ms = 20;
-+
-+  return CUBEB_OK;
-+}
-+
-+static int
-+sunaudio_stream_get_latency(cubeb_stream * s, uint32_t * latency)
-+{
-+  if (!s || !latency)
-+    return CUBEB_ERROR;
-+
-+  int rv = CUBEB_OK;
-+  pthread_mutex_lock(&s->mutex);
-+  if (s->active && s->fd > 0) {
-+    if (s->using_oss) {
-+      int delay;
-+      ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay);
-+      *latency = delay / s->n_channles / 2 / s->rate;
-+    } else {
-+      audio_info_t info;
-+      ioctl(s->fd, AUDIO_GETINFO, &info);
-+      *latency = (s->frm_played - info.play.samples) / s->rate;
-+    }
-+    DPR("sunaudio_stream_get_position() %lld\n", *p);
-+  } else {
-+    rv = CUBEB_ERROR;
-+  }
-+  pthread_mutex_unlock(&s->mutex);
-+  return rv;
-+}
-+
-+static struct cubeb_ops const sunaudio_ops = {
-+  .init = sunaudio_init,
-+  .get_backend_id = sunaudio_get_backend_id,
-+  .destroy = sunaudio_destroy,
-+  .get_preferred_sample_rate = sunaudio_get_preferred_sample_rate,
-+  .stream_init = sunaudio_stream_init,
-+  .stream_destroy = sunaudio_stream_destroy,
-+  .stream_start = sunaudio_stream_start,
-+  .stream_stop = sunaudio_stream_stop,
-+  .stream_get_position = sunaudio_stream_get_position,
-+  .get_max_channel_count = sunaudio_get_max_channel_count,
-+  .get_min_latency = sunaudio_get_min_latency,
-+  .stream_get_latency = sunaudio_stream_get_latency
-+};
---- mozilla-esr31/media/libcubeb/src/moz.build.orig	2015-06-04 17:42:52.255965962 -0700
-+++ mozilla-esr31/media/libcubeb/src/moz.build	2015-06-04 17:42:52.261292681 -0700
[email protected]@ -30,6 +30,12 @@
-     ]
-     DEFINES['USE_SNDIO'] = True
- 
-+if CONFIG['OS_ARCH'] == 'SunOS':
-+    SOURCES += [
-+        'cubeb_sun.c',
-+    ]
-+    DEFINES['USE_SUN'] = True
-+
- if CONFIG['OS_TARGET'] == 'Darwin':
-     SOURCES += [
-         'cubeb_audiounit.c',
--- a/components/desktop/firefox/patches/firefox28-96-MediaDecoder.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Casts the value to an int since abs() only takes an integer argument. 
-May want to change this so that we use labs() instead of abs(). 
-
---- mozilla-esr31/content/media/MediaDecoderStateMachine.cpp.orig	2015-06-04 17:42:52.361303668 -0700
-+++ mozilla-esr31/content/media/MediaDecoderStateMachine.cpp	2015-06-04 17:42:52.366561967 -0700
[email protected]@ -1227,7 +1227,7 @@
-   AssertCurrentThreadInMonitor();
-   int64_t duration = GetDuration();
-   if (aDuration != duration &&
--      abs(aDuration - duration) > ESTIMATED_DURATION_FUZZ_FACTOR_USECS) {
-+      abs((int)(aDuration - duration)) > ESTIMATED_DURATION_FUZZ_FACTOR_USECS) {
-     SetDuration(aDuration);
-     nsCOMPtr<nsIRunnable> event =
-       NS_NewRunnableMethod(mDecoder, &MediaDecoder::DurationChanged);
--- a/components/desktop/firefox/patches/firefox29-214-gfx.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-May be compiler specific. Can potentially send upstream with an ifdef Solaris 
-statement. 
-Investigate whether the emmintrin.h part is necessary. 
-
---- mozilla-esr31/gfx/2d/FilterProcessingSIMD-inl.h.orig	2015-06-04 17:42:52.586368339 -0700
-+++ mozilla-esr31/gfx/2d/FilterProcessingSIMD-inl.h	2015-06-04 17:42:52.594507633 -0700
[email protected]@ -490,7 +490,7 @@
-   // int16_t rows_ra[8] == { rB, rG, rR, rA, aB, aG, aR, aA }.
-   // int32_t bias[4] == { _B, _G, _R, _A }.
- 
--  i32x4_t sum = bias;
-+  i32x4_t sum = (i32x4_t)bias;
- 
-   // int16_t bg[8] = { b, g, b, g, b, g, b, g };
-   i16x8_t bg = simd::ShuffleHi16<1,0,1,0>(simd::ShuffleLo16<1,0,1,0>(p));
---- mozilla-esr31/gfx/2d/SIMD.h.orig	2015-06-04 17:42:52.591921342 -0700
-+++ mozilla-esr31/gfx/2d/SIMD.h	2015-06-04 17:42:52.594674555 -0700
[email protected]@ -10,8 +10,8 @@
-  * Consumers of this file need to #define SIMD_COMPILE_SSE2 before including it
-  * if they want access to the SSE2 functions.
-  */
--
- #ifdef SIMD_COMPILE_SSE2
-+#include <emmintrin.h>
- #include <xmmintrin.h>
- #endif
- 
--- a/components/desktop/firefox/patches/firefox29-313-mozconfig_loader_bash.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-This patch is needed because the default shell on Solaris 10 has issues.
-The default shell on S11 and S12 is ksh93, which would probably work. If
-so, then this patch can be removed. This needs to be investigated further.
-
---- mozilla-esr31/python/mozbuild/mozbuild/mozconfig_loader.orig	2015-06-04 17:42:52.695582248 -0700
-+++ mozilla-esr31/python/mozbuild/mozbuild/mozconfig_loader	2015-06-04 17:42:52.698042560 -0700
[email protected]@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- # This Source Code Form is subject to the terms of the Mozilla Public
- # License, v. 2.0. If a copy of the MPL was not distributed with this
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--- a/components/desktop/firefox/patches/firefox29-45-snappy.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-Solaris studio doesn't use __i386__ and __x86_64__ defined, instead uses 
-alternate definitions. 
-If we use GCC, we may not need this part of the patch. 
-The second part of the patch defined Endians. 
-Needs to go upstream. 
-
---- mozilla-esr31/other-licenses/snappy/src/snappy-stubs-internal.h.orig	2015-06-04 17:42:51.512176985 -0700
-+++ mozilla-esr31/other-licenses/snappy/src/snappy-stubs-internal.h	2015-06-04 17:42:51.521372882 -0700
[email protected]@ -178,7 +178,7 @@
- 
- // Potentially unaligned loads and stores.
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__i386) || defined(__x86_64)
- 
- #define UNALIGNED_LOAD16(_p) (*reinterpret_cast<const uint16 *>(_p))
- #define UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_p))
---- mozilla-esr31//configure.orig	2015-06-04 17:42:51.515409215 -0700
-+++ mozilla-esr31//configure	2015-06-04 17:42:51.524041156 -0700
[email protected]@ -9660,6 +9660,18 @@
- #define SOLARIS 1
- EOF
- 
-+    if test "$CPU_ARCH" = "sparc"; then
-+ cat >> confdefs.pytmp <<\EOF
-+  (''' WORDS_BIGENDIAN ''', ' 1 ')
-+  (''' IS_BIG_ENDIAN ''', ' 1 ')
-+EOF
-+cat >> confdefs.h <<\EOF
-+#define WORDS_BIGENDIAN 1
-+#define IS_BIG_ENDIAN 1
-+EOF
-+
-+    fi
-+
-     TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
-     MOZ_FIX_LINK_PATHS=
-     # $ORIGIN/.. is for shared libraries under components/ to locate shared
--- a/components/desktop/firefox/patches/firefox30-05-skia_gpu.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-Returns an error if big endian. We probably don't need to worry about this 
-since we don't use Skia gpu. 
-Seems sparc specific. To be investigated. 
-
---- mozilla-esr31/gfx/skia/trunk/include/gpu/GrTypes.h.orig	2015-06-04 17:42:51.134028157 -0700
-+++ mozilla-esr31/gfx/skia/trunk/include/gpu/GrTypes.h	2015-06-04 17:42:51.145109963 -0700
[email protected]@ -285,9 +285,9 @@
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--    #error "Skia gpu currently assumes little endian"
--#endif
-+// #ifndef SK_CPU_LENDIAN
-+//    #error "Skia gpu currently assumes little endian"
-+// #endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
-     static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
--- a/components/desktop/firefox/patches/firefox30-205-test.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-For testing. Commented out some tests that are known not to work on Solaris. 
-Can probably be removed. 
-
-The if(workerThreadCount)... part is already fixed upstream. 
-
---- mozilla-esr31/docshell/test/unit/test_bug414201_jfif.js.orig	2015-06-04 17:42:52.485074716 -0700
-+++ mozilla-esr31/docshell/test/unit/test_bug414201_jfif.js	2015-06-04 17:42:52.509205432 -0700
[email protected]@ -20,8 +20,9 @@
-     /* Check whether the primary extension is what we'd expect */
-     for (var mimetype in types) {
-         var exts = types[mimetype];
--        var primary = ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase();
-+// Known issue on Solaris
-+//        var primary = ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase();
- 
--        do_check_true (exts.indexOf(primary) != -1);
-+//        do_check_true (exts.indexOf(primary) != -1);
-     }
- }
---- mozilla-esr31/dom/tests/unit/test_geolocation_provider.js.orig	2015-06-04 17:42:52.490462853 -0700
-+++ mozilla-esr31/dom/tests/unit/test_geolocation_provider.js	2015-06-04 17:42:52.509339704 -0700
[email protected]@ -70,6 +70,7 @@
-     // needs a place where it can store databases.
-     do_get_profile();
- 
-+/* Network issue
-     // only kill this test when shutdown is called on the provider.
-     do_test_pending();
- 
[email protected]@ -89,4 +90,5 @@
- 
-     geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
-     watchID = geolocation.watchPosition(successCallback, errorCallback);
-+*/
- }
---- mozilla-esr31/gfx/tests/gtest/TestLayers.cpp.orig	2015-06-04 17:42:52.495808015 -0700
-+++ mozilla-esr31/gfx/tests/gtest/TestLayers.cpp	2015-06-04 17:42:52.509475929 -0700
[email protected]@ -85,7 +85,7 @@
- 
- TEST(Layers, Defaults) {
-   TestContainerLayer layer(nullptr);
--  ASSERT_EQ(1.0, layer.GetOpacity());
-+  ASSERT_EQ(1.0f, layer.GetOpacity());
-   ASSERT_EQ(1.0f, layer.GetPostXScale());
-   ASSERT_EQ(1.0f, layer.GetPostYScale());
- 
---- mozilla-esr31/js/src/jit-test/tests/basic/offThreadCompileScript-02.js.orig	2015-06-04 17:42:52.501230839 -0700
-+++ mozilla-esr31/js/src/jit-test/tests/basic/offThreadCompileScript-02.js	2015-06-04 17:42:52.509576725 -0700
[email protected]@ -1,5 +1,8 @@
- // Test offThreadCompileScript option handling.
- 
-+if (workerThreadCount() === 0)
-+  quit(0);
-+
- offThreadCompileScript('Error()');
- assertEq(!!runOffThreadScript().stack.match(/^@<string>:1:1\n/), true);
- 
--- a/components/desktop/firefox/patches/firefox30-29-rules_mk.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-Needs further investigation to see if this can be removed. 
-The ninstall... function is not callable for some reason, so we need to copy 
-the definition when using install_cmd. 
-
---- mozilla-esr31/config/rules.mk.orig	2015-06-04 17:42:51.342231683 -0700
-+++ mozilla-esr31/config/rules.mk	2015-06-04 17:42:51.344729049 -0700
[email protected]@ -1429,7 +1429,7 @@
- nsinstall_is_usable = $(if $(wildcard $(DIST)/bin/nsinstall$(HOST_BIN_SUFFIX)),yes)
- 
- define install_cmd_override
--$(1): install_cmd = $$(if $$(nsinstall_is_usable),$$(INSTALL),$$(NSINSTALL_PY) -t) $$(1)
-+$(1): install_cmd = $$(if $(wildcard $(DIST)/bin/nsinstall$(HOST_BIN_SUFFIX)),$$(INSTALL),$$(NSINSTALL_PY) -t) $$(1)
- endef
- endif
- endif
--- a/components/desktop/firefox/patches/firefox30-61-skia-endian.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-Already exists upstream. 
-
---- mozilla-esr31/gfx/skia/trunk/include/core/SkPreConfig.h.orig	2015-06-04 17:42:51.687614279 -0700
-+++ mozilla-esr31/gfx/skia/trunk/include/core/SkPreConfig.h	2015-06-04 17:42:51.689910035 -0700
[email protected]@ -93,7 +93,7 @@
- 
- #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
-     #if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) \
--        || defined(__PPC64__)
-+        || defined(__PPC64__) || defined(__sparc) || defined(__sparc__)
-         #define SK_CPU_BENDIAN
-     #else
-         #define SK_CPU_LENDIAN
--- a/components/desktop/firefox/patches/firefox31-01-locale.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Matches the OS locale. We need to determine if this patch should be sent
-upstream. 
-
---- mozilla-esr31/modules/libpref/src/init/all.js.orig	2015-02-18 16:39:16.189950136 +0530
-+++ mozilla-esr31/modules/libpref/src/init/all.js	2015-02-18 16:40:56.002524458 +0530
[email protected]@ -1461,7 +1461,7 @@ pref("intl.charset.detector",
- pref("intl.charset.fallback.override",      "");
- pref("intl.charset.fallback.tld",           true);
- pref("intl.ellipsis",                       "chrome://global-platform/locale/intl.properties");
--pref("intl.locale.matchOS",                 false);
-+pref("intl.locale.matchOS",                 true);
- // fallback charset list for Unicode conversion (converting from Unicode)
- // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes)
- // for ISO-8859-1
--- a/components/desktop/firefox/patches/firefox31-03-g11n-nav-lang.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-This fixes Mozilla bug#285267 - navigator.language js property doesn't reflect 
-browser default language. It appears that this patch was previously 
-proposed upstream but not accepted. (https://bugzilla.mozilla.org/show_bug.cgi?id=285267) 
-
-diff --git a/browser/locales/en-US/firefox-l10n.js b/browser/locales/en-US/firefox-l10n.js
-index e9027aa..10bdcdb 100644
---- a/browser/locales/en-US/firefox-l10n.js
-+++ b/browser/locales/en-US/firefox-l10n.js
[email protected]@ -36,4 +36,4 @@
- 
- #filter substitution
- 
--pref("general.useragent.locale", "@[email protected]");
-+pref("general.useragent.locale", "chrome://global/locale/intl.properties");
--- a/components/desktop/firefox/patches/firefox31-13-jit-test-multi-processes.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-For testing. This reduces memory needed for JIT test. The -f flag will print 
-the full patch of failures (want to keep this). 
-
---- mozilla-esr31/js/src/Makefile.in.orig	2015-06-04 17:42:51.305891808 -0700
-+++ mozilla-esr31/js/src/Makefile.in	2015-06-04 17:42:51.308235809 -0700
[email protected]@ -152,7 +152,7 @@
- 
- check-jit-test::
- 	$(JITTEST_ASAN_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
--	        --no-slow --no-progress --tinderbox --tbpl $(JITTEST_VALGRIND_FLAG) \
-+	        --no-slow --no-progress --tinderbox --tbpl -j 2 -f $(JITTEST_VALGRIND_FLAG) \
- 	        $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
- 
- check:: check-style
--- a/components/desktop/firefox/patches/firefox31-199-stacksize.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-For sparc. Our function frame is very big, so on sparc we need more stack size.
-Potentially send upstream. 
-
---- mozilla-esr31/js/src/jsapi.cpp.orig	2015-06-04 17:42:52.465842609 -0700
-+++ mozilla-esr31/js/src/jsapi.cpp	2015-06-04 17:42:52.468887397 -0700
[email protected]@ -2120,6 +2120,9 @@
- static void
- SetNativeStackQuota(JSRuntime* rt, StackKind kind, size_t stackSize)
- {
-+#ifdef JS_CPU_SPARC
-+    stackSize = stackSize * 8 < 7 * 1024 * 1024 ? stackSize * 8 : 7 * 1024 * 1024;
-+#endif
-     rt->nativeStackQuota[kind] = stackSize;
-     if (rt->nativeStackBase)
-         RecomputeStackLimit(rt, kind);
--- a/components/desktop/firefox/patches/firefox31-30-configure.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-Shell translations. Should probably be removed. 
-
---- mozilla-esr31/js/src/configure.orig	2015-06-04 17:42:51.357938258 -0700
-+++ mozilla-esr31/js/src/configure	2015-06-04 17:42:51.371806503 -0700
[email protected]@ -1291,7 +1291,7 @@
-   fi
- 
-     fi
--    IS_GCC=$($CC -v 2>&1 | grep gcc)
-+    IS_GCC=`$CC -v 2>&1 | grep gcc`
-     if test -n "$IS_GCC"
-     then
-       echo gcc is known to be broken on OS X, please use clang.
[email protected]@ -4342,7 +4342,7 @@
- for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
-   possible=$base/python/mozbuild/mozbuild/virtualenv.py
- 
--  if test -e $possible; then
-+  if test -f $possible; then
-     _virtualenv_topsrcdir=$base
-     _virtualenv_populate_path=$possible
-     break
[email protected]@ -8861,12 +8861,12 @@
- 
- if test "$GNU_CC" -a -n "$MOZ_FORCE_GOLD"; then
-             if $CC -Wl,--version 2>&1 | grep -q "GNU ld"; then
--        GOLD=$($CC -print-prog-name=ld.gold)
-+        GOLD=`$CC -print-prog-name=ld.gold`
-         case "$GOLD" in
-         /*)
-             ;;
-         *)
--            GOLD=$(which $GOLD)
-+            GOLD=`which $GOLD`
-             ;;
-         esac
-         if test -n "$GOLD"; then
[email protected]@ -15668,7 +15668,8 @@
-     	  _CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- case "$host" in
- *-mingw*)
--    _CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
-+    tmp_DIRNAME=`dirname "$_CONFIG_SHELL"`
-+    _CONFIG_SHELL=`(cd $tmp_DIRNAME; pwd -W)`/`(basename $_CONFIG_SHELL)`
-     if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
-         _CONFIG_SHELL="${_CONFIG_SHELL}.exe"
-     fi
[email protected]@ -15793,7 +15794,8 @@
-           _CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- case "$host" in
- *-mingw*)
--    _CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
-+     tmp_DIRNAME=`dirname "$_CONFIG_SHELL"`
-+    _CONFIG_SHELL=`(cd $tmp_DIRNAME; pwd -W)`/`(basename $_CONFIG_SHELL)`
-     if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
-         _CONFIG_SHELL="${_CONFIG_SHELL}.exe"
-     fi
[email protected]@ -16044,7 +16046,8 @@
-    _CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- case "$host" in
- *-mingw*)
--    _CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
-+     tmp_DIRNAME=`dirname "$_CONFIG_SHELL"`
-+    _CONFIG_SHELL=`(cd $tmp_DIRNAME; pwd -W)`/`(basename $_CONFIG_SHELL)`
-     if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
-         _CONFIG_SHELL="${_CONFIG_SHELL}.exe"
-     fi
[email protected]@ -16613,9 +16616,12 @@
-   
- chmod +x $CONFIG_STATUS
- rm -fr confdefs* $ac_clean_files
--if test "$no_create" != yes && ! ${PYTHON} $CONFIG_STATUS; then
-+if test "$no_create" != yes; then
-+  ${PYTHON} $CONFIG_STATUS
-+  if test "$?" != 0; then
-     trap '' EXIT
-     exit 1
-+  fi
- fi
- 
- fi
--- a/components/desktop/firefox/patches/firefox31-317-sparc-xptcall.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-See Mozilla bug #1153707 - [JavaScript Error: "invalid 'in' operand 
-aLivemarkInfo"] when calling method: [mozIAsyncLivemarks::getLivemark].
-This is already upstream in version 38. 
-
---- mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp.orig	2015-06-04 17:42:52.730766562 -0700
-+++ mozilla-esr31/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp	2015-06-04 17:42:52.738654394 -0700
[email protected]@ -52,13 +52,17 @@
- 
-         if(param.IsOut() || !type.IsArithmetic())
-         {
--            dp->val.p = (void*) *ap;
-+            if (type == nsXPTType::T_JSVAL)
-+                dp->val.p = *((void**)*ap);
-+            else
-+                dp->val.p = (void*) *ap;
-+
-             continue;
-         }
-         // else
-         switch(type)
-         {
--        case nsXPTType::T_I8     : dp->val.i8  = *((int32_t*)  ap);       break;
-+        case nsXPTType::T_I8     : dp->val.i8  = *((int32_t*) ap);       break;
-         case nsXPTType::T_I16    : dp->val.i16 = *((int32_t*) ap);       break;
-         case nsXPTType::T_I32    : dp->val.i32 = *((int32_t*) ap);       break;
-         case nsXPTType::T_DOUBLE :
---- mozilla-esr31/js/xpconnect/src/XPCWrappedJSClass.cpp.orig	2015-06-04 17:42:52.736217989 -0700
-+++ mozilla-esr31/js/xpconnect/src/XPCWrappedJSClass.cpp	2015-06-04 17:42:52.739152339 -0700
[email protected]@ -1357,21 +1357,9 @@
-                 break;
-         }
- 
--// see bug #961488
--#if (defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(_AIX)) && \
--    ((defined(__sparc) && !defined(__sparcv9) && !defined(__sparcv9__)) || \
--    (defined(__powerpc__) && !defined (__powerpc64__)))
--        if (type_tag == nsXPTType::T_JSVAL) {
--            if (!XPCConvert::JSData2Native(*(void**)(&pv->val), val, type,
--                                           !param.IsDipper(), &param_iid, nullptr))
--                break;
--        } else
--#endif
--        {
--            if (!XPCConvert::JSData2Native(&pv->val, val, type,
--                                           !param.IsDipper(), &param_iid, nullptr))
--                break;
--        }
-+        if (!XPCConvert::JSData2Native(&pv->val, val, type,
-+                                       !param.IsDipper(), &param_iid, nullptr))
-+            break;
-     }
- 
-     // if any params were dependent, then we must iterate again to convert them.
--- a/components/desktop/firefox/patches/firefox31-401-other-buildissue.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-Various ifdef Solaris fixes. 
-Recast for getpid() because it requires an int. 
-Changing default flags for compiling on SSE. We can try removing these or add
-them to the config lines in Makefile. 
-
---- mozilla-esr31/build/gyp.mozbuild.orig	2015-06-04 17:42:52.755839292 -0700
-+++ mozilla-esr31/build/gyp.mozbuild	2015-06-04 17:42:52.861350941 -0700
[email protected]@ -38,6 +38,7 @@
-     'moz_widget_toolkit_gonk': 0,
-     'moz_webrtc_omx': 0,
- 
-+    'use_official_google_api_keys': 0,
-     # (for vp8) chromium sets to 0 also
-     'use_temporal_layers': 0,
-     # Creates AEC internal sample dump files in current directory
---- mozilla-esr31/memory/mozalloc/VolatileBufferFallback.cpp.orig	2015-06-04 17:42:52.788896719 -0700
-+++ mozilla-esr31/memory/mozalloc/VolatileBufferFallback.cpp	2015-06-04 17:42:52.862173467 -0700
[email protected]@ -8,7 +8,7 @@
- #include "mozilla/mozalloc.h"
- 
- #ifdef MOZ_MEMORY
--int posix_memalign(void** memptr, size_t alignment, size_t size);
-+extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size);
- #endif
- 
- namespace mozilla {
---- mozilla-esr31/media/libsoundtouch/src/FIRFilter.cpp.orig	2015-06-04 17:42:52.816481996 -0700
-+++ mozilla-esr31/media/libsoundtouch/src/FIRFilter.cpp	2015-06-04 17:42:52.863552954 -0700
[email protected]@ -46,6 +46,10 @@
- #include "FIRFilter.h"
- #include "cpu_detect.h"
- 
-+#ifdef __sun
-+#include <alloca.h>
-+#endif
-+
- #ifdef _MSC_VER
- #include <malloc.h>
- #define alloca _alloca
---- mozilla-esr31/media/libsoundtouch/src/SoundTouch.cpp.orig	2015-06-04 17:42:52.821942936 -0700
-+++ mozilla-esr31/media/libsoundtouch/src/SoundTouch.cpp	2015-06-04 17:42:52.863676152 -0700
[email protected]@ -80,6 +80,10 @@
- #include "RateTransposer.h"
- #include "cpu_detect.h"
- 
-+#ifdef __sun
-+#include <alloca.h>
-+#endif
-+
- #ifdef _MSC_VER
- #include <malloc.h>
- #define alloca _alloca
---- mozilla-esr31/media/webrtc/trunk/build/common.gypi.orig	2015-06-04 17:42:52.827866736 -0700
-+++ mozilla-esr31/media/webrtc/trunk/build/common.gypi	2015-06-04 17:42:52.864152685 -0700
[email protected]@ -917,11 +917,16 @@
-     'android_app_version_name%': 'Developer Build',
-     'android_app_version_code%': 0,
- 
--    'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
--    'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
-+    'conditions': [
-+      ['OS=="win"', {
-+        'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
-+        'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
-+      }],
-+    ],
- 
-     'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
-     'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
-+    'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
- 
-     'conditions': [
-       ['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
---- mozilla-esr31/xpcom/base/nsStatusReporterManager.cpp.orig	2015-06-04 17:42:52.846266617 -0700
-+++ mozilla-esr31/xpcom/base/nsStatusReporterManager.cpp	2015-06-04 17:42:52.864489417 -0700
[email protected]@ -142,7 +142,7 @@
-   nsresult rv;
- 
-   nsCString filename("status-reports-");
--  filename.AppendInt(getpid());
-+  filename.AppendInt((int)getpid());
-   filename.AppendLiteral("-");
-   filename.AppendInt(number++);
-   filename.AppendLiteral(".json");
---- mozilla-esr31//configure.orig	2015-06-04 17:42:52.849519256 -0700
-+++ mozilla-esr31//configure	2015-06-04 17:42:52.867572588 -0700
[email protected]@ -9678,8 +9678,8 @@
-        CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
-        LDFLAGS="-xildoff $LDFLAGS"
-        MMX_FLAGS="-xarch=mmx -xO4"
--       SSE_FLAGS="-xarch=sse"
--       SSE2_FLAGS="-xarch=ssei2 -xO4"
-+       SSE_FLAGS="-xarch=sse -xO4"
-+       SSE2_FLAGS="-xarch=sse2 -xO4"
-        if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
-            _SAVE_LDFLAGS=$LDFLAGS
-            LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
--- a/components/desktop/firefox/patches/firefox31-405-cpu.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-Can try removing this one since we are now using GNU compilers.
- 
---- mozilla-esr31/js/src/assembler/assembler/MacroAssemblerX86Common.cpp.orig	2015-06-04 17:42:52.915487926 -0700
-+++ mozilla-esr31/js/src/assembler/assembler/MacroAssemblerX86Common.cpp	2015-06-04 17:42:52.917782337 -0700
[email protected]@ -31,8 +31,8 @@
- {
-     // Default the flags value to zero; if the compiler is
-     // not MSVC or GCC we will read this as SSE2 not present.
--    int flags_edx = 0;
--    int flags_ecx = 0;
-+    volatile int flags_edx = 0;
-+    volatile int flags_ecx = 0;
- #if WTF_COMPILER_MSVC
- #if WTF_CPU_X86_64
-     int cpuinfo[4];
--- a/components/desktop/firefox/patches/firefox31-408-urlbar-sparc.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-For the font in the URL bar. Can try to send upstream. 
-
---- mozilla-esr31/gfx/cairo/cairo/src/cairo-xlib-surface.c.orig	2015-06-04 17:42:52.933166699 -0700
-+++ mozilla-esr31/gfx/cairo/cairo/src/cairo-xlib-surface.c	2015-06-04 17:42:52.936030831 -0700
[email protected]@ -1310,7 +1310,11 @@
- 		int a, r, g, b;
- 
- 		if (image_masks.bpp == 1)
-+#ifdef WORDS_BIGENDIAN
-+		    in_pixel = !! (((uint8_t*)row)[x/8] & (1 << (7 - (x & 7))));
-+#else
- 		    in_pixel = !! (((uint8_t*)row)[x/8] & (1 << (x & 7)));
-+#endif
- 		else if (image_masks.bpp <= 8)
- 		    in_pixel = ((uint8_t*)row)[x];
- 		else if (image_masks.bpp <= 16)
--- a/components/desktop/firefox/patches/firefox31-409-thumbnail-sparc.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-Either already fixed or we can send upstream. 
-
---- mozilla-esr31/gfx/2d/DataSurfaceHelpers.cpp.orig	2015-06-04 17:42:52.952071382 -0700
-+++ mozilla-esr31/gfx/2d/DataSurfaceHelpers.cpp	2015-06-04 17:42:52.954656062 -0700
[email protected]@ -19,11 +19,7 @@
- 
-   for (int row = 0; row < aSize.height; ++row) {
-     for (int column = 0; column < aSize.width; ++column) {
--#ifdef IS_BIG_ENDIAN
--      pixel[column] |= 0x000000FF;
--#else
-       pixel[column] |= 0xFF000000;
--#endif
-     }
-     pixel += (aStride/4);
-   }
--- a/components/desktop/firefox/patches/firefox31-43-solaris_jemalloc_linkage.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-This patch makes it so jemalloc is not included in firefox. Not accepted by 
-the upstream community. 
-Put jemalloc inside libxul. Then need firefox to depend on libxul
-and build jemalloc library.
-Remove lines - do not include memory for every program
-Need to create/add our own versions of the functions malloc_usable, jemalloc_stats, etc.
-Remove mozalloc library
-Check if we have jemalloc; if not, skip it.
-Build libxul and use flags -Wl,-z,interpose, needed to build the library.
-
---- mozilla-esr31/browser/app/Makefile.in.orig	2015-06-04 17:42:51.441312058 -0700
-+++ mozilla-esr31/browser/app/Makefile.in	2015-06-04 17:42:51.478117039 -0700
[email protected]@ -30,6 +30,12 @@
- 	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
- 	$(NULL)
- 
-+ifdef MOZ_MEMORY
-+ifeq ($(OS_ARCH),SunOS)
-+LIBS += $(LIBXUL_LIBS)
-+endif
-+endif
-+
- ifdef MOZ_LINKER
- LIBS += $(MOZ_ZLIB_LIBS)
- endif
---- mozilla-esr31/config/jemalloc_solaris.map.orig	1969-12-31 16:00:00.000000000 -0800
-+++ mozilla-esr31/config/jemalloc_solaris.map	2015-06-04 17:42:51.478209751 -0700
[email protected]@ -0,0 +1,12 @@
-+{
-+    global:
-+        calloc             = NODIRECT;
-+        free               = NODIRECT;
-+        jemalloc_stats     = NODIRECT;
-+        malloc             = NODIRECT;
-+        malloc_usable_size = NODIRECT;
-+        memalign           = NODIRECT;
-+        posix_memalign     = NODIRECT;
-+        realloc            = NODIRECT;
-+        valloc             = NODIRECT;
-+};
---- mozilla-esr31//configure.orig	2015-06-04 17:42:51.444508647 -0700
-+++ mozilla-esr31//configure	2015-06-04 17:42:51.480874311 -0700
[email protected]@ -24162,9 +24162,6 @@
-   fi
- else
-     MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
--      if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
--    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
--  fi
-   MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
-   if test -n "$GNU_CC"; then
-         MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
---- mozilla-esr31/memory/mozalloc/mozalloc.cpp.orig	2015-06-04 17:42:51.453412680 -0700
-+++ mozilla-esr31/memory/mozalloc/mozalloc.cpp	2015-06-04 17:42:51.481002191 -0700
[email protected]@ -200,6 +200,14 @@
- }
- #endif // if defined(HAVE_VALLOC)
- 
-+#if defined(MOZ_MEMORY_SOLARIS)
-+#include "jemalloc_types.h"
-+extern "C" {
-+extern size_t malloc_usable_size(const void *ptr);
-+extern void jemalloc_stats(jemalloc_stats_t* stats);
-+}
-+#endif
-+
- size_t
- moz_malloc_usable_size(void *ptr)
- {
[email protected]@ -209,7 +217,22 @@
- #if defined(XP_MACOSX)
-     return malloc_size(ptr);
- #elif defined(HAVE_MALLOC_USABLE_SIZE) || defined(MOZ_MEMORY)
-+#if defined(SOLARIS)
-+    static bool checked = false;
-+    static bool using_jemalloc = false;
-+    if (!checked) {
-+        checked = true;
-+        jemalloc_stats_t stats;
-+        jemalloc_stats(&stats);
-+        using_jemalloc = stats.allocated;
-+    }
-+    if (using_jemalloc)
-+        return malloc_usable_size(ptr);
-+    else
-+        return 0;
-+#else
-     return malloc_usable_size(ptr);
-+#endif
- #elif defined(XP_WIN)
-     return _msize(ptr);
- #else
---- mozilla-esr31/security/manager/ssl/tests/unit/tlsserver/cmd/Makefile.in.orig	2015-06-04 17:42:51.459223858 -0700
-+++ mozilla-esr31/security/manager/ssl/tests/unit/tlsserver/cmd/Makefile.in	2015-06-04 17:42:51.481099560 -0700
[email protected]@ -9,7 +9,6 @@
- LIBS = \
-   $(NSPR_LIBS) \
-   $(NSS_LIBS) \
--  $(MOZALLOC_LIB) \
-   ../../../../../../pkix/$(LIB_PREFIX)mozillapkix.$(LIB_SUFFIX) \
-   ../../../../../../pkix/test/lib/$(LIB_PREFIX)pkixtestutil.$(LIB_SUFFIX) \
-   ../lib/$(LIB_PREFIX)tlsserver.$(LIB_SUFFIX) \
---- mozilla-esr31/storage/src/mozStorageService.cpp.orig	2015-06-04 17:42:51.464827762 -0700
-+++ mozilla-esr31/storage/src/mozStorageService.cpp	2015-06-04 17:42:51.481242977 -0700
[email protected]@ -503,9 +503,14 @@
-   int rc;
- 
- #ifdef MOZ_STORAGE_MEMORY
--  rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
--  if (rc != SQLITE_OK)
--    return convertResultCode(rc);
-+  // in case other malloc library is PRELOAD-ed
-+  void *test_jemalloc = malloc(4);
-+  if (::moz_malloc_usable_size(test_jemalloc)) {
-+    rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
-+    if (rc != SQLITE_OK)
-+      return convertResultCode(rc);
-+  }
-+  free(test_jemalloc);
- #endif
- 
-   // Explicitly initialize sqlite3.  Although this is implicitly called by
---- mozilla-esr31/toolkit/library/Makefile.in.orig	2015-06-04 17:42:51.470433696 -0700
-+++ mozilla-esr31/toolkit/library/Makefile.in	2015-06-04 17:42:51.481334017 -0700
[email protected]@ -24,6 +24,16 @@
- 
- include $(topsrcdir)/config/rules.mk
- 
-+ifdef MOZ_MEMORY
-+ifeq ($(OS_ARCH),SunOS)
-+EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib) -Wl,-M $(topsrcdir)/config/jemalloc_solaris.map -Wl,-z,interpose
-+endif
-+endif
-+
-+ifeq ($(OS_ARCH),SunOS)
-+EXTRA_DSO_LDOPTS += -lintl_unicharutil_util_internal -lxpt -lm -Wl,-z,defs
-+endif
-+
- .PHONY: gtestxul
- gtestxul:
- 	$(MAKE) -C gtest libs LINK_GTEST=1
---- mozilla-esr31/toolkit/library/libxul.mk.orig	2015-06-04 17:42:51.475797585 -0700
-+++ mozilla-esr31/toolkit/library/libxul.mk	2015-06-04 17:42:51.481432770 -0700
[email protected]@ -253,3 +253,13 @@
- ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
- OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
- endif
-+
-+ifdef MOZ_MEMORY
-+ifeq ($(OS_ARCH),SunOS)
-+EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib) -Wl,-M $(topsrcdir)/config/jemalloc_solaris.map -Wl,-z,interpose
-+endif
-+endif
-+
-+ifeq ($(OS_ARCH),SunOS)
-+EXTRA_DSO_LDOPTS += -lintl_unicharutil_util_internal -lxpt -lm -Wl,-z,defs
-+endif
--- a/components/desktop/firefox/patches/firefox31-60-Yarr_SPARC.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-Sparc assembler and fixes a bug in JIT. 
-Also some endian patch. 
-
---- mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h.orig	2015-06-04 17:42:51.654203814 -0700
-+++ mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h	2015-06-04 17:42:51.667707756 -0700
[email protected]@ -337,6 +337,17 @@
-             }
-         }
- 
-+        void load16Unaligned(BaseIndex address, RegisterID dest)
-+        {
-+            m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
-+            add32(Imm32(address.offset+1), SparcRegisters::g2);
-+            m_assembler.ldub_r(address.base, SparcRegisters::g2, dest);
-+            m_assembler.subcc_imm(SparcRegisters::g2, 1, SparcRegisters::g2);
-+            m_assembler.ldub_r(address.base, SparcRegisters::g2, SparcRegisters::g3);
-+            m_assembler.sll_imm(SparcRegisters::g3, 8, SparcRegisters::g3);
-+            m_assembler.or_r(SparcRegisters::g3, dest, dest);
-+        }
-+
-         void store8(RegisterID src, ImplicitAddress address)
-         {
-             if (m_assembler.isimm13(address.offset))
[email protected]@ -416,6 +427,11 @@
-             }
-         }
- 
-+        void load8(BaseIndex address, RegisterID dest)
-+        {
-+            load8ZeroExtend(address, dest);
-+        }
-+
-         void load8SignExtend(BaseIndex address, RegisterID dest)
-         {
-             m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
---- mozilla-esr31/js/src/assembler/assembler/SparcAssembler.h.orig	2015-06-04 17:42:51.659564348 -0700
-+++ mozilla-esr31/js/src/assembler/assembler/SparcAssembler.h	2015-06-04 17:42:51.667904536 -0700
[email protected]@ -161,6 +161,10 @@
-             {
-             }
- 
-+            bool isSet() const {
-+                return m_offset != -1;
-+            }
-+
-         private:
-             JmpSrc(int offset)
-                 : m_offset(offset)
---- mozilla-esr31/js/src/yarr/YarrJIT.cpp.orig	2015-06-04 17:42:51.665227855 -0700
-+++ mozilla-esr31/js/src/yarr/YarrJIT.cpp	2015-06-04 17:42:51.668284205 -0700
[email protected]@ -84,6 +84,7 @@
-     static const RegisterID regT1 = SparcRegisters::i5;
- 
-     static const RegisterID returnRegister = SparcRegisters::i0;
-+    static const RegisterID returnRegister2 = SparcRegisters::i1;
- #elif WTF_CPU_X86
-     static const RegisterID input = X86Registers::eax;
-     static const RegisterID index = X86Registers::edx;
[email protected]@ -824,6 +825,18 @@
-                 ignoreCaseMask |= 32 << shiftAmount;
-         }
- 
-+#if WTF_CPU_BIG_ENDIAN
-+        if (m_charSize == Char8) {
-+            allCharacters = (allCharacters << 24) | ((allCharacters << 8) & 0xff0000) |
-+                            ((allCharacters >> 8) & 0xff00) | ((allCharacters >> 24) & 0xff);
-+            ignoreCaseMask = (ignoreCaseMask << 24) | ((ignoreCaseMask << 8) & 0xff0000) |
-+                             ((ignoreCaseMask >> 8) & 0xff00) | ((ignoreCaseMask >> 24) & 0xff);
-+        } else {
-+            allCharacters = (allCharacters << 16) | ((allCharacters >> 16) & 0xffff);
-+            ignoreCaseMask = (ignoreCaseMask << 16) | ((ignoreCaseMask >> 16) & 0xffff);
-+        }
-+#endif
-+
-         if (m_charSize == Char8) {
-             switch (numberCharacters) {
-             case 1:
--- a/components/desktop/firefox/patches/firefox31-69-ipcv2.patch	Tue Mar 01 10:33:35 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2115 +0,0 @@
-There are a lot of separate ipcv2 patches collected here in one file.
-Some of them are Studio specific and can hopefully be removed.
-
-In more detail: 
-
-First part is for studio, we may be able to remove. 
-Need to keep the if defined(OS_LINUX)... parts, should try to send upstream. 
-Using evpoll/devpoll instead of epoll may be Studio specific. 
-asm_volatile changes may also be studio specific. 
-
-For Solaris, we have no proc/self/exe location so we get the name of the 
-process some other way. Should be able to send this part upstream. 
-
-Patch to use FTS (tool for traversing tool hierarchies). We have these
-functions but they're not in libraries for C. This part is included in firefox
-40. 
-
-ENABLE_XSS_SUPPORT links XSS libraries; needs further investigation. 
-
-In Solaris, the queue can be too long so we have it read 32 bits only (?) for
-the wakeup_pip_read function. 
-
-DCHECK(std::find...) may be because we couldn't compile it otherwise. Needs
-namespace added. 
-
-We can remove the part for wstring because it's for studio. 
-
-Solaris specific change for adding definition of thr_self. 
-
-Differing memory for munmap((caddr_t)... patch
-
-We don't have timestruct defined in solaris (#ifndef SOLARIS...timstruct...)
-
-event2/event-config.h: Adds a new file so that libevent will compile on Solaris.In the .mozconfig file, we are using system libevent, so this shouldn't be necessary.
-
-IPC_RMID -- shared memory; on solaris, need to detach the shared memory first. So we move that segment of code up. If we detach the memory in Solaris, we cannot do a new attach.
-
-Add flags for Studio compiler. (CXXFLAGS)
-
-extern *C* int madvise(...) not defined , so we need to define it.
-
---- mozilla-esr31//configure.orig	2015-06-04 17:42:51.721170546 -0700
-+++ mozilla-esr31//configure	2015-06-04 17:42:52.022280764 -0700
[email protected]@ -9675,7 +9675,7 @@
- EOF
- 
-        CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
--       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
-+       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
-        LDFLAGS="-xildoff $LDFLAGS"
-        MMX_FLAGS="-xarch=mmx -xO4"
-        SSE_FLAGS="-xarch=sse"
---- mozilla-esr31/dom/plugins/ipc/PluginMessageUtils.cpp.orig	2015-06-04 17:42:51.729961817 -0700
-+++ mozilla-esr31/dom/plugins/ipc/PluginMessageUtils.cpp	2015-06-04 17:42:52.022446816 -0700
[email protected]@ -85,7 +85,7 @@
-   }
- }
- 
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
- static string
- ReplaceAll(const string& haystack, const string& needle, const string& with)
- {
[email protected]@ -104,7 +104,7 @@
- string
- MungePluginDsoPath(const string& path)
- {
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
-   // https://bugzilla.mozilla.org/show_bug.cgi?id=519601
-   return ReplaceAll(path, "netscape", "[email protected]");
- #else
[email protected]@ -115,7 +115,7 @@
- string
- UnmungePluginDsoPath(const string& munged)
- {
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
-   return ReplaceAll(munged, "[email protected]", "netscape");
- #else
-   return munged;
---- mozilla-esr31/dom/plugins/ipc/PluginModuleChild.cpp.orig	2015-06-04 17:42:51.732749854 -0700
-+++ mozilla-esr31/dom/plugins/ipc/PluginModuleChild.cpp	2015-06-04 17:42:52.022749494 -0700
[email protected]@ -207,7 +207,7 @@
- 
-     // TODO: use PluginPRLibrary here
- 
--#if defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
-     mShutdownFunc =
-         (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
- 
[email protected]@ -238,9 +238,11 @@
- }
- 
- #if defined(MOZ_WIDGET_GTK)
-+extern "C" {
- typedef void (*GObjectDisposeFn)(GObject*);
- typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
- typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
-+}
- 
- static GObjectDisposeFn real_gtk_plug_dispose;
- static GtkPlugEmbeddedFn real_gtk_plug_embedded;
[email protected]@ -1837,7 +1839,7 @@
-     PLUGIN_LOG_DEBUG_METHOD;
-     AssertPluginThread();
- 
--#if defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
-     return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
-     *_retval = mGetEntryPointsFunc(&mFunctions);
[email protected]@ -1866,7 +1868,7 @@
-     SendBackUpXResources(FileDescriptor(xSocketFd));
- #endif
- 
--#if defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
-     *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
-     return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
---- mozilla-esr31/dom/plugins/ipc/PluginModuleChild.h.orig	2015-06-04 17:42:51.740779458 -0700
-+++ mozilla-esr31/dom/plugins/ipc/PluginModuleChild.h	2015-06-04 17:42:52.022883746 -0700
[email protected]@ -319,7 +319,7 @@
- 
-     // we get this from the plugin
-     NP_PLUGINSHUTDOWN mShutdownFunc;
--#if defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
-     NP_PLUGINUNIXINIT mInitializeFunc;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
-     NP_PLUGININIT mInitializeFunc;
---- mozilla-esr31/dom/plugins/ipc/PluginModuleParent.h.orig	2015-06-04 17:42:51.746067316 -0700
-+++ mozilla-esr31/dom/plugins/ipc/PluginModuleParent.h	2015-06-04 17:42:52.023009056 -0700
[email protected]@ -203,7 +203,7 @@
- 
-     // Implement the module-level functions from NPAPI; these are
-     // normally resolved directly from the DSO.
--#ifdef OS_LINUX
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
-     NPError NP_Initialize(const NPNetscapeFuncs* npnIface,
-                           NPPluginFuncs* nppIface);
- #else
---- mozilla-esr31/dom/plugins/ipc/PluginProcessParent.cpp.orig	2015-06-04 17:42:51.751413278 -0700
-+++ mozilla-esr31/dom/plugins/ipc/PluginProcessParent.cpp	2015-06-04 17:42:52.023117720 -0700
[email protected]@ -68,6 +68,9 @@
-         else if (base::PROCESS_ARCH_ARM & pluginLibArchitectures & containerArchitectures) {
-           selectedArchitecture = base::PROCESS_ARCH_ARM;
-         }
-+        else if (base::PROCESS_ARCH_SPARC & pluginLibArchitectures & containerArchitectures) {
-+          selectedArchitecture = base::PROCESS_ARCH_SPARC;
-+        }
-         else {
-             return false;
-         }
---- mozilla-esr31/ipc/chromium/chromium-config.mozbuild.orig	2015-06-04 17:42:51.762667985 -0700
-+++ mozilla-esr31/ipc/chromium/chromium-config.mozbuild	2015-06-04 17:42:52.023331021 -0700
[email protected]@ -41,6 +41,9 @@
-     if CONFIG['OS_ARCH'] == 'Darwin':
-         DEFINES['OS_MACOSX'] = 1
- 
-+    elif CONFIG['OS_ARCH'] == 'SunOS':
-+        DEFINES['OS_SOLARIS'] = 1
-+
-     elif CONFIG['OS_ARCH'] == 'DragonFly':
-         OS_LIBS += [ '$(call EXPAND_LIBNAME,kvm)' ]
-         DEFINES.update({
---- mozilla-esr31/ipc/chromium/moz.build.orig	2015-06-04 17:42:51.765444586 -0700
-+++ mozilla-esr31/ipc/chromium/moz.build	2015-06-04 17:42:52.023499565 -0700
[email protected]@ -230,17 +230,25 @@
-             'moc_message_pump_qt.cc',
-         ]
-     if not CONFIG['MOZ_NATIVE_LIBEVENT']:
--        if CONFIG['OS_TARGET'] != 'Android':
-+        if CONFIG['OS_TARGET'] != 'SunOS':
-+            if CONFIG['OS_TARGET'] != 'Android':
-+                SOURCES += [
-+                    'src/third_party/libevent/epoll_sub.c',
-+                ]
-             SOURCES += [
--                'src/third_party/libevent/epoll_sub.c',
-+                'src/third_party/libevent/epoll.c',
-             ]
--        SOURCES += [
--            'src/third_party/libevent/epoll.c',
--        ]
-         if CONFIG['OS_TARGET'] == 'Android':
-             LOCAL_INCLUDES += ['src/third_party/libevent/android']
-         else:
--            LOCAL_INCLUDES += ['src/third_party/libevent/linux']
-+            if CONFIG['OS_TARGET'] != 'SunOS':
-+                LOCAL_INCLUDES += ['src/third_party/libevent/linux']
-+            else:
-+                LOCAL_INCLUDES += ['src/third_party/libevent/solaris']
-+                SOURCES += [
-+                    'src/third_party/libevent/devpoll.c',
-+                    'src/third_party/libevent/evport.c',
-+                ]
- 
- if os_bsd:
-     SOURCES += [
---- mozilla-esr31/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc.orig	2015-06-04 17:42:51.779492901 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc	2015-06-04 17:42:52.023724795 -0700
[email protected]@ -19,13 +19,13 @@
- // Inline cpuid instruction.  In PIC compilations, %ebx contains the address
- // of the global offset table.  To avoid breaking such executables, this code
- // must preserve that register's value across cpuid instructions.
--#if defined(__i386__)
-+#if defined(__i386__) || defined (__i386)
- #define cpuid(a, b, c, d, inp) \
-   asm ("mov %%ebx, %%edi\n"    \
-        "cpuid\n"               \
-        "xchg %%edi, %%ebx\n"   \
-        : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
--#elif defined (__x86_64__)
-+#elif defined (__x86_64__) || defined(__x86_64)
- #define cpuid(a, b, c, d, inp) \
-   asm ("mov %%rbx, %%rdi\n"    \
-        "cpuid\n"               \
---- mozilla-esr31/ipc/chromium/src/base/atomicops_internals_x86_gcc.h.orig	2015-06-04 17:42:51.785051435 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/atomicops_internals_x86_gcc.h	2015-06-04 17:42:52.023927132 -0700
[email protected]@ -29,18 +29,18 @@
-                                          Atomic32 old_value,
-                                          Atomic32 new_value) {
-   Atomic32 prev;
--  __asm__ __volatile__("lock; cmpxchgl %1,%2"
-+  __asm__ __volatile__("lock; cmpxchgl %1,(%2)"
-                        : "=a" (prev)
--                       : "q" (new_value), "m" (*ptr), "0" (old_value)
-+                       : "q" (new_value), "r" (ptr), "0" (old_value)
-                        : "memory");
-   return prev;
- }
- 
- inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                          Atomic32 new_value) {
--  __asm__ __volatile__("xchgl %1,%0"  // The lock prefix is implicit for xchg.
-+  __asm__ __volatile__("xchgl (%1),%0"  // The lock prefix is implicit for xchg.
-                        : "=r" (new_value)
--                       : "m" (*ptr), "0" (new_value)
-+                       : "r" (ptr), "0" (new_value)
-                        : "memory");
-   return new_value;  // Now it's the previous value.
- }
[email protected]@ -48,8 +48,8 @@
- inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                           Atomic32 increment) {
-   Atomic32 temp = increment;
--  __asm__ __volatile__("lock; xaddl %0,%1"
--                       : "+r" (temp), "+m" (*ptr)
-+  __asm__ __volatile__("lock; xaddl %0,(%1)"
-+                       : "+r" (temp), "+r" (ptr)
-                        : : "memory");
-   // temp now holds the old value of *ptr
-   return temp + increment;
[email protected]@ -58,8 +58,8 @@
- inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                         Atomic32 increment) {
-   Atomic32 temp = increment;
--  __asm__ __volatile__("lock; xaddl %0,%1"
--                       : "+r" (temp), "+m" (*ptr)
-+  __asm__ __volatile__("lock; xaddl %0,(%1)"
-+                       : "+r" (temp), "+r" (ptr)
-                        : : "memory");
-   // temp now holds the old value of *ptr
-   if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
[email protected]@ -153,18 +153,18 @@
-                                          Atomic64 old_value,
-                                          Atomic64 new_value) {
-   Atomic64 prev;
--  __asm__ __volatile__("lock; cmpxchgq %1,%2"
-+  __asm__ __volatile__("lock; cmpxchgq %1,(%2)"
-                        : "=a" (prev)
--                       : "q" (new_value), "m" (*ptr), "0" (old_value)
-+                       : "q" (new_value), "r" (ptr), "0" (old_value)
-                        : "memory");
-   return prev;
- }
- 
- inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                          Atomic64 new_value) {
--  __asm__ __volatile__("xchgq %1,%0"  // The lock prefix is implicit for xchg.
-+  __asm__ __volatile__("xchgq (%1),%0"  // The lock prefix is implicit for xchg.
-                        : "=r" (new_value)
--                       : "m" (*ptr), "0" (new_value)
-+                       : "r" (ptr), "0" (new_value)
-                        : "memory");
-   return new_value;  // Now it's the previous value.
- }
[email protected]@ -172,8 +172,8 @@
- inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                           Atomic64 increment) {
-   Atomic64 temp = increment;
--  __asm__ __volatile__("lock; xaddq %0,%1"
--                       : "+r" (temp), "+m" (*ptr)
-+  __asm__ __volatile__("lock; xaddq %0,(%1)"
-+                       : "+r" (temp), "+r" (ptr)
-                        : : "memory");
-   // temp now contains the previous value of *ptr
-   return temp + increment;
[email protected]@ -182,8 +182,8 @@
- inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                         Atomic64 increment) {
-   Atomic64 temp = increment;
--  __asm__ __volatile__("lock; xaddq %0,%1"
--                       : "+r" (temp), "+m" (*ptr)
-+  __asm__ __volatile__("lock; xaddq %0,(%1)"
-+                       : "+r" (temp), "+r" (ptr)
-                        : : "memory");
-   // temp now contains the previous value of *ptr
-   if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
---- mozilla-esr31/ipc/chromium/src/base/base_paths.h.orig	2015-06-04 17:42:51.790740170 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/base_paths.h	2015-06-04 17:42:52.024028774 -0700
[email protected]@ -13,7 +13,7 @@
- #include "base/base_paths_win.h"
- #elif defined(OS_MACOSX)
- #include "base/base_paths_mac.h"
--#elif defined(OS_LINUX) || defined(OS_BSD)
-+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
- #include "base/base_paths_linux.h"
- #endif
- #include "base/path_service.h"
---- mozilla-esr31/ipc/chromium/src/base/base_paths_linux.cc.orig	2015-06-04 17:42:51.796070387 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/base_paths_linux.cc	2015-06-04 17:42:52.024134065 -0700
[email protected]@ -21,11 +21,19 @@
-     case base::FILE_EXE:
-     case base::FILE_MODULE: { // TODO(evanm): is this correct?
-       char bin_dir[PATH_MAX + 1];
-+#ifdef OS_SOLARIS
-+      if (!(realpath(getexecname(), bin_dir) && bin_dir[0] != '[')) {
-+        NOTREACHED() << "Unable to get exec name.";
-+        return false;
-+      }
-+      int bin_dir_size = strlen(bin_dir);
-+#else
-       int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX);
-       if (bin_dir_size < 0 || bin_dir_size > PATH_MAX) {
-         NOTREACHED() << "Unable to resolve /proc/self/exe.";
-         return false;
-       }
-+#endif      
-       bin_dir[bin_dir_size] = 0;
-       *result = FilePath(bin_dir);
-       return true;
---- mozilla-esr31/ipc/chromium/src/base/debug_util_posix.cc.orig	2015-06-04 17:42:51.806726871 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/debug_util_posix.cc	2015-06-04 17:42:52.024415350 -0700
[email protected]@ -110,7 +110,7 @@
-   return being_debugged;
- }
- 
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
- 
- // We can look in /proc/self/status for TracerPid.  We are likely used in crash
- // handling, so we are careful not to use the heap or have side effects.
[email protected]@ -145,7 +145,7 @@
-   return pid_index < status.size() && status[pid_index] != '0';
- }
- 
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_SOLARIS
- 
- // static
- void DebugUtil::BreakDebugger() {
---- mozilla-esr31/ipc/chromium/src/base/file_util.cc.orig	2015-06-04 17:42:51.817383612 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/file_util.cc	2015-06-04 17:42:52.024645830 -0700
[email protected]@ -245,4 +245,25 @@
- int WriteFile(const std::wstring& filename, const char* data, int size) {
-   return WriteFile(FilePath::FromWStringHack(filename), data, size);
- }
-+
-+#ifdef OS_SOLARIS
-+
-+bool IsDot(const FilePath& path) {
-+  return FILE_PATH_LITERAL(".") == path.BaseName().value();
-+}
-+
-+bool IsDotDot(const FilePath& path) {
-+  return FILE_PATH_LITERAL("..") == path.BaseName().value();
-+}
-+
-+///////////////////////////////////////////////
-+// FileEnumerator
-+//
-+// Note: the main logic is in file_util_<platform>.cc
-+
-+bool FileEnumerator::ShouldSkip(const FilePath& path) {
-+  FilePath::StringType basename = path.BaseName().value();
-+  return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_));
-+}
-+#endif
- }  // namespace
---- mozilla-esr31/ipc/chromium/src/base/file_util.h.orig	2015-06-04 17:42:51.822731946 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/file_util.h	2015-06-04 17:42:52.024795816 -0700
[email protected]@ -12,7 +12,7 @@
- 
- #if defined(OS_WIN)
- #include <windows.h>
--#elif defined(ANDROID)
-+#elif defined(ANDROID) || defined(OS_SOLARIS)
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
[email protected]@ -241,6 +241,103 @@
- // Deprecated temporary compatibility function.
- bool SetCurrentDirectory(const std::wstring& current_directory);
- 
-+#ifdef OS_SOLARIS
-+// A class for enumerating the files in a provided path. The order of the
-+// results is not guaranteed.
-+//
-+// DO NOT USE FROM THE MAIN THREAD of your application unless it is a test
-+// program where latency does not matter. This class is blocking.
-+class FileEnumerator {
-+ public:
-+  typedef struct {
-+    struct stat stat;
-+    std::string filename;
-+  } FindInfo;
-+
-+  enum FILE_TYPE {
-+    FILES                 = 1 << 0,
-+    DIRECTORIES           = 1 << 1,
-+    INCLUDE_DOT_DOT       = 1 << 2,
-+    SHOW_SYM_LINKS        = 1 << 4,
-+  };
-+
-+  // |root_path| is the starting directory to search for. It may or may not end
-+  // in a slash.
-+  //  
-+  // If |recursive| is true, this will enumerate all matches in any
-+  // subdirectories matched as well. It does a breadth-first search, so all
-+  // files in one directory will be returned before any files in a
-+  // subdirectory.
-+  //
-+  // |file_type| specifies whether the enumerator should match files,
-+  // directories, or both.
-+  //
-+  // |pattern| is an optional pattern for which files to match. This
-+  // works like shell globbing. For example, "*.txt" or "Foo???.doc".
-+  // However, be careful in specifying patterns that aren't cross platform
-+  // since the underlying code uses OS-specific matching routines.  In general,
-+  // Windows matching is less featureful than others, so test there first.
-+  // If unspecified, this will match all files.
-+  // NOTE: the pattern only matches the contents of root_path, not files in
-+  // recursive subdirectories.
-+  // TODO(erikkay): Fix the pattern matching to work at all levels.
-+  FileEnumerator(const FilePath& root_path,
-+                 bool recursive,
-+                 FileEnumerator::FILE_TYPE file_type);
-+  FileEnumerator(const FilePath& root_path,
-+                 bool recursive,
-+                 FileEnumerator::FILE_TYPE file_type,
-+                 const FilePath::StringType& pattern);
-+  ~FileEnumerator();
-+
-+  // Returns an empty string if there are no more results.
-+  FilePath Next();
-+
-+  // Write the file info into |info|.
-+  void GetFindInfo(FindInfo* info);
-+
-+  // Looks inside a FindInfo and determines if it's a directory.
-+  static bool IsDirectory(const FindInfo& info);
-+
-+  static FilePath GetFilename(const FindInfo& find_info);
-+
-+ private:
-+  // Returns true if the given path should be skipped in enumeration.
-+  bool ShouldSkip(const FilePath& path);
-+
-+
-+  typedef struct {
-+    FilePath filename;
-+    struct stat stat;
-+  } DirectoryEntryInfo;
-+
-+  // Read the filenames in source into the vector of DirectoryEntryInfo's
-+  static bool ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
-+                            const FilePath& source, bool show_links);
-+
-+  // The files in the current directory
-+  std::vector<DirectoryEntryInfo> directory_entries_;
-+
-+  // The next entry to use from the directory_entries_ vector
-+  size_t current_directory_entry_;
-+
-+  FilePath root_path_;
-+  bool recursive_;
-+  FILE_TYPE file_type_;
-+  FilePath::StringType pattern_;  // Empty when we want to find everything.
-+
-+  // Set to true when there is a find operation open. This way, we can lazily
-+  // start the operations when the caller calls Next().
-+  bool is_in_find_op_;
-+
-+  // A stack that keeps track of which subdirectories we still need to
-+  // enumerate in the breadth-first search.
-+  std::stack<FilePath> pending_paths_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(FileEnumerator);
-+};
-+#endif
-+
- }  // namespace file_util
- 
- #endif  // BASE_FILE_UTIL_H_
---- mozilla-esr31/ipc/chromium/src/base/file_util_posix.cc.orig	2015-06-04 17:42:51.828082851 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/file_util_posix.cc	2015-06-04 17:42:52.025067753 -0700
[email protected]@ -8,7 +8,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <fnmatch.h>
--#ifndef ANDROID
-+#if !defined(ANDROID) && !defined(OS_SOLARIS)
- #include <fts.h>
- #endif
- #include <libgen.h>
[email protected]@ -67,9 +67,34 @@
-   if (!recursive)
-     return (rmdir(path_str) == 0);
- 
--#ifdef ANDROID
-+#if defined(ANDROID)
-   // XXX Need ftsless impl for bionic
-   return false;
-+#elif defined(OS_SOLARIS)
-+  bool success = true;
-+  std::stack<std::string> directories;
-+  directories.push(path.value());
-+  FileEnumerator traversal(path, true, static_cast<FileEnumerator::FILE_TYPE>(
-+        FileEnumerator::FILES | FileEnumerator::DIRECTORIES |
-+        FileEnumerator::SHOW_SYM_LINKS));
-+  for (FilePath current = traversal.Next(); success && !current.empty();
-+       current = traversal.Next()) {
-+    FileEnumerator::FindInfo info;
-+    traversal.GetFindInfo(&info);
-+
-+    if (S_ISDIR(info.stat.st_mode))
-+      directories.push(current.value());
-+    else
-+      success = (unlink(current.value().c_str()) == 0);
-+  }
-+
-+  while (success && !directories.empty()) {
-+    FilePath dir = FilePath(directories.top());
-+    directories.pop();
-+    success = (rmdir(dir.value().c_str()) == 0);
-+  }
-+
-+  return success; 
- #else
-   bool success = true;
-   int ftsflags = FTS_PHYSICAL | FTS_NOSTAT;
[email protected]@ -140,14 +165,98 @@
-     return false;
-   }
- 
--#ifdef ANDROID
-+#if defined(ANDROID)
-   // XXX Need ftsless impl for bionic
-   return false;
-+#elif defined(OS_SOLARIS)
-+  // This function does not properly handle destinations within the source
-+  FilePath real_to_path = to_path;
-+  if (PathExists(real_to_path)) {
-+    if (!AbsolutePath(&real_to_path))
-+      return false;
-+  } else {
-+    real_to_path = real_to_path.DirName();
-+    if (!AbsolutePath(&real_to_path))
-+      return false;
-+  }
-+  FilePath real_from_path = from_path;
-+  if (!AbsolutePath(&real_from_path))
-+    return false;
-+  if (real_to_path.value().size() >= real_from_path.value().size() &&
-+      real_to_path.value().compare(0, real_from_path.value().size(),
-+      real_from_path.value()) == 0)
-+    return false;
-+
-+  bool success = true;
-+  FileEnumerator::FILE_TYPE traverse_type =
-+      static_cast<FileEnumerator::FILE_TYPE>(FileEnumerator::FILES |
-+      FileEnumerator::SHOW_SYM_LINKS);
-+  if (recursive)
-+    traverse_type = static_cast<FileEnumerator::FILE_TYPE>(
-+        traverse_type | FileEnumerator::DIRECTORIES);
-+  FileEnumerator traversal(from_path, recursive, traverse_type);
-+
-+  // We have to mimic windows behavior here. |to_path| may not exist yet,
-+  // start the loop with |to_path|.
-+  FileEnumerator::FindInfo info;
-+  FilePath current = from_path;
-+  if (stat(from_path.value().c_str(), &info.stat) < 0) {
-+    CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't stat source directory: " <<
-+        from_path.value() << " errno = " << errno;
-+    success = false;
-+  }
-+  struct stat to_path_stat;
-+  FilePath from_path_base = from_path;
-+  if (recursive && stat(to_path.value().c_str(), &to_path_stat) == 0 &&
-+      S_ISDIR(to_path_stat.st_mode)) {
-+    // If the destination already exists and is a directory, then the
-+    // top level of source needs to be copied.
-+    from_path_base = from_path.DirName();
-+  }
-+
-+  // The Windows version of this function assumes that non-recursive calls
-+  // will always have a directory for from_path.
-+  DCHECK(recursive || S_ISDIR(info.stat.st_mode));
-+
-+  while (success && !current.empty()) {
-+    // current is the source path, including from_path, so paste
-+    // the suffix after from_path onto to_path to create the target_path.
-+    std::string suffix(&current.value().c_str()[from_path_base.value().size()]);
-+    // Strip the leading '/' (if any).
-+    if (!suffix.empty()) {
-+      DCHECK_EQ('/', suffix[0]);
-+      suffix.erase(0, 1);
-+    }
-+    const FilePath target_path = to_path.Append(suffix);
-+
-+    if (S_ISDIR(info.stat.st_mode)) {
-+      if (mkdir(target_path.value().c_str(), info.stat.st_mode & 01777) != 0 &&
-+          errno != EEXIST) {
-+        CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create directory: " <<
-+            target_path.value() << " errno = " << errno;
-+        success = false;
-+      }
-+    } else if (S_ISREG(info.stat.st_mode)) {
-+      if (!CopyFile(current, target_path)) {
-+        CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create file: " <<
-+            target_path.value();
-+        success = false;
-+      }
-+    } else {
-+      CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping non-regular file: " <<
-+          current.value();
-+    }
-+
-+    current = traversal.Next();
-+    traversal.GetFindInfo(&info);
-+  }
-+
-+  return success;
- #else
-   char* dir_list[] = { top_dir, NULL };
-   FTS* fts = fts_open(dir_list, FTS_PHYSICAL | FTS_NOSTAT, NULL);
-   if (!fts) {
--    CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
-+    CHROMIUM_CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
-     return false;
-   }
- 
[email protected]@ -203,11 +312,11 @@
-         break;
-       case FTS_SL:      // Symlink.
-       case FTS_SLNONE:  // Symlink with broken target.
--        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
-+        CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
-             ent->fts_path;
-         continue;
-       case FTS_DEFAULT:  // Some other sort of file.
--        CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
-+        CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
-             ent->fts_path;
-         continue;
-       default:
[email protected]@ -227,7 +336,7 @@
-   }
- 
-   if (error) {
--    CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
-+    CHROMIUM_CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
-     return false;
-   }
-   return true;
[email protected]@ -446,7 +555,7 @@
- }
- 
- bool GetShmemTempDir(FilePath* path) {
--#if defined(OS_LINUX) && !defined(ANDROID)
-+#if defined(OS_LINUX) && !defined(ANDROID) && !defined(OS_SOLARIS)
-   *path = FilePath("/dev/shm");
-   return true;
- #else
[email protected]@ -501,4 +610,144 @@
- }
- #endif // !defined(OS_MACOSX)
- 
-+#ifdef OS_SOLARIS
-+///////////////////////////////////////////////
-+// FileEnumerator
-+
-+FileEnumerator::FileEnumerator(const FilePath& root_path,
-+                               bool recursive,
-+                               FileEnumerator::FILE_TYPE file_type)
-+    : current_directory_entry_(0),
-+      root_path_(root_path),
-+      recursive_(recursive),
-+      file_type_(file_type),
-+      is_in_find_op_(false) {
-+  // INCLUDE_DOT_DOT must not be specified if recursive.
-+  DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_)));
-+  pending_paths_.push(root_path);
-+}
-+
-+FileEnumerator::FileEnumerator(const FilePath& root_path,
-+                               bool recursive,
-+                               FileEnumerator::FILE_TYPE file_type,
-+                               const FilePath::StringType& pattern)
-+    : current_directory_entry_(0),
-+      root_path_(root_path),
-+      recursive_(recursive),
-+      file_type_(file_type),
-+      pattern_(root_path.Append(pattern).value()),
-+      is_in_find_op_(false) {
-+  // INCLUDE_DOT_DOT must not be specified if recursive.
-+  DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_)));
-+  // The Windows version of this code appends the pattern to the root_path,
-+  // potentially only matching against items in the top-most directory.
-+  // Do the same here.
-+  if (pattern.size() == 0)
-+    pattern_ = FilePath::StringType();
-+  pending_paths_.push(root_path);
-+}
-+
-+FileEnumerator::~FileEnumerator() {
-+}
-+
-+void FileEnumerator::GetFindInfo(FindInfo* info) {
-+  DCHECK(info);
-+
-+  if (current_directory_entry_ >= directory_entries_.size())
-+    return;
-+
-+  DirectoryEntryInfo* cur_entry = &directory_entries_[current_directory_entry_];
-+  memcpy(&(info->stat), &(cur_entry->stat), sizeof(info->stat));
-+  info->filename.assign(cur_entry->filename.value());
-+}
-+
-+bool FileEnumerator::IsDirectory(const FindInfo& info) {
-+  return S_ISDIR(info.stat.st_mode);
-+}
-+
-+// static
-+FilePath FileEnumerator::GetFilename(const FindInfo& find_info) {
-+  return FilePath(find_info.filename);
-+}
-+
-+FilePath FileEnumerator::Next() {
-+  ++current_directory_entry_;
-+
-+  // While we've exhausted the entries in the current directory, do the next
-+  while (current_directory_entry_ >= directory_entries_.size()) {
-+    if (pending_paths_.empty())
-+      return FilePath();
-+
-+    root_path_ = pending_paths_.top();
-+    root_path_ = root_path_.StripTrailingSeparators();
-+    pending_paths_.pop();
-+
-+    std::vector<DirectoryEntryInfo> entries;
-+    if (!ReadDirectory(&entries, root_path_, file_type_ & SHOW_SYM_LINKS))
-+      continue;
-+
-+    directory_entries_.clear();
-+    current_directory_entry_ = 0;
-+    for (std::vector<DirectoryEntryInfo>::const_iterator
-+        i = entries.begin(); i != entries.end(); ++i) {
-+      FilePath full_path = root_path_.Append(i->filename);
-+      if (ShouldSkip(full_path))
-+        continue;
-+
-+      if (pattern_.size() &&
-+          fnmatch(pattern_.c_str(), full_path.value().c_str(), FNM_NOESCAPE))
-+        continue;
-+
-+      if (recursive_ && S_ISDIR(i->stat.st_mode))
-+        pending_paths_.push(full_path);
-+
-+      if ((S_ISDIR(i->stat.st_mode) && (file_type_ & DIRECTORIES)) ||
-+          (!S_ISDIR(i->stat.st_mode) && (file_type_ & FILES)))
-+        directory_entries_.push_back(*i);
-+    }
-+  }
-+
-+  return root_path_.Append(directory_entries_[current_directory_entry_
-+      ].filename);
-+}
-+
-+bool FileEnumerator::ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
-+                                   const FilePath& source, bool show_links) {
-+
-+  DIR* dir = opendir(source.value().c_str());
-+  if (!dir)
-+    return false;
-+  struct {
-+          dirent dent_buffer;
-+          char chars[MAXNAMLEN];
-+  } dent_buf;
-+  struct dirent* dent;
-+
-+  while (readdir_r(dir, (dirent *)&dent_buf, &dent) == 0 && dent) {
-+    DirectoryEntryInfo info;
-+    info.filename = FilePath(dent->d_name);
-+
-+    FilePath full_name = source.Append(dent->d_name);
-+    int ret;
-+    if (show_links)
-+      ret = lstat(full_name.value().c_str(), &info.stat);
-+    else
-+      ret = stat(full_name.value().c_str(), &info.stat);
-+    if (ret < 0) {
-+      // Print the stat() error message unless it was ENOENT and we're
-+      // following symlinks.
-+      if (!(errno == ENOENT && !show_links)) {
-+        CHROMIUM_LOG(ERROR) << "Couldn't stat "
-+                   << source.Append(dent->d_name).value();
-+      }
-+      memset(&info.stat, 0, sizeof(info.stat));
-+    }
-+    entries->push_back(info);
-+  }
-+
-+  closedir(dir);
-+  return true;
-+}
-+#endif
-+
- } // namespace file_util
---- mozilla-esr31/ipc/chromium/src/base/idle_timer.cc.orig	2015-06-04 17:42:51.839092878 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/idle_timer.cc	2015-06-04 17:42:52.025292118 -0700
[email protected]@ -7,13 +7,13 @@
- // We may not want to port idle_timer to Linux, but we have implemented it
- // anyway.  Define this to 1 to enable the Linux idle timer and then add the
- // libs that need to be linked (Xss).
--#define ENABLE_XSS_SUPPORT 0
-+#define ENABLE_XSS_SUPPORT 1
- 
- #if defined(OS_MACOSX)
- #include <ApplicationServices/ApplicationServices.h>
- #endif
- 
--#if defined(OS_LINUX) && ENABLE_XSS_SUPPORT
-+#if (defined(OS_LINUX) || defined(OS_SOLARIS)) && ENABLE_XSS_SUPPORT
- // We may not want to port idle_timer to Linux, but we have implemented it
- // anyway.  Remove the 0 above if we want it.
- #include <gdk/gdkx.h>
[email protected]@ -54,7 +54,7 @@
-           kCGAnyInputEventType) * 1000.0;
-   return true;
- }
--#elif defined(OS_LINUX) && ENABLE_XSS_SUPPORT
-+#elif (defined(OS_LINUX) || defined(OS_SOLARIS)) && ENABLE_XSS_SUPPORT
- class IdleState {
-  public:
-   IdleState() {
---- mozilla-esr31/ipc/chromium/src/base/message_loop.cc.orig	2015-06-04 17:42:51.844404204 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/message_loop.cc	2015-06-04 17:42:52.025433046 -0700
[email protected]@ -20,7 +20,7 @@
- #if defined(OS_POSIX)
- #include "base/message_pump_libevent.h"
- #endif
--#if defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
- #if defined(MOZ_WIDGET_GTK)
- #include "base/message_pump_glib.h"
- #endif
[email protected]@ -140,9 +140,9 @@
-   if (type_ == TYPE_UI) {
- #if defined(OS_MACOSX)
-     pump_ = base::MessagePumpMac::Create();
--#elif defined(OS_LINUX) || defined(OS_BSD)
-+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
-     pump_ = new base::MessagePumpForUI();
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_SOLARIS
-   } else if (type_ == TYPE_IO) {
-     pump_ = new base::MessagePumpLibevent();
-   } else {
---- mozilla-esr31/ipc/chromium/src/base/message_pump_glib.cc.orig	2015-06-04 17:42:51.849699822 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/message_pump_glib.cc	2015-06-04 17:42:52.025576630 -0700
[email protected]@ -131,6 +131,12 @@
-   // Create our wakeup pipe, which is used to flag when work was scheduled.
-   int fds[2];
-   CHECK(pipe(fds) == 0);
-+
-+  int flags = fcntl(fds[0], F_GETFL, 0);
-+  if (flags == -1)
-+    flags = 0;
-+  fcntl(fds[0], F_SETFL, flags | O_NDELAY);
-+
-   wakeup_pipe_read_  = fds[0];
-   wakeup_pipe_write_ = fds[1];
-   wakeup_gpollfd_->fd = wakeup_pipe_read_;
[email protected]@ -237,10 +243,9 @@
-   // are only signaled when the queue went from empty to non-empty.  The glib
-   // poll will tell us whether there was data, so this read shouldn't block.
-   if (wakeup_gpollfd_->revents & G_IO_IN) {
--    char msg;
--    if (HANDLE_EINTR(read(wakeup_pipe_read_, &msg, 1)) != 1 || msg != '!') {
--      NOTREACHED() << "Error reading from the wakeup pipe.";
--    }
-+    char buf[32];
-+    while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32)));
-+
-     // Since we ate the message, we need to record that we have more work,
-     // because HandleCheck() may be called without HandleDispatch being called
-     // afterwards.
[email protected]@ -304,6 +309,9 @@
-   // variables as we would then need locks all over.  This ensures that if
-   // we are sleeping in a poll that we will wake up.
-   char msg = '!';
-+  char buf[32];
-+  while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32)));
-+
-   if (HANDLE_EINTR(write(wakeup_pipe_write_, &msg, 1)) != 1) {
-     NOTREACHED() << "Could not write to the UI message loop wakeup pipe!";
-   }
---- mozilla-esr31/ipc/chromium/src/base/message_pump_libevent.cc.orig	2015-06-04 17:42:51.855133081 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/message_pump_libevent.cc	2015-06-04 17:42:52.025700484 -0700
[email protected]@ -6,6 +6,10 @@
- 
- #include <errno.h>
- #include <fcntl.h>
-+#if defined(OS_SOLARIS)
-+#include <unistd.h>
-+#include <sys/stat.h>
-+#endif
- #if defined(ANDROID) || defined(OS_POSIX)
- #include <unistd.h>
- #endif
---- mozilla-esr31/ipc/chromium/src/base/observer_list.h.orig	2015-06-04 17:42:51.860470602 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/observer_list.h	2015-06-04 17:42:52.025805253 -0700
[email protected]@ -88,7 +88,7 @@
- 
-   // Add an observer to the list.
-   void AddObserver(ObserverType* obs) {
--    DCHECK(find(observers_.begin(), observers_.end(), obs) == observers_.end())
-+    DCHECK(std::find(observers_.begin(), observers_.end(), obs) == observers_.end())
-         << "Observers can only be added once!";
-     observers_.push_back(obs);
-   }
---- mozilla-esr31/ipc/chromium/src/base/path_service.cc.orig	2015-06-04 17:42:51.865762507 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/path_service.cc	2015-06-04 17:42:52.025978038 -0700
[email protected]@ -24,7 +24,7 @@
-   bool PathProviderWin(int key, FilePath* result);
- #elif defined(OS_MACOSX)
-   bool PathProviderMac(int key, FilePath* result);
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
-   bool PathProviderLinux(int key, FilePath* result);
- #endif
- }
[email protected]@ -80,7 +80,7 @@
- };
- #endif
- 
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
- static Provider base_provider_linux = {
-   base::PathProviderLinux,
-   &base_provider,
[email protected]@ -92,6 +92,17 @@
- };
- #endif
- 
-+#if 0//defined(OS_SOLARIS)
-+static Provider base_provider_posix = {
-+  base::PathProviderPosix,
-+  &base_provider,
-+#ifndef NDEBUG
-+  0,
-+  0,
-+#endif
-+  true
-+};
-+#endif
- 
- struct PathData {
-   Lock      lock;
[email protected]@ -104,7 +115,7 @@
-     providers = &base_provider_win;
- #elif defined(OS_MACOSX)
-     providers = &base_provider_mac;
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
-     providers = &base_provider_linux;
- #endif
-   }
[email protected]@ -206,6 +217,24 @@
-   return path_data->overrides.find(key) != path_data->overrides.end();
- }
- 
-+#ifdef OS_SOLARIS
-+bool PathService::Override(int key, const FilePath& path) {
-+  PathData* path_data = GetPathData();
-+  DCHECK(path_data);
-+  DCHECK(key > base::DIR_CURRENT) << "invalid path key";
-+
-+  FilePath file_path = path;
-+
-+  // make sure the directory exists:
-+  if (!file_util::CreateDirectory(file_path))
-+    return false;
-+
-+  AutoLock scoped_lock(path_data->lock);
-+  path_data->cache[key] = file_path;
-+  path_data->overrides.insert(key);
-+  return true;
-+}
-+#else
- bool PathService::Override(int key, const std::wstring& path) {
-   PathData* path_data = GetPathData();
-   DCHECK(path_data);
[email protected]@ -231,8 +260,13 @@
-   path_data->overrides.insert(key);
-   return true;
- }
-+#endif
- 
-+#ifdef OS_SOLARIS
-+bool PathService::SetCurrentDirectory(const FilePath& current_directory) {
-+#else
- bool PathService::SetCurrentDirectory(const std::wstring& current_directory) {
-+#endif
-   return file_util::SetCurrentDirectory(current_directory);
- }
- 
---- mozilla-esr31/ipc/chromium/src/base/path_service.h.orig	2015-06-04 17:42:51.871131068 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/path_service.h	2015-06-04 17:42:52.026081564 -0700
[email protected]@ -48,13 +48,21 @@
-   //
-   // WARNING: Consumers of PathService::Get may expect paths to be constant
-   // over the lifetime of the app, so this method should be used with caution.
-+#ifdef OS_SOLARIS  
-+  static bool Override(int key, const FilePath& path);
-+#else
-   static bool Override(int key, const std::wstring& path);
-+#endif
- 
-   // Return whether a path was overridden.
-   static bool IsOverridden(int key);
- 
-   // Sets the current directory.
-+#ifdef OS_SOLARIS  
-+  static bool SetCurrentDirectory(const FilePath& current_directory);
-+#else  
-   static bool SetCurrentDirectory(const std::wstring& current_directory);
-+#endif
- 
-   // To extend the set of supported keys, you can register a path provider,
-   // which is just a function mirroring PathService::Get.  The ProviderFunc
---- mozilla-esr31/ipc/chromium/src/base/platform_thread.h.orig	2015-06-04 17:42:51.876432809 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/platform_thread.h	2015-06-04 17:42:52.026181532 -0700
[email protected]@ -22,7 +22,7 @@
- #elif defined(OS_POSIX)
- #include <pthread.h>
- typedef pthread_t PlatformThreadHandle;
--#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__)
-+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
- #include <unistd.h>
- typedef pid_t PlatformThreadId;
- #elif defined(OS_BSD)
---- mozilla-esr31/ipc/chromium/src/base/platform_thread_posix.cc.orig	2015-06-04 17:42:51.881741384 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/platform_thread_posix.cc	2015-06-04 17:42:52.026320376 -0700
[email protected]@ -27,6 +27,12 @@
- #include <pthread_np.h>
- #endif
- 
-+#if defined(OS_SOLARIS)
-+#include <sys/syscall.h>
-+#include <unistd.h>
-+#include <thread.h>
-+#endif
-+
- #if defined(OS_MACOSX)
- namespace base {
- void InitThreading();
[email protected]@ -54,6 +60,8 @@
- #else
-   return syscall(__NR_gettid);
- #endif
-+#elif defined(OS_SOLARIS)
-+  return thr_self();
- #elif defined(OS_OPENBSD) || defined(__GLIBC__)
-   return (intptr_t) (pthread_self());
- #elif defined(OS_NETBSD)
[email protected]@ -96,6 +104,7 @@
- 
- // static
- void PlatformThread::SetName(const char* name) {
-+#ifndef OS_SOLARIS
-   // On linux we can get the thread names to show up in the debugger by setting
-   // the process name for the LWP.  We don't want to do this for the main
-   // thread because that would rename the process, causing tools like killall
[email protected]@ -116,6 +125,7 @@
-   pthread_set_name_np(pthread_self(), name);
- #else
- #endif
-+#endif // !OS_SOLARIS
- }
- #endif // !OS_MACOSX
- 
---- mozilla-esr31/ipc/chromium/src/base/port.h.orig	2015-06-04 17:42:51.887028405 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/port.h	2015-06-04 17:42:52.026427782 -0700
[email protected]@ -56,7 +56,7 @@
- // Define an OS-neutral wrapper for shared library entry points
- #if defined(OS_WIN)
- #define API_CALL __stdcall
--#elif defined(OS_LINUX) || defined(OS_MACOSX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_MACOSX)
- #define API_CALL
- #endif
- 
---- mozilla-esr31/ipc/chromium/src/base/process_util.h.orig	2015-06-04 17:42:51.892333219 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/process_util.h	2015-06-04 17:42:52.026584078 -0700
[email protected]@ -13,7 +13,7 @@
- #if defined(OS_WIN)
- #include <windows.h>
- #include <tlhelp32.h>
--#elif defined(OS_LINUX) || defined(__GLIBC__)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(__GLIBC__)
- #include <dirent.h>
- #include <limits.h>
- #include <sys/types.h>
[email protected]@ -21,6 +21,10 @@
- #include <mach/mach.h>
- #endif
- 
-+#if defined(OS_SOLARIS)
-+#define NAME_MAX 14
-+#endif
-+
- #include <map>
- #include <string>
- #include <vector>
[email protected]@ -62,7 +66,8 @@
-   PROCESS_ARCH_I386 = 0x1,
-   PROCESS_ARCH_X86_64 = 0x2,
-   PROCESS_ARCH_PPC = 0x4,
--  PROCESS_ARCH_ARM = 0x8
-+  PROCESS_ARCH_ARM = 0x8,
-+  PROCESS_ARCH_SPARC = 0x10
- };
- 
- inline ProcessArchitecture GetCurrentProcessArchitecture()
[email protected]@ -76,6 +81,8 @@
-   currentArchitecture = base::PROCESS_ARCH_PPC;
- #elif defined(ARCH_CPU_ARMEL)
-   currentArchitecture = base::PROCESS_ARCH_ARM;
-+#elif defined(ARCH_CPU_SPARC)
-+  currentArchitecture = base::PROCESS_ARCH_SPARC;
- #endif
-   return currentArchitecture;
- }
[email protected]@ -249,7 +256,7 @@
- #if defined(OS_WIN)
-   HANDLE snapshot_;
-   bool started_iteration_;
--#elif defined(OS_LINUX) || defined(__GLIBC__)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(__GLIBC__)
-   DIR *procfs_dir_;
- #elif defined(OS_BSD)
-   std::vector<ProcessEntry> content;
---- mozilla-esr31/ipc/chromium/src/base/process_util_posix.cc.orig	2015-06-04 17:42:51.897626965 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/process_util_posix.cc	2015-06-04 17:42:52.026710300 -0700
[email protected]@ -110,7 +110,7 @@
- #if defined(ANDROID)
-   static const rlim_t kSystemDefaultMaxFds = 1024;
-   static const char kFDDir[] = "/proc/self/fd";
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
-   static const rlim_t kSystemDefaultMaxFds = 8192;
-   static const char kFDDir[] = "/proc/self/fd";
- #elif defined(OS_MACOSX)
[email protected]@ -202,7 +202,7 @@
- // TODO(agl): Remove this function. It's fundamentally broken for multithreaded
- // apps.
- void SetAllFDsToCloseOnExec() {
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
-   const char fd_dir[] = "/proc/self/fd";
- #elif defined(OS_MACOSX) || defined(OS_BSD)
-   const char fd_dir[] = "/dev/fd";
---- mozilla-esr31/ipc/chromium/src/base/shared_memory_posix.cc.orig	2015-06-04 17:42:51.902973938 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/shared_memory_posix.cc	2015-06-04 17:42:52.026834474 -0700
[email protected]@ -124,9 +124,15 @@
-   if (file_util::GetShmemTempDir(&temp_dir) == false)
-     return false;
- 
-+#ifndef OS_SOLARIS    
-   mem_filename = UTF8ToWide(temp_dir.value());
-   file_util::AppendToPath(&mem_filename, L"com.google.chrome.shmem." + memname);
-   *filename = mem_filename;
-+#else  
-+  *filename = (temp_dir.Append("com.google.chrome.shmem." +
-+                               WideToUTF8(memname))).ToWStringHack();
-+#endif                               
-+
-   return true;
- }
- 
[email protected]@ -246,7 +252,7 @@
-   if (memory_ == NULL)
-     return false;
- 
--  munmap(memory_, max_size_);
-+  munmap((caddr_t)memory_, max_size_);
-   memory_ = NULL;
-   max_size_ = 0;
-   return true;
---- mozilla-esr31/ipc/chromium/src/base/sys_info_posix.cc.orig	2015-06-04 17:42:51.929533186 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/sys_info_posix.cc	2015-06-04 17:42:52.027419274 -0700
[email protected]@ -119,7 +119,7 @@
- 
- // static
- std::string SysInfo::OperatingSystemName() {
--  utsname info;
-+  struct utsname info;
-   if (uname(&info) < 0) {
-     NOTREACHED();
-     return "";
[email protected]@ -129,7 +129,7 @@
- 
- // static
- std::string SysInfo::OperatingSystemVersion() {
--  utsname info;
-+  struct utsname info;
-   if (uname(&info) < 0) {
-     NOTREACHED();
-     return "";
[email protected]@ -139,7 +139,7 @@
- 
- // static
- std::string SysInfo::CPUArchitecture() {
--  utsname info;
-+  struct utsname info;
-   if (uname(&info) < 0) {
-     NOTREACHED();
-     return "";
---- mozilla-esr31/ipc/chromium/src/base/time.h.orig	2015-06-04 17:42:51.935020865 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/time.h	2015-06-04 17:42:52.027549556 -0700
[email protected]@ -62,6 +62,10 @@
-     return delta_;
-   }
- 
-+#if defined(OS_POSIX)
-+  struct timespec ToTimeSpec() const;
-+#endif
-+
-   // Returns the time delta in some unit. The F versions return a floating
-   // point value, the "regular" versions return a rounded-down value.
-   int InDays() const;
[email protected]@ -224,6 +228,10 @@
-   static Time FromDoubleT(double dt);
-   double ToDoubleT() const;
- 
-+#if defined(OS_POSIX)
-+  struct timeval ToTimeVal() const;
-+#endif
-+
- 
- #if defined(OS_WIN)
-   static Time FromFileTime(FILETIME ft);
---- mozilla-esr31/ipc/chromium/src/base/time_posix.cc.orig	2015-06-04 17:42:51.940371366 -0700
-+++ mozilla-esr31/ipc/chromium/src/base/time_posix.cc	2015-06-04 17:42:52.027684078 -0700
[email protected]@ -65,11 +65,13 @@
-   timestruct.tm_wday   = exploded.day_of_week;  // mktime/timegm ignore this
-   timestruct.tm_yday   = 0;     // mktime/timegm ignore this
-   timestruct.tm_isdst  = -1;    // attempt to figure it out
-+#ifndef OS_SOLARIS
-   timestruct.tm_gmtoff = 0;     // not a POSIX field, so mktime/timegm ignore
-   timestruct.tm_zone   = NULL;  // not a POSIX field, so mktime/timegm ignore
--
-+#endif
-+  
-   time_t seconds;
--#ifdef ANDROID
-+#if defined(ANDROID) || defined(OS_SOLARIS)
-     seconds = mktime(&timestruct);
- #else
-   if (is_local)
[email protected]@ -167,7 +169,7 @@
-   // With numer and denom = 1 (the expected case), the 64-bit absolute time
-   // reported in nanoseconds is enough to last nearly 585 years.
- 
--#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \
-+#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_POSIX) && \
-       defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
- 
-   struct timespec ts;
[email protected]@ -192,4 +194,25 @@
-   return Now();
- }
- 
-+struct timespec TimeDelta::ToTimeSpec() const {
-+  int64_t microseconds = InMicroseconds();
-+  time_t seconds = 0;
-+  if (microseconds >= Time::kMicrosecondsPerSecond) {
-+    seconds = InSeconds();
-+    microseconds -= seconds * Time::kMicrosecondsPerSecond;
-+  }
-+  struct timespec result =
-+      {seconds,
-+       microseconds * Time::kNanosecondsPerMicrosecond};
-+  return result;
-+}
-+
-+struct timeval Time::ToTimeVal() const {
-+  struct timeval result;
-+  int64_t us = us_ - kTimeTToMicrosecondsOffset;
-+  result.tv_sec = us / Time::kMicrosecondsPerSecond;
-+  result.tv_usec = us % Time::kMicrosecondsPerSecond;
-+  return result;
-+}
-+
- }  // namespace base
---- mozilla-esr31/ipc/chromium/src/build/build_config.h.orig	2015-06-04 17:42:51.945838858 -0700
-+++ mozilla-esr31/ipc/chromium/src/build/build_config.h	2015-06-04 17:42:52.027834010 -0700
[email protected]@ -4,9 +4,9 @@
- 
- // This file adds defines about the platform we're currently building on.
- //  Operating System:
--//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
-+//    OS_WIN / OS_MACOSX / OS_LINUX / OS_SOLARIS / OS_POSIX (MACOSX or LINUX)
- //  Compiler:
--//    COMPILER_MSVC / COMPILER_GCC
-+//    COMPILER_MSVC / COMPILER_GCC / COMPILER_SUNPRO
- //  Processor:
- //    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
- //    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
[email protected]@ -30,6 +30,8 @@
- #define OS_NETBSD 1
- #elif defined(__OpenBSD__)
- #define OS_OPENBSD 1
-+#elif defined(__sun__) || defined(__sun)
-+#define OS_SOLARIS 1
- #elif defined(_WIN32)
- #define OS_WIN 1
- #else
[email protected]@ -45,13 +47,15 @@
- 
- // For access to standard POSIX features, use OS_POSIX instead of a more
- // specific macro.
--#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
-+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
- #define OS_POSIX 1
- #endif
- 
- // Compiler detection.
- #if defined(__GNUC__)
- #define COMPILER_GCC 1
-+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-+#define COMPILER_SUNPRO 1
- #elif defined(_MSC_VER)
- #define COMPILER_MSVC 1
- #else
[email protected]@ -62,11 +66,11 @@
- //   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
- //   http://www.agner.org/optimize/calling_conventions.pdf
- //   or with gcc, run: "echo | gcc -E -dM -"
--#if defined(_M_X64) || defined(__x86_64__)
-+#if defined(_M_X64) || defined(__x86_64__) || defined(__x86_64)
- #define ARCH_CPU_X86_FAMILY 1
- #define ARCH_CPU_X86_64 1
- #define ARCH_CPU_64_BITS 1
--#elif defined(_M_IX86) || defined(__i386__)
-+#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
- #define ARCH_CPU_X86_FAMILY 1
- #define ARCH_CPU_X86 1
- #define ARCH_CPU_32_BITS 1
[email protected]@ -84,7 +88,7 @@
- #elif defined(__sparc64__)
- #define ARCH_CPU_SPARC 1
- #define ARCH_CPU_64_BITS 1
--#elif defined(__sparc__)
-+#elif defined(__sparc__) || defined(__sparc)
- #define ARCH_CPU_SPARC 1
- #define ARCH_CPU_32_BITS 1
- #elif defined(__mips__)
---- mozilla-esr31/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc.orig	2015-06-04 17:42:51.951499640 -0700
-+++ mozilla-esr31/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc	2015-06-04 17:42:52.027937295 -0700
[email protected]@ -4,6 +4,10 @@
- 
- #include "chrome/common/file_descriptor_set_posix.h"
- 
-+#if defined(OS_SOLARIS)
-+#include <unistd.h>
-+#endif
-+
- #include "base/eintr_wrapper.h"
- #include "base/logging.h"
- 
---- mozilla-esr31/ipc/chromium/src/chrome/common/ipc_channel_posix.h.orig	2015-06-04 17:42:51.956835709 -0700
-+++ mozilla-esr31/ipc/chromium/src/chrome/common/ipc_channel_posix.h	2015-06-04 17:42:52.028050266 -0700
[email protected]@ -111,7 +111,7 @@
-   };
- 
-   // This is a control message buffer large enough to hold kMaxReadFDs
--#if defined(OS_MACOSX) || defined(OS_NETBSD)
-+#if defined(OS_MACOSX) || defined(OS_NETBSD) || defined(OS_SOLARIS)
-   // TODO(agl): OSX appears to have non-constant CMSG macros!
-   char input_cmsg_buf_[1024];
- #else
---- mozilla-esr31/ipc/chromium/src/chrome/common/transport_dib.h.orig	2015-06-04 17:42:51.962135898 -0700
-+++ mozilla-esr31/ipc/chromium/src/chrome/common/transport_dib.h	2015-06-04 17:42:52.028183580 -0700
[email protected]@ -13,7 +13,7 @@
- 
- #if defined(OS_WIN)
- #include <windows.h>
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
- #include "chrome/common/x11_util.h"
- #endif
- 
[email protected]@ -66,7 +66,7 @@
-   typedef base::SharedMemoryHandle Handle;
-   // On Mac, the inode number of the backing file is used as an id.
-   typedef base::SharedMemoryId Id;
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_SOLARIS)
-   typedef int Handle;  // These two ints are SysV IPC shared memory keys
-   typedef int Id;
- #endif
[email protected]@ -96,7 +96,7 @@
-   // wire to give this transport DIB to another process.
-   Handle handle() const;
- 
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_SOLARIS)
-   // Map the shared memory into the X server and return an id for the shared
-   // segment.
-   XID MapToX(Display* connection);
[email protected]@ -107,7 +107,7 @@
- #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
-   explicit TransportDIB(base::SharedMemoryHandle dib);
-   base::SharedMemory shared_memory_;