Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (3e24e7c002f0d685796ec3dec57139709a607ab9)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (3e24e7c002f0d685796ec3dec57139709a607ab9)
  • Date: Tue, 13 Dec 2022 21:43:41 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

dev/null
|binary
http/firefox/DEPENDS
| 2
http/firefox/DETAILS
| 4
http/firefox/HISTORY
| 5
http/firefox/patches/0001-Don-t-use-build-id.patch
| 64 --
http/firefox/patches/0003-Check-additional-plugins-dir.patch
| 58 --
http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
| 181 +++++++
http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
| 208 ++++++++
http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
| 181 -------
http/firefox/patches/0005-bmo-1559213-Support-system-av1.patch
| 114 ++++
http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
| 208 --------
http/firefox/patches/0006-bmo-1516803-Fix-building-sandbox.patch
| 28 +
http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
| 114 ----
http/firefox/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
| 36 -

http/firefox/patches/0007-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
| 35 +
http/firefox/patches/0008-bmo-1516803-Fix-building-sandbox.patch
| 28 -
http/firefox/patches/0008-musl-Fix-syscall-wrappers.patch
| 42 +

http/firefox/patches/0009-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
| 35 -

http/firefox/patches/0009-musl-Only-use-system-heap-reporter-with-glibc.patch
| 33 +
http/firefox/patches/0010-musl-Fix-syscall-wrappers.patch
| 42 -
http/firefox/patches/0010-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 +

http/firefox/patches/0011-musl-Only-use-system-heap-reporter-with-glibc.patch
| 33 -

http/firefox/patches/0011-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
| 28 +
http/firefox/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 -

http/firefox/patches/0012-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 51 ++

http/firefox/patches/0013-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
| 28 -

http/firefox/patches/0013-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
| 28 +

http/firefox/patches/0014-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
| 27 +

http/firefox/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 51 --
http/firefox/patches/0015-Make-PGO-use-toolchain.patch
| 33 +

http/firefox/patches/0015-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
| 28 -

http/firefox/patches/0016-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
| 55 ++

http/firefox/patches/0016-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
| 27 -
http/firefox/patches/0017-Make-PGO-use-toolchain.patch
| 33 -

http/firefox/patches/0017-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
| 32 +
http/firefox/patches/0018-Fix-building-with-PGO-when-using-GCC.patch
| 84 +++

http/firefox/patches/0018-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
| 55 --

http/firefox/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
| 32 -

http/firefox/patches/0019-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
| 28 +
http/firefox/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
| 84 ---
http/firefox/patches/0020-build-Disable-Werror.patch
| 24

http/firefox/patches/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 +

http/firefox/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
| 28 -

http/firefox/patches/0022-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 23
http/firefox/patches/0022-build-Disable-Werror.patch
| 24

http/firefox/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 -

http/firefox/patches/0023-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
| 96 +++

http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 23

http/firefox/patches/0024-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 37 +
http/firefox/patches/0025-bgo-816975-fix-build-on-x86.patch
| 16

http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
| 96 ---
http/firefox/patches/0026-bmo-1559213-fix-system-av1-libs.patch
| 23

http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 37 -
http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
| 16
http/firefox/patches/0027-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
| 23
http/firefox/patches/0028-bmo-1754469-memory_mozalloc_throw.patch
| 69 ++
http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox/patches/0029-rhbz-2115253-vaapi-fixes.patch
| 20
http/firefox/patches/0030-bgo-860033-firefox-wayland-no-dbus.patch
| 49 +
http/firefox/patches/0030-bmo-1754469-memory_mozalloc_throw.patch
| 69 --
http/firefox/patches/0031-bmo-1769631-python-3.11-compatibility.patch
| 30 -
http/firefox/patches/0031-bmo-1775202-ppc64-webrtc-missing-conditions.patch
| 17
http/firefox/patches/0032-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
| 55 ++
http/firefox/patches/0032-rhbz-2115253-vaapi-fixes.patch
| 20
http/firefox/patches/0033-bgo-860033-firefox-wayland-no-dbus.patch
| 49 -
http/firefox/patches/0033-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
| 22
http/firefox/patches/0034-bgo-877267-rust-opaque-binding-type.patch
| 253 ++++++++++
http/firefox/patches/0034-bmo-1775202-ppc64-webrtc-missing-conditions.patch
| 17
http/firefox/patches/0035-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
| 55 --
http/firefox/patches/0036-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
| 22
http/firefox/patches/0037-bgo-877267-rust-opaque-binding-type.patch
| 253 ----------
72 files changed, 1819 insertions(+), 1954 deletions(-)

New commits:
commit 3e24e7c002f0d685796ec3dec57139709a607ab9
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

http/firefox: version 108.0, SECURITY_PATCH++

diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index 7139fa7..01e85b3 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -40,7 +40,7 @@ depends libwebp "--with-system-webp"
&&

depends nspr "--with-system-nspr" &&

-local NSS_BRANCH="3.84" &&
+local NSS_BRANCH="3.85" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
diff --git a/http/firefox/DETAILS b/http/firefox/DETAILS
index 9d12111..1e80891 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,6 +1,6 @@
SPELL=firefox
- VERSION=107.0.1
- SECURITY_PATCH=170
+ VERSION=108.0
+ SECURITY_PATCH=171
SOURCE="${SPELL}-${VERSION}.source.tar.xz"

SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}";
SOURCE2="${SOURCE}.asc"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index 4fd5116..9e2a56e 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2022-12-13 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 108.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.85
+ * patches/*: updated
+
2022-11-29 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 107.0.1
* patches/*: updated
diff --git a/http/firefox/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp
b/http/firefox/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp
deleted file mode 100644
index 73b00ef..0000000
Binary files a/http/firefox/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp
and /dev/null differ
diff --git a/http/firefox/patches/0001-Don-t-use-build-id.patch
b/http/firefox/patches/0001-Don-t-use-build-id.patch
index 27c2fc3..fdf4457 100644
--- a/http/firefox/patches/0001-Don-t-use-build-id.patch
+++ b/http/firefox/patches/0001-Don-t-use-build-id.patch
@@ -1,54 +1,38 @@
-From db2794973f8a5e580fbceacbfb1b6469c9f162d7 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:14:26 +0200
-Subject: [PATCH 01/30] Don't use build id
-
-We must drop build id as it causes conflicts when merging
-thunderbird/firefox/seamonkey on same system when using
-splitdebug.
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- js/src/old-configure.in | 7 -------
- old-configure.in | 7 -------
- 2 files changed, 14 deletions(-)
-
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
-index 905494b784..15a7a2a852 100644
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -350,13 +350,6 @@ if test "$GNU_CC"; then
+diff -Naur a/js/src/old-configure.in b/js/src/old-configure.in
+--- a/js/src/old-configure.in 2022-12-13 07:48:54.317336755 +0200
++++ b/js/src/old-configure.in 2022-12-13 07:49:43.722154247 +0200
+@@ -255,15 +255,6 @@
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)

-- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
-- _SAVE_LDFLAGS=$LDFLAGS
-- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
-- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-- AC_MSG_RESULT([no])
-- LDFLAGS=$_SAVE_LDFLAGS)
+- if test -z "$DEVELOPER_OPTIONS" -o "$OS_TARGET" = "Android"; then
+- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+- fi
-
_DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
fi

-diff --git a/old-configure.in b/old-configure.in
-index d1479574d1..f69f5f5456 100644
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -337,13 +337,6 @@ if test "$GNU_CC"; then
+diff -Naur a/old-configure.in b/old-configure.in
+--- a/old-configure.in 2022-12-13 07:48:54.169334306 +0200
++++ b/old-configure.in 2022-12-13 07:50:01.182443153 +0200
+@@ -269,15 +269,6 @@
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)

-- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
-- _SAVE_LDFLAGS=$LDFLAGS
-- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
-- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-- AC_MSG_RESULT([no])
-- LDFLAGS=$_SAVE_LDFLAGS)
+- if test -z "$DEVELOPER_OPTIONS" -o "$OS_TARGET" = "Android"; then
+- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+- fi
-
AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
_SAVE_LDFLAGS=$LDFLAGS
---
-2.34.1
-
diff --git a/http/firefox/patches/0003-Check-additional-plugins-dir.patch
b/http/firefox/patches/0003-Check-additional-plugins-dir.patch
deleted file mode 100644
index ef66d9b..0000000
--- a/http/firefox/patches/0003-Check-additional-plugins-dir.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 4d5eb53fa2ca9eeeadbfcd2be832aa8e97d413fc Mon Sep 17 00:00:00 2001
-From: Arfrever Frehtes Taifersar Arahesis <Arfrever AT Apache.Org>
-Date: Mon, 6 Apr 2020 19:17:43 +0200
-Subject: [PATCH 03/30] Check additional plugins dir
-
-Check original plugins dir along with default plugins dir.
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- xpcom/io/nsAppFileLocationProvider.cpp | 18 +++++++++++++++++-
- 1 file changed, 17 insertions(+), 1 deletion(-)
-
-diff --git a/xpcom/io/nsAppFileLocationProvider.cpp
b/xpcom/io/nsAppFileLocationProvider.cpp
-index ef974f9904..6261eafcc8 100644
---- a/xpcom/io/nsAppFileLocationProvider.cpp
-+++ b/xpcom/io/nsAppFileLocationProvider.cpp
-@@ -50,6 +50,7 @@
- # define NS_MACOSX_LOCAL_PLUGIN_DIR "OSXLocalPlugins"
- #elif XP_UNIX
- # define NS_SYSTEM_PLUGINS_DIR "SysPlugins"
-+# define NS_SYSTEM_NSBROWSER_PLUGINS_DIR "SysNsBrowserPlugins"
- #endif
-
- #define DEFAULTS_DIR_NAME "defaults"_ns
-@@ -172,6 +173,21 @@ nsAppFileLocationProvider::GetFile(const char* aProp,
bool* aPersistent,
- getter_AddRefs(localFile));
- # else
- rv = NS_ERROR_FAILURE;
-+# endif
-+ } else if (nsCRT::strcmp(aProp, NS_SYSTEM_NSBROWSER_PLUGINS_DIR) == 0) {
-+# ifdef ENABLE_SYSTEM_EXTENSION_DIRS
-+ static const char* const sysLPlgDir =
-+# if defined(HAVE_USR_LIB64_DIR) && defined(__LP64__)
-+ "/usr/lib64/nsbrowser/plugins";
-+# elif defined(__OpenBSD__) || defined(__FreeBSD__)
-+ "/usr/local/lib/nsbrowser/plugins";
-+# else
-+ "/usr/lib/nsbrowser/plugins";
-+# endif
-+ rv = NS_NewNativeLocalFile(nsDependentCString(sysLPlgDir), false,
-+ getter_AddRefs(localFile));
-+# else
-+ rv = NS_ERROR_FAILURE;
- # endif
- }
- # endif
-@@ -418,7 +434,7 @@ nsAppFileLocationProvider::GetFiles(const char* aProp,
- #else
- # ifdef XP_UNIX
- static const char* keys[] = {NS_USER_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR,
-- nullptr};
-+ NS_SYSTEM_NSBROWSER_PLUGINS_DIR, nullptr};
- # else
- static const char* keys[] = {NS_USER_PLUGINS_DIR, nullptr};
- # endif
---
-2.34.1
-
diff --git
a/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
new file mode 100644
index 0000000..37ecef5
--- /dev/null
+++ b/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
@@ -0,0 +1,181 @@
+From 61e8f03c526a40dda89b57aad6aec3f37d7125cd Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:32:39 +0200
+Subject: [PATCH 04/30] bmo#847568: Support system harfbuzz
+
+Allow building against system-wide harfbuzz.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 7 +++++++
+ dom/base/moz.build | 3 +++
+ gfx/moz.build | 4 +++-
+ gfx/skia/generate_mozbuild.py | 3 +++
+ gfx/skia/moz.build | 3 +++
+ gfx/thebes/moz.build | 3 +++
+ intl/unicharutil/util/moz.build | 3 +++
+ netwerk/dns/moz.build | 3 +++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 9 +++++++++
+ 10 files changed, 40 insertions(+), 1 deletion(-)
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index ae0c9d6d7c..44d08cf06b 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
+ 'vr/gvr/capi/include/gvr.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ system_headers += [
++ 'harfbuzz/hb-glib.h',
++ 'harfbuzz/hb-ot.h',
++ 'harfbuzz/hb.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/dom/base/moz.build b/dom/base/moz.build
+index d390adfc49..4508f19cb6 100644
+--- a/dom/base/moz.build
++++ b/dom/base/moz.build
+@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
+ if CONFIG["MOZ_X11"]:
+ CXXFLAGS += CONFIG["TK_CFLAGS"]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ GeneratedFile(
+ "UseCounterList.h",
+ script="gen-usecounters.py",
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 4d6d63da9d..8222b72333 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -10,6 +10,9 @@ with Files("**"):
+ with Files("wr/**"):
+ BUG_COMPONENT = ("Core", "Graphics: WebRender")
+
++if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ DIRS += ["harfbuzz/src"]
++
+ DIRS += [
+ "cairo",
+ "2d",
+@@ -20,7 +23,6 @@ DIRS += [
+ "gl",
+ "layers",
+ "graphite2/src",
+- "harfbuzz/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
+index 5e0fd17d79..860b80af4f 100755
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
+ LOCAL_INCLUDES += [
+ "/gfx/cairo/cairo/src",
+diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+index 524bd28dac..615c93b266 100755
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
+ LOCAL_INCLUDES += [
+ "/gfx/cairo/cairo/src",
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index baa6f090a9..c51c36e2b4 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -288,6 +288,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+ DEFINES["GRAPHITE2_STATIC"] = True
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
+ # Suppress warnings from Skia header files.
+ SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
+diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
+index 301eb9a854..7cece5e06c 100644
+--- a/intl/unicharutil/util/moz.build
++++ b/intl/unicharutil/util/moz.build
+@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
+ "nsUnicodeProperties.cpp",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ GeneratedFile(
+diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
+index f769e270fa..8f64710257 100644
+--- a/netwerk/dns/moz.build
++++ b/netwerk/dns/moz.build
+@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
+ "/netwerk/protocol/http",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ USE_LIBS += ["icu"]
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index 2c3f86948e..dd6901ba9a 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ "-lgvr",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_JPEG"]:
+ OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 00698656f6..1843188d11 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -460,6 +460,15 @@ add_old_configure_assignment(
+ )
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
++# HarfBuzz
++# ==============================================================
++option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
++
++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
++ when='--with-system-harfbuzz')
++
++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _:
True))
++
+ # Apple platform decoder support
+ # ==============================================================
+ @depends(toolkit)
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
b/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
new file mode 100644
index 0000000..74d9b24
--- /dev/null
+++ b/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
@@ -0,0 +1,208 @@
+From a7761d4886498eaa0e83d1c9b4399632cdbf314e Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:34:44 +0200
+Subject: [PATCH 05/30] bmo#847568: Support system graphite2
+
+Allow building against system-wide graphite2.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 6 ++++++
+ gfx/graphite2/geckoextra/moz.build | 21 +++++++++++++++++++++
+ gfx/graphite2/moz-gr-update.sh | 7 ++++++-
+ gfx/moz.build | 6 +++++-
+ gfx/thebes/moz.build | 5 ++++-
+ old-configure.in | 21 +++++++++++++++++++++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 13 +++++++++++++
+ 8 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 gfx/graphite2/geckoextra/moz.build
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 44d08cf06b..2f7ae39515 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ 'harfbuzz/hb.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ system_headers += [
++ 'graphite2/Font.h',
++ 'graphite2/Segment.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
+new file mode 100644
+index 0000000000..24e8d7a032
+--- /dev/null
++++ b/gfx/graphite2/geckoextra/moz.build
+@@ -0,0 +1,21 @@
++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
++# 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/.
++
++EXPORTS.graphite2 += [
++ 'include/GraphiteExtra.h',
++ 'include/GraphiteStructsForRLBox.h',
++]
++
++UNIFIED_SOURCES += [
++ '../geckoextra/src/GraphiteExtra.cpp',
++]
++
++CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
++
++# Match bundled graphite2 configuration
++AllowCompilerWarnings()
++
++FINAL_LIBRARY = 'gkmedias'
+diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
+index b91d9c161c..a97e6eb203 100755
+--- a/gfx/graphite2/moz-gr-update.sh
++++ b/gfx/graphite2/moz-gr-update.sh
+@@ -1,6 +1,7 @@
+ #!/bin/bash
+
+ # Script used to update the Graphite2 library in the mozilla source tree
++# and bump version for --with-system-graphite2
+
+ # This script lives in gfx/graphite2, along with the library source,
+ # but must be run from the top level of the mozilla-central tree.
+@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
gfx/graphite2/README.mozilla
+ #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+
++# chase version for --with-system-graphite2
++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
++ if /GR2_VERSION_REQUIRE/" old-configure.in
++
+ # summarize what's been touched
+ echo Updated to $RELEASE.
+ echo Here is what changed in the gfx/graphite2 directory:
+ echo
+
+-hg stat gfx/graphite2
++hg stat old-configure.in gfx/graphite2
+
+ echo
+ echo If gfx/graphite2/src/files.mk has changed, please make corresponding
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 8222b72333..16a2b401db 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -10,6 +10,11 @@ with Files("**"):
+ with Files("wr/**"):
+ BUG_COMPONENT = ("Core", "Graphics: WebRender")
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ DIRS += ["graphite2/geckoextra"]
++else:
++ DIRS += ["graphite2/src"]
++
+ if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ DIRS += ["harfbuzz/src"]
+
+@@ -22,7 +27,6 @@ DIRS += [
+ "qcms",
+ "gl",
+ "layers",
+- "graphite2/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index c51c36e2b4..4f02a9e2a5 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:
+
+ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+-DEFINES["GRAPHITE2_STATIC"] = True
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
++else:
++ DEFINES["GRAPHITE2_STATIC"] = True
+
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+diff --git a/old-configure.in b/old-configure.in
+index f69f5f5456..1c1c8ecef3 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -2204,6 +2204,27 @@ if test "$USE_FC_FREETYPE"; then
+ fi
+ fi
+
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
++ dnl graphite2.pc has bogus version, check manually
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
++ AC_TRY_COMPILE([ #include <graphite2/Font.h>
++ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
++ ( GR2_VERSION_MAJOR * 10000 +
GR2_VERSION_MINOR \
++ * 100 + GR2_VERSION_BUGFIX >= \
++ (major) * 10000 + (minor) * 100 + (bugfix) )
++ ], [
++ #if !GR2_VERSION_REQUIRE(1,3,8)
++ #error "Insufficient graphite2 version."
++ #endif
++ ], [],
++ [AC_MSG_ERROR([--with-system-graphite2 requested but no
working libgraphite2 found])])
++ CFLAGS=$_SAVE_CFLAGS
++fi
++
+ dnl ========================================================
+ dnl Check if we need the 32-bit Linux SSE2 error dialog
+ dnl ========================================================
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index dd6901ba9a..be73ac4bee 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ "-lgvr",
+ ]
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 1843188d11..a68e1b347d 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -460,6 +460,19 @@ add_old_configure_assignment(
+ )
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
++# Graphite2
++# ==============================================================
++option('--with-system-graphite2', help="Use system graphite2 (located with
pkgconfig)")
++
++@depends('--with-system-graphite2')
++def check_for_graphite2(value):
++ return bool(value)
++
++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
++ when=check_for_graphite2)
++
++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _:
True))
++
+ # HarfBuzz
+ # ==============================================================
+ option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
deleted file mode 100644
index 37ecef5..0000000
--- a/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From 61e8f03c526a40dda89b57aad6aec3f37d7125cd Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:32:39 +0200
-Subject: [PATCH 04/30] bmo#847568: Support system harfbuzz
-
-Allow building against system-wide harfbuzz.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/system-headers.mozbuild | 7 +++++++
- dom/base/moz.build | 3 +++
- gfx/moz.build | 4 +++-
- gfx/skia/generate_mozbuild.py | 3 +++
- gfx/skia/moz.build | 3 +++
- gfx/thebes/moz.build | 3 +++
- intl/unicharutil/util/moz.build | 3 +++
- netwerk/dns/moz.build | 3 +++
- toolkit/library/moz.build | 3 +++
- toolkit/moz.configure | 9 +++++++++
- 10 files changed, 40 insertions(+), 1 deletion(-)
-
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index ae0c9d6d7c..44d08cf06b 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
- 'vr/gvr/capi/include/gvr.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ system_headers += [
-+ 'harfbuzz/hb-glib.h',
-+ 'harfbuzz/hb-ot.h',
-+ 'harfbuzz/hb.h',
-+ ]
-+
- if CONFIG['MOZ_JACK']:
- system_headers += [
- 'jack/jack.h',
-diff --git a/dom/base/moz.build b/dom/base/moz.build
-index d390adfc49..4508f19cb6 100644
---- a/dom/base/moz.build
-+++ b/dom/base/moz.build
-@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
- if CONFIG["MOZ_X11"]:
- CXXFLAGS += CONFIG["TK_CFLAGS"]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- GeneratedFile(
- "UseCounterList.h",
- script="gen-usecounters.py",
-diff --git a/gfx/moz.build b/gfx/moz.build
-index 4d6d63da9d..8222b72333 100644
---- a/gfx/moz.build
-+++ b/gfx/moz.build
-@@ -10,6 +10,9 @@ with Files("**"):
- with Files("wr/**"):
- BUG_COMPONENT = ("Core", "Graphics: WebRender")
-
-+if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ DIRS += ["harfbuzz/src"]
-+
- DIRS += [
- "cairo",
- "2d",
-@@ -20,7 +23,6 @@ DIRS += [
- "gl",
- "layers",
- "graphite2/src",
-- "harfbuzz/src",
- "ots/src",
- "thebes",
- "ipc",
-diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index 5e0fd17d79..860b80af4f 100755
---- a/gfx/skia/generate_mozbuild.py
-+++ b/gfx/skia/generate_mozbuild.py
-@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
- '-Wno-unused-private-field',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
- LOCAL_INCLUDES += [
- "/gfx/cairo/cairo/src",
-diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 524bd28dac..615c93b266 100755
---- a/gfx/skia/moz.build
-+++ b/gfx/skia/moz.build
-@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
- '-Wno-unused-private-field',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
- LOCAL_INCLUDES += [
- "/gfx/cairo/cairo/src",
-diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index baa6f090a9..c51c36e2b4 100644
---- a/gfx/thebes/moz.build
-+++ b/gfx/thebes/moz.build
-@@ -288,6 +288,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
-
- DEFINES["GRAPHITE2_STATIC"] = True
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
- # Suppress warnings from Skia header files.
- SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
-diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
-index 301eb9a854..7cece5e06c 100644
---- a/intl/unicharutil/util/moz.build
-+++ b/intl/unicharutil/util/moz.build
-@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
- "nsUnicodeProperties.cpp",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- include("/ipc/chromium/chromium-config.mozbuild")
-
- GeneratedFile(
-diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index f769e270fa..8f64710257 100644
---- a/netwerk/dns/moz.build
-+++ b/netwerk/dns/moz.build
-@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
- "/netwerk/protocol/http",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- USE_LIBS += ["icu"]
-diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index 2c3f86948e..dd6901ba9a 100644
---- a/toolkit/library/moz.build
-+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
- "-lgvr",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
-+
- if CONFIG["MOZ_SYSTEM_JPEG"]:
- OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
-
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 00698656f6..1843188d11 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -460,6 +460,15 @@ add_old_configure_assignment(
- )
- set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
-
-+# HarfBuzz
-+# ==============================================================
-+option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
-+
-+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
-+ when='--with-system-harfbuzz')
-+
-+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _:
True))
-+
- # Apple platform decoder support
- # ==============================================================
- @depends(toolkit)
---
-2.34.1
-
diff --git a/http/firefox/patches/0005-bmo-1559213-Support-system-av1.patch
b/http/firefox/patches/0005-bmo-1559213-Support-system-av1.patch
new file mode 100644
index 0000000..e894258
--- /dev/null
+++ b/http/firefox/patches/0005-bmo-1559213-Support-system-av1.patch
@@ -0,0 +1,114 @@
+From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:36:02 +0200
+Subject: [PATCH 06/30] bmo#1559213: Support system av1
+
+Allow building against system-wide av1.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/external/moz.build | 5 +++--
+ config/system-headers.mozbuild | 8 ++++++++
+ dom/media/platforms/moz.build | 5 +++++
+ toolkit/moz.configure | 20 ++++++++++++++++++--
+ 4 files changed, 34 insertions(+), 4 deletions(-)
+
+diff --git a/config/external/moz.build b/config/external/moz.build
+index ab771212bf..75595d999c 100644
+--- a/config/external/moz.build
++++ b/config/external/moz.build
+@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
+ external_dirs += ["media/libvpx"]
+
+ if CONFIG["MOZ_AV1"]:
+- external_dirs += ["media/libaom"]
+- external_dirs += ["media/libdav1d"]
++ if not CONFIG["MOZ_SYSTEM_AV1"]:
++ external_dirs += ["media/libaom"]
++ external_dirs += ["media/libdav1d"]
+
+ if not CONFIG["MOZ_SYSTEM_PNG"]:
+ external_dirs += ["media/libpng"]
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 2f7ae39515..96ab3a6466 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
+ 'proxy.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_AV1']:
++ system_headers += [
++ 'aom/aom_decoder.h',
++ 'aom/aomdx.h',
++ 'aom/aom_image.h',
++ 'dav1d/dav1d.h',
++ ]
++
+ if CONFIG['MOZ_SYSTEM_LIBVPX']:
+ system_headers += [
+ 'vpx_mem/vpx_mem.h',
+diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+index 8509aec6ef..7c5a1df63d 100644
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
+ "agnostic/AOMDecoder.cpp",
+ "agnostic/DAV1DDecoder.cpp",
+ ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
+
+ if CONFIG["MOZ_OMX"]:
+ EXPORTS += [
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index a68e1b347d..7b7975bd12 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -544,14 +544,29 @@ def av1(value):
+ if value:
+ return True
+
++option("--with-system-av1", help="Use system av1 (located with pkg-config)")
+
+-@depends(target, when=av1 & compile_environment)
++system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
++ when='--with-system-av1')
++
++system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >=
0.1.1',
++ when='--with-system-av1')
++
++@depends(system_libaom_info, system_libdav1d_info)
++def system_av1(system_libaom_info, system_libdav1d_info):
++ has_av1_libs = False
++ if system_libaom_info and system_libdav1d_info:
++ has_av1_libs = True
++ return has_av1_libs
++
++
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_asm(target):
+ if target.cpu in ("aarch64", "x86", "x86_64"):
+ return True
+
+
+-@depends(target, when=av1 & compile_environment)
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_nasm(target):
+ if target.cpu in ("x86", "x86_64"):
+ return namespace(version="2.14", what="AV1")
+@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
+ set_define("MOZ_DAV1D_ASM", dav1d_asm)
+ set_config("MOZ_AV1", av1)
+ set_define("MOZ_AV1", av1)
++set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
+
+ # JXL Image Codec Support
+ # ==============================================================
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
b/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
deleted file mode 100644
index 74d9b24..0000000
--- a/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From a7761d4886498eaa0e83d1c9b4399632cdbf314e Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:34:44 +0200
-Subject: [PATCH 05/30] bmo#847568: Support system graphite2
-
-Allow building against system-wide graphite2.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/system-headers.mozbuild | 6 ++++++
- gfx/graphite2/geckoextra/moz.build | 21 +++++++++++++++++++++
- gfx/graphite2/moz-gr-update.sh | 7 ++++++-
- gfx/moz.build | 6 +++++-
- gfx/thebes/moz.build | 5 ++++-
- old-configure.in | 21 +++++++++++++++++++++
- toolkit/library/moz.build | 3 +++
- toolkit/moz.configure | 13 +++++++++++++
- 8 files changed, 79 insertions(+), 3 deletions(-)
- create mode 100644 gfx/graphite2/geckoextra/moz.build
-
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 44d08cf06b..2f7ae39515 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
- 'harfbuzz/hb.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
-+ system_headers += [
-+ 'graphite2/Font.h',
-+ 'graphite2/Segment.h',
-+ ]
-+
- if CONFIG['MOZ_JACK']:
- system_headers += [
- 'jack/jack.h',
-diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
-new file mode 100644
-index 0000000000..24e8d7a032
---- /dev/null
-+++ b/gfx/graphite2/geckoextra/moz.build
-@@ -0,0 +1,21 @@
-+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-+# 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/.
-+
-+EXPORTS.graphite2 += [
-+ 'include/GraphiteExtra.h',
-+ 'include/GraphiteStructsForRLBox.h',
-+]
-+
-+UNIFIED_SOURCES += [
-+ '../geckoextra/src/GraphiteExtra.cpp',
-+]
-+
-+CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
-+
-+# Match bundled graphite2 configuration
-+AllowCompilerWarnings()
-+
-+FINAL_LIBRARY = 'gkmedias'
-diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
-index b91d9c161c..a97e6eb203 100755
---- a/gfx/graphite2/moz-gr-update.sh
-+++ b/gfx/graphite2/moz-gr-update.sh
-@@ -1,6 +1,7 @@
- #!/bin/bash
-
- # Script used to update the Graphite2 library in the mozilla source tree
-+# and bump version for --with-system-graphite2
-
- # This script lives in gfx/graphite2, along with the library source,
- # but must be run from the top level of the mozilla-central tree.
-@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
gfx/graphite2/README.mozilla
- #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
- #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
-
-+# chase version for --with-system-graphite2
-+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
-+ if /GR2_VERSION_REQUIRE/" old-configure.in
-+
- # summarize what's been touched
- echo Updated to $RELEASE.
- echo Here is what changed in the gfx/graphite2 directory:
- echo
-
--hg stat gfx/graphite2
-+hg stat old-configure.in gfx/graphite2
-
- echo
- echo If gfx/graphite2/src/files.mk has changed, please make corresponding
-diff --git a/gfx/moz.build b/gfx/moz.build
-index 8222b72333..16a2b401db 100644
---- a/gfx/moz.build
-+++ b/gfx/moz.build
-@@ -10,6 +10,11 @@ with Files("**"):
- with Files("wr/**"):
- BUG_COMPONENT = ("Core", "Graphics: WebRender")
-
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ DIRS += ["graphite2/geckoextra"]
-+else:
-+ DIRS += ["graphite2/src"]
-+
- if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- DIRS += ["harfbuzz/src"]
-
-@@ -22,7 +27,6 @@ DIRS += [
- "qcms",
- "gl",
- "layers",
-- "graphite2/src",
- "ots/src",
- "thebes",
- "ipc",
-diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index c51c36e2b4..4f02a9e2a5 100644
---- a/gfx/thebes/moz.build
-+++ b/gfx/thebes/moz.build
-@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:
-
- LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
-
--DEFINES["GRAPHITE2_STATIC"] = True
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
-+else:
-+ DEFINES["GRAPHITE2_STATIC"] = True
-
- if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-diff --git a/old-configure.in b/old-configure.in
-index f69f5f5456..1c1c8ecef3 100644
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -2204,6 +2204,27 @@ if test "$USE_FC_FREETYPE"; then
- fi
- fi
-
-+dnl ========================================================
-+dnl Check for graphite2
-+dnl ========================================================
-+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
-+ dnl graphite2.pc has bogus version, check manually
-+ _SAVE_CFLAGS=$CFLAGS
-+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
-+ AC_TRY_COMPILE([ #include <graphite2/Font.h>
-+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
-+ ( GR2_VERSION_MAJOR * 10000 +
GR2_VERSION_MINOR \
-+ * 100 + GR2_VERSION_BUGFIX >= \
-+ (major) * 10000 + (minor) * 100 + (bugfix) )
-+ ], [
-+ #if !GR2_VERSION_REQUIRE(1,3,8)
-+ #error "Insufficient graphite2 version."
-+ #endif
-+ ], [],
-+ [AC_MSG_ERROR([--with-system-graphite2 requested but no
working libgraphite2 found])])
-+ CFLAGS=$_SAVE_CFLAGS
-+fi
-+
- dnl ========================================================
- dnl Check if we need the 32-bit Linux SSE2 error dialog
- dnl ========================================================
-diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index dd6901ba9a..be73ac4bee 100644
---- a/toolkit/library/moz.build
-+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
- "-lgvr",
- ]
-
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
-+
- if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
-
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 1843188d11..a68e1b347d 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -460,6 +460,19 @@ add_old_configure_assignment(
- )
- set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
-
-+# Graphite2
-+# ==============================================================
-+option('--with-system-graphite2', help="Use system graphite2 (located with
pkgconfig)")
-+
-+@depends('--with-system-graphite2')
-+def check_for_graphite2(value):
-+ return bool(value)
-+
-+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
-+ when=check_for_graphite2)
-+
-+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _:
True))
-+
- # HarfBuzz
- # ==============================================================
- option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
---
-2.34.1
-
diff --git a/http/firefox/patches/0006-bmo-1516803-Fix-building-sandbox.patch
b/http/firefox/patches/0006-bmo-1516803-Fix-building-sandbox.patch
new file mode 100644
index 0000000..24333b2
--- /dev/null
+++ b/http/firefox/patches/0006-bmo-1516803-Fix-building-sandbox.patch
@@ -0,0 +1,28 @@
+From 6eeeca1b673a60d3e51427b2a5cf3e916bdb012b Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:44:28 +0200
+Subject: [PATCH 09/30] bmo#1516803: Fix building sandbox
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
+Bug: https://bugs.gentoo.org/666580
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/linux/moz.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+index 573f667812..e62d1a99a4 100644
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -116,7 +116,7 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+ # forcing there to be only one partition.
+ for f in CONFIG["OS_CXXFLAGS"]:
+ if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
+- LDFLAGS += ["--param lto-partitions=1"]
++ LDFLAGS += ["--param", "lto-partitions=1"]
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
+--
+2.34.1
+
diff --git a/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
b/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
deleted file mode 100644
index e894258..0000000
--- a/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:36:02 +0200
-Subject: [PATCH 06/30] bmo#1559213: Support system av1
-
-Allow building against system-wide av1.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/external/moz.build | 5 +++--
- config/system-headers.mozbuild | 8 ++++++++
- dom/media/platforms/moz.build | 5 +++++
- toolkit/moz.configure | 20 ++++++++++++++++++--
- 4 files changed, 34 insertions(+), 4 deletions(-)
-
-diff --git a/config/external/moz.build b/config/external/moz.build
-index ab771212bf..75595d999c 100644
---- a/config/external/moz.build
-+++ b/config/external/moz.build
-@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
- external_dirs += ["media/libvpx"]
-
- if CONFIG["MOZ_AV1"]:
-- external_dirs += ["media/libaom"]
-- external_dirs += ["media/libdav1d"]
-+ if not CONFIG["MOZ_SYSTEM_AV1"]:
-+ external_dirs += ["media/libaom"]
-+ external_dirs += ["media/libdav1d"]
-
- if not CONFIG["MOZ_SYSTEM_PNG"]:
- external_dirs += ["media/libpng"]
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 2f7ae39515..96ab3a6466 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
- 'proxy.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_AV1']:
-+ system_headers += [
-+ 'aom/aom_decoder.h',
-+ 'aom/aomdx.h',
-+ 'aom/aom_image.h',
-+ 'dav1d/dav1d.h',
-+ ]
-+
- if CONFIG['MOZ_SYSTEM_LIBVPX']:
- system_headers += [
- 'vpx_mem/vpx_mem.h',
-diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
-index 8509aec6ef..7c5a1df63d 100644
---- a/dom/media/platforms/moz.build
-+++ b/dom/media/platforms/moz.build
-@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
- "agnostic/AOMDecoder.cpp",
- "agnostic/DAV1DDecoder.cpp",
- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
-+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
-+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
-+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
-
- if CONFIG["MOZ_OMX"]:
- EXPORTS += [
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index a68e1b347d..7b7975bd12 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -544,14 +544,29 @@ def av1(value):
- if value:
- return True
-
-+option("--with-system-av1", help="Use system av1 (located with pkg-config)")
-
--@depends(target, when=av1 & compile_environment)
-+system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
-+ when='--with-system-av1')
-+
-+system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >=
0.1.1',
-+ when='--with-system-av1')
-+
-+@depends(system_libaom_info, system_libdav1d_info)
-+def system_av1(system_libaom_info, system_libdav1d_info):
-+ has_av1_libs = False
-+ if system_libaom_info and system_libdav1d_info:
-+ has_av1_libs = True
-+ return has_av1_libs
-+
-+
-+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
- def dav1d_asm(target):
- if target.cpu in ("aarch64", "x86", "x86_64"):
- return True
-
-
--@depends(target, when=av1 & compile_environment)
-+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
- def dav1d_nasm(target):
- if target.cpu in ("x86", "x86_64"):
- return namespace(version="2.14", what="AV1")
-@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
- set_define("MOZ_DAV1D_ASM", dav1d_asm)
- set_config("MOZ_AV1", av1)
- set_define("MOZ_AV1", av1)
-+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
-
- # JXL Image Codec Support
- # ==============================================================
---
-2.34.1
-
diff --git
a/http/firefox/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
b/http/firefox/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
deleted file mode 100644
index 6b1cde0..0000000
---
a/http/firefox/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From e43f7431036904989cfd520f19de28a72be97ad9 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:41:43 +0200
-Subject: [PATCH 08/30] bmo#878089: Don't fail when TERM is not set
-
-Link: https://github.com/erikrose/blessings/pull/137
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=878089
-Bug: https://bugs.gentoo.org/654316
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- third_party/python/blessings/blessings/__init__.py | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/third_party/python/blessings/blessings/__init__.py
b/third_party/python/blessings/blessings/__init__.py
-index 388cece0b8..1283460cc9 100644
---- a/third_party/python/blessings/blessings/__init__.py
-+++ b/third_party/python/blessings/blessings/__init__.py
-@@ -94,8 +94,13 @@ class Terminal(object):
- # init sequences to the stream if it has a file descriptor, and
- # send them to stdout as a fallback, since they have to go
- # somewhere.
-- setupterm(kind or environ.get('TERM', 'unknown'),
-- self._init_descriptor)
-+ try:
-+ setupterm(kind or environ.get('TERM', 'dumb') or 'dumb',
-+ self._init_descriptor)
-+ except curses.error:
-+ # There was an error setting up the terminal, either curses
is
-+ # not supported or TERM is incorrectly set. Fall back to
dumb.
-+ self._does_styling = False
-
- self.stream = stream
-
---
-2.34.1
-
diff --git
a/http/firefox/patches/0007-musl-Add-alternate-name-for-private-siginfo-struct-m.patch

b/http/firefox/patches/0007-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
new file mode 100644
index 0000000..300846f
--- /dev/null
+++
b/http/firefox/patches/0007-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
@@ -0,0 +1,35 @@
+From d8ec0bd6f3b0ad2dfd8a97a864f08decaafdea69 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 8 Jan 2017 19:16:38 -0600
+Subject: [PATCH 10/30] musl: Add alternate name for private siginfo struct
+ member
+
+musl does not provide a macro for detecting its presence. For now,
+assume that it is the only non-glibc-based libc on Linux systems.
+
+Signed-off-by: Samuel Holland <samuel AT sholland.org>
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+index 9884be8bb2..86d8f88e30 100644
+--- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
++++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+@@ -174,7 +174,11 @@ void Trap::SigSys(int nr, LinuxSigInfo* info,
ucontext_t* ctx) {
+ // If the version of glibc doesn't include this information in
+ // siginfo_t (older than 2.17), we need to explicitly copy it
+ // into an arch_sigsys structure.
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++#if defined(__GLIBC__)
++ memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++#else
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
++#endif
+ #endif
+
+ #if defined(__mips__)
+--
+2.34.1
+
diff --git a/http/firefox/patches/0008-bmo-1516803-Fix-building-sandbox.patch
b/http/firefox/patches/0008-bmo-1516803-Fix-building-sandbox.patch
deleted file mode 100644
index 24333b2..0000000
--- a/http/firefox/patches/0008-bmo-1516803-Fix-building-sandbox.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6eeeca1b673a60d3e51427b2a5cf3e916bdb012b Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:44:28 +0200
-Subject: [PATCH 09/30] bmo#1516803: Fix building sandbox
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
-Bug: https://bugs.gentoo.org/666580
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/linux/moz.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
-index 573f667812..e62d1a99a4 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -116,7 +116,7 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- # forcing there to be only one partition.
- for f in CONFIG["OS_CXXFLAGS"]:
- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param lto-partitions=1"]
-+ LDFLAGS += ["--param", "lto-partitions=1"]
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
---
-2.34.1
-
diff --git a/http/firefox/patches/0008-musl-Fix-syscall-wrappers.patch
b/http/firefox/patches/0008-musl-Fix-syscall-wrappers.patch
new file mode 100644
index 0000000..d9dda49
--- /dev/null
+++ b/http/firefox/patches/0008-musl-Fix-syscall-wrappers.patch
@@ -0,0 +1,42 @@
+From 1b46c0fc085fe93c36320d7ac1004c83efccdccc Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 8 Jan 2017 19:19:23 -0600
+Subject: [PATCH 11/30] musl: Fix syscall wrappers
+
+musl defines p{read,write}64 to their non-suffixed equivalents to avoid
+duplication in its syscall wrappers. This breaks macro expansion here,
+leading to errors such as:
+
+In function size_t sys_pread64(int, void*, size_t, off_t):
+ error: '__NR_pread' was not declared in this scope
+
+The fix here is to undefine the p{read,write}64 macros, so the syscall
+expands to (e.g.) __NR_pread64 instead.
+
+Signed-off-by: Samuel Holland <samuel AT sholland.org>
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../src/third_party/lss/linux_syscall_support.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h

b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+index 1abe0ba5b0..d6087a1674 100644
+---
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
++++
b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+@@ -173,6 +173,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0009-musl-Add-alternate-name-for-private-siginfo-struct-m.patch

b/http/firefox/patches/0009-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
deleted file mode 100644
index 300846f..0000000
---
a/http/firefox/patches/0009-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From d8ec0bd6f3b0ad2dfd8a97a864f08decaafdea69 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel AT sholland.org>
-Date: Sun, 8 Jan 2017 19:16:38 -0600
-Subject: [PATCH 10/30] musl: Add alternate name for private siginfo struct
- member
-
-musl does not provide a macro for detecting its presence. For now,
-assume that it is the only non-glibc-based libc on Linux systems.
-
-Signed-off-by: Samuel Holland <samuel AT sholland.org>
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
-index 9884be8bb2..86d8f88e30 100644
---- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -174,7 +174,11 @@ void Trap::SigSys(int nr, LinuxSigInfo* info,
ucontext_t* ctx) {
- // If the version of glibc doesn't include this information in
- // siginfo_t (older than 2.17), we need to explicitly copy it
- // into an arch_sigsys structure.
-- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+#if defined(__GLIBC__)
-+ memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+#else
-+ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
-+#endif
- #endif
-
- #if defined(__mips__)
---
-2.34.1
-
diff --git
a/http/firefox/patches/0009-musl-Only-use-system-heap-reporter-with-glibc.patch

b/http/firefox/patches/0009-musl-Only-use-system-heap-reporter-with-glibc.patch
new file mode 100644
index 0000000..08f0214
--- /dev/null
+++
b/http/firefox/patches/0009-musl-Only-use-system-heap-reporter-with-glibc.patch
@@ -0,0 +1,33 @@
+From 68dd87a3dc06cf59396dccc3e031761f7237656e Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:09:26 +0200
+Subject: [PATCH 12/30] musl: Only use system heap reporter with glibc
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ xpcom/base/nsMemoryReporterManager.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/xpcom/base/nsMemoryReporterManager.cpp
b/xpcom/base/nsMemoryReporterManager.cpp
+index bd4629c785..b513f81216 100644
+--- a/xpcom/base/nsMemoryReporterManager.cpp
++++ b/xpcom/base/nsMemoryReporterManager.cpp
+@@ -647,6 +647,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
+ return NS_OK;
+ }
+
++#ifdef __GLIBC__
+ # define HAVE_SYSTEM_HEAP_REPORTER 1
+ // Windows can have multiple separate heaps, but we should not touch
non-default
+ // heaps because they may be destroyed at anytime while we hold a handle.
So we
+@@ -679,6 +680,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
+ *aSizeOut = heapSize;
+ return NS_OK;
+ }
++#endif
+
+ struct SegmentKind {
+ DWORD mState;
+--
+2.34.1
+
diff --git a/http/firefox/patches/0010-musl-Fix-syscall-wrappers.patch
b/http/firefox/patches/0010-musl-Fix-syscall-wrappers.patch
deleted file mode 100644
index d9dda49..0000000
--- a/http/firefox/patches/0010-musl-Fix-syscall-wrappers.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 1b46c0fc085fe93c36320d7ac1004c83efccdccc Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel AT sholland.org>
-Date: Sun, 8 Jan 2017 19:19:23 -0600
-Subject: [PATCH 11/30] musl: Fix syscall wrappers
-
-musl defines p{read,write}64 to their non-suffixed equivalents to avoid
-duplication in its syscall wrappers. This breaks macro expansion here,
-leading to errors such as:
-
-In function size_t sys_pread64(int, void*, size_t, off_t):
- error: '__NR_pread' was not declared in this scope
-
-The fix here is to undefine the p{read,write}64 macros, so the syscall
-expands to (e.g.) __NR_pread64 instead.
-
-Signed-off-by: Samuel Holland <samuel AT sholland.org>
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../src/third_party/lss/linux_syscall_support.h | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h

b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
-index 1abe0ba5b0..d6087a1674 100644
----
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
-+++
b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
-@@ -173,6 +173,13 @@ extern "C" {
- # undef __NR_waitpid
- #endif
-
-+#ifdef pread64
-+#undef pread64
-+#endif
-+#ifdef pwrite64
-+#undef pwrite64
-+#endif
-+
- /* As glibc often provides subtly incompatible data structures (and implicit
- * wrapper functions that convert them), we provide our own kernel data
- * structures for use by the system calls.
---
-2.34.1
-
diff --git
a/http/firefox/patches/0010-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox/patches/0010-musl-Set-pthread-name-for-non-glibc-systems.patch
new file mode 100644
index 0000000..fe74bb1
--- /dev/null
+++
b/http/firefox/patches/0010-musl-Set-pthread-name-for-non-glibc-systems.patch
@@ -0,0 +1,29 @@
+From 70d47d18420fe9e3de8f896c08f97ef2596c9c84 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:10:03 +0200
+Subject: [PATCH 13/30] musl: Set pthread name for non glibc systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ js/src/threading/posix/PosixThread.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/js/src/threading/posix/PosixThread.cpp
b/js/src/threading/posix/PosixThread.cpp
+index 35532e375b..983da45326 100644
+--- a/js/src/threading/posix/PosixThread.cpp
++++ b/js/src/threading/posix/PosixThread.cpp
+@@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) {
+ rv = 0;
+ #elif defined(__NetBSD__)
+ rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
+-#else
++#elif defined(__GLIBC__)
+ rv = pthread_setname_np(pthread_self(), name);
++#else
++ rv = 0;
+ #endif
+ MOZ_RELEASE_ASSERT(!rv);
+ }
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0011-musl-Only-use-system-heap-reporter-with-glibc.patch

b/http/firefox/patches/0011-musl-Only-use-system-heap-reporter-with-glibc.patch
deleted file mode 100644
index 08f0214..0000000
---
a/http/firefox/patches/0011-musl-Only-use-system-heap-reporter-with-glibc.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 68dd87a3dc06cf59396dccc3e031761f7237656e Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:09:26 +0200
-Subject: [PATCH 12/30] musl: Only use system heap reporter with glibc
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- xpcom/base/nsMemoryReporterManager.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/xpcom/base/nsMemoryReporterManager.cpp
b/xpcom/base/nsMemoryReporterManager.cpp
-index bd4629c785..b513f81216 100644
---- a/xpcom/base/nsMemoryReporterManager.cpp
-+++ b/xpcom/base/nsMemoryReporterManager.cpp
-@@ -647,6 +647,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
- return NS_OK;
- }
-
-+#ifdef __GLIBC__
- # define HAVE_SYSTEM_HEAP_REPORTER 1
- // Windows can have multiple separate heaps, but we should not touch
non-default
- // heaps because they may be destroyed at anytime while we hold a handle.
So we
-@@ -679,6 +680,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
- *aSizeOut = heapSize;
- return NS_OK;
- }
-+#endif
-
- struct SegmentKind {
- DWORD mState;
---
-2.34.1
-
diff --git
a/http/firefox/patches/0011-musl-getcontext-is-only-avaliable-on-glibc-systems.patch

b/http/firefox/patches/0011-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
new file mode 100644
index 0000000..e9cf02e
--- /dev/null
+++
b/http/firefox/patches/0011-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
@@ -0,0 +1,28 @@
+From 3283cc3981f99894dec1219fbf380489905827a9 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:10:47 +0200
+Subject: [PATCH 14/30] musl: getcontext is only avaliable on glibc systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ tools/profiler/core/platform-linux-android.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/profiler/core/platform-linux-android.cpp
b/tools/profiler/core/platform-linux-android.cpp
+index d065387552..aaca9e81e4 100644
+--- a/tools/profiler/core/platform-linux-android.cpp
++++ b/tools/profiler/core/platform-linux-android.cpp
+@@ -603,8 +603,10 @@ static void PlatformInit(PSLockRef aLock) {}
+
+ #if defined(HAVE_NATIVE_UNWIND)
+ void Registers::SyncPopulate() {
++#if defined(__GLIBC__)
+ if (!getcontext(&mContextSyncStorage)) {
+ PopulateRegsFromContext(*this, &mContextSyncStorage);
+ }
++#endif
+ }
+ #endif
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
deleted file mode 100644
index fe74bb1..0000000
---
a/http/firefox/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 70d47d18420fe9e3de8f896c08f97ef2596c9c84 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:10:03 +0200
-Subject: [PATCH 13/30] musl: Set pthread name for non glibc systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- js/src/threading/posix/PosixThread.cpp | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/js/src/threading/posix/PosixThread.cpp
b/js/src/threading/posix/PosixThread.cpp
-index 35532e375b..983da45326 100644
---- a/js/src/threading/posix/PosixThread.cpp
-+++ b/js/src/threading/posix/PosixThread.cpp
-@@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) {
- rv = 0;
- #elif defined(__NetBSD__)
- rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
--#else
-+#elif defined(__GLIBC__)
- rv = pthread_setname_np(pthread_self(), name);
-+#else
-+ rv = 0;
- #endif
- MOZ_RELEASE_ASSERT(!rv);
- }
---
-2.34.1
-
diff --git
a/http/firefox/patches/0012-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch

b/http/firefox/patches/0012-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
new file mode 100644
index 0000000..121c8cd
--- /dev/null
+++
b/http/firefox/patches/0012-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
@@ -0,0 +1,51 @@
+From beed745f96bbc18a3c22a728095c9a2eef7435ee Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:12:09 +0200
+Subject: [PATCH 15/30] musl: sys/auvx.h avaliable on more then just glibc
+ systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../system_wrappers/source/cpu_features_linux.cc | 12 +++---------
+ 1 file changed, 3 insertions(+), 9 deletions(-)
+
+diff --git
a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
+index 335bed4da3..c2c98dae8a 100644
+--- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
++++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
+@@ -12,13 +12,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#ifdef __GLIBC_PREREQ
+-#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
+-#else
+-#define WEBRTC_GLIBC_PREREQ(a, b) 0
+-#endif
+-
+-#if WEBRTC_GLIBC_PREREQ(2, 16)
++#if defined(__linux__)
+ #include <sys/auxv.h>
+ #else
+ #include <errno.h>
+@@ -40,7 +34,7 @@ uint64_t GetCPUFeaturesARM(void) {
+ int architecture = 0;
+ uint64_t hwcap = 0;
+ const char* platform = NULL;
+-#if WEBRTC_GLIBC_PREREQ(2, 16)
++#if defined(__linux__)
+ hwcap = getauxval(AT_HWCAP);
+ platform = (const char*)getauxval(AT_PLATFORM);
+ #else
+@@ -64,7 +58,7 @@ uint64_t GetCPUFeaturesARM(void) {
+ }
+ close(fd);
+ }
+-#endif // WEBRTC_GLIBC_PREREQ(2, 16)
++#endif // (__linux__)
+ #if defined(__aarch64__)
+ architecture = 8;
+ if ((hwcap & HWCAP_FP) != 0)
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0013-musl-getcontext-is-only-avaliable-on-glibc-systems.patch

b/http/firefox/patches/0013-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
deleted file mode 100644
index e9cf02e..0000000
---
a/http/firefox/patches/0013-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3283cc3981f99894dec1219fbf380489905827a9 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:10:47 +0200
-Subject: [PATCH 14/30] musl: getcontext is only avaliable on glibc systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- tools/profiler/core/platform-linux-android.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tools/profiler/core/platform-linux-android.cpp
b/tools/profiler/core/platform-linux-android.cpp
-index d065387552..aaca9e81e4 100644
---- a/tools/profiler/core/platform-linux-android.cpp
-+++ b/tools/profiler/core/platform-linux-android.cpp
-@@ -603,8 +603,10 @@ static void PlatformInit(PSLockRef aLock) {}
-
- #if defined(HAVE_NATIVE_UNWIND)
- void Registers::SyncPopulate() {
-+#if defined(__GLIBC__)
- if (!getcontext(&mContextSyncStorage)) {
- PopulateRegsFromContext(*this, &mContextSyncStorage);
- }
-+#endif
- }
- #endif
---
-2.34.1
-
diff --git
a/http/firefox/patches/0013-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch

b/http/firefox/patches/0013-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
new file mode 100644
index 0000000..9de0db7
--- /dev/null
+++
b/http/firefox/patches/0013-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
@@ -0,0 +1,28 @@
+From 6d36ed9e971861321bb381e25516500069314eb6 Mon Sep 17 00:00:00 2001
+From: Johannes <johannes.brechtmann AT gmail.com>
+Date: Fri, 1 May 2020 17:20:29 +0200
+Subject: [PATCH 16/30] musl: make SYS_fork non-fatal, musl uses it for
fork(2)
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/linux/SandboxFilter.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/security/sandbox/linux/SandboxFilter.cpp
b/security/sandbox/linux/SandboxFilter.cpp
+index eb72d944c8..8ce22d6f65 100644
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1537,6 +1537,10 @@ class ContentSandboxPolicy : public
SandboxPolicyCommon {
+ // usually do something reasonable on error.
+ case __NR_clone:
+ return ClonePolicy(Error(EPERM));
++# ifdef __NR_fork
++ case __NR_fork:
++ return Error(ENOSYS);
++# endif
+
+ case __NR_clone3:
+ return Error(ENOSYS);
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0014-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch

b/http/firefox/patches/0014-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
new file mode 100644
index 0000000..de77780
--- /dev/null
+++
b/http/firefox/patches/0014-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
@@ -0,0 +1,27 @@
+From 08a7a0d7fa52e1bdacdcb47e847cf5ecd980ee6f Mon Sep 17 00:00:00 2001
+From: Rasmus Thomsen <oss AT cogitri.dev>
+Date: Wed, 28 Oct 2020 17:50:24 +0100
+Subject: [PATCH 17/30] musl: include net/if.h before linux/if.h to avoid
+ redefinition
+
+Bug: https://bugs.gentoo.org/751469
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git
a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
+index 73e85c6ccc..9eca548638 100644
+--- a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
++++ b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
+@@ -31,6 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
+ */
+
+ #if defined(LINUX)
++#include <net/if.h>
+ #include "addrs-netlink.h"
+ #include <csi_platform.h>
+ #include <assert.h>
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch

b/http/firefox/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
deleted file mode 100644
index 121c8cd..0000000
---
a/http/firefox/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From beed745f96bbc18a3c22a728095c9a2eef7435ee Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:12:09 +0200
-Subject: [PATCH 15/30] musl: sys/auvx.h avaliable on more then just glibc
- systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../system_wrappers/source/cpu_features_linux.cc | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git
a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-index 335bed4da3..c2c98dae8a 100644
---- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-+++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-@@ -12,13 +12,7 @@
- #include <stdlib.h>
- #include <string.h>
-
--#ifdef __GLIBC_PREREQ
--#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
--#else
--#define WEBRTC_GLIBC_PREREQ(a, b) 0
--#endif
--
--#if WEBRTC_GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- #include <sys/auxv.h>
- #else
- #include <errno.h>
-@@ -40,7 +34,7 @@ uint64_t GetCPUFeaturesARM(void) {
- int architecture = 0;
- uint64_t hwcap = 0;
- const char* platform = NULL;
--#if WEBRTC_GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- hwcap = getauxval(AT_HWCAP);
- platform = (const char*)getauxval(AT_PLATFORM);
- #else
-@@ -64,7 +58,7 @@ uint64_t GetCPUFeaturesARM(void) {
- }
- close(fd);
- }
--#endif // WEBRTC_GLIBC_PREREQ(2, 16)
-+#endif // (__linux__)
- #if defined(__aarch64__)
- architecture = 8;
- if ((hwcap & HWCAP_FP) != 0)
---
-2.34.1
-
diff --git a/http/firefox/patches/0015-Make-PGO-use-toolchain.patch
b/http/firefox/patches/0015-Make-PGO-use-toolchain.patch
new file mode 100644
index 0000000..3f72b05
--- /dev/null
+++ b/http/firefox/patches/0015-Make-PGO-use-toolchain.patch
@@ -0,0 +1,33 @@
+From 45d43bb2dc1c1c033c860951c93261e98647f851 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:13:34 +0200
+Subject: [PATCH 18/30] Make PGO use toolchain
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/unix/mozconfig.unix | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix
+index 9ca9c97fce..9f86fe0940 100644
+--- a/build/unix/mozconfig.unix
++++ b/build/unix/mozconfig.unix
+@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
+ CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
+ CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+
++ if [ -n "$MOZ_PGO" ]; then
++ if [ -z "$USE_ARTIFACT" ]; then
++ ac_add_options --enable-lto
++ fi
++ export AR="$topsrcdir/gcc/bin/gcc-ar"
++ export NM="$topsrcdir/gcc/bin/gcc-nm"
++ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
++ fi
++
+ # We want to make sure we use binutils and other binaries in the
tooltool
+ # package.
+ mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0015-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch

b/http/firefox/patches/0015-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
deleted file mode 100644
index 9de0db7..0000000
---
a/http/firefox/patches/0015-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6d36ed9e971861321bb381e25516500069314eb6 Mon Sep 17 00:00:00 2001
-From: Johannes <johannes.brechtmann AT gmail.com>
-Date: Fri, 1 May 2020 17:20:29 +0200
-Subject: [PATCH 16/30] musl: make SYS_fork non-fatal, musl uses it for
fork(2)
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/linux/SandboxFilter.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/security/sandbox/linux/SandboxFilter.cpp
b/security/sandbox/linux/SandboxFilter.cpp
-index eb72d944c8..8ce22d6f65 100644
---- a/security/sandbox/linux/SandboxFilter.cpp
-+++ b/security/sandbox/linux/SandboxFilter.cpp
-@@ -1537,6 +1537,10 @@ class ContentSandboxPolicy : public
SandboxPolicyCommon {
- // usually do something reasonable on error.
- case __NR_clone:
- return ClonePolicy(Error(EPERM));
-+# ifdef __NR_fork
-+ case __NR_fork:
-+ return Error(ENOSYS);
-+# endif
-
- case __NR_clone3:
- return Error(ENOSYS);
---
-2.34.1
-
diff --git
a/http/firefox/patches/0016-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

b/http/firefox/patches/0016-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
new file mode 100644
index 0000000..70cf5c3
--- /dev/null
+++
b/http/firefox/patches/0016-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
@@ -0,0 +1,55 @@
+From 2502829abc1a02a08cc1934538c3d30e6f4f6fae Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:27:06 +0200
+Subject: [PATCH 19/30] bmo#1516081: Disable watchdog during PGO builds
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516081
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/moz.configure/lto-pgo.configure | 4 ++--
+ toolkit/components/terminator/nsTerminator.cpp | 7 +++++++
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
+index e5a4e6f913..567ccf0ba4 100644
+--- a/build/moz.configure/lto-pgo.configure
++++ b/build/moz.configure/lto-pgo.configure
+@@ -84,7 +84,7 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
+ def pgo_flags(compiler, profdata, target_is_windows):
+ if compiler.type == "gcc":
+ return namespace(
+- gen_cflags=["-fprofile-generate"],
++ gen_cflags=["-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"],
+ gen_ldflags=["-fprofile-generate"],
+ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
+ use_ldflags=["-fprofile-use"],
+@@ -98,7 +98,7 @@ def pgo_flags(compiler, profdata, target_is_windows):
+ else:
+ gen_ldflags = ["-fprofile-generate"]
+
+- gen_cflags = [prefix + "-fprofile-generate"]
++ gen_cflags = [prefix + "-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"]
+ if target_is_windows:
+ # native llvm-profdata.exe on Windows can't read profile data
+ # if name compression is enabled (which cross-compiling enables
+diff --git a/toolkit/components/terminator/nsTerminator.cpp
b/toolkit/components/terminator/nsTerminator.cpp
+index 194bb36e2d..c960d44137 100644
+--- a/toolkit/components/terminator/nsTerminator.cpp
++++ b/toolkit/components/terminator/nsTerminator.cpp
+@@ -466,6 +466,13 @@ void nsTerminator::StartWatchdog() {
+ }
+ #endif
+
++ // Disable watchdog for PGO train builds - writting profile information at
++ // exit may take time and it is better to make build hang rather than
++ // silently produce poorly performing binary.
++#ifdef MOZ_PROFILE_INSTRUMENTATION
++ crashAfterMS = INT32_MAX;
++#endif
++
+ UniquePtr<Options> options(new Options());
+ const PRIntervalTime ticksDuration =
+ PR_MillisecondsToInterval(HEARTBEAT_INTERVAL_MS);
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0016-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch

b/http/firefox/patches/0016-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
deleted file mode 100644
index de77780..0000000
---
a/http/firefox/patches/0016-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 08a7a0d7fa52e1bdacdcb47e847cf5ecd980ee6f Mon Sep 17 00:00:00 2001
-From: Rasmus Thomsen <oss AT cogitri.dev>
-Date: Wed, 28 Oct 2020 17:50:24 +0100
-Subject: [PATCH 17/30] musl: include net/if.h before linux/if.h to avoid
- redefinition
-
-Bug: https://bugs.gentoo.org/751469
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git
a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
-index 73e85c6ccc..9eca548638 100644
---- a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
-+++ b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
-@@ -31,6 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
- */
-
- #if defined(LINUX)
-+#include <net/if.h>
- #include "addrs-netlink.h"
- #include <csi_platform.h>
- #include <assert.h>
---
-2.34.1
-
diff --git a/http/firefox/patches/0017-Make-PGO-use-toolchain.patch
b/http/firefox/patches/0017-Make-PGO-use-toolchain.patch
deleted file mode 100644
index 3f72b05..0000000
--- a/http/firefox/patches/0017-Make-PGO-use-toolchain.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 45d43bb2dc1c1c033c860951c93261e98647f851 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:13:34 +0200
-Subject: [PATCH 18/30] Make PGO use toolchain
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/unix/mozconfig.unix | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix
-index 9ca9c97fce..9f86fe0940 100644
---- a/build/unix/mozconfig.unix
-+++ b/build/unix/mozconfig.unix
-@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
- CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
- CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
-
-+ if [ -n "$MOZ_PGO" ]; then
-+ if [ -z "$USE_ARTIFACT" ]; then
-+ ac_add_options --enable-lto
-+ fi
-+ export AR="$topsrcdir/gcc/bin/gcc-ar"
-+ export NM="$topsrcdir/gcc/bin/gcc-nm"
-+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
-+ fi
-+
- # We want to make sure we use binutils and other binaries in the
tooltool
- # package.
- mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
---
-2.34.1
-
diff --git
a/http/firefox/patches/0017-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch

b/http/firefox/patches/0017-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
new file mode 100644
index 0000000..ef8f9b2
--- /dev/null
+++
b/http/firefox/patches/0017-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
@@ -0,0 +1,32 @@
+From 0501ed4bbdbf8d16a69a4460d2ada33ac259365d Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Wed, 15 Apr 2020 00:27:25 +0200
+Subject: [PATCH 20/30] bmo#1516803: force one LTO partition for sandbox when
+ using GCC
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/linux/moz.build | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+index e62d1a99a4..913b9ba2ce 100644
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -114,9 +114,10 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+ # gcc lto likes to put the top level asm in syscall.cc in a different
partition
+ # from the function using it which breaks the build. Work around that by
+ # forcing there to be only one partition.
+-for f in CONFIG["OS_CXXFLAGS"]:
+- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
+- LDFLAGS += ["--param", "lto-partitions=1"]
++if CONFIG["CC_TYPE"] != "clang" and CONFIG["MOZ_LTO_LDFLAGS"] is not None:
++ for f in CONFIG["MOZ_LTO_LDFLAGS"]:
++ if f.startswith("-flto"):
++ LDFLAGS += ["--param", "lto-partitions=1"]
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0018-Fix-building-with-PGO-when-using-GCC.patch
b/http/firefox/patches/0018-Fix-building-with-PGO-when-using-GCC.patch
new file mode 100644
index 0000000..81de54b
--- /dev/null
+++ b/http/firefox/patches/0018-Fix-building-with-PGO-when-using-GCC.patch
@@ -0,0 +1,84 @@
+From 98e1e605c8fdf7b021d6f1888ce6baed5c1097b5 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Thu, 2 Jul 2020 18:05:03 +0200
+Subject: [PATCH 22/30] Fix building with PGO when using GCC
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/moz.configure/lto-pgo.configure | 5 +++--
+ build/pgo/profileserver.py | 26 ++++++++++++++++++++++----
+ 2 files changed, 25 insertions(+), 6 deletions(-)
+
+diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
+index 567ccf0ba4..c6470ef829 100644
+--- a/build/moz.configure/lto-pgo.configure
++++ b/build/moz.configure/lto-pgo.configure
+@@ -83,11 +83,12 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
+ @imports("multiprocessing")
+ def pgo_flags(compiler, profdata, target_is_windows):
+ if compiler.type == "gcc":
++ profile_use = "-fprofile-use"
+ return namespace(
+ gen_cflags=["-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"],
+ gen_ldflags=["-fprofile-generate"],
+- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
+- use_ldflags=["-fprofile-use"],
++ use_cflags=[profile_use, "-fprofile-correction",
"-Wcoverage-mismatch"],
++ use_ldflags=[profile_use],
+ )
+
+ if compiler.type in ("clang-cl", "clang"):
+diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
+index 7f3de106ab..89289a7756 100755
+--- a/build/pgo/profileserver.py
++++ b/build/pgo/profileserver.py
+@@ -11,7 +11,7 @@ import glob
+ import subprocess
+
+ import mozcrash
+-from mozbuild.base import MozbuildObject, BinaryNotFoundException
++from mozbuild.base import MozbuildObject, BinaryNotFoundException,
BuildEnvironmentNotFoundException
+ from mozfile import TemporaryDirectory
+ from mozhttpd import MozHttpd
+ from mozprofile import FirefoxProfile, Preferences
+@@ -87,9 +87,22 @@ if __name__ == "__main__":
+ locations = ServerLocations()
+ locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
+
+- old_profraw_files = glob.glob("*.profraw")
+- for f in old_profraw_files:
+- os.remove(f)
++ using_gcc = False
++ try:
++ if build.config_environment.substs.get("CC_TYPE") == "gcc":
++ using_gcc = True
++ except BuildEnvironmentNotFoundException:
++ pass
++
++ if using_gcc:
++ for dirpath, _, filenames in os.walk("."):
++ for f in filenames:
++ if f.endswith(".gcda"):
++ os.remove(os.path.join(dirpath, f))
++ else:
++ old_profraw_files = glob.glob("*.profraw")
++ for f in old_profraw_files:
++ os.remove(f)
+
+ with TemporaryDirectory() as profilePath:
+ # TODO: refactor this into mozprofile
+@@ -212,6 +225,11 @@ if __name__ == "__main__":
+ print("Firefox exited successfully, but produced a crashreport")
+ sys.exit(1)
+
++ if using_gcc:
++ print("Copying profile data...")
++ os.system("pwd");
++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd
..; tar xf instrumented/profdata.tar.gz;');
++
+ llvm_profdata = env.get("LLVM_PROFDATA")
+ if llvm_profdata:
+ profraw_files = glob.glob("*.profraw")
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0018-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

b/http/firefox/patches/0018-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
deleted file mode 100644
index 70cf5c3..0000000
---
a/http/firefox/patches/0018-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 2502829abc1a02a08cc1934538c3d30e6f4f6fae Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:27:06 +0200
-Subject: [PATCH 19/30] bmo#1516081: Disable watchdog during PGO builds
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516081
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/moz.configure/lto-pgo.configure | 4 ++--
- toolkit/components/terminator/nsTerminator.cpp | 7 +++++++
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
-index e5a4e6f913..567ccf0ba4 100644
---- a/build/moz.configure/lto-pgo.configure
-+++ b/build/moz.configure/lto-pgo.configure
-@@ -84,7 +84,7 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
- def pgo_flags(compiler, profdata, target_is_windows):
- if compiler.type == "gcc":
- return namespace(
-- gen_cflags=["-fprofile-generate"],
-+ gen_cflags=["-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"],
- gen_ldflags=["-fprofile-generate"],
- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
- use_ldflags=["-fprofile-use"],
-@@ -98,7 +98,7 @@ def pgo_flags(compiler, profdata, target_is_windows):
- else:
- gen_ldflags = ["-fprofile-generate"]
-
-- gen_cflags = [prefix + "-fprofile-generate"]
-+ gen_cflags = [prefix + "-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"]
- if target_is_windows:
- # native llvm-profdata.exe on Windows can't read profile data
- # if name compression is enabled (which cross-compiling enables
-diff --git a/toolkit/components/terminator/nsTerminator.cpp
b/toolkit/components/terminator/nsTerminator.cpp
-index 194bb36e2d..c960d44137 100644
---- a/toolkit/components/terminator/nsTerminator.cpp
-+++ b/toolkit/components/terminator/nsTerminator.cpp
-@@ -466,6 +466,13 @@ void nsTerminator::StartWatchdog() {
- }
- #endif
-
-+ // Disable watchdog for PGO train builds - writting profile information at
-+ // exit may take time and it is better to make build hang rather than
-+ // silently produce poorly performing binary.
-+#ifdef MOZ_PROFILE_INSTRUMENTATION
-+ crashAfterMS = INT32_MAX;
-+#endif
-+
- UniquePtr<Options> options(new Options());
- const PRIntervalTime ticksDuration =
- PR_MillisecondsToInterval(HEARTBEAT_INTERVAL_MS);
---
-2.34.1
-
diff --git
a/http/firefox/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch

b/http/firefox/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
deleted file mode 100644
index ef8f9b2..0000000
---
a/http/firefox/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0501ed4bbdbf8d16a69a4460d2ada33ac259365d Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Wed, 15 Apr 2020 00:27:25 +0200
-Subject: [PATCH 20/30] bmo#1516803: force one LTO partition for sandbox when
- using GCC
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/linux/moz.build | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
-index e62d1a99a4..913b9ba2ce 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -114,9 +114,10 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- # gcc lto likes to put the top level asm in syscall.cc in a different
partition
- # from the function using it which breaks the build. Work around that by
- # forcing there to be only one partition.
--for f in CONFIG["OS_CXXFLAGS"]:
-- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param", "lto-partitions=1"]
-+if CONFIG["CC_TYPE"] != "clang" and CONFIG["MOZ_LTO_LDFLAGS"] is not None:
-+ for f in CONFIG["MOZ_LTO_LDFLAGS"]:
-+ if f.startswith("-flto"):
-+ LDFLAGS += ["--param", "lto-partitions=1"]
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
---
-2.34.1
-
diff --git
a/http/firefox/patches/0019-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch

b/http/firefox/patches/0019-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
new file mode 100644
index 0000000..85c305f
--- /dev/null
+++
b/http/firefox/patches/0019-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
@@ -0,0 +1,28 @@
+From 6e220b49aee7dbdcafd255f6260517c5c551f9b1 Mon Sep 17 00:00:00 2001
+From: Mike Hommey <mh AT glandium.org>
+Date: Mon, 26 Nov 2018 09:59:56 +0900
+Subject: [PATCH 23/30] libaom: Use NEON_FLAGS instead of VPX_ASFLAGS for
+ libaom neon code
+
+Bug: https://bugs.gentoo.org/730606
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ media/libaom/moz.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/media/libaom/moz.build b/media/libaom/moz.build
+index fd8c7f2b33..db3f9ca6ec 100644
+--- a/media/libaom/moz.build
++++ b/media/libaom/moz.build
+@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm':
+
+ for f in SOURCES:
+ if f.endswith('neon.c'):
+- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
++ SOURCES[f].flags += CONFIG['NEON_FLAGS']
+
+ if CONFIG['OS_TARGET'] == 'Android':
+ # For cpu-features.h
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
b/http/firefox/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
deleted file mode 100644
index 81de54b..0000000
--- a/http/firefox/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 98e1e605c8fdf7b021d6f1888ce6baed5c1097b5 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 2 Jul 2020 18:05:03 +0200
-Subject: [PATCH 22/30] Fix building with PGO when using GCC
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/moz.configure/lto-pgo.configure | 5 +++--
- build/pgo/profileserver.py | 26 ++++++++++++++++++++++----
- 2 files changed, 25 insertions(+), 6 deletions(-)
-
-diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
-index 567ccf0ba4..c6470ef829 100644
---- a/build/moz.configure/lto-pgo.configure
-+++ b/build/moz.configure/lto-pgo.configure
-@@ -83,11 +83,12 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
- @imports("multiprocessing")
- def pgo_flags(compiler, profdata, target_is_windows):
- if compiler.type == "gcc":
-+ profile_use = "-fprofile-use"
- return namespace(
- gen_cflags=["-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"],
- gen_ldflags=["-fprofile-generate"],
-- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
-- use_ldflags=["-fprofile-use"],
-+ use_cflags=[profile_use, "-fprofile-correction",
"-Wcoverage-mismatch"],
-+ use_ldflags=[profile_use],
- )
-
- if compiler.type in ("clang-cl", "clang"):
-diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
-index 7f3de106ab..89289a7756 100755
---- a/build/pgo/profileserver.py
-+++ b/build/pgo/profileserver.py
-@@ -11,7 +11,7 @@ import glob
- import subprocess
-
- import mozcrash
--from mozbuild.base import MozbuildObject, BinaryNotFoundException
-+from mozbuild.base import MozbuildObject, BinaryNotFoundException,
BuildEnvironmentNotFoundException
- from mozfile import TemporaryDirectory
- from mozhttpd import MozHttpd
- from mozprofile import FirefoxProfile, Preferences
-@@ -87,9 +87,22 @@ if __name__ == "__main__":
- locations = ServerLocations()
- locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
-
-- old_profraw_files = glob.glob("*.profraw")
-- for f in old_profraw_files:
-- os.remove(f)
-+ using_gcc = False
-+ try:
-+ if build.config_environment.substs.get("CC_TYPE") == "gcc":
-+ using_gcc = True
-+ except BuildEnvironmentNotFoundException:
-+ pass
-+
-+ if using_gcc:
-+ for dirpath, _, filenames in os.walk("."):
-+ for f in filenames:
-+ if f.endswith(".gcda"):
-+ os.remove(os.path.join(dirpath, f))
-+ else:
-+ old_profraw_files = glob.glob("*.profraw")
-+ for f in old_profraw_files:
-+ os.remove(f)
-
- with TemporaryDirectory() as profilePath:
- # TODO: refactor this into mozprofile
-@@ -212,6 +225,11 @@ if __name__ == "__main__":
- print("Firefox exited successfully, but produced a crashreport")
- sys.exit(1)
-
-+ if using_gcc:
-+ print("Copying profile data...")
-+ os.system("pwd");
-+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd
..; tar xf instrumented/profdata.tar.gz;');
-+
- llvm_profdata = env.get("LLVM_PROFDATA")
- if llvm_profdata:
- profraw_files = glob.glob("*.profraw")
---
-2.34.1
-
diff --git a/http/firefox/patches/0020-build-Disable-Werror.patch
b/http/firefox/patches/0020-build-Disable-Werror.patch
new file mode 100644
index 0000000..e1df117
--- /dev/null
+++ b/http/firefox/patches/0020-build-Disable-Werror.patch
@@ -0,0 +1,24 @@
+diff -Naur a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
+--- a/build/moz.configure/warnings.configure 2022-10-10 19:05:25.000000000
+0300
++++ b/build/moz.configure/warnings.configure 2022-10-18 13:59:24.514026407
+0300
+@@ -160,6 +160,9 @@
+ # false positives depending on optimization
+ check_and_add_warning("-Wno-error=array-bounds")
+
++# can't get rid of those PGO warnings
++check_and_add_warning("-Wno-error=coverage-mismatch")
++
+ # false positives depending on optimizations
+ check_and_add_warning("-Wno-error=free-nonheap-object")
+
+@@ -279,8 +282,8 @@
+ # build, but we're not sure why.
+ check_and_add_warning("-Wno-enum-compare")
+
+-# Make it an error to be missing function declarations for C code.
+-check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
++check_and_add_warning("-Werror=implicit-function-declaration",
++ when="--enable-warnings-as-errors")
+
+ # New in clang 11. We can't really do anything about this warning.
+ check_and_add_warning("-Wno-psabi")
diff --git
a/http/firefox/patches/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
new file mode 100644
index 0000000..32bd0eb
--- /dev/null
+++
b/http/firefox/patches/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
@@ -0,0 +1,34 @@
+From 685e82ac82921720c6cd9c6c45703ff034f081e7 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Sat, 29 Aug 2020 22:30:59 +0200
+Subject: [PATCH 25/30] LTO: Only enable LTO for Rust when complete build uses
+ LTO
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/makefiles/rust.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
+index 75570d32b9..924722a506 100644
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -87,6 +87,7 @@ endif
+ # These flags are passed via `cargo rustc` and only apply to the final rustc
+ # invocation (i.e., only the top-level crate, not its dependencies).
+ cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
++ifdef MOZ_LTO
+ ifndef DEVELOPER_OPTIONS
+ ifndef MOZ_DEBUG_RUST
+ # Enable link-time optimization for release builds, but not when linking
+@@ -106,6 +107,7 @@ endif
+ endif
+ endif
+ endif
++endif
+
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch

b/http/firefox/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
deleted file mode 100644
index 85c305f..0000000
---
a/http/firefox/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6e220b49aee7dbdcafd255f6260517c5c551f9b1 Mon Sep 17 00:00:00 2001
-From: Mike Hommey <mh AT glandium.org>
-Date: Mon, 26 Nov 2018 09:59:56 +0900
-Subject: [PATCH 23/30] libaom: Use NEON_FLAGS instead of VPX_ASFLAGS for
- libaom neon code
-
-Bug: https://bugs.gentoo.org/730606
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- media/libaom/moz.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/media/libaom/moz.build b/media/libaom/moz.build
-index fd8c7f2b33..db3f9ca6ec 100644
---- a/media/libaom/moz.build
-+++ b/media/libaom/moz.build
-@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm':
-
- for f in SOURCES:
- if f.endswith('neon.c'):
-- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
-+ SOURCES[f].flags += CONFIG['NEON_FLAGS']
-
- if CONFIG['OS_TARGET'] == 'Android':
- # For cpu-features.h
---
-2.34.1
-
diff --git
a/http/firefox/patches/0022-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0022-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
new file mode 100644
index 0000000..5e48dd2
--- /dev/null
+++
b/http/firefox/patches/0022-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
@@ -0,0 +1,23 @@
+Enable FLAC on platforms without ffvpx like powerpc*
+
+--- a/dom/media/flac/FlacDecoder.cpp
++++ b/dom/media/flac/FlacDecoder.cpp
+@@ -7,6 +7,7 @@
+ #include "FlacDecoder.h"
+ #include "MediaContainerType.h"
+ #include "mozilla/StaticPrefs_media.h"
++#include "PDMFactory.h"
+
+ namespace mozilla {
+
+@@ -14,6 +15,10 @@ namespace mozilla {
+ bool FlacDecoder::IsEnabled() {
+ #ifdef MOZ_FFVPX
+ return StaticPrefs::media_flac_enabled();
++#elif defined(MOZ_FFMPEG)
++ RefPtr<PDMFactory> platform = new PDMFactory();
++ return StaticPrefs::media_flac_enabled() &&
++ (platform->SupportsMimeType("audio/flac"_ns) !=
media::DecodeSupport::Unsupported);
+ #else
+ return false;
+ #endif
diff --git a/http/firefox/patches/0022-build-Disable-Werror.patch
b/http/firefox/patches/0022-build-Disable-Werror.patch
deleted file mode 100644
index e1df117..0000000
--- a/http/firefox/patches/0022-build-Disable-Werror.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naur a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
---- a/build/moz.configure/warnings.configure 2022-10-10 19:05:25.000000000
+0300
-+++ b/build/moz.configure/warnings.configure 2022-10-18 13:59:24.514026407
+0300
-@@ -160,6 +160,9 @@
- # false positives depending on optimization
- check_and_add_warning("-Wno-error=array-bounds")
-
-+# can't get rid of those PGO warnings
-+check_and_add_warning("-Wno-error=coverage-mismatch")
-+
- # false positives depending on optimizations
- check_and_add_warning("-Wno-error=free-nonheap-object")
-
-@@ -279,8 +282,8 @@
- # build, but we're not sure why.
- check_and_add_warning("-Wno-enum-compare")
-
--# Make it an error to be missing function declarations for C code.
--check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
-+check_and_add_warning("-Werror=implicit-function-declaration",
-+ when="--enable-warnings-as-errors")
-
- # New in clang 11. We can't really do anything about this warning.
- check_and_add_warning("-Wno-psabi")
diff --git
a/http/firefox/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
deleted file mode 100644
index 32bd0eb..0000000
---
a/http/firefox/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 685e82ac82921720c6cd9c6c45703ff034f081e7 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Sat, 29 Aug 2020 22:30:59 +0200
-Subject: [PATCH 25/30] LTO: Only enable LTO for Rust when complete build uses
- LTO
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/makefiles/rust.mk | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
-index 75570d32b9..924722a506 100644
---- a/config/makefiles/rust.mk
-+++ b/config/makefiles/rust.mk
-@@ -87,6 +87,7 @@ endif
- # These flags are passed via `cargo rustc` and only apply to the final rustc
- # invocation (i.e., only the top-level crate, not its dependencies).
- cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
-+ifdef MOZ_LTO
- ifndef DEVELOPER_OPTIONS
- ifndef MOZ_DEBUG_RUST
- # Enable link-time optimization for release builds, but not when linking
-@@ -106,6 +107,7 @@ endif
- endif
- endif
- endif
-+endif
-
- ifdef CARGO_INCREMENTAL
- export CARGO_INCREMENTAL
---
-2.34.1
-
diff --git
a/http/firefox/patches/0023-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0023-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
new file mode 100644
index 0000000..856361d
--- /dev/null
+++
b/http/firefox/patches/0023-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
@@ -0,0 +1,96 @@
+From 0b53fcfa8ee76ccc2d77abb947810f631efaecd9 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Fri, 11 Dec 2020 15:37:38 +0100
+Subject: [PATCH 29/30] bmo#1670333: OpenH264: Fix decoding if it starts on
non
+ IDR I-frame
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/mp4/MP4Demuxer.cpp | 8 ++++++++
+ dom/media/platforms/PDMFactory.cpp | 15 ++++++++++-----
+ dom/media/platforms/PDMFactory.h | 2 ++
+ 3 files changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/dom/media/mp4/MP4Demuxer.cpp b/dom/media/mp4/MP4Demuxer.cpp
+index 59bba16577..0304e3e89f 100644
+--- a/dom/media/mp4/MP4Demuxer.cpp
++++ b/dom/media/mp4/MP4Demuxer.cpp
+@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { return
gMediaDemuxerLog; }
+ DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
+ __func__, ##__VA_ARGS__)
+
++extern bool gUseKeyframeFromContainer;
++
+ namespace mozilla {
+
+ DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
+@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData>
MP4TrackDemuxer::GetNextSample() {
+ [[fallthrough]];
+ case H264::FrameType::OTHER: {
+ bool keyframe = type == H264::FrameType::I_FRAME;
++ if (gUseKeyframeFromContainer) {
++ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
++ sample->mKeyframe = keyframe;
++ }
++ break;
++ }
+ if (sample->mKeyframe != keyframe) {
+ NS_WARNING(nsPrintfCString("Frame incorrectly marked as
%skeyframe "
+ "@ pts:%" PRId64 " dur:%" PRId64
+diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
+index 4e377082ae..e778eb9948 100644
+--- a/dom/media/platforms/PDMFactory.cpp
++++ b/dom/media/platforms/PDMFactory.cpp
+@@ -58,6 +58,8 @@
+
+ #include <functional>
+
++bool gUseKeyframeFromContainer = false;
++
+ namespace mozilla {
+
+ #define PDM_INIT_LOG(msg, ...) \
+@@ -536,10 +538,12 @@ void PDMFactory::CreateContentPDMs() {
+ }
+ #endif
+ #ifdef MOZ_FFMPEG
+- if (StaticPrefs::media_ffmpeg_enabled() &&
+- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
+- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
+- FFmpegRuntimeLinker::LinkStatusCode());
++ if (StaticPrefs::media_ffmpeg_enabled()) {
++ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
++ if (!mFFmpegUsed) {
++ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
++ FFmpegRuntimeLinker::LinkStatusCode());
++ }
+ }
+ #endif
+ #ifdef MOZ_FFVPX
+@@ -556,8 +560,9 @@ void PDMFactory::CreateContentPDMs() {
+
+ CreateAndStartupPDM<AgnosticDecoderModule>();
+
+- if (StaticPrefs::media_gmp_decoder_enabled() &&
++ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
+ !CreateAndStartupPDM<GMPDecoderModule>()) {
++ gUseKeyframeFromContainer = true;
+ mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
+ }
+ }
+diff --git a/dom/media/platforms/PDMFactory.h
b/dom/media/platforms/PDMFactory.h
+index 4fc81c0b37..72f3255b6f 100644
+--- a/dom/media/platforms/PDMFactory.h
++++ b/dom/media/platforms/PDMFactory.h
+@@ -122,6 +122,8 @@ class PDMFactory final {
+
+ DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
+
++ bool mFFmpegUsed = false;
++
+ friend class RemoteVideoDecoderParent;
+ static void EnsureInit();
+ };
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
deleted file mode 100644
index 5e48dd2..0000000
---
a/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Enable FLAC on platforms without ffvpx like powerpc*
-
---- a/dom/media/flac/FlacDecoder.cpp
-+++ b/dom/media/flac/FlacDecoder.cpp
-@@ -7,6 +7,7 @@
- #include "FlacDecoder.h"
- #include "MediaContainerType.h"
- #include "mozilla/StaticPrefs_media.h"
-+#include "PDMFactory.h"
-
- namespace mozilla {
-
-@@ -14,6 +15,10 @@ namespace mozilla {
- bool FlacDecoder::IsEnabled() {
- #ifdef MOZ_FFVPX
- return StaticPrefs::media_flac_enabled();
-+#elif defined(MOZ_FFMPEG)
-+ RefPtr<PDMFactory> platform = new PDMFactory();
-+ return StaticPrefs::media_flac_enabled() &&
-+ (platform->SupportsMimeType("audio/flac"_ns) !=
media::DecodeSupport::Unsupported);
- #else
- return false;
- #endif
diff --git
a/http/firefox/patches/0024-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0024-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
new file mode 100644
index 0000000..4cc43ea
--- /dev/null
+++
b/http/firefox/patches/0024-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
@@ -0,0 +1,37 @@
+diff -up firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h
+--- firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
2022-06-08 23:06:36.000000000 +0200
++++ firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h 2022-06-09
17:17:04.775008085 +0200
+@@ -27,7 +27,7 @@ class GMPSharedMem {
+ // returned to the parent pool (which is not included). If more than
+ // this are needed, we presume the client has either crashed or hung
+ // (perhaps temporarily).
+- static const uint32_t kGMPBufLimit = 20;
++ static const uint32_t kGMPBufLimit = 40;
+
+ GMPSharedMem() {
+ for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);
+diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+---
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
++++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
2022-06-09 20:31:25.120035588 +0200
+@@ -84,6 +84,9 @@ media::DecodeSupportSet GMPDecoderModule
+
+ media::DecodeSupportSet GMPDecoderModule::SupportsMimeType(
+ const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics)
const {
++ if (MP4Decoder::IsH264(aMimeType)) {
++ return media::DecodeSupport::SoftwareDecode;
++ }
+ return media::DecodeSupport::Unsupported;
+ }
+
+diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+---
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
++++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
2022-06-09 17:17:04.776008117 +0200
+@@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
+ RefPtr<GMPVideoDecoder> self = this;
+ if (v) {
+ mDecodedData.AppendElement(std::move(v));
++ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
++ mDecodedData = DecodedData();
+ } else {
+ mDecodedData.Clear();
+ mDecodePromise.RejectIfExists(
diff --git a/http/firefox/patches/0025-bgo-816975-fix-build-on-x86.patch
b/http/firefox/patches/0025-bgo-816975-fix-build-on-x86.patch
new file mode 100644
index 0000000..4b2289f
--- /dev/null
+++ b/http/firefox/patches/0025-bgo-816975-fix-build-on-x86.patch
@@ -0,0 +1,16 @@
+diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
+index 51d79f9c2ec59..fafd7d6fc1e0d 100644
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,11 @@
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
+
++#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
++typedef long double __double_t;
++#else
+ typedef double __double_t;
++#endif
+ typedef __double_t double_t;
+
+ /*
diff --git
a/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
deleted file mode 100644
index 856361d..0000000
---
a/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 0b53fcfa8ee76ccc2d77abb947810f631efaecd9 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Fri, 11 Dec 2020 15:37:38 +0100
-Subject: [PATCH 29/30] bmo#1670333: OpenH264: Fix decoding if it starts on
non
- IDR I-frame
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/mp4/MP4Demuxer.cpp | 8 ++++++++
- dom/media/platforms/PDMFactory.cpp | 15 ++++++++++-----
- dom/media/platforms/PDMFactory.h | 2 ++
- 3 files changed, 20 insertions(+), 5 deletions(-)
-
-diff --git a/dom/media/mp4/MP4Demuxer.cpp b/dom/media/mp4/MP4Demuxer.cpp
-index 59bba16577..0304e3e89f 100644
---- a/dom/media/mp4/MP4Demuxer.cpp
-+++ b/dom/media/mp4/MP4Demuxer.cpp
-@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { return
gMediaDemuxerLog; }
- DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
- __func__, ##__VA_ARGS__)
-
-+extern bool gUseKeyframeFromContainer;
-+
- namespace mozilla {
-
- DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
-@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData>
MP4TrackDemuxer::GetNextSample() {
- [[fallthrough]];
- case H264::FrameType::OTHER: {
- bool keyframe = type == H264::FrameType::I_FRAME;
-+ if (gUseKeyframeFromContainer) {
-+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
-+ sample->mKeyframe = keyframe;
-+ }
-+ break;
-+ }
- if (sample->mKeyframe != keyframe) {
- NS_WARNING(nsPrintfCString("Frame incorrectly marked as
%skeyframe "
- "@ pts:%" PRId64 " dur:%" PRId64
-diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
-index 4e377082ae..e778eb9948 100644
---- a/dom/media/platforms/PDMFactory.cpp
-+++ b/dom/media/platforms/PDMFactory.cpp
-@@ -58,6 +58,8 @@
-
- #include <functional>
-
-+bool gUseKeyframeFromContainer = false;
-+
- namespace mozilla {
-
- #define PDM_INIT_LOG(msg, ...) \
-@@ -536,10 +538,12 @@ void PDMFactory::CreateContentPDMs() {
- }
- #endif
- #ifdef MOZ_FFMPEG
-- if (StaticPrefs::media_ffmpeg_enabled() &&
-- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-- FFmpegRuntimeLinker::LinkStatusCode());
-+ if (StaticPrefs::media_ffmpeg_enabled()) {
-+ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
-+ if (!mFFmpegUsed) {
-+ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-+ FFmpegRuntimeLinker::LinkStatusCode());
-+ }
- }
- #endif
- #ifdef MOZ_FFVPX
-@@ -556,8 +560,9 @@ void PDMFactory::CreateContentPDMs() {
-
- CreateAndStartupPDM<AgnosticDecoderModule>();
-
-- if (StaticPrefs::media_gmp_decoder_enabled() &&
-+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
- !CreateAndStartupPDM<GMPDecoderModule>()) {
-+ gUseKeyframeFromContainer = true;
- mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
- }
- }
-diff --git a/dom/media/platforms/PDMFactory.h
b/dom/media/platforms/PDMFactory.h
-index 4fc81c0b37..72f3255b6f 100644
---- a/dom/media/platforms/PDMFactory.h
-+++ b/dom/media/platforms/PDMFactory.h
-@@ -122,6 +122,8 @@ class PDMFactory final {
-
- DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
-
-+ bool mFFmpegUsed = false;
-+
- friend class RemoteVideoDecoderParent;
- static void EnsureInit();
- };
---
-2.34.1
-
diff --git a/http/firefox/patches/0026-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox/patches/0026-bmo-1559213-fix-system-av1-libs.patch
new file mode 100644
index 0000000..361c0b6
--- /dev/null
+++ b/http/firefox/patches/0026-bmo-1559213-fix-system-av1-libs.patch
@@ -0,0 +1,23 @@
+diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+index 0069865..e806fc8 100644
+--- a/media/ffvpx/libavcodec/moz.build
++++ b/media/ffvpx/libavcodec/moz.build
+@@ -108,10 +108,14 @@
+ 'vp9prob.c',
+ 'vp9recon.c'
+ ]
+- USE_LIBS += [
+- 'dav1d',
+- 'media_libdav1d_asm',
+- ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
++ else:
++ USE_LIBS += [
++ 'dav1d',
++ 'media_libdav1d_asm',
++ ]
+ if CONFIG['MOZ_WAYLAND']:
+ LOCAL_INCLUDES += ['/media/mozva']
+ SOURCES += [
diff --git
a/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
deleted file mode 100644
index 4cc43ea..0000000
---
a/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -up firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h
---- firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
2022-06-08 23:06:36.000000000 +0200
-+++ firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h 2022-06-09
17:17:04.775008085 +0200
-@@ -27,7 +27,7 @@ class GMPSharedMem {
- // returned to the parent pool (which is not included). If more than
- // this are needed, we presume the client has either crashed or hung
- // (perhaps temporarily).
-- static const uint32_t kGMPBufLimit = 20;
-+ static const uint32_t kGMPBufLimit = 40;
-
- GMPSharedMem() {
- for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);
-diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
----
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
-+++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
2022-06-09 20:31:25.120035588 +0200
-@@ -84,6 +84,9 @@ media::DecodeSupportSet GMPDecoderModule
-
- media::DecodeSupportSet GMPDecoderModule::SupportsMimeType(
- const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics)
const {
-+ if (MP4Decoder::IsH264(aMimeType)) {
-+ return media::DecodeSupport::SoftwareDecode;
-+ }
- return media::DecodeSupport::Unsupported;
- }
-
-diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
----
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
-+++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
2022-06-09 17:17:04.776008117 +0200
-@@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
- RefPtr<GMPVideoDecoder> self = this;
- if (v) {
- mDecodedData.AppendElement(std::move(v));
-+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
-+ mDecodedData = DecodedData();
- } else {
- mDecodedData.Clear();
- mDecodePromise.RejectIfExists(
diff --git a/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
b/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
deleted file mode 100644
index 4b2289f..0000000
--- a/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
-index 51d79f9c2ec59..fafd7d6fc1e0d 100644
---- a/modules/fdlibm/src/math_private.h
-+++ b/modules/fdlibm/src/math_private.h
-@@ -30,7 +30,11 @@
- * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
- */
-
-+#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
-+typedef long double __double_t;
-+#else
- typedef double __double_t;
-+#endif
- typedef __double_t double_t;
-
- /*
diff --git
a/http/firefox/patches/0027-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0027-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..864741e
--- /dev/null
+++ b/http/firefox/patches/0027-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
@@ -0,0 +1,13 @@
+diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
+--- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
++++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
+@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
+- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
++ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
++ GDK_FOCUS_CHANGE_MASK;
+
+ /* utility functions */
+ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git a/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
deleted file mode 100644
index 361c0b6..0000000
--- a/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
-index 0069865..e806fc8 100644
---- a/media/ffvpx/libavcodec/moz.build
-+++ b/media/ffvpx/libavcodec/moz.build
-@@ -108,10 +108,14 @@
- 'vp9prob.c',
- 'vp9recon.c'
- ]
-- USE_LIBS += [
-- 'dav1d',
-- 'media_libdav1d_asm',
-- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
-+ else:
-+ USE_LIBS += [
-+ 'dav1d',
-+ 'media_libdav1d_asm',
-+ ]
- if CONFIG['MOZ_WAYLAND']:
- LOCAL_INCLUDES += ['/media/mozva']
- SOURCES += [
diff --git
a/http/firefox/patches/0028-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox/patches/0028-bmo-1754469-memory_mozalloc_throw.patch
new file mode 100644
index 0000000..634892be
--- /dev/null
+++ b/http/firefox/patches/0028-bmo-1754469-memory_mozalloc_throw.patch
@@ -0,0 +1,69 @@
+--- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
++++ b/memory/mozalloc/throw_gcc.h
+@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
+ mozalloc_abort("fatal: STL threw bad_function_call");
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_invalid_argument(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_overflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_underflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
+ const char* msg) {
diff --git
a/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
deleted file mode 100644
index 864741e..0000000
--- a/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
---- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
-+++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
-@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
-- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
-+ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
-+ GDK_FOCUS_CHANGE_MASK;
-
- /* utility functions */
- static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git a/http/firefox/patches/0029-rhbz-2115253-vaapi-fixes.patch
b/http/firefox/patches/0029-rhbz-2115253-vaapi-fixes.patch
new file mode 100644
index 0000000..ddf30d1
--- /dev/null
+++ b/http/firefox/patches/0029-rhbz-2115253-vaapi-fixes.patch
@@ -0,0 +1,20 @@
+diff -up firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp.firefox-enable-vaapi
firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp
+diff -up firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi
firefox-104.0/widget/gtk/GfxInfo.cpp
+--- firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2022-08-16
15:14:53.014042400 +0200
++++ firefox-104.0/widget/gtk/GfxInfo.cpp 2022-08-16 15:15:30.482301677
+0200
+@@ -873,15 +873,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
+ V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", "");
+
+- // Disable on Release/late Beta
+-#if !defined(EARLY_BETA_OR_EARLIER)
+- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::All,
+- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
+- nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
+- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
+- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE",
"");
+-#endif
+-
+ ////////////////////////////////////
+ // FEATURE_WEBRENDER_PARTIAL_PRESENT
+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
diff --git
a/http/firefox/patches/0030-bgo-860033-firefox-wayland-no-dbus.patch
b/http/firefox/patches/0030-bgo-860033-firefox-wayland-no-dbus.patch
new file mode 100644
index 0000000..7cf532a
--- /dev/null
+++ b/http/firefox/patches/0030-bgo-860033-firefox-wayland-no-dbus.patch
@@ -0,0 +1,49 @@
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -2353,18 +2353,6 @@ with only_when(compile_environment & tar
+ )
+ set_config("MOZ_D3DCOMPILER_VISTA_DLL_PATH", d3d_compiler_dll.path)
+
+-# Remoting protocol support
+-# ==============================================================
+-
+-
+-@depends(toolkit)
+-def has_remote(toolkit):
+- if toolkit in ("gtk", "windows", "cocoa"):
+- return True
+-
+-
+-set_config("MOZ_HAS_REMOTE", has_remote)
+-set_define("MOZ_HAS_REMOTE", has_remote)
+
+ # RLBox Library Sandboxing wasm support
+ # ==============================================================
+@@ -2900,6 +2888,26 @@ with only_when(toolkit_gtk):
+ set_config("MOZ_ENABLE_DBUS", True)
+ set_define("MOZ_ENABLE_DBUS", True)
+
++# Remoting protocol support
++# ==============================================================
++
++@depends(
++ toolkit,
++ depends("--enable-dbus", when=toolkit_gtk)(lambda x: x),
++ depends(wayland_headers, when=toolkit_gtk)(lambda x: x),
++ depends(x11_headers, when=toolkit_gtk)(lambda x: x),
++)
++def has_remote(toolkit, dbus, wayland, x11):
++ if toolkit in ("windows", "cocoa"):
++ return True
++ if toolkit == "gtk":
++ if not dbus and wayland and not x11:
++ return
++ return True
++
++
++set_config("MOZ_HAS_REMOTE", has_remote)
++set_define("MOZ_HAS_REMOTE", has_remote)
+
+ # Necko's wifi scanner
+ # ==============================================================
diff --git
a/http/firefox/patches/0030-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox/patches/0030-bmo-1754469-memory_mozalloc_throw.patch
deleted file mode 100644
index 634892be..0000000
--- a/http/firefox/patches/0030-bmo-1754469-memory_mozalloc_throw.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
-+++ b/memory/mozalloc/throw_gcc.h
-@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
- mozalloc_abort("fatal: STL threw bad_function_call");
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_invalid_argument(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_overflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_underflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
- const char* msg) {
diff --git
a/http/firefox/patches/0031-bmo-1769631-python-3.11-compatibility.patch
b/http/firefox/patches/0031-bmo-1769631-python-3.11-compatibility.patch
deleted file mode 100644
index 97ac3ce..0000000
--- a/http/firefox/patches/0031-bmo-1769631-python-3.11-compatibility.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-#
https://src.fedoraproject.org/rpms/firefox/c/4d45de9bff7b7ef01f7d3c9e53a61adc9cf3ce9e?branch=4d45de9bff7b7ef01f7d3c9e53a61adc9cf3ce9e
-
-diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.build-python-3.11
firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py
---- firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.build-python-3.11
2022-06-23 09:10:31.000000000 +0200
-+++ firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-15
16:18:52.048351493 +0200
-@@ -1572,13 +1572,13 @@ class IDLParser(object):
- t_ignore = " \t"
-
- def t_multilinecomment(self, t):
-- r"/\*(?s).*?\*/"
-+ r"/\*(?s:.)*?\*/"
- t.lexer.lineno += t.value.count("\n")
- if t.value.startswith("/**"):
- self._doccomments.append(t.value)
-
- def t_singlelinecomment(self, t):
-- r"(?m)//.*?$"
-+ r"(?m://.*?$)"
-
- def t_IID(self, t):
- return t
-@@ -1591,7 +1591,7 @@ class IDLParser(object):
- return t
-
- def t_LCDATA(self, t):
-- r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
-+ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?)"
- t.type = "CDATA"
- t.value = t.lexer.lexmatch.group("cdata")
- t.lexer.lineno += t.value.count("\n")
diff --git
a/http/firefox/patches/0031-bmo-1775202-ppc64-webrtc-missing-conditions.patch
b/http/firefox/patches/0031-bmo-1775202-ppc64-webrtc-missing-conditions.patch
new file mode 100644
index 0000000..b1748de
--- /dev/null
+++
b/http/firefox/patches/0031-bmo-1775202-ppc64-webrtc-missing-conditions.patch
@@ -0,0 +1,17 @@
+diff --git a/third_party/libwebrtc/moz.build
b/third_party/libwebrtc/moz.build
+index 8579f8bb3622..d9ca79d4fcb8 100644
+--- a/third_party/libwebrtc/moz.build
++++ b/third_party/libwebrtc/moz.build
+@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and
CONFIG["OS_TARGET"] == "Linux":
+
"/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
+
"/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
+ "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
+- "/third_party/libwebrtc/modules/audio_coding/isac_gn"
++ "/third_party/libwebrtc/modules/audio_coding/isac_gn",
++
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",
++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
+ ]
+
+ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
+
diff --git
a/http/firefox/patches/0032-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
b/http/firefox/patches/0032-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
new file mode 100644
index 0000000..51f7faa
--- /dev/null
+++ b/http/firefox/patches/0032-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
@@ -0,0 +1,55 @@
+From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel AT octaforge.org>
+Date: Fri, 23 Sep 2022 02:38:29 +0200
+Subject: [PATCH] fix sqlite3 on ppc with clang
+
+The __ppc__ macro is always defined on clang but not gcc, which
+results in sqlite mistakenly thinking that ppc64le with clang
+is big endian.
+
+Also disable some inline assembly stuff on ppc that is never used
+with gcc and probably was never tested with modern machines.
+---
+ third_party/sqlite3/src/sqlite3.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/third_party/sqlite3/src/sqlite3.c
b/third_party/sqlite3/src/sqlite3.c
+index 4f3dc68..9017062 100644
+--- a/third_party/sqlite3/src/sqlite3.c
++++ b/third_party/sqlite3/src/sqlite3.c
+@@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
+ # if defined(i386) || defined(__i386__) || defined(_M_IX86) ||
\
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) ||
\
+ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) ||
\
+- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||
defined(__LITTLE_ENDIAN__)
+ # define SQLITE_BYTEORDER 1234
+-# elif defined(sparc) || defined(__ppc__) || \
++# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
+ defined(__ARMEB__) || defined(__AARCH64EB__)
+ # define SQLITE_BYTEORDER 4321
+ # else
+@@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char
**sqlite3CompileOptions(int *pnOpt);
+ return val;
+ }
+
+-#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
++#elif 0
+
+ __inline__ sqlite_uint64 sqlite3Hwtime(void){
+ unsigned long long retval;
+@@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
+ #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
+ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
+- defined(__arm__)
++ defined(__arm__) || defined(__LITTLE_ENDIAN__)
+ # define SQLITE_BYTEORDER 1234
+-#elif defined(sparc) || defined(__ppc__)
++#elif defined(sparc) || defined(__BIG_ENDIAN__)
+ # define SQLITE_BYTEORDER 4321
+ #else
+ # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
+--
+2.37.3
+
diff --git a/http/firefox/patches/0032-rhbz-2115253-vaapi-fixes.patch
b/http/firefox/patches/0032-rhbz-2115253-vaapi-fixes.patch
deleted file mode 100644
index ddf30d1..0000000
--- a/http/firefox/patches/0032-rhbz-2115253-vaapi-fixes.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -up firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp.firefox-enable-vaapi
firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp
-diff -up firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi
firefox-104.0/widget/gtk/GfxInfo.cpp
---- firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2022-08-16
15:14:53.014042400 +0200
-+++ firefox-104.0/widget/gtk/GfxInfo.cpp 2022-08-16 15:15:30.482301677
+0200
-@@ -873,15 +873,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
- V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", "");
-
-- // Disable on Release/late Beta
--#if !defined(EARLY_BETA_OR_EARLIER)
-- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::All,
-- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
-- nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
-- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
-- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE",
"");
--#endif
--
- ////////////////////////////////////
- // FEATURE_WEBRENDER_PARTIAL_PRESENT
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
diff --git
a/http/firefox/patches/0033-bgo-860033-firefox-wayland-no-dbus.patch
b/http/firefox/patches/0033-bgo-860033-firefox-wayland-no-dbus.patch
deleted file mode 100644
index 7cf532a..0000000
--- a/http/firefox/patches/0033-bgo-860033-firefox-wayland-no-dbus.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -2353,18 +2353,6 @@ with only_when(compile_environment & tar
- )
- set_config("MOZ_D3DCOMPILER_VISTA_DLL_PATH", d3d_compiler_dll.path)
-
--# Remoting protocol support
--# ==============================================================
--
--
--@depends(toolkit)
--def has_remote(toolkit):
-- if toolkit in ("gtk", "windows", "cocoa"):
-- return True
--
--
--set_config("MOZ_HAS_REMOTE", has_remote)
--set_define("MOZ_HAS_REMOTE", has_remote)
-
- # RLBox Library Sandboxing wasm support
- # ==============================================================
-@@ -2900,6 +2888,26 @@ with only_when(toolkit_gtk):
- set_config("MOZ_ENABLE_DBUS", True)
- set_define("MOZ_ENABLE_DBUS", True)
-
-+# Remoting protocol support
-+# ==============================================================
-+
-+@depends(
-+ toolkit,
-+ depends("--enable-dbus", when=toolkit_gtk)(lambda x: x),
-+ depends(wayland_headers, when=toolkit_gtk)(lambda x: x),
-+ depends(x11_headers, when=toolkit_gtk)(lambda x: x),
-+)
-+def has_remote(toolkit, dbus, wayland, x11):
-+ if toolkit in ("windows", "cocoa"):
-+ return True
-+ if toolkit == "gtk":
-+ if not dbus and wayland and not x11:
-+ return
-+ return True
-+
-+
-+set_config("MOZ_HAS_REMOTE", has_remote)
-+set_define("MOZ_HAS_REMOTE", has_remote)
-
- # Necko's wifi scanner
- # ==============================================================
diff --git
a/http/firefox/patches/0033-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
b/http/firefox/patches/0033-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
new file mode 100644
index 0000000..3dd71d7
--- /dev/null
+++
b/http/firefox/patches/0033-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
@@ -0,0 +1,22 @@
+diff --git a/media/libyuv/libyuv/source/row_neon.cc
b/media/libyuv/libyuv/source/row_neon.cc
+index 14eed6f..89d4d9d 100644
+--- a/media/libyuv/libyuv/source/row_neon.cc
++++ b/media/libyuv/libyuv/source/row_neon.cc
+@@ -588,7 +588,7 @@ void DetileRow_NEON(const uint8_t* src,
+ "1: \n"
+ "vld1.16 {q0}, [%0], %3 \n" // load 16 bytes
+ "subs %2, %2, #16 \n" // 16 processed per
loop
+- "pld [%0, 1792] \n"
++ "pld [%0, #1792] \n"
+ "vst1.16 {q0}, [%1]! \n" // store 16 bytes
+ "bgt 1b \n"
+ : "+r"(src), // %0
+@@ -609,7 +609,7 @@ void DetileSplitUVRow_NEON(const uint8_t* src_uv,
+ "1: \n"
+ "vld2.8 {d0, d1}, [%0], %4 \n"
+ "subs %3, %3, #16 \n"
+- "pld [%0, 1792] \n"
++ "pld [%0, #1792] \n"
+ "vst1.8 {d0}, [%1]! \n"
+ "vst1.8 {d1}, [%2]! \n"
+ "bgt 1b \n"
diff --git
a/http/firefox/patches/0034-bgo-877267-rust-opaque-binding-type.patch
b/http/firefox/patches/0034-bgo-877267-rust-opaque-binding-type.patch
new file mode 100644
index 0000000..8bd2e53
--- /dev/null
+++ b/http/firefox/patches/0034-bgo-877267-rust-opaque-binding-type.patch
@@ -0,0 +1,253 @@
+From a5848cf44e02645cddf020609ea67340cf6e3d24 Mon Sep 17 00:00:00 2001
+From: Collin Baker <collinbaker AT chromium.org>
+Date: Wed, 20 Jul 2022 11:57:16 -0400
+Subject: [PATCH] Generate opaque type for template param dependent bit field
+ width
+
+libclang's API does not provide a straightforward way to check for
+this, and calling clang_getFieldDeclBitWidth is actively unsafe in
+this case. See https://github.com/llvm/llvm-project/issues/56644
+
+We probably can't generate reasonable bindings for such a type, so
+make the binding opaque.
+
+Ideally libclang would report if the bit width could not be
+evaluated. Unfortunately making such a change would mean bumping the
+minimum libclang version from 6.0 to 15.0.
+
+Instead, add logic to traverse the AST subtree starting from the
+field's bit width specifier looking for template parameters. If we
+find one, we make the resulting type opaque.
+---
+ src/clang.rs | 96 ++++++++++++++++++-
+ src/ir/comp.rs | 26 ++++-
+ ...issue-2239-template-dependent-bit-width.rs | 19 ++++
+ ...ssue-2239-template-dependent-bit-width.hpp | 10 ++
+ 4 files changed, 147 insertions(+), 4 deletions(-)
+ create mode 100644
tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
+ create mode 100644 tests/headers/issue-2239-template-dependent-bit-width.hpp
+
+diff --git a/third_party/rust/bindgen/src/clang.rs
b/third_party/rust/bindgen/src/clang.rs
+index 587cc0ba7..00716a1bd 100644
+--- a/third_party/rust/bindgen/src/clang.rs
++++ b/third_party/rust/bindgen/src/clang.rs
+@@ -276,6 +276,56 @@ impl Cursor {
+ true
+ }
+
++ /// Is the referent any kind of template parameter?
++ pub fn is_template_parameter(&self) -> bool {
++ match self.kind() {
++ CXCursor_TemplateTemplateParameter |
++ CXCursor_TemplateTypeParameter |
++ CXCursor_NonTypeTemplateParameter => true,
++ _ => false,
++ }
++ }
++
++ /// Does the referent's type or value depend on a template parameter?
++ pub fn is_dependent_on_template_parameter(&self) -> bool {
++ fn visitor(
++ found_template_parameter: &mut bool,
++ cur: Cursor,
++ ) -> CXChildVisitResult {
++ // If we found a template parameter, it is dependent.
++ if cur.is_template_parameter() {
++ *found_template_parameter = true;
++ return CXChildVisit_Break;
++ }
++
++ // Get the referent and traverse it as well.
++ if let Some(referenced) = cur.referenced() {
++ if referenced.is_template_parameter() {
++ *found_template_parameter = true;
++ return CXChildVisit_Break;
++ }
++
++ referenced
++ .visit(|next| visitor(found_template_parameter, next));
++ if *found_template_parameter {
++ return CXChildVisit_Break;
++ }
++ }
++
++ // Continue traversing the AST at the original cursor.
++ CXChildVisit_Recurse
++ }
++
++ if self.is_template_parameter() {
++ return true;
++ }
++
++ let mut found_template_parameter = false;
++ self.visit(|next| visitor(&mut found_template_parameter, next));
++
++ found_template_parameter
++ }
++
+ /// Is this cursor pointing a valid referent?
+ pub fn is_valid(&self) -> bool {
+ unsafe { clang_isInvalid(self.kind()) == 0 }
+@@ -485,9 +535,45 @@ impl Cursor {
+ !self.is_defaulted_function()
+ }
+
++ /// Is the referent a bit field declaration?
++ pub fn is_bit_field(&self) -> bool {
++ unsafe { clang_Cursor_isBitField(self.x) != 0 }
++ }
++
++ /// Get a cursor to the bit field's width expression, or `None` if it's
not
++ /// a bit field.
++ pub fn bit_width_expr(&self) -> Option<Cursor> {
++ if !self.is_bit_field() {
++ return None;
++ }
++
++ let mut result = None;
++ self.visit(|cur| {
++ // The first child may or may not be a TypeRef, depending on
whether
++ // the field's type is builtin. Skip it.
++ if cur.kind() == CXCursor_TypeRef {
++ return CXChildVisit_Continue;
++ }
++
++ // The next expression or literal is the bit width.
++ result = Some(cur);
++
++ CXChildVisit_Break
++ });
++
++ result
++ }
++
+ /// Get the width of this cursor's referent bit field, or `None` if the
+- /// referent is not a bit field.
++ /// referent is not a bit field or if the width could not be evaluated.
+ pub fn bit_width(&self) -> Option<u32> {
++ // It is not safe to check the bit width without ensuring it doesn't
++ // depend on a template parameter. See
++ // https://github.com/rust-lang/rust-bindgen/issues/2239
++ if self.bit_width_expr()?.is_dependent_on_template_parameter() {
++ return None;
++ }
++
+ unsafe {
+ let w = clang_getFieldDeclBitWidth(self.x);
+ if w == -1 {
+@@ -1789,9 +1875,15 @@ pub fn ast_dump(c: &Cursor, depth: isize) ->
CXChildVisitResult {
+ format!(" {}number-of-template-args = {}", prefix, num),
+ );
+ }
+- if let Some(width) = c.bit_width() {
++
++ if c.is_bit_field() {
++ let width = match c.bit_width() {
++ Some(w) => w.to_string(),
++ None => "<unevaluable>".to_string(),
++ };
+ print_indent(depth, format!(" {}bit-width = {}", prefix,
width));
+ }
++
+ if let Some(ty) = c.enum_type() {
+ print_indent(
+ depth,
+diff --git a/third_party/rust/bindgen/src/ir/comp.rs
b/third_party/rust/bindgen/src/ir/comp.rs
+index a221e5207..9808d5986 100644
+--- a/third_party/rust/bindgen/src/ir/comp.rs
++++ b/third_party/rust/bindgen/src/ir/comp.rs
+@@ -1045,6 +1045,11 @@ pub struct CompInfo {
+ /// size_t)
+ has_non_type_template_params: bool,
+
++ /// Whether this type has a bit field member whose width couldn't be
++ /// evaluated (e.g. if it depends on a template parameter). We generate
an
++ /// opaque type in this case.
++ has_unevaluable_bit_field_width: bool,
++
+ /// Whether we saw `__attribute__((packed))` on or within this type.
+ packed_attr: bool,
+
+@@ -1078,6 +1083,7 @@ impl CompInfo {
+ has_destructor: false,
+ has_nonempty_base: false,
+ has_non_type_template_params: false,
++ has_unevaluable_bit_field_width: false,
+ packed_attr: false,
+ found_unknown_attr: false,
+ is_forward_declaration: false,
+@@ -1317,7 +1323,21 @@ impl CompInfo {
+ }
+ }
+
+- let bit_width = cur.bit_width();
++ let bit_width = if cur.is_bit_field() {
++ let width = cur.bit_width();
++
++ // Make opaque type if the bit width couldn't be
++ // evaluated.
++ if width.is_none() {
++ ci.has_unevaluable_bit_field_width = true;
++ return CXChildVisit_Break;
++ }
++
++ width
++ } else {
++ None
++ };
++
+ let field_type = Item::from_ty_or_ref(
+ cur.cur_type(),
+ cur,
+@@ -1753,7 +1773,9 @@ impl IsOpaque for CompInfo {
+ type Extra = Option<Layout>;
+
+ fn is_opaque(&self, ctx: &BindgenContext, layout: &Option<Layout>) ->
bool {
+- if self.has_non_type_template_params {
++ if self.has_non_type_template_params ||
++ self.has_unevaluable_bit_field_width
++ {
+ return true;
+ }
+
+diff --git
a/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs

b/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
+new file mode 100644
+index 000000000..75ec9e439
+--- /dev/null
++++
b/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
+@@ -0,0 +1,19 @@
++#![allow(
++ dead_code,
++ non_snake_case,
++ non_camel_case_types,
++ non_upper_case_globals
++)]
++
++#[repr(C)]
++#[derive(Debug, Default, Copy, Clone)]
++pub struct b {
++ pub _address: u8,
++}
++pub type b_td<a> = a;
++pub type b_ta<a> = a;
++#[repr(C)]
++#[derive(Debug, Default, Copy, Clone)]
++pub struct b_foo {
++ pub _address: u8,
++}
+diff --git
a/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp

b/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp
+new file mode 100644
+index 000000000..4e6feb3f1
+--- /dev/null
++++
b/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp
+@@ -0,0 +1,10 @@
++template <class a> class b {
++ typedef a td;
++ using ta = a;
++ struct foo {
++ a foo : sizeof(a);
++ a : sizeof(a);
++ td : sizeof(td);
++ ta : sizeof(ta);
++ };
++};
diff --git
a/http/firefox/patches/0034-bmo-1775202-ppc64-webrtc-missing-conditions.patch
b/http/firefox/patches/0034-bmo-1775202-ppc64-webrtc-missing-conditions.patch
deleted file mode 100644
index b1748de..0000000
---
a/http/firefox/patches/0034-bmo-1775202-ppc64-webrtc-missing-conditions.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/third_party/libwebrtc/moz.build
b/third_party/libwebrtc/moz.build
-index 8579f8bb3622..d9ca79d4fcb8 100644
---- a/third_party/libwebrtc/moz.build
-+++ b/third_party/libwebrtc/moz.build
-@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and
CONFIG["OS_TARGET"] == "Linux":
-
"/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
-
"/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
- "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
-- "/third_party/libwebrtc/modules/audio_coding/isac_gn"
-+ "/third_party/libwebrtc/modules/audio_coding/isac_gn",
-+
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",
-+ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-+ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
- ]
-
- if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
-
diff --git
a/http/firefox/patches/0035-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
b/http/firefox/patches/0035-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
deleted file mode 100644
index 51f7faa..0000000
--- a/http/firefox/patches/0035-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel AT octaforge.org>
-Date: Fri, 23 Sep 2022 02:38:29 +0200
-Subject: [PATCH] fix sqlite3 on ppc with clang
-
-The __ppc__ macro is always defined on clang but not gcc, which
-results in sqlite mistakenly thinking that ppc64le with clang
-is big endian.
-
-Also disable some inline assembly stuff on ppc that is never used
-with gcc and probably was never tested with modern machines.
----
- third_party/sqlite3/src/sqlite3.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/third_party/sqlite3/src/sqlite3.c
b/third_party/sqlite3/src/sqlite3.c
-index 4f3dc68..9017062 100644
---- a/third_party/sqlite3/src/sqlite3.c
-+++ b/third_party/sqlite3/src/sqlite3.c
-@@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
- # if defined(i386) || defined(__i386__) || defined(_M_IX86) ||
\
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) ||
\
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) ||
\
-- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
-+ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||
defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--# elif defined(sparc) || defined(__ppc__) || \
-+# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
- defined(__ARMEB__) || defined(__AARCH64EB__)
- # define SQLITE_BYTEORDER 4321
- # else
-@@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char
**sqlite3CompileOptions(int *pnOpt);
- return val;
- }
-
--#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
-+#elif 0
-
- __inline__ sqlite_uint64 sqlite3Hwtime(void){
- unsigned long long retval;
-@@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
- #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
-- defined(__arm__)
-+ defined(__arm__) || defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--#elif defined(sparc) || defined(__ppc__)
-+#elif defined(sparc) || defined(__BIG_ENDIAN__)
- # define SQLITE_BYTEORDER 4321
- #else
- # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
---
-2.37.3
-
diff --git
a/http/firefox/patches/0036-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
b/http/firefox/patches/0036-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
deleted file mode 100644
index 3dd71d7..0000000
---
a/http/firefox/patches/0036-bmo-1787405-fix-offsets-for-row_neon-on-arm.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/media/libyuv/libyuv/source/row_neon.cc
b/media/libyuv/libyuv/source/row_neon.cc
-index 14eed6f..89d4d9d 100644
---- a/media/libyuv/libyuv/source/row_neon.cc
-+++ b/media/libyuv/libyuv/source/row_neon.cc
-@@ -588,7 +588,7 @@ void DetileRow_NEON(const uint8_t* src,
- "1: \n"
- "vld1.16 {q0}, [%0], %3 \n" // load 16 bytes
- "subs %2, %2, #16 \n" // 16 processed per
loop
-- "pld [%0, 1792] \n"
-+ "pld [%0, #1792] \n"
- "vst1.16 {q0}, [%1]! \n" // store 16 bytes
- "bgt 1b \n"
- : "+r"(src), // %0
-@@ -609,7 +609,7 @@ void DetileSplitUVRow_NEON(const uint8_t* src_uv,
- "1: \n"
- "vld2.8 {d0, d1}, [%0], %4 \n"
- "subs %3, %3, #16 \n"
-- "pld [%0, 1792] \n"
-+ "pld [%0, #1792] \n"
- "vst1.8 {d0}, [%1]! \n"
- "vst1.8 {d1}, [%2]! \n"
- "bgt 1b \n"
diff --git
a/http/firefox/patches/0037-bgo-877267-rust-opaque-binding-type.patch
b/http/firefox/patches/0037-bgo-877267-rust-opaque-binding-type.patch
deleted file mode 100644
index 8bd2e53..0000000
--- a/http/firefox/patches/0037-bgo-877267-rust-opaque-binding-type.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-From a5848cf44e02645cddf020609ea67340cf6e3d24 Mon Sep 17 00:00:00 2001
-From: Collin Baker <collinbaker AT chromium.org>
-Date: Wed, 20 Jul 2022 11:57:16 -0400
-Subject: [PATCH] Generate opaque type for template param dependent bit field
- width
-
-libclang's API does not provide a straightforward way to check for
-this, and calling clang_getFieldDeclBitWidth is actively unsafe in
-this case. See https://github.com/llvm/llvm-project/issues/56644
-
-We probably can't generate reasonable bindings for such a type, so
-make the binding opaque.
-
-Ideally libclang would report if the bit width could not be
-evaluated. Unfortunately making such a change would mean bumping the
-minimum libclang version from 6.0 to 15.0.
-
-Instead, add logic to traverse the AST subtree starting from the
-field's bit width specifier looking for template parameters. If we
-find one, we make the resulting type opaque.
----
- src/clang.rs | 96 ++++++++++++++++++-
- src/ir/comp.rs | 26 ++++-
- ...issue-2239-template-dependent-bit-width.rs | 19 ++++
- ...ssue-2239-template-dependent-bit-width.hpp | 10 ++
- 4 files changed, 147 insertions(+), 4 deletions(-)
- create mode 100644
tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
- create mode 100644 tests/headers/issue-2239-template-dependent-bit-width.hpp
-
-diff --git a/third_party/rust/bindgen/src/clang.rs
b/third_party/rust/bindgen/src/clang.rs
-index 587cc0ba7..00716a1bd 100644
---- a/third_party/rust/bindgen/src/clang.rs
-+++ b/third_party/rust/bindgen/src/clang.rs
-@@ -276,6 +276,56 @@ impl Cursor {
- true
- }
-
-+ /// Is the referent any kind of template parameter?
-+ pub fn is_template_parameter(&self) -> bool {
-+ match self.kind() {
-+ CXCursor_TemplateTemplateParameter |
-+ CXCursor_TemplateTypeParameter |
-+ CXCursor_NonTypeTemplateParameter => true,
-+ _ => false,
-+ }
-+ }
-+
-+ /// Does the referent's type or value depend on a template parameter?
-+ pub fn is_dependent_on_template_parameter(&self) -> bool {
-+ fn visitor(
-+ found_template_parameter: &mut bool,
-+ cur: Cursor,
-+ ) -> CXChildVisitResult {
-+ // If we found a template parameter, it is dependent.
-+ if cur.is_template_parameter() {
-+ *found_template_parameter = true;
-+ return CXChildVisit_Break;
-+ }
-+
-+ // Get the referent and traverse it as well.
-+ if let Some(referenced) = cur.referenced() {
-+ if referenced.is_template_parameter() {
-+ *found_template_parameter = true;
-+ return CXChildVisit_Break;
-+ }
-+
-+ referenced
-+ .visit(|next| visitor(found_template_parameter, next));
-+ if *found_template_parameter {
-+ return CXChildVisit_Break;
-+ }
-+ }
-+
-+ // Continue traversing the AST at the original cursor.
-+ CXChildVisit_Recurse
-+ }
-+
-+ if self.is_template_parameter() {
-+ return true;
-+ }
-+
-+ let mut found_template_parameter = false;
-+ self.visit(|next| visitor(&mut found_template_parameter, next));
-+
-+ found_template_parameter
-+ }
-+
- /// Is this cursor pointing a valid referent?
- pub fn is_valid(&self) -> bool {
- unsafe { clang_isInvalid(self.kind()) == 0 }
-@@ -485,9 +535,45 @@ impl Cursor {
- !self.is_defaulted_function()
- }
-
-+ /// Is the referent a bit field declaration?
-+ pub fn is_bit_field(&self) -> bool {
-+ unsafe { clang_Cursor_isBitField(self.x) != 0 }
-+ }
-+
-+ /// Get a cursor to the bit field's width expression, or `None` if it's
not
-+ /// a bit field.
-+ pub fn bit_width_expr(&self) -> Option<Cursor> {
-+ if !self.is_bit_field() {
-+ return None;
-+ }
-+
-+ let mut result = None;
-+ self.visit(|cur| {
-+ // The first child may or may not be a TypeRef, depending on
whether
-+ // the field's type is builtin. Skip it.
-+ if cur.kind() == CXCursor_TypeRef {
-+ return CXChildVisit_Continue;
-+ }
-+
-+ // The next expression or literal is the bit width.
-+ result = Some(cur);
-+
-+ CXChildVisit_Break
-+ });
-+
-+ result
-+ }
-+
- /// Get the width of this cursor's referent bit field, or `None` if the
-- /// referent is not a bit field.
-+ /// referent is not a bit field or if the width could not be evaluated.
- pub fn bit_width(&self) -> Option<u32> {
-+ // It is not safe to check the bit width without ensuring it doesn't
-+ // depend on a template parameter. See
-+ // https://github.com/rust-lang/rust-bindgen/issues/2239
-+ if self.bit_width_expr()?.is_dependent_on_template_parameter() {
-+ return None;
-+ }
-+
- unsafe {
- let w = clang_getFieldDeclBitWidth(self.x);
- if w == -1 {
-@@ -1789,9 +1875,15 @@ pub fn ast_dump(c: &Cursor, depth: isize) ->
CXChildVisitResult {
- format!(" {}number-of-template-args = {}", prefix, num),
- );
- }
-- if let Some(width) = c.bit_width() {
-+
-+ if c.is_bit_field() {
-+ let width = match c.bit_width() {
-+ Some(w) => w.to_string(),
-+ None => "<unevaluable>".to_string(),
-+ };
- print_indent(depth, format!(" {}bit-width = {}", prefix,
width));
- }
-+
- if let Some(ty) = c.enum_type() {
- print_indent(
- depth,
-diff --git a/third_party/rust/bindgen/src/ir/comp.rs
b/third_party/rust/bindgen/src/ir/comp.rs
-index a221e5207..9808d5986 100644
---- a/third_party/rust/bindgen/src/ir/comp.rs
-+++ b/third_party/rust/bindgen/src/ir/comp.rs
-@@ -1045,6 +1045,11 @@ pub struct CompInfo {
- /// size_t)
- has_non_type_template_params: bool,
-
-+ /// Whether this type has a bit field member whose width couldn't be
-+ /// evaluated (e.g. if it depends on a template parameter). We generate
an
-+ /// opaque type in this case.
-+ has_unevaluable_bit_field_width: bool,
-+
- /// Whether we saw `__attribute__((packed))` on or within this type.
- packed_attr: bool,
-
-@@ -1078,6 +1083,7 @@ impl CompInfo {
- has_destructor: false,
- has_nonempty_base: false,
- has_non_type_template_params: false,
-+ has_unevaluable_bit_field_width: false,
- packed_attr: false,
- found_unknown_attr: false,
- is_forward_declaration: false,
-@@ -1317,7 +1323,21 @@ impl CompInfo {
- }
- }
-
-- let bit_width = cur.bit_width();
-+ let bit_width = if cur.is_bit_field() {
-+ let width = cur.bit_width();
-+
-+ // Make opaque type if the bit width couldn't be
-+ // evaluated.
-+ if width.is_none() {
-+ ci.has_unevaluable_bit_field_width = true;
-+ return CXChildVisit_Break;
-+ }
-+
-+ width
-+ } else {
-+ None
-+ };
-+
- let field_type = Item::from_ty_or_ref(
- cur.cur_type(),
- cur,
-@@ -1753,7 +1773,9 @@ impl IsOpaque for CompInfo {
- type Extra = Option<Layout>;
-
- fn is_opaque(&self, ctx: &BindgenContext, layout: &Option<Layout>) ->
bool {
-- if self.has_non_type_template_params {
-+ if self.has_non_type_template_params ||
-+ self.has_unevaluable_bit_field_width
-+ {
- return true;
- }
-
-diff --git
a/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs

b/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
-new file mode 100644
-index 000000000..75ec9e439
---- /dev/null
-+++
b/third_party/rust/bindgen/tests/expectations/tests/issue-2239-template-dependent-bit-width.rs
-@@ -0,0 +1,19 @@
-+#![allow(
-+ dead_code,
-+ non_snake_case,
-+ non_camel_case_types,
-+ non_upper_case_globals
-+)]
-+
-+#[repr(C)]
-+#[derive(Debug, Default, Copy, Clone)]
-+pub struct b {
-+ pub _address: u8,
-+}
-+pub type b_td<a> = a;
-+pub type b_ta<a> = a;
-+#[repr(C)]
-+#[derive(Debug, Default, Copy, Clone)]
-+pub struct b_foo {
-+ pub _address: u8,
-+}
-diff --git
a/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp

b/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp
-new file mode 100644
-index 000000000..4e6feb3f1
---- /dev/null
-+++
b/third_party/rust/bindgen/tests/headers/issue-2239-template-dependent-bit-width.hpp
-@@ -0,0 +1,10 @@
-+template <class a> class b {
-+ typedef a td;
-+ using ta = a;
-+ struct foo {
-+ a foo : sizeof(a);
-+ a : sizeof(a);
-+ td : sizeof(td);
-+ ta : sizeof(ta);
-+ };
-+};



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (3e24e7c002f0d685796ec3dec57139709a607ab9), Pavel Vinogradov, 12/13/2022

Archive powered by MHonArc 2.6.24.

Top of Page