aboutsummaryrefslogtreecommitdiffstats
path: root/www/firefox-esr
diff options
context:
space:
mode:
authorbeat <beat@FreeBSD.org>2014-03-20 04:46:37 +0800
committerbeat <beat@FreeBSD.org>2014-03-20 04:46:37 +0800
commit2b5d051326e7ef0112918e0fdcddcbb2da43a1eb (patch)
tree8328d62bf6a7445a78ee750e6a14a1c78a2b33ac /www/firefox-esr
parent6c418b311076e81ee151d5938e8c9e5afa83f9bb (diff)
downloadfreebsd-ports-gnome-2b5d051326e7ef0112918e0fdcddcbb2da43a1eb.tar.gz
freebsd-ports-gnome-2b5d051326e7ef0112918e0fdcddcbb2da43a1eb.tar.zst
freebsd-ports-gnome-2b5d051326e7ef0112918e0fdcddcbb2da43a1eb.zip
- Update Firefox to 28.0
- Update Firefox ESR to 24.4.0 - Update Thunderbird to 24.4.0 - Update NSPR to 4.10.4 - Update NSS to 3.15.5 - Switch GSTREAMER option for non-esr ports to depend on multimedia/gstreamer1 [2] - Switch to Uses/compiler.mk, defaults to lang/gcc47 on 8.x and 9.x - Use port dependencies for libogg, libvorbis, libopus, harfbuzz, graphite2 - Enable readahead in url-classifier, asmjs, download resume like on Linux - Build www/firefox and www/seamonkey faster using unified compilation - Unbreak build on sparc64 [1] - Workaround OPTIMIZED_CFLAGS startup crash on 8.x and 9.x - OPTIMIZED_CFLAGS is enabled by default - A few DEBUG build fixes - Add clang 3.2/3.3/3.4 workarounds for i386 - Mention known GSTREAMER issue in pkg-message Submitted by: Jan Beich PR: ports/186580 [1] Requested by: kwm [2] Security: http://www.vuxml.org/freebsd/610de647-af8d-11e3-a25b-b4b52fce4ce8.html
Diffstat (limited to 'www/firefox-esr')
-rw-r--r--www/firefox-esr/Makefile7
-rw-r--r--www/firefox-esr/distinfo4
-rw-r--r--www/firefox-esr/files/patch-bug89339777
-rw-r--r--www/firefox-esr/files/patch-bug94894638
-rw-r--r--www/firefox-esr/files/patch-bug961264266
-rw-r--r--www/firefox-esr/files/patch-bug96181648
-rw-r--r--www/firefox-esr/files/patch-bug96234518
-rw-r--r--www/firefox-esr/files/patch-bug97563463
-rw-r--r--www/firefox-esr/files/patch-bug97745727
-rw-r--r--www/firefox-esr/files/patch-clang32-libc++-visibility-hack38
-rw-r--r--www/firefox-esr/files/patch-clang34-disable-stdcall13
-rw-r--r--www/firefox-esr/files/patch-memory-jemalloc-Makefile.in10
-rw-r--r--www/firefox-esr/files/patch-z-bug847568234
-rw-r--r--www/firefox-esr/files/patch-zz-bug517422324
-rw-r--r--www/firefox-esr/pkg-message13
15 files changed, 1083 insertions, 97 deletions
diff --git a/www/firefox-esr/Makefile b/www/firefox-esr/Makefile
index 314bfe9f8dd9..74c76a9447f4 100644
--- a/www/firefox-esr/Makefile
+++ b/www/firefox-esr/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= firefox
-DISTVERSION= 24.3.0
-PORTREVISION= 2
+DISTVERSION= 24.4.0
PORTEPOCH= 1
CATEGORIES= www ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source
@@ -18,7 +17,11 @@ BUILD_DEPENDS= nspr>=4.10.2:${PORTSDIR}/devel/nspr \
sqlite3>=3.7.17:${PORTSDIR}/databases/sqlite3 \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+ harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
+ libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+ opus>=1.1:${PORTSDIR}/audio/opus \
v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
+ zip:${PORTSDIR}/archivers/zip \
unzip:${PORTSDIR}/archivers/unzip
LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l
diff --git a/www/firefox-esr/distinfo b/www/firefox-esr/distinfo
index b8f85a402c3f..2ef7d1a4281d 100644
--- a/www/firefox-esr/distinfo
+++ b/www/firefox-esr/distinfo
@@ -1,2 +1,2 @@
-SHA256 (firefox-24.3.0esr.source.tar.bz2) = 0d38dd50beffff640cfea67fcf8f44bb95c3c927ccfa225f2b937b9a4ba262b9
-SIZE (firefox-24.3.0esr.source.tar.bz2) = 119391302
+SHA256 (firefox-24.4.0esr.source.tar.bz2) = b56fb5f16e0fe42bdf9ba560a64bca3633cdea5d264f7e9beca01b7a355efd6e
+SIZE (firefox-24.4.0esr.source.tar.bz2) = 119614180
diff --git a/www/firefox-esr/files/patch-bug893397 b/www/firefox-esr/files/patch-bug893397
index 4d755c2ebb17..906f712d58dd 100644
--- a/www/firefox-esr/files/patch-bug893397
+++ b/www/firefox-esr/files/patch-bug893397
@@ -2,7 +2,7 @@ diff --git configure.in configure.in
index 549ad06..2878d9f 100644
--- configure.in
+++ configure.in
-@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in
NECKO_WIFI=1
fi
;;
@@ -15,9 +15,9 @@ diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
index 07b01de..11706af 100644
--- netwerk/wifi/moz.build
+++ netwerk/wifi/moz.build
-@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
- CMMSRCS += [
- 'osx_corewlan.mm',
+@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+ CPP_SOURCES += [
+ 'nsWifiScannerMac.cpp',
]
+elif CONFIG['OS_ARCH'] == 'FreeBSD':
+ CPP_SOURCES += [
@@ -31,7 +31,7 @@ new file mode 100644
index 0000000..80d4cb6
--- /dev/null
+++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -0,0 +1,172 @@
+@@ -0,0 +1,167 @@
+/* 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/. */
@@ -60,43 +60,39 @@ index 0000000..80d4cb6
+static nsresult
+FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
+{
-+ bool res = false;
-+ char *dupn = NULL;
-+ struct ifaddrs *ifal, *ifa;
-+ unsigned len;
-+
+ // get list of interfaces
-+ if (getifaddrs(&ifal) < 0)
++ struct ifaddrs *ifal;
++ if (getifaddrs(&ifal) < 0) {
+ return NS_ERROR_FAILURE;
++ }
+
+ accessPoints.Clear();
+
+ // loop through the interfaces
++ nsresult rv = NS_ERROR_FAILURE;
++ struct ifaddrs *ifa;
+ for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
-+ int s;
-+ struct ifreq ifr;
-+ struct ifmediareq ifmr;
-+ struct ieee80211req i802r;
-+ char iscanbuf[32*1024], *vsr;
-+
-+ memset(&ifr, 0, sizeof(ifr));
-+
-+ // list can contain duplicates, so ignore those
-+ if (dupn != NULL && strcmp(dupn, ifa->ifa_name) == 0)
++ // limit to one interface per address
++ if (ifa->ifa_addr->sa_family != AF_LINK) {
+ continue;
-+ dupn = ifa->ifa_name;
++ }
+
+ // store interface name in socket structure
++ struct ifreq ifr;
++ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name));
+ ifr.ifr_addr.sa_family = AF_LOCAL;
+
+ // open socket to interface
-+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++ int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
++ if (s < 0) {
+ continue;
++ }
+
+ // clear interface media structure
-+ (void) memset(&ifmr, 0, sizeof(ifmr));
-+ (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
++ struct ifmediareq ifmr;
++ memset(&ifmr, 0, sizeof(ifmr));
++ strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
+
+ // get interface media information
+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
@@ -111,8 +107,10 @@ index 0000000..80d4cb6
+ }
+
+ // perform WiFi scan
-+ (void) memset(&i802r, 0, sizeof(i802r));
-+ (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
++ struct ieee80211req i802r;
++ char iscanbuf[32*1024];
++ memset(&i802r, 0, sizeof(i802r));
++ strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
+ i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
+ i802r.i_data = iscanbuf;
+ i802r.i_len = sizeof(iscanbuf);
@@ -125,36 +123,33 @@ index 0000000..80d4cb6
+ close(s);
+
+ // loop through WiFi networks and build geoloc-lookup structure
-+ vsr = (char *) i802r.i_data;
-+ len = i802r.i_len;
++ char *vsr = (char *) i802r.i_data;
++ unsigned len = i802r.i_len;
+ while (len >= sizeof(struct ieee80211req_scan_result)) {
-+ struct ieee80211req_scan_result *isr;
-+ char *id;
-+ int idlen;
-+ char ssid[IEEE80211_NWID_LEN+1];
-+ nsWifiAccessPoint *ap;
-+
-+ isr = (struct ieee80211req_scan_result *) vsr;
++ struct ieee80211req_scan_result *isr =
++ (struct ieee80211req_scan_result *) vsr;
+
+ // determine size of this entry
++ char *id;
++ int idlen;
+ if (isr->isr_meshid_len) {
+ id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
+ idlen = isr->isr_meshid_len;
-+ }
-+ else {
++ } else {
+ id = vsr + isr->isr_ie_off;
+ idlen = isr->isr_ssid_len;
+ }
+
+ // copy network data
++ char ssid[IEEE80211_NWID_LEN+1];
+ strncpy(ssid, id, idlen);
+ ssid[idlen] = '\0';
-+ ap = new nsWifiAccessPoint();
++ nsWifiAccessPoint *ap = new nsWifiAccessPoint();
+ ap->setSSID(ssid, strlen(ssid));
+ ap->setMac(isr->isr_bssid);
+ ap->setSignal(isr->isr_rssi);
+ accessPoints.AppendObject(ap);
-+ res = true;
++ rv = NS_OK;
+
+ // log the data
+ LOG(( "FreeBSD access point: "
@@ -172,7 +167,7 @@ index 0000000..80d4cb6
+
+ freeifaddrs(ifal);
+
-+ return res ? NS_OK : NS_ERROR_FAILURE;
++ return rv;
+}
+
+nsresult
diff --git a/www/firefox-esr/files/patch-bug948946 b/www/firefox-esr/files/patch-bug948946
index 146668185b2c..63e35e8f550b 100644
--- a/www/firefox-esr/files/patch-bug948946
+++ b/www/firefox-esr/files/patch-bug948946
@@ -1,12 +1,26 @@
-diff --git browser/themes/moz.build browser/themes/moz.build
-index d82bda3..86d343d 100644
---- browser/themes/moz.build
-+++ browser/themes/moz.build
-@@ -9,6 +9,7 @@ toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
- if toolkit == 'cocoa':
- DIRS += ['osx']
- elif toolkit in ('gtk2', 'gtk3', 'qt'):
-+ DEFINES += ['-DXP_LINUX']
- DIRS += ['linux']
- else:
- DIRS += ['windows']
+diff --git browser/themes/shared/devtools/common.inc.css browser/themes/shared/devtools/common.inc.css
+index 268164e..922f21a 100644
+--- browser/themes/shared/devtools/common.inc.css
++++ browser/themes/shared/devtools/common.inc.css
+@@ -14,7 +14,7 @@
+ background-color: transparent;
+ background-image: linear-gradient(to bottom, hsla(209,18%,18%,0.9), hsl(210,11%,16%));
+ border-radius: 3px;
+-%ifdef XP_LINUX
++%if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
+ max-height: 32rem;
+ %else
+ max-height: 40rem;
+diff --git browser/themes/shared/devtools/highlighter.inc.css browser/themes/shared/devtools/highlighter.inc.css
+index 3d5ae51..3fb4b01 100644
+--- browser/themes/shared/devtools/highlighter.inc.css
++++ browser/themes/shared/devtools/highlighter.inc.css
+@@ -54,7 +54,7 @@ html|*.highlighter-nodeinfobar-pseudo-classes {
+ padding: 0;
+ width: 26px;
+ min-height: 26px;
+-%ifndef XP_LINUX
++%if !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_QT)
+ background-color: transparent;
+ %endif
+ }
diff --git a/www/firefox-esr/files/patch-bug961264 b/www/firefox-esr/files/patch-bug961264
new file mode 100644
index 000000000000..85bc94d001ff
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug961264
@@ -0,0 +1,266 @@
+commit d099acd
+Author: Trevor Saunders <trev.saunders@gmail.com>
+Date: Fri Jan 17 15:08:00 2014 -0800
+
+ Bug 961264 - Remove obsolete checks for gcc visibility stuff.
+---
+ configure.in | 115 +++-------------------------------------------------
+ js/src/configure.in | 111 ++------------------------------------------------
+ 2 files changed, 8 insertions(+), 218 deletions(-)
+
+diff --git configure.in configure.in
+index dfb8193..33d71b3 100644
+--- configure.in
++++ configure.in
+@@ -2507,118 +2507,15 @@ MOZ_CXX11
+
+ AC_LANG_C
+
+-dnl Check for .hidden assembler directive and visibility attribute.
+-dnl Borrowed from glibc configure.in
++dnl Setup default hidden visibility and wrapped system headers.
+ dnl ===============================================================
+ if test "$GNU_CC"; then
+- AC_CACHE_CHECK(for visibility(hidden) attribute,
+- ac_cv_visibility_hidden,
+- [cat > conftest.c <<EOF
+- int foo __attribute__ ((visibility ("hidden"))) = 1;
+-EOF
+- ac_cv_visibility_hidden=no
+- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
+- ac_cv_visibility_hidden=yes
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_hidden" = "yes"; then
+- AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
+-
+- AC_CACHE_CHECK(for visibility(default) attribute,
+- ac_cv_visibility_default,
+- [cat > conftest.c <<EOF
+- int foo __attribute__ ((visibility ("default"))) = 1;
+-EOF
+- ac_cv_visibility_default=no
+- if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
+- ac_cv_visibility_default=yes
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_default" = "yes"; then
+- AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
+-
+- AC_CACHE_CHECK(for visibility pragma support,
+- ac_cv_visibility_pragma,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+- int foo_hidden = 1;
+-#pragma GCC visibility push(default)
+- int foo_default = 1;
+-EOF
+- ac_cv_visibility_pragma=no
+- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
+- if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
+- ac_cv_visibility_pragma=yes
+- fi
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_pragma" = "yes"; then
+- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
+- ac_cv_have_visibility_class_bug,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+-struct __attribute__ ((visibility ("default"))) TestStruct {
+- static void Init();
+-};
+-__attribute__ ((visibility ("default"))) void TestFunc() {
+- TestStruct::Init();
+-}
+-EOF
+- ac_cv_have_visibility_class_bug=no
+- if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+- ac_cv_have_visibility_class_bug=yes
+- else
+- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
+- ac_cv_have_visibility_class_bug=yes
+- fi
+- fi
+- rm -rf conftest.{c,S}
+- ])
+-
+- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
+- ac_cv_have_visibility_builtin_bug,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+-#pragma GCC visibility push(default)
+-#include <string.h>
+-#pragma GCC visibility pop
+-
+-__attribute__ ((visibility ("default"))) void Func() {
+- char c[[100]];
+- memset(c, 0, sizeof(c));
+-}
+-EOF
+- ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+- ac_cv_have_visibility_builtin_bug=yes
+- else
+- if test `grep -c "@PLT" conftest.S` = 0; then
+- ac_cv_visibility_builtin_bug=yes
+- fi
+- fi
+- rm -f conftest.{c,S}
+- ])
+- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
+- "$ac_cv_have_visibility_class_bug" = "no"; then
+- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+- WRAP_SYSTEM_INCLUDES=1
+- STL_FLAGS='-I$(DIST)/stl_wrappers'
+- WRAP_STL_INCLUDES=1
+- else
+- VISIBILITY_FLAGS='-fvisibility=hidden'
+- fi # have visibility pragma bug
+- fi # have visibility pragma
+- fi # have visibility(default) attribute
+- fi # have visibility(hidden) attribute
++ AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
++ AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
++ VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
++ WRAP_SYSTEM_INCLUDES=1
++ STL_FLAGS='-I$(DIST)/stl_wrappers'
++ WRAP_STL_INCLUDES=1
+ fi # GNU_CC
+
+ # visibility hidden flag for Sun Studio on Solaris
+diff --git js/src/configure.in js/src/configure.in
+index bddd46d..d4b522e 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -2348,116 +2348,13 @@ fi
+
+ AC_LANG_C
+
+-dnl Check for .hidden assembler directive and visibility attribute.
+-dnl Borrowed from glibc configure.in
++dnl Setup default hidden visibility and wrapped system headers.
+ dnl ===============================================================
+ if test "$GNU_CC"; then
+- AC_CACHE_CHECK(for visibility(hidden) attribute,
+- ac_cv_visibility_hidden,
+- [cat > conftest.c <<EOF
+- int foo __attribute__ ((visibility ("hidden"))) = 1;
+-EOF
+- ac_cv_visibility_hidden=no
+- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
+- ac_cv_visibility_hidden=yes
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_hidden" = "yes"; then
+- AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
+-
+- AC_CACHE_CHECK(for visibility(default) attribute,
+- ac_cv_visibility_default,
+- [cat > conftest.c <<EOF
+- int foo __attribute__ ((visibility ("default"))) = 1;
+-EOF
+- ac_cv_visibility_default=no
+- if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
+- ac_cv_visibility_default=yes
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_default" = "yes"; then
+- AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
+-
+- AC_CACHE_CHECK(for visibility pragma support,
+- ac_cv_visibility_pragma,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+- int foo_hidden = 1;
+-#pragma GCC visibility push(default)
+- int foo_default = 1;
+-EOF
+- ac_cv_visibility_pragma=no
+- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+- if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
+- if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
+- ac_cv_visibility_pragma=yes
+- fi
+- fi
+- fi
+- rm -f conftest.[cs]
+- ])
+- if test "$ac_cv_visibility_pragma" = "yes"; then
+- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
+- ac_cv_have_visibility_class_bug,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+-struct __attribute__ ((visibility ("default"))) TestStruct {
+- static void Init();
+-};
+-__attribute__ ((visibility ("default"))) void TestFunc() {
+- TestStruct::Init();
+-}
+-EOF
+- ac_cv_have_visibility_class_bug=no
+- if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+- ac_cv_have_visibility_class_bug=yes
+- else
+- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
+- ac_cv_have_visibility_class_bug=yes
+- fi
+- fi
+- rm -rf conftest.{c,S}
+- ])
+-
+- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
+- ac_cv_have_visibility_builtin_bug,
+- [cat > conftest.c <<EOF
+-#pragma GCC visibility push(hidden)
+-#pragma GCC visibility push(default)
+-#include <string.h>
+-#pragma GCC visibility pop
+-
+-__attribute__ ((visibility ("default"))) void Func() {
+- char c[[100]];
+- memset(c, 0, sizeof(c));
+-}
+-EOF
+- ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+- ac_cv_have_visibility_builtin_bug=yes
+- else
+- if test `grep -c "@PLT" conftest.S` = 0; then
+- ac_cv_visibility_builtin_bug=yes
+- fi
+- fi
+- rm -f conftest.{c,S}
+- ])
+- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
+- "$ac_cv_have_visibility_class_bug" = "no"; then
+- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h'
+- WRAP_SYSTEM_INCLUDES=1
+- else
+- VISIBILITY_FLAGS='-fvisibility=hidden'
+- fi # have visibility pragma bug
+- fi # have visibility pragma
+- fi # have visibility(default) attribute
+- fi # have visibility(hidden) attribute
++ AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
++ AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
++ VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h'
++ WRAP_SYSTEM_INCLUDES=1
+ fi # GNU_CC
+
+ # visibility hidden flag for Sun Studio on Solaris
diff --git a/www/firefox-esr/files/patch-bug961816 b/www/firefox-esr/files/patch-bug961816
new file mode 100644
index 000000000000..322e73f952f6
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug961816
@@ -0,0 +1,48 @@
+diff --git config/system-headers config/system-headers
+index 8803150..ae38d68 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1158,3 +1158,4 @@ unicode/unum.h
+ unicode/ustring.h
+ #endif
+ libutil.h
++unwind.h
+diff --git configure.in configure.in
+index f452a5e..a1ebbcc 100644
+--- configure.in
++++ configure.in
+@@ -7455,7 +7455,10 @@ dnl ========================================================
+ dnl = Support for gcc stack unwinding (from gcc 3.3)
+ dnl ========================================================
+ if test -z "$SKIP_LIBRARY_CHECKS"; then
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
+ MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
++ AC_LANG_RESTORE
+ fi
+
+ dnl ========================================================
+diff --git config/system-headers config/system-headers
+index 8803150..ae38d68 100644
+--- js/src/config/system-headers
++++ js/src/config/system-headers
+@@ -1158,3 +1158,4 @@ unicode/unum.h
+ unicode/ustring.h
+ #endif
+ libutil.h
++unwind.h
+diff --git configure.in configure.in
+index f452a5e..a1ebbcc 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -7455,7 +7455,10 @@ dnl ========================================================
+ dnl = Support for gcc stack unwinding (from gcc 3.3)
+ dnl ========================================================
+ if test -z "$SKIP_LIBRARY_CHECKS"; then
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
+ MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
++ AC_LANG_RESTORE
+ fi
+
+ dnl ========================================================
diff --git a/www/firefox-esr/files/patch-bug962345 b/www/firefox-esr/files/patch-bug962345
new file mode 100644
index 000000000000..a465c93a51d1
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug962345
@@ -0,0 +1,18 @@
+diff --git config/system-headers config/system-headers
+index 8803150..ae38d68 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1159,3 +1159,4 @@ unicode/ustring.h
+ #endif
+ libutil.h
+ unwind.h
++cairo-qt.h
+diff --git config/system-headers config/system-headers
+index 8803150..ae38d68 100644
+--- js/src/config/system-headers
++++ js/src/config/system-headers
+@@ -1159,3 +1159,4 @@ unicode/ustring.h
+ #endif
+ libutil.h
+ unwind.h
++cairo-qt.h
diff --git a/www/firefox-esr/files/patch-bug975634 b/www/firefox-esr/files/patch-bug975634
new file mode 100644
index 000000000000..d41e69e83892
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug975634
@@ -0,0 +1,63 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- configure.in
++++ configure.in
+@@ -9034,6 +9034,20 @@ AC_SUBST(MOZ_FOLD_LIBS)
+ AC_SUBST(MOZ_ENABLE_SZIP)
+ AC_SUBST(MOZ_SZIP_FLAGS)
+
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++ #include <fcntl.h>],
++ [posix_fadvise(0, 0, 0, 0);],
++ [ac_cv___posix_fadvise=true],
++ [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++ AC_DEFINE(HAVE_POSIX_FADVISE)
++ AC_MSG_RESULT(yes)
++else
++ AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+ #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++ #include <fcntl.h>],
++ [posix_fadvise(0, 0, 0, 0);],
++ [ac_cv___posix_fadvise=true],
++ [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++ AC_DEFINE(HAVE_POSIX_FADVISE)
++ AC_MSG_RESULT(yes)
++else
++ AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+ #include <fcntl.h>],
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- xpcom/io/nsLocalFileUnix.cpp
++++ xpcom/io/nsLocalFileUnix.cpp
+@@ -382,7 +382,7 @@ nsLocalFile::OpenNSPRFileDesc(int32_t flags, int32_t mode, PRFileDesc **_retval)
+ PR_Delete(mPath.get());
+ }
+
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ if (flags & OS_READAHEAD) {
+ posix_fadvise(PR_FileDesc2NativeHandle(*_retval), 0, 0,
+ POSIX_FADV_SEQUENTIAL);
diff --git a/www/firefox-esr/files/patch-bug977457 b/www/firefox-esr/files/patch-bug977457
new file mode 100644
index 000000000000..cf57b6b1b809
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug977457
@@ -0,0 +1,27 @@
+diff --git xpcom/base/nsStackWalk.cpp xpcom/base/nsStackWalk.cpp
+index bb0e15b..7641267 100644
+--- xpcom/base/nsStackWalk.cpp
++++ xpcom/base/nsStackWalk.cpp
+@@ -23,6 +23,12 @@ struct CriticalAddress {
+ };
+ static CriticalAddress gCriticalAddress;
+
++// for _Unwind_Backtrace from libcxxrt or libunwind
++// cxxabi.h from libcxxrt implicitly includes unwind.h first
++#if defined(HAVE__UNWIND_BACKTRACE) && !defined(_GNU_SOURCE)
++#define _GNU_SOURCE
++#endif
++
+ #if defined(HAVE_DLOPEN) || defined(XP_MACOSX)
+ #include <dlfcn.h>
+ #endif
+@@ -1222,9 +1228,6 @@ NS_StackWalk(NS_WalkStackCallback aCallback, uint32_t aSkipFrames,
+ #elif defined(HAVE__UNWIND_BACKTRACE)
+
+ // libgcc_s.so symbols _Unwind_Backtrace@@GCC_3.3 and _Unwind_GetIP@@GCC_3.0
+-#ifndef _GNU_SOURCE
+-#define _GNU_SOURCE
+-#endif
+ #include <unwind.h>
+
+ struct unwind_info {
diff --git a/www/firefox-esr/files/patch-clang32-libc++-visibility-hack b/www/firefox-esr/files/patch-clang32-libc++-visibility-hack
deleted file mode 100644
index ccada32cbee3..000000000000
--- a/www/firefox-esr/files/patch-clang32-libc++-visibility-hack
+++ /dev/null
@@ -1,38 +0,0 @@
---- configure.in~
-+++ configure.in
-@@ -2855,6 +2855,7 @@ EOF
- #pragma GCC visibility push(hidden)
- #pragma GCC visibility push(default)
- #include <string.h>
-+#include <iterator>
- #pragma GCC visibility pop
-
- __attribute__ ((visibility ("default"))) void Func() {
-@@ -2863,7 +2864,7 @@ __attribute__ ((visibility ("default"))) void Func() {
- }
- EOF
- ac_cv_have_visibility_builtin_bug=no
-- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
-+ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
- ac_cv_have_visibility_builtin_bug=yes
- else
- if test `grep -c "@PLT" conftest.S` = 0; then
---- js/src/configure.in~
-+++ js/src/configure.in
-@@ -2855,6 +2855,7 @@ EOF
- #pragma GCC visibility push(hidden)
- #pragma GCC visibility push(default)
- #include <string.h>
-+#include <iterator>
- #pragma GCC visibility pop
-
- __attribute__ ((visibility ("default"))) void Func() {
-@@ -2863,7 +2864,7 @@ __attribute__ ((visibility ("default"))) void Func() {
- }
- EOF
- ac_cv_have_visibility_builtin_bug=no
-- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
-+ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
- ac_cv_have_visibility_builtin_bug=yes
- else
- if test `grep -c "@PLT" conftest.S` = 0; then
diff --git a/www/firefox-esr/files/patch-clang34-disable-stdcall b/www/firefox-esr/files/patch-clang34-disable-stdcall
new file mode 100644
index 000000000000..8f4bb31b9ccd
--- /dev/null
+++ b/www/firefox-esr/files/patch-clang34-disable-stdcall
@@ -0,0 +1,13 @@
+# http://llvm.org/bugs/show_bug.cgi?id=19007
+
+--- xpcom/base/nscore.h~
++++ xpcom/base/nscore.h
+@@ -110,7 +110,7 @@
+ * NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
+ */
+
+-#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2)
++#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2) && !(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ == 0)
+ #define NS_FASTCALL __attribute__ ((regparm (3), stdcall))
+ #define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))
+ #elif defined(XP_WIN) && !defined(_WIN64)
diff --git a/www/firefox-esr/files/patch-memory-jemalloc-Makefile.in b/www/firefox-esr/files/patch-memory-jemalloc-Makefile.in
new file mode 100644
index 000000000000..e02b050cbb1d
--- /dev/null
+++ b/www/firefox-esr/files/patch-memory-jemalloc-Makefile.in
@@ -0,0 +1,10 @@
+--- memory/jemalloc/Makefile.in~
++++ memory/jemalloc/Makefile.in
+@@ -12,3 +12,7 @@ include $(topsrcdir)/config/rules.mk
+ ifdef GNU_CC
+ CFLAGS += -std=gnu99
+ endif
++
++# XXX startup crash workaround for gcc47 on amd64
++jemalloc.$(OBJ_SUFFIX): OS_CFLAGS := $(filter-out -O3 -Ofast,$(OS_CFLAGS))
++jemalloc.$(OBJ_SUFFIX): MOZ_OPTIMIZE_FLAGS=
diff --git a/www/firefox-esr/files/patch-z-bug847568 b/www/firefox-esr/files/patch-z-bug847568
new file mode 100644
index 000000000000..14f7e151aa94
--- /dev/null
+++ b/www/firefox-esr/files/patch-z-bug847568
@@ -0,0 +1,234 @@
+# Allow building against system-wide graphite2/harfbuzz.
+
+diff --git config/Makefile.in config/Makefile.in
+index 14bfc0d..5383399 100644
+--- config/Makefile.in
++++ config/Makefile.in
+@@ -77,6 +77,8 @@ export:: $(export-preqs)
+ -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
+ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
++ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
++ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
+ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+ $(INSTALL) system_wrappers $(DIST)
+
+diff --git config/system-headers config/system-headers
+index 126391e..b711fc3 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1144,3 +1144,11 @@ unicode/utypes.h
+ #endif
+ libutil.h
+ unwind.h
++#if MOZ_NATIVE_GRAPHITE2==1
++graphite2/Font.h
++graphite2/Segment.h
++#endif
++#if MOZ_NATIVE_HARFBUZZ==1
++harfbuzz/hb-ot.h
++harfbuzz/hb.h
++#endif
+diff --git configure.in configure.in
+index bbc7b40..1747206 100644
+--- configure.in
++++ configure.in
+@@ -7830,6 +7830,38 @@ if test "$USE_FC_FREETYPE"; then
+ fi
+
+ dnl ========================================================
++dnl Check for graphite2 and harfbuzz
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-harfbuzz,
++[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)],
++MOZ_NATIVE_HARFBUZZ=1,
++MOZ_NATIVE_HARFBUZZ= )
++
++if test -n "$MOZ_NATIVE_HARFBUZZ"; then
++ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.16)
++else
++ MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
++fi
++AC_SUBST(MOZ_NATIVE_HARFBUZZ)
++AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
++AC_SUBST(MOZ_HARFBUZZ_LIBS)
++
++MOZ_ARG_WITH_BOOL(system-graphite2,
++[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
++MOZ_NATIVE_GRAPHITE2=1,
++MOZ_NATIVE_GRAPHITE2= )
++
++if test -n "$MOZ_NATIVE_GRAPHITE2"; then
++ PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2 >= 1.2.3)
++else
++ MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
++fi
++AC_SUBST(MOZ_NATIVE_GRAPHITE2)
++AC_SUBST(MOZ_GRAPHITE_CFLAGS)
++AC_SUBST(MOZ_GRAPHITE_LIBS)
++
++dnl ========================================================
+ dnl Check for pixman and cairo
+ dnl ========================================================
+
+@@ -8379,18 +8412,6 @@ QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFI
+ AC_SUBST(QCMS_LIBS)
+
+ dnl ========================================================
+-dnl HarfBuzz
+-dnl ========================================================
+-MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
+-AC_SUBST(MOZ_HARFBUZZ_LIBS)
+-
+-dnl ========================================================
+-dnl SIL Graphite
+-dnl ========================================================
+-MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
+-AC_SUBST(MOZ_GRAPHITE_LIBS)
+-
+-dnl ========================================================
+ dnl OTS
+ dnl ========================================================
+ MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
+diff --git content/base/src/Makefile.in content/base/src/Makefile.in
+index a618096..596901a 100644
+--- content/base/src/Makefile.in
++++ content/base/src/Makefile.in
+@@ -5,6 +5,10 @@
+
+ include $(topsrcdir)/config/rules.mk
+
++ifdef MOZ_NATIVE_HARFBUZZ
++nsContentUtils.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++endif
++
+ # gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug
+ # 585538 comment 12.)
+ ifneq (,$(INTEL_ARCHITECTURE))
+diff --git gfx/moz.build gfx/moz.build
+index 519aa46..6929751 100644
+--- gfx/moz.build
++++ gfx/moz.build
+@@ -7,6 +7,12 @@
+ if CONFIG['MOZ_TREE_CAIRO']:
+ DIRS += ['cairo']
+
++if not CONFIG['MOZ_NATIVE_GRAPHITE2']:
++ DIRS += ['graphite2/src' ]
++
++if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
++ DIRS += ['harfbuzz/src']
++
+ DIRS += [
+ '2d',
+ 'ycbcr',
+@@ -15,8 +21,6 @@ DIRS += [
+ 'qcms',
+ 'gl',
+ 'layers',
+- 'graphite2/src',
+- 'harfbuzz/src',
+ 'ots/src',
+ 'thebes',
+ 'ipc',
+diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
+index 07a77a3..067f7bd 100644
+--- gfx/skia/Makefile.in
++++ gfx/skia/Makefile.in
+@@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+ OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
+ endif
+
++ifdef MOZ_NATIVE_HARFBUZZ
++OS_CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
++endif
++
+ include $(topsrcdir)/config/rules.mk
+
+ ifneq (,$(INTEL_ARCHITECTURE))
+diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
+index e9f6b6c..0df2d8d 100644
+--- gfx/thebes/Makefile.in
++++ gfx/thebes/Makefile.in
+@@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
+ CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
+ CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
+
++ifdef MOZ_NATIVE_GRAPHITE2
++CXXFLAGS += $(MOZ_GRAPHITE_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_HARFBUZZ
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
++endif
++
+ ifeq ($(MOZ_WIDGET_TOOLKIT),android)
+ CXXFLAGS += $(CAIRO_FT_CFLAGS)
+ endif
+diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
+index f6b9f7c..11c44f4 100644
+--- intl/unicharutil/util/Makefile.in
++++ intl/unicharutil/util/Makefile.in
+@@ -21,3 +21,7 @@ ifdef _MSC_VER
+ OS_COMPILE_CXXFLAGS += -Zl
+ OS_COMPILE_CFLAGS += -Zl
+ endif
++
++ifdef MOZ_NATIVE_HARFBUZZ
++nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++endif
+diff --git layout/media/Makefile.in layout/media/Makefile.in
+index 1cacbd7..a8cd156 100644
+--- layout/media/Makefile.in
++++ layout/media/Makefile.in
+@@ -18,10 +18,16 @@ endif
+ SHARED_LIBRARY_LIBS = \
+ $(MOZ_OTS_LIBS) \
+ $(QCMS_LIBS) \
+- $(MOZ_GRAPHITE_LIBS) \
+- $(MOZ_HARFBUZZ_LIBS) \
+ $(NULL)
+
++ifndef MOZ_NATIVE_GRAPHITE2
++SHARED_LIBRARY_LIBS += $(MOZ_GRAPHITE_LIBS)
++endif
++
++ifndef MOZ_NATIVE_HARFBUZZ
++SHARED_LIBRARY_LIBS += $(MOZ_HARFBUZZ_LIBS)
++endif
++
+ ifdef MOZ_TREE_CAIRO
+ SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
+ endif
+diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
+index 1cacbd7..a8cd156 100644
+--- netwerk/dns/Makefile.in
++++ netwerk/dns/Makefile.in
+@@ -9,3 +9,7 @@ include $(topsrcdir)/config/rules.mk
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
+ $(PYTHON) $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat > etld_data.inc
++
++ifdef MOZ_NATIVE_HARFBUZZ
++nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++endif
+diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
+index 007f272..27f488e 100644
+--- toolkit/library/Makefile.in
++++ toolkit/library/Makefile.in
+@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+ EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
+ endif
+
++ifdef MOZ_NATIVE_GRAPHITE2
++EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE_LIBS)
++endif
++
++ifdef MOZ_NATIVE_HARFBUZZ
++EXTRA_DSO_LDOPTS += $(MOZ_HARFBUZZ_LIBS)
++endif
++
+ ifdef MOZ_DMD
+ EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
+ endif
diff --git a/www/firefox-esr/files/patch-zz-bug517422 b/www/firefox-esr/files/patch-zz-bug517422
new file mode 100644
index 000000000000..85db66a2acdc
--- /dev/null
+++ b/www/firefox-esr/files/patch-zz-bug517422
@@ -0,0 +1,324 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..4393ae8 100644
+--- config/Makefile.in
++++ config/Makefile.in
+@@ -79,6 +79,9 @@ export:: $(export-preqs)
+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
++ -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
++ -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++ -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
+ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+ $(INSTALL) system_wrappers $(DIST)
+
+diff --git toolkit/toolkit.mozbuild toolkit/toolkit.mozbuild
+index c22a36c..2febb45 100644
+--- toolkit/toolkit.mozbuild
++++ toolkit/toolkit.mozbuild
+@@ -64,13 +64,13 @@ add_tier_dir('platform', 'rdf')
+ if CONFIG['MOZ_JSDEBUGGER']:
+ add_tier_dir('platform', 'js/jsd')
+
+-if CONFIG['MOZ_VORBIS']:
++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
+ add_tier_dir('platform', 'media/libvorbis')
+
+ if CONFIG['MOZ_TREMOR']:
+ add_tier_dir('platform', 'media/libtremor')
+
+-if CONFIG['MOZ_OPUS']:
++if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
+ add_tier_dir('platform', 'media/libopus')
+
+ if CONFIG['MOZ_WEBM']:
+@@ -82,7 +82,9 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ
+ add_tier_dir('platform', 'media/libvpx')
+
+ if CONFIG['MOZ_OGG']:
+- add_tier_dir('platform', ['media/libogg', 'media/libtheora'])
++ if not CONFIG['MOZ_NATIVE_OGG']:
++ add_tier_dir('platform', 'media/libogg')
++ add_tier_dir('platform', 'media/libtheora')
+
+ if CONFIG['MOZ_WEBRTC']:
+ add_tier_dir('platform', [
+diff --git config/system-headers config/system-headers
+index b711fc3..fd3c14f 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1152,3 +1152,17 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.h
++ogg/os_types.h
++#endif
++#if MOZ_NATIVE_VORBIS==1
++vorbis/codec.h
++vorbis/vorbisenc.h
++#endif
++#if MOZ_NATIVE_OPUS==1
++opus.h
++opus_multistream.h
++opus/opus.h
++opus/opus_multistream.h
++#endif
+diff --git configure.in configure.in
+index df49287..05e97ff 100644
+--- configure.in
++++ configure.in
+@@ -5143,6 +5143,40 @@ if test -n "$MOZ_OGG"; then
+ fi
+
+ dnl ========================================================
++dnl Check for libogg
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-ogg,
++[ --with-system-ogg Use system libogg (located with pkgconfig)],
++MOZ_NATIVE_OGG=1,
++MOZ_NATIVE_OGG= )
++
++if test -n "$MOZ_NATIVE_OGG"; then
++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_OGG)
++AC_SUBST(MOZ_OGG_CFLAGS)
++AC_SUBST(MOZ_OGG_LIBS)
++
++dnl ========================================================
++dnl Check for libvorbis
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-vorbis,
++[ --with-system-vorbis Use system libvorbis (located with pkgconfig)],
++MOZ_NATIVE_VORBIS=1,
++MOZ_NATIVE_VORBIS= )
++
++if test -n "$MOZ_NATIVE_VORBIS"; then
++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
++fi
++
++AC_SUBST(MOZ_NATIVE_VORBIS)
++AC_SUBST(MOZ_VORBIS_CFLAGS)
++AC_SUBST(MOZ_VORBIS_LIBS)
++
++dnl ========================================================
+ dnl = Disable Opus audio codec support
+ dnl ========================================================
+ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5151,6 +5185,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+ MOZ_OPUS=1)
+
+ dnl ========================================================
++dnl Check for libopus
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-opus,
++[ --with-system-opus Use system libopus (located with pkgconfig)],
++MOZ_NATIVE_OPUS=1,
++MOZ_NATIVE_OPUS= )
++
++if test -n "$MOZ_NATIVE_OPUS"; then
++ PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
++else
++ MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include'
++fi
++
++AC_SUBST(MOZ_NATIVE_OPUS)
++AC_SUBST(MOZ_OPUS_CFLAGS)
++AC_SUBST(MOZ_OPUS_LIBS)
++
++dnl ========================================================
+ dnl = Disable VP8 decoder support
+ dnl ========================================================
+ MOZ_ARG_DISABLE_BOOL(webm,
+diff --git content/media/Makefile.in content/media/Makefile.in
+index 68f360e..76f2d57 100644
+--- content/media/Makefile.in
++++ content/media/Makefile.in
+@@ -7,4 +7,16 @@ include $(topsrcdir)/config/rules.mk
+ CFLAGS += $(GSTREAMER_CFLAGS)
+ CXXFLAGS += $(GSTREAMER_CFLAGS)
+
++ifdef MOZ_NATIVE_OGG
++CXXFLAGS += $(MOZ_OGG_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_VORBIS
++CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_OPUS
++CXXFLAGS += $(MOZ_OPUS_CFLAGS)
++endif
++
+ AudioNodeEngineNEON.$(OBJ_SUFFIX): CXXFLAGS += -mfpu=neon
+diff --git layout/media/Makefile.in layout/media/Makefile.in
+index 1cacbd7..a8cd156 100644
+--- layout/media/Makefile.in
++++ layout/media/Makefile.in
+@@ -30,12 +36,21 @@ ifdef MOZ_TREE_PIXMAN
+ SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
+ endif
+
++ifdef MOZ_OGG
++ifndef MOZ_NATIVE_OGG
++SHARED_LIBRARY_LIBS += \
++ $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
++ $(NULL)
++endif
++endif
++
+ ifdef MOZ_VORBIS
++ifndef MOZ_NATIVE_VORBIS
+ SHARED_LIBRARY_LIBS += \
+ $(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \
+- $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+ $(NULL)
+ endif
++endif
+
+ ifdef MOZ_TREMOR
+ SHARED_LIBRARY_LIBS += \
+@@ -51,10 +66,12 @@ SHARED_LIBRARY_LIBS += \
+ endif
+
+ ifdef MOZ_OPUS
++ifndef MOZ_NATIVE_OPUS
+ SHARED_LIBRARY_LIBS += \
+ $(DEPTH)/media/libopus/$(LIB_PREFIX)opus.$(LIB_SUFFIX) \
+ $(NULL)
+ endif
++endif
+
+ ifdef MOZ_WEBM
+ SHARED_LIBRARY_LIBS += \
+diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libtheora/Makefile.in
+@@ -0,0 +1,16 @@
++# 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/.
++
++DEPTH = @DEPTH@
++topsrcdir = @top_srcdir@
++srcdir = @srcdir@
++VPATH = @srcdir@
++
++include $(DEPTH)/config/autoconf.mk
++
++include $(topsrcdir)/config/rules.mk
++
++ifdef MOZ_NATIVE_OGG
++CFLAGS += $(MOZ_OGG_CFLAGS)
++endif
+diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libtremor/Makefile.in
+@@ -0,0 +1,16 @@
++# 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/.
++
++DEPTH = @DEPTH@
++topsrcdir = @top_srcdir@
++srcdir = @srcdir@
++VPATH = @srcdir@
++
++include $(DEPTH)/config/autoconf.mk
++
++include $(topsrcdir)/config/rules.mk
++
++ifdef MOZ_NATIVE_OGG
++CFLAGS += $(MOZ_OGG_CFLAGS)
++endif
+diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libvorbis/Makefile.in
+@@ -0,0 +1,16 @@
++# 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/.
++
++DEPTH = @DEPTH@
++topsrcdir = @top_srcdir@
++srcdir = @srcdir@
++VPATH = @srcdir@
++
++include $(DEPTH)/config/autoconf.mk
++
++include $(topsrcdir)/config/rules.mk
++
++ifdef MOZ_NATIVE_OGG
++CFLAGS += $(MOZ_OGG_CFLAGS)
++endif
+diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+index c5e82c4..91ef86a 100644
+--- media/webrtc/signaling/test/Makefile.in
++++ media/webrtc/signaling/test/Makefile.in
+@@ -48,6 +48,12 @@ LIBS += \
+ $(NULL)
+ endif
+
++ifdef MOZ_NATIVE_OPUS
++LIBS += \
++ $(MOZ_OPUS_LIBS) \
++ $(NULL)
++endif
++
+ ifdef MOZ_NATIVE_LIBVPX
+ LIBS += \
+ $(MOZ_LIBVPX_LIBS) \
+diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
+index 00e77e7..55f48ab 100644
+--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
++++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
+@@ -14,9 +14,9 @@
+ 'conditions': [
+ ['build_with_mozilla==1', {
+ # Mozilla provides its own build of the opus library.
+- 'include_dirs': [
+- '$(DIST)/include/opus',
+- ]
++ 'cflags_mozilla': [
++ '$(MOZ_OPUS_CFLAGS)',
++ ],
+ }, {
+ 'dependencies': [
+ '<(DEPTH)/third_party/opus/opus.gyp:opus'
+diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
+index 27f488e..cd27084 100644
+--- toolkit/library/Makefile.in
++++ toolkit/library/Makefile.in
+@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+ EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
+ endif
+
++ifdef MOZ_NATIVE_OGG
++EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
++endif
++
++ifdef MOZ_NATIVE_VORBIS
++EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
++endif
++
++ifdef MOZ_NATIVE_OPUS
++EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
++endif
++
+ ifdef MOZ_NATIVE_LIBEVENT
+ EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
+ endif
diff --git a/www/firefox-esr/pkg-message b/www/firefox-esr/pkg-message
index 33841ae90f29..7a3e4ea85d32 100644
--- a/www/firefox-esr/pkg-message
+++ b/www/firefox-esr/pkg-message
@@ -16,8 +16,17 @@ The SSH server on remote_host must allow pub key authentication.
Firefox and HTML5
-Certain functions used to display HTML5 elements need the sem module
-only on 8.x releases.
+H.264 or MP3 playback may fail due to ffmpeg/libav bug with one of
+the following messages on the terminal
+
+ (gst-plugin-scanner:13877): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-0.10/libgstffmpeg.so': /usr/local/lib/gstreamer-0.10/libgstffmpeg.so: Undefined symbol "ff_mlp_init_x86"
+ (gst-plugin-scanner:42518): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-0.10/libgstffmpeg.so': /usr/local/lib/gstreamer-0.10/libgstffmpeg.so: Undefined symbol "ff_deinterlace_line_mmx"
+
+If you happen to be affected please apply the fix in ports/181964 and
+rebuild the ports.
+
+Also, certain functions used to display HTML5 elements need the sem(4)
+module but only on 8.x releases (or before r201546).
If your Firefox crashes with the following message while viewing a
HTML5 page: