Skip to Content.
Sympa Menu

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

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 (0860d04aae90bf849b6afb758a510ee355ab2a84)
  • Date: Tue, 7 Dec 2021 23:29:01 +0000

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

http/firefox/DEPENDS
| 2
http/firefox/DETAILS
| 4
http/firefox/HISTORY
| 7
http/firefox/mozconfig
| 2
http/firefox/patches/0001-Don-t-use-build-id.patch
| 6
http/firefox/patches/0002-Fortify-sources-properly.patch
| 6
http/firefox/patches/0003-Check-additional-plugins-dir.patch
| 6
http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
| 20 +-
http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
| 12 -
http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
| 8
http/firefox/patches/0007-Support-sndio-audio-framework.patch
| 6
http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
| 6
http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
| 6

http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
| 6

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

http/firefox/patches/0012-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
| 35 ---
http/firefox/patches/0012-musl-Fix-syscall-wrappers.patch
| 42 ++++
http/firefox/patches/0013-musl-Fix-syscall-wrappers.patch
| 42 ----

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

http/firefox/patches/0014-musl-Only-use-system-heap-reporter-with-glibc.patch
| 33 ---
http/firefox/patches/0014-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 +++
http/firefox/patches/0015-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 ---

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

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

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

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

http/firefox/patches/0017-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 48 -----

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

http/firefox/patches/0018-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
| 28 --
http/firefox/patches/0019-Make-PGO-use-toolchain.patch
| 33 +++

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

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

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

http/firefox/patches/0021-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
| 32 +++
http/firefox/patches/0022-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 28 ++

http/firefox/patches/0022-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
| 32 ---
http/firefox/patches/0023-Fix-building-with-PGO-when-using-GCC.patch
| 84 ++++++++
http/firefox/patches/0023-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 28 --
http/firefox/patches/0024-Fix-building-with-PGO-when-using-GCC.patch
| 84 --------

http/firefox/patches/0024-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
| 28 ++
http/firefox/patches/0025-build-Disable-Werror.patch
| 28 ++

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

http/firefox/patches/0026-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 +++
http/firefox/patches/0026-build-Disable-Werror.patch
| 28 --

http/firefox/patches/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 ---
http/firefox/patches/0027-Make-elfhack-use-toolchain.patch
| 26 ++
http/firefox/patches/0028-Disable-FFVPX-with-VA-API.patch
| 91 +++++++++
http/firefox/patches/0028-Make-elfhack-use-toolchain.patch
| 26 --
http/firefox/patches/0029-Disable-FFVPX-with-VA-API.patch
| 91 ---------

http/firefox/patches/0029-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 36 +++

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

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

http/firefox/patches/0031-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 55 +++++

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

http/firefox/patches/0032-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 55 -----
56 files changed, 949 insertions(+), 940 deletions(-)

New commits:
commit 0860d04aae90bf849b6afb758a510ee355ab2a84
Author: Pavel Vinogradov <public AT sourcemaage.org>
Commit: Pavel Vinogradov <public AT sourcemaage.org>

http/firefox: version 95.0, SECURITY_PATCH++

diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index 43e05b5..6f66379 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -35,7 +35,7 @@ depends libwebp "--with-system-webp"
&&

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

-local NSS_BRANCH="3.71" &&
+local NSS_BRANCH="3.72" &&
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 907069b..8311477 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,6 +1,6 @@
SPELL=firefox
- VERSION=94.0.2
- SECURITY_PATCH=155
+ VERSION=95.0
+ SECURITY_PATCH=156
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 fe442f1..550ff19 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,10 @@
+2021-12-07 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 95.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.72
+ * patches/*: updated
+ * mozconfig: added --without-wasm-sandboxed-libraries, we don't have
wasi
+ spell yet
+
2021-11-18 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 94.0.2

diff --git a/http/firefox/mozconfig b/http/firefox/mozconfig
index 44b1b78..06347ff 100644
--- a/http/firefox/mozconfig
+++ b/http/firefox/mozconfig
@@ -27,3 +27,5 @@ ac_add_options --enable-rust-simd
ac_add_options --with-distribution-id=org.sourcemage

ac_add_options --with-unsigned-addon-scopes=app,system
+
+ac_add_options --without-wasm-sandboxed-libraries
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 31a4670..ad10018 100644
--- a/http/firefox/patches/0001-Don-t-use-build-id.patch
+++ b/http/firefox/patches/0001-Don-t-use-build-id.patch
@@ -1,7 +1,7 @@
-From a65ad7b4b488c9e5582048d76af70860b2a271ec Mon Sep 17 00:00:00 2001
+From 5afd7721b1433d1d354abd96e2fdc967fe34f8d7 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/32] Don't use build id
+Subject: [PATCH 01/31] Don't use build id

We must drop build id as it causes conflicts when merging
thunderbird/firefox/seamonkey on same system when using
@@ -50,5 +50,5 @@ index 9c8cdb462a..1707e98471 100644
HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
_SAVE_LDFLAGS=$LDFLAGS
--
-2.33.1
+2.34.1

diff --git a/http/firefox/patches/0002-Fortify-sources-properly.patch
b/http/firefox/patches/0002-Fortify-sources-properly.patch
index c7a5119..81d9eb9 100644
--- a/http/firefox/patches/0002-Fortify-sources-properly.patch
+++ b/http/firefox/patches/0002-Fortify-sources-properly.patch
@@ -1,7 +1,7 @@
-From 854be08b4f846169916d4064fd65f9cbb0f76570 Mon Sep 17 00:00:00 2001
+From e9f2525adaa1958f048acee2bd873a5c3aaa0c5b Mon Sep 17 00:00:00 2001
From: "Jory A. Pratt" <anarchy AT gentoo.org>
Date: Mon, 6 Apr 2020 19:16:36 +0200
-Subject: [PATCH 02/32] Fortify sources properly
+Subject: [PATCH 02/31] Fortify sources properly

Ensure we fortify properly, features.h is pulled in via fortification.

@@ -37,5 +37,5 @@ index 16c9b33329..df38d9336c 100644

#endif /* _SDP_OS_DEFS_H_ */
--
-2.33.1
+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
index 47611e4..1a3b4ea 100644
--- a/http/firefox/patches/0003-Check-additional-plugins-dir.patch
+++ b/http/firefox/patches/0003-Check-additional-plugins-dir.patch
@@ -1,7 +1,7 @@
-From c073b9862be61fb1e897292a746d8c9d7ee37354 Mon Sep 17 00:00:00 2001
+From 461b9a82277a8f610642bc1b40ba6d4f8870355b 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/32] Check additional plugins dir
+Subject: [PATCH 03/31] Check additional plugins dir

Check original plugins dir along with default plugins dir.

@@ -54,5 +54,5 @@ index ef974f9904..6261eafcc8 100644
static const char* keys[] = {NS_USER_PLUGINS_DIR, nullptr};
# endif
--
-2.33.1
+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
index 53849db..65f7d1f 100644
--- a/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
+++ b/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
@@ -1,7 +1,7 @@
-From 6371b00577970f715fec174eacb32c74a6946f68 Mon Sep 17 00:00:00 2001
+From 7f2fec622a442d150368b762fbe632580281104e 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/32] bmo#847568: Support system harfbuzz
+Subject: [PATCH 04/31] bmo#847568: Support system harfbuzz

Allow building against system-wide harfbuzz.

@@ -39,10 +39,10 @@ index e060fd2dcc..7178ada497 100644
system_headers += [
'jack/jack.h',
diff --git a/dom/base/moz.build b/dom/base/moz.build
-index 145f20810f..49453e0d56 100644
+index 1e9ee396b7..2e5f8c10f6 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
-@@ -562,6 +562,9 @@ FINAL_LIBRARY = "xul"
+@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_X11"]:
CXXFLAGS += CONFIG["TK_CFLAGS"]

@@ -103,10 +103,10 @@ index 4ff948f567..6e920ff27f 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index 3f483d180e..4bb25233e7 100644
+index baa6f090a9..c51c36e2b4 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
-@@ -287,6 +287,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+@@ -288,6 +288,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]

DEFINES["GRAPHITE2_STATIC"] = True

@@ -131,10 +131,10 @@ index 301eb9a854..7cece5e06c 100644

GeneratedFile(
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index 8de4f64777..18ddb4e0b2 100644
+index 4e29fb6c7f..3adbe4ca9f 100644
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
-@@ -106,6 +106,9 @@ LOCAL_INCLUDES += [
+@@ -107,6 +107,9 @@ LOCAL_INCLUDES += [
"/netwerk/protocol/http",
]

@@ -159,7 +159,7 @@ index 2c3f86948e..dd6901ba9a 100644
OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index f63780b892..fb1c48abc3 100644
+index a78a32bdc0..73658c073e 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -460,6 +460,15 @@ add_old_configure_assignment(
@@ -179,5 +179,5 @@ index f63780b892..fb1c48abc3 100644
# ==============================================================
@depends(toolkit)
--
-2.33.1
+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
index f3da478..6725365 100644
--- a/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
+++ b/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
@@ -1,7 +1,7 @@
-From 5d03cddd1c0d8eb7acef44ff7272176d33e6be51 Mon Sep 17 00:00:00 2001
+From c5230b3e0caf6fa208bab8f7fd4c30c7fe58a2c9 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/32] bmo#847568: Support system graphite2
+Subject: [PATCH 05/31] bmo#847568: Support system graphite2

Allow building against system-wide graphite2.

@@ -118,10 +118,10 @@ index 8222b72333..16a2b401db 100644
"thebes",
"ipc",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index 4bb25233e7..a2dd99ceb4 100644
+index c51c36e2b4..4f02a9e2a5 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
-@@ -285,7 +285,10 @@ if CONFIG["MOZ_WAYLAND"]:
+@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:

LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]

@@ -180,7 +180,7 @@ index dd6901ba9a..be73ac4bee 100644
OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index fb1c48abc3..d98e748bb9 100644
+index 73658c073e..77424c64c2 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -460,6 +460,19 @@ add_old_configure_assignment(
@@ -204,5 +204,5 @@ index fb1c48abc3..d98e748bb9 100644
# ==============================================================
option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
--
-2.33.1
+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
index 5beea65..a68a628 100644
--- a/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
+++ b/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
@@ -1,7 +1,7 @@
-From 34a104c3cc36d9a4297a51d7b1cf7195c8c28a1d Mon Sep 17 00:00:00 2001
+From ae83763f3a4a21fb3d41d5e9fc4ea466fda2a7d4 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/32] bmo#1559213: Support system av1
+Subject: [PATCH 06/31] bmo#1559213: Support system av1

Allow building against system-wide av1.

@@ -66,7 +66,7 @@ index 16ca8a9cbc..b349dcbe6d 100644
if CONFIG["MOZ_OMX"]:
EXPORTS += [
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index d98e748bb9..1e704a4765 100644
+index 77424c64c2..60197e5456 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -544,14 +544,29 @@ def av1(value):
@@ -110,5 +110,5 @@ index d98e748bb9..1e704a4765 100644
# JXL Image Codec Support
# ==============================================================
--
-2.33.1
+2.34.1

diff --git a/http/firefox/patches/0007-Support-sndio-audio-framework.patch
b/http/firefox/patches/0007-Support-sndio-audio-framework.patch
index 197e60a..7417816 100644
--- a/http/firefox/patches/0007-Support-sndio-audio-framework.patch
+++ b/http/firefox/patches/0007-Support-sndio-audio-framework.patch
@@ -1,7 +1,7 @@
-From a22ef7c7b78058d48f07a78e2ee97dc81c71ddd8 Mon Sep 17 00:00:00 2001
+From 7d80af5250a056be9f9c839c386c7a4029b87fff Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi AT gentoo.org>
Date: Thu, 29 Apr 2021 18:54:42 +0200
-Subject: [PATCH 07/32] Support sndio audio framework
+Subject: [PATCH 07/31] Support sndio audio framework

Bug: https://bugs.gentoo.org/785613
Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
@@ -71,5 +71,5 @@ index 95098e4638..f3b92b3695 100644
dnl =
dnl = Maintainer debug option (no --enable equivalent)
--
-2.33.1
+2.34.1

diff --git
a/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
b/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
index 1140916..811943f 100644
---
a/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
+++
b/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
@@ -1,7 +1,7 @@
-From 915273302b3e749678fce68f3ec4be34a806c5d5 Mon Sep 17 00:00:00 2001
+From 409a51cb5afd1b2fa1abc6953830b98ff3708263 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/32] bmo#878089: Don't fail when TERM is not set
+Subject: [PATCH 08/31] 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
@@ -32,5 +32,5 @@ index 388cece0b8..1283460cc9 100644
self.stream = stream

--
-2.33.1
+2.34.1

diff --git a/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
b/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
index 6799b98..1f9624b 100644
--- a/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
+++ b/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
@@ -1,7 +1,7 @@
-From c56a65360a1c42c7f0276e4cf36c9d9f33a3f716 Mon Sep 17 00:00:00 2001
+From 026eb522aab43f39b2c89a0dd8d450eb394ed77a 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/32] bmo#1516803: Fix building sandbox
+Subject: [PATCH 09/31] bmo#1516803: Fix building sandbox

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
Bug: https://bugs.gentoo.org/666580
@@ -24,5 +24,5 @@ index 0a3a14c96d..81c89bd947 100644
DEFINES["NS_NO_XPCOM"] = True
DisableStlWrapping()
--
-2.33.1
+2.34.1

diff --git
a/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch

b/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
index 12615d1..62d4db0 100644
---
a/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
+++
b/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
@@ -1,7 +1,7 @@
-From ddda554a91933277152f4e5c5931b78db820d0ba Mon Sep 17 00:00:00 2001
+From 49509912d5411e547c6eb56d06e141bc6205c081 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi AT gentoo.org>
Date: Mon, 6 Apr 2020 19:51:22 +0200
-Subject: [PATCH 10/32] Fix building spellchecker when using GCC and PGO
+Subject: [PATCH 10/31] Fix building spellchecker when using GCC and PGO

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88561
Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
@@ -23,5 +23,5 @@ index dcc1d54f74..06a2ad5a15 100644
+if CONFIG["CC_TYPE"] in ("gcc"):
+ CXXFLAGS += ["-fno-devirtualize"]
--
-2.33.1
+2.34.1

diff --git
a/http/firefox/patches/0011-musl-Add-alternate-name-for-private-siginfo-struct-m.patch

b/http/firefox/patches/0011-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
new file mode 100644
index 0000000..2468c08
--- /dev/null
+++
b/http/firefox/patches/0011-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
@@ -0,0 +1,35 @@
+From 3f6da58bceab982f34554f24382db37eef176cfa 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 11/31] 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/0012-musl-Add-alternate-name-for-private-siginfo-struct-m.patch

b/http/firefox/patches/0012-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
deleted file mode 100644
index 9a01325..0000000
---
a/http/firefox/patches/0012-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 58c047eee19d7bb652b44f3bcf00fd90b9d9dddc 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 12/32] 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.33.1
-
diff --git a/http/firefox/patches/0012-musl-Fix-syscall-wrappers.patch
b/http/firefox/patches/0012-musl-Fix-syscall-wrappers.patch
new file mode 100644
index 0000000..ef7f480
--- /dev/null
+++ b/http/firefox/patches/0012-musl-Fix-syscall-wrappers.patch
@@ -0,0 +1,42 @@
+From 89cf5ddec1c8e6311b1df36b3d42524106f83e22 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 12/31] 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/0013-musl-Fix-syscall-wrappers.patch
b/http/firefox/patches/0013-musl-Fix-syscall-wrappers.patch
deleted file mode 100644
index 512b41e..0000000
--- a/http/firefox/patches/0013-musl-Fix-syscall-wrappers.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From acb6fb4a0105f01455629e448dbec9a32913b84e 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 13/32] 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.33.1
-
diff --git
a/http/firefox/patches/0013-musl-Only-use-system-heap-reporter-with-glibc.patch

b/http/firefox/patches/0013-musl-Only-use-system-heap-reporter-with-glibc.patch
new file mode 100644
index 0000000..c3c72eb
--- /dev/null
+++
b/http/firefox/patches/0013-musl-Only-use-system-heap-reporter-with-glibc.patch
@@ -0,0 +1,33 @@
+From abe1d2ac2da8aa950c22e7afeaa8cb04fc267327 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 13/31] 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/0014-musl-Only-use-system-heap-reporter-with-glibc.patch

b/http/firefox/patches/0014-musl-Only-use-system-heap-reporter-with-glibc.patch
deleted file mode 100644
index 39f5c67..0000000
---
a/http/firefox/patches/0014-musl-Only-use-system-heap-reporter-with-glibc.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From f3eb4ca6beeb6afe0b16593cbde67c32b3654686 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 14/32] 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 6aa934812f..ccb8d5255a 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.33.1
-
diff --git
a/http/firefox/patches/0014-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox/patches/0014-musl-Set-pthread-name-for-non-glibc-systems.patch
new file mode 100644
index 0000000..d064209
--- /dev/null
+++
b/http/firefox/patches/0014-musl-Set-pthread-name-for-non-glibc-systems.patch
@@ -0,0 +1,29 @@
+From 22643933640f8305b2b6321b7dabcb83f28ba7e7 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 14/31] 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/0015-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox/patches/0015-musl-Set-pthread-name-for-non-glibc-systems.patch
deleted file mode 100644
index 19ac361..0000000
---
a/http/firefox/patches/0015-musl-Set-pthread-name-for-non-glibc-systems.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 3cab58ac693ba976ba9c5afdee9c345e4af3a5f2 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 15/32] 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.33.1
-
diff --git
a/http/firefox/patches/0015-musl-getcontext-is-only-avaliable-on-glibc-systems.patch

b/http/firefox/patches/0015-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
new file mode 100644
index 0000000..ee98c60
--- /dev/null
+++
b/http/firefox/patches/0015-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
@@ -0,0 +1,28 @@
+From ae527e3c05ff35b1781819d4ddcc9ba89141db2c 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 15/31] 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 a66043eeb8..fe0bd3c149 100644
+--- a/tools/profiler/core/platform-linux-android.cpp
++++ b/tools/profiler/core/platform-linux-android.cpp
+@@ -572,8 +572,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/0016-musl-getcontext-is-only-avaliable-on-glibc-systems.patch

b/http/firefox/patches/0016-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
deleted file mode 100644
index a4a678b..0000000
---
a/http/firefox/patches/0016-musl-getcontext-is-only-avaliable-on-glibc-systems.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3091ac0a99f8ad59d6baf1a00e4754688e4598f4 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 16/32] 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 a66043eeb8..fe0bd3c149 100644
---- a/tools/profiler/core/platform-linux-android.cpp
-+++ b/tools/profiler/core/platform-linux-android.cpp
-@@ -572,8 +572,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.33.1
-
diff --git
a/http/firefox/patches/0016-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch

b/http/firefox/patches/0016-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
new file mode 100644
index 0000000..d2450ce
--- /dev/null
+++
b/http/firefox/patches/0016-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
@@ -0,0 +1,48 @@
+From 04dc6d6531cb200b6cdb92fab525dfb231376d56 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 16/31] musl: sys/auvx.h avaliable on more then just glibc
+ systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../webrtc/system_wrappers/source/cpu_features_linux.c | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git
a/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
b/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
+index 9c5645068a..05fea37ee0 100644
+---
a/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
++++
b/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
+@@ -11,10 +11,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <features.h>
+-#ifndef __GLIBC_PREREQ
+-#define __GLIBC_PREREQ(a, b) 0
+-#endif
+-#if __GLIBC_PREREQ(2, 16)
++#if defined(__linux__)
+ #include <sys/auxv.h>
+ #else
+ #include <fcntl.h>
+@@ -32,7 +29,7 @@ uint64_t WebRtc_GetCPUFeaturesARM(void) {
+ int architecture = 0;
+ unsigned long hwcap = 0;
+ const char* platform = NULL;
+-#if __GLIBC_PREREQ(2, 16)
++#if defined(__linux__)
+ hwcap = getauxval(AT_HWCAP);
+ platform = (const char*)getauxval(AT_PLATFORM);
+ #else
+@@ -56,7 +53,7 @@ uint64_t WebRtc_GetCPUFeaturesARM(void) {
+ }
+ close(fd);
+ }
+-#endif // __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/0017-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch

b/http/firefox/patches/0017-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
new file mode 100644
index 0000000..1bcdce3
--- /dev/null
+++
b/http/firefox/patches/0017-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
@@ -0,0 +1,28 @@
+From 33fffd37b81292f4f28f71b0ce73d5e14c64719c 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 17/31] 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 6b07186e8c..a4b69b08cf 100644
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1506,6 +1506,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/0017-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch

b/http/firefox/patches/0017-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
deleted file mode 100644
index 5edc670..0000000
---
a/http/firefox/patches/0017-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From ea275741215702a199c73b6468535112638221c6 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 17/32] musl: sys/auvx.h avaliable on more then just glibc
- systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../webrtc/system_wrappers/source/cpu_features_linux.c | 9 +++------
- 1 file changed, 3 insertions(+), 6 deletions(-)
-
-diff --git
a/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
b/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
-index 9c5645068a..05fea37ee0 100644
----
a/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
-+++
b/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c
-@@ -11,10 +11,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <features.h>
--#ifndef __GLIBC_PREREQ
--#define __GLIBC_PREREQ(a, b) 0
--#endif
--#if __GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- #include <sys/auxv.h>
- #else
- #include <fcntl.h>
-@@ -32,7 +29,7 @@ uint64_t WebRtc_GetCPUFeaturesARM(void) {
- int architecture = 0;
- unsigned long hwcap = 0;
- const char* platform = NULL;
--#if __GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- hwcap = getauxval(AT_HWCAP);
- platform = (const char*)getauxval(AT_PLATFORM);
- #else
-@@ -56,7 +53,7 @@ uint64_t WebRtc_GetCPUFeaturesARM(void) {
- }
- close(fd);
- }
--#endif // __GLIBC_PREREQ(2,16)
-+#endif // (__linux__)
- #if defined(__aarch64__)
- architecture = 8;
- if ((hwcap & HWCAP_FP) != 0)
---
-2.33.1
-
diff --git
a/http/firefox/patches/0018-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch

b/http/firefox/patches/0018-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
new file mode 100644
index 0000000..3db0ea0
--- /dev/null
+++
b/http/firefox/patches/0018-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
@@ -0,0 +1,27 @@
+From 183e4f90f968068b663857755142d79dc0963778 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 18/31] 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/0018-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch

b/http/firefox/patches/0018-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
deleted file mode 100644
index ac85904..0000000
---
a/http/firefox/patches/0018-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 9ac6801a837ab148171b3363ab3a29e3b565ffd3 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 18/32] 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 6b07186e8c..a4b69b08cf 100644
---- a/security/sandbox/linux/SandboxFilter.cpp
-+++ b/security/sandbox/linux/SandboxFilter.cpp
-@@ -1506,6 +1506,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.33.1
-
diff --git a/http/firefox/patches/0019-Make-PGO-use-toolchain.patch
b/http/firefox/patches/0019-Make-PGO-use-toolchain.patch
new file mode 100644
index 0000000..d2cb316
--- /dev/null
+++ b/http/firefox/patches/0019-Make-PGO-use-toolchain.patch
@@ -0,0 +1,33 @@
+From b0d84725cccf578dd1f614a264a29a8f3473a182 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 19/31] 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/0019-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch

b/http/firefox/patches/0019-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
deleted file mode 100644
index 4ad070c..0000000
---
a/http/firefox/patches/0019-musl-include-net-if.h-before-linux-if.h-to-avoid-red.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 70bcdf33735944eb3d2e18e95128f9589355adec 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 19/32] 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.33.1
-
diff --git a/http/firefox/patches/0020-Make-PGO-use-toolchain.patch
b/http/firefox/patches/0020-Make-PGO-use-toolchain.patch
deleted file mode 100644
index e78c30d..0000000
--- a/http/firefox/patches/0020-Make-PGO-use-toolchain.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From bb0d0a304ff3b88ab43209cca723a1fa03904aad 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 20/32] 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.33.1
-
diff --git
a/http/firefox/patches/0020-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

b/http/firefox/patches/0020-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
new file mode 100644
index 0000000..e5fa394
--- /dev/null
+++
b/http/firefox/patches/0020-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
@@ -0,0 +1,55 @@
+From 4e0bae4eb9f51834b7010d1ab91844695fb2528c 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 20/31] 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/0021-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

b/http/firefox/patches/0021-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
deleted file mode 100644
index ff71052..0000000
---
a/http/firefox/patches/0021-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 3ee6407285485040421e55990e604313d3bfeeca 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 21/32] 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 ed27f7f8e7..81c9977b57 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 f0d2a08c29..c8797bf12d 100644
---- a/toolkit/components/terminator/nsTerminator.cpp
-+++ b/toolkit/components/terminator/nsTerminator.cpp
-@@ -456,6 +456,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.33.1
-
diff --git
a/http/firefox/patches/0021-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch

b/http/firefox/patches/0021-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
new file mode 100644
index 0000000..c2a0f16
--- /dev/null
+++
b/http/firefox/patches/0021-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
@@ -0,0 +1,32 @@
+From 8e8b47da9ac6f33ac35ca07e5e76f22720b96865 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 21/31] 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 81c89bd947..a5b76067a7 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/0022-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0022-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..e234f71
--- /dev/null
+++ b/http/firefox/patches/0022-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
@@ -0,0 +1,28 @@
+From a999c252cfc8195e01c566523335a7b6433019cf Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:47:13 +0200
+Subject: [PATCH 22/31] bmo#1196777: Set GDK_FOCUS_CHANGE_MASK
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1196777
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ widget/gtk/nsWindow.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
+index 620e2f47f2..0f6b701441 100644
+--- a/widget/gtk/nsWindow.cpp
++++ b/widget/gtk/nsWindow.cpp
+@@ -161,7 +161,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK |
GDK_EXPOSURE_MASK |
+ 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;
+
+ #if !GTK_CHECK_VERSION(3, 22, 0)
+ typedef enum {
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0022-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch

b/http/firefox/patches/0022-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
deleted file mode 100644
index 5865586..0000000
---
a/http/firefox/patches/0022-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0539ac3b5a6574e8ba3a27b62681c0a49d89edcb 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 22/32] 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 81c89bd947..a5b76067a7 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.33.1
-
diff --git
a/http/firefox/patches/0023-Fix-building-with-PGO-when-using-GCC.patch
b/http/firefox/patches/0023-Fix-building-with-PGO-when-using-GCC.patch
new file mode 100644
index 0000000..f3a9753
--- /dev/null
+++ b/http/firefox/patches/0023-Fix-building-with-PGO-when-using-GCC.patch
@@ -0,0 +1,84 @@
+From 2d23d70e94cefb707cb77ec931d48e4a8aa8954b 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 23/31] 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/0023-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0023-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
deleted file mode 100644
index fe9a000..0000000
--- a/http/firefox/patches/0023-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From a720277c807504568a210d74b46887cc8be97fe2 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:47:13 +0200
-Subject: [PATCH 23/32] bmo#1196777: Set GDK_FOCUS_CHANGE_MASK
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1196777
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- widget/gtk/nsWindow.cpp | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
-index aec5588fae..c280cd0178 100644
---- a/widget/gtk/nsWindow.cpp
-+++ b/widget/gtk/nsWindow.cpp
-@@ -161,7 +161,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK |
GDK_EXPOSURE_MASK |
- 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;
-
- #if !GTK_CHECK_VERSION(3, 22, 0)
- typedef enum {
---
-2.33.1
-
diff --git
a/http/firefox/patches/0024-Fix-building-with-PGO-when-using-GCC.patch
b/http/firefox/patches/0024-Fix-building-with-PGO-when-using-GCC.patch
deleted file mode 100644
index 107253f..0000000
--- a/http/firefox/patches/0024-Fix-building-with-PGO-when-using-GCC.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 1ca9aac1bc06cee521e0e71059db3bf0b9d17ba7 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 24/32] 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 81c9977b57..e9c22ffb30 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.33.1
-
diff --git
a/http/firefox/patches/0024-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch

b/http/firefox/patches/0024-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
new file mode 100644
index 0000000..7ec620d
--- /dev/null
+++
b/http/firefox/patches/0024-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
@@ -0,0 +1,28 @@
+From 152aa9e23736fd99647e0b61f627e9a3d40fed56 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 24/31] 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/0025-build-Disable-Werror.patch
b/http/firefox/patches/0025-build-Disable-Werror.patch
new file mode 100644
index 0000000..2da5cba
--- /dev/null
+++ b/http/firefox/patches/0025-build-Disable-Werror.patch
@@ -0,0 +1,28 @@
+From 98672d8bbca50efacbdd35285be336b27f24fa95 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Sat, 29 Aug 2020 22:06:15 +0200
+Subject: [PATCH 25/31] build: Disable -Werror
+
+Bug: https://bugzilla.mozilla.org/822978
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/moz.configure/warnings.configure | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
+index dcb353859f..8a25b43201 100755
+--- a/build/moz.configure/warnings.configure
++++ b/build/moz.configure/warnings.configure
+@@ -212,7 +212,8 @@ with only_when(depends(target)(lambda t: t.kernel ==
"WINNT")):
+ check_and_add_gcc_warning("-Wno-gnu-zero-variadic-macro-arguments")
+
+ # Make it an error to be missing function declarations for C code.
+-check_and_add_gcc_warning("-Werror=implicit-function-declaration",
c_compiler)
++check_and_add_gcc_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_gcc_warning("-Wno-psabi")
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0025-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch

b/http/firefox/patches/0025-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
deleted file mode 100644
index 1208e68..0000000
---
a/http/firefox/patches/0025-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 754e6ff1936cf8888e0062e8815c3a99f8a82b42 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 25/32] 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.33.1
-
diff --git
a/http/firefox/patches/0026-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0026-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
new file mode 100644
index 0000000..f2c0a9f
--- /dev/null
+++
b/http/firefox/patches/0026-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
@@ -0,0 +1,34 @@
+From f8bcf72a3fdb62f27f23d7bcbd1253f82ff027e1 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 26/31] 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 abd2181858..bb6b58db85 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
+@@ -103,6 +104,7 @@ endif
+ endif
+ endif
+ endif
++endif
+
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
+--
+2.34.1
+
diff --git a/http/firefox/patches/0026-build-Disable-Werror.patch
b/http/firefox/patches/0026-build-Disable-Werror.patch
deleted file mode 100644
index 8504a5b..0000000
--- a/http/firefox/patches/0026-build-Disable-Werror.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From cb6220c80ec4034c93e3e7ff298bd82256770f94 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Sat, 29 Aug 2020 22:06:15 +0200
-Subject: [PATCH 26/32] build: Disable -Werror
-
-Bug: https://bugzilla.mozilla.org/822978
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/moz.configure/warnings.configure | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
-index 192f9574fe..2020d65ffc 100755
---- a/build/moz.configure/warnings.configure
-+++ b/build/moz.configure/warnings.configure
-@@ -215,7 +215,8 @@ with only_when(depends(target)(lambda t: t.kernel ==
"WINNT")):
- check_and_add_gcc_warning("-Wno-gnu-zero-variadic-macro-arguments")
-
- # Make it an error to be missing function declarations for C code.
--check_and_add_gcc_warning("-Werror=implicit-function-declaration",
c_compiler)
-+check_and_add_gcc_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_gcc_warning("-Wno-psabi")
---
-2.33.1
-
diff --git
a/http/firefox/patches/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
deleted file mode 100644
index cd92ded..0000000
---
a/http/firefox/patches/0027-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 3e2964adcd0b04dd72a5c0a1d6ad8e1680e6a429 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 27/32] 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 e5a6d57ba7..1d7d80ca3f 100644
---- a/config/makefiles/rust.mk
-+++ b/config/makefiles/rust.mk
-@@ -62,6 +62,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
-@@ -75,6 +76,7 @@ RUSTFLAGS += -Cembed-bitcode=yes
- endif
- endif
- endif
-+endif
-
- ifdef CARGO_INCREMENTAL
- export CARGO_INCREMENTAL
---
-2.33.1
-
diff --git a/http/firefox/patches/0027-Make-elfhack-use-toolchain.patch
b/http/firefox/patches/0027-Make-elfhack-use-toolchain.patch
new file mode 100644
index 0000000..c4220d1
--- /dev/null
+++ b/http/firefox/patches/0027-Make-elfhack-use-toolchain.patch
@@ -0,0 +1,26 @@
+From acd924914e8a6c23ed377f036f80346160b94adf Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 28 Sep 2020 20:52:24 +0200
+Subject: [PATCH 27/31] Make elfhack use toolchain
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/unix/elfhack/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/unix/elfhack/Makefile.in b/build/unix/elfhack/Makefile.in
+index 08cc3d6852..c2b575d87a 100644
+--- a/build/unix/elfhack/Makefile.in
++++ b/build/unix/elfhack/Makefile.in
+@@ -20,7 +20,7 @@ test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX):
%$(DLL_SUFFIX): %.$(OBJ_SUFFIX)
+ # Fail if the backup file doesn't exist
+ [ -f '$@.bak' ]
+ # Fail if the new library doesn't contain less relocations
+- [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt $$(objdump -R
$@ | wc -l) ]
++ [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt
$$($(TOOLCHAIN_PREFIX)objdump -R $@ | wc -l) ]
+
+ test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): DSO_SONAME=$@
+ test-array$(DLL_SUFFIX): DT_TYPE=INIT_ARRAY
+--
+2.34.1
+
diff --git a/http/firefox/patches/0028-Disable-FFVPX-with-VA-API.patch
b/http/firefox/patches/0028-Disable-FFVPX-with-VA-API.patch
new file mode 100644
index 0000000..812cd84
--- /dev/null
+++ b/http/firefox/patches/0028-Disable-FFVPX-with-VA-API.patch
@@ -0,0 +1,91 @@
+From 1e48a24951577ea59ffcfef6aa3b51961b844053 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Thu, 29 Apr 2021 18:22:48 +0200
+Subject: [PATCH 28/31] Disable FFVPX with VA-API
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/platforms/PDMFactory.cpp | 32 +++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
+index 9b0342ce82..4e377082ae 100644
+--- a/dom/media/platforms/PDMFactory.cpp
++++ b/dom/media/platforms/PDMFactory.cpp
+@@ -486,12 +486,6 @@ void PDMFactory::CreateRddPDMs() {
+ CreateAndStartupPDM<AppleDecoderModule>();
+ }
+ #endif
+-#ifdef MOZ_FFVPX
+- if (StaticPrefs::media_ffvpx_enabled() &&
+- StaticPrefs::media_rdd_ffvpx_enabled()) {
+- CreateAndStartupPDM<FFVPXRuntimeLinker>();
+- }
+-#endif
+ #ifdef MOZ_FFMPEG
+ if (StaticPrefs::media_ffmpeg_enabled() &&
+ StaticPrefs::media_rdd_ffmpeg_enabled() &&
+@@ -499,6 +493,12 @@ void PDMFactory::CreateRddPDMs() {
+ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
+ FFmpegRuntimeLinker::LinkStatusCode());
+ }
++#endif
++#ifdef MOZ_FFVPX
++ if (StaticPrefs::media_ffvpx_enabled() &&
++ StaticPrefs::media_rdd_ffvpx_enabled()) {
++ CreateAndStartupPDM<FFVPXRuntimeLinker>();
++ }
+ #endif
+ CreateAndStartupPDM<AgnosticDecoderModule>();
+ }
+@@ -535,11 +535,6 @@ void PDMFactory::CreateContentPDMs() {
+ CreateAndStartupPDM<OmxDecoderModule>();
+ }
+ #endif
+-#ifdef MOZ_FFVPX
+- if (StaticPrefs::media_ffvpx_enabled()) {
+- CreateAndStartupPDM<FFVPXRuntimeLinker>();
+- }
+-#endif
+ #ifdef MOZ_FFMPEG
+ if (StaticPrefs::media_ffmpeg_enabled() &&
+ !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
+@@ -547,6 +542,11 @@ void PDMFactory::CreateContentPDMs() {
+ FFmpegRuntimeLinker::LinkStatusCode());
+ }
+ #endif
++#ifdef MOZ_FFVPX
++ if (StaticPrefs::media_ffvpx_enabled()) {
++ CreateAndStartupPDM<FFVPXRuntimeLinker>();
++ }
++#endif
+ #ifdef MOZ_WIDGET_ANDROID
+ if (StaticPrefs::media_android_media_codec_enabled()) {
+ StartupPDM(AndroidDecoderModule::Create(),
+@@ -581,11 +581,6 @@ void PDMFactory::CreateDefaultPDMs() {
+ CreateAndStartupPDM<OmxDecoderModule>();
+ }
+ #endif
+-#ifdef MOZ_FFVPX
+- if (StaticPrefs::media_ffvpx_enabled()) {
+- CreateAndStartupPDM<FFVPXRuntimeLinker>();
+- }
+-#endif
+ #ifdef MOZ_FFMPEG
+ if (StaticPrefs::media_ffmpeg_enabled() &&
+ !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
+@@ -593,6 +588,11 @@ void PDMFactory::CreateDefaultPDMs() {
+ FFmpegRuntimeLinker::LinkStatusCode());
+ }
+ #endif
++#ifdef MOZ_FFVPX
++ if (StaticPrefs::media_ffvpx_enabled()) {
++ CreateAndStartupPDM<FFVPXRuntimeLinker>();
++ }
++#endif
+ #ifdef MOZ_WIDGET_ANDROID
+ if (StaticPrefs::media_android_media_codec_enabled()) {
+ StartupPDM(AndroidDecoderModule::Create(),
+--
+2.34.1
+
diff --git a/http/firefox/patches/0028-Make-elfhack-use-toolchain.patch
b/http/firefox/patches/0028-Make-elfhack-use-toolchain.patch
deleted file mode 100644
index c798cf8..0000000
--- a/http/firefox/patches/0028-Make-elfhack-use-toolchain.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From b0d4e17b82a626c6102ce7ee9f2d5f80d97a212c Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 28 Sep 2020 20:52:24 +0200
-Subject: [PATCH 28/32] Make elfhack use toolchain
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/unix/elfhack/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/build/unix/elfhack/Makefile.in b/build/unix/elfhack/Makefile.in
-index 08cc3d6852..c2b575d87a 100644
---- a/build/unix/elfhack/Makefile.in
-+++ b/build/unix/elfhack/Makefile.in
-@@ -20,7 +20,7 @@ test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX):
%$(DLL_SUFFIX): %.$(OBJ_SUFFIX)
- # Fail if the backup file doesn't exist
- [ -f '$@.bak' ]
- # Fail if the new library doesn't contain less relocations
-- [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt $$(objdump -R
$@ | wc -l) ]
-+ [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt
$$($(TOOLCHAIN_PREFIX)objdump -R $@ | wc -l) ]
-
- test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): DSO_SONAME=$@
- test-array$(DLL_SUFFIX): DT_TYPE=INIT_ARRAY
---
-2.33.1
-
diff --git a/http/firefox/patches/0029-Disable-FFVPX-with-VA-API.patch
b/http/firefox/patches/0029-Disable-FFVPX-with-VA-API.patch
deleted file mode 100644
index 258264e..0000000
--- a/http/firefox/patches/0029-Disable-FFVPX-with-VA-API.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 28fd1be3e3b9cfcf27a790fc5c5e14ae4b8113ef Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 29 Apr 2021 18:22:48 +0200
-Subject: [PATCH 29/32] Disable FFVPX with VA-API
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/platforms/PDMFactory.cpp | 32 +++++++++++++++---------------
- 1 file changed, 16 insertions(+), 16 deletions(-)
-
-diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
-index 9b0342ce82..4e377082ae 100644
---- a/dom/media/platforms/PDMFactory.cpp
-+++ b/dom/media/platforms/PDMFactory.cpp
-@@ -486,12 +486,6 @@ void PDMFactory::CreateRddPDMs() {
- CreateAndStartupPDM<AppleDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled() &&
-- StaticPrefs::media_rdd_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- StaticPrefs::media_rdd_ffmpeg_enabled() &&
-@@ -499,6 +493,12 @@ void PDMFactory::CreateRddPDMs() {
- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
- FFmpegRuntimeLinker::LinkStatusCode());
- }
-+#endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled() &&
-+ StaticPrefs::media_rdd_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
- #endif
- CreateAndStartupPDM<AgnosticDecoderModule>();
- }
-@@ -535,11 +535,6 @@ void PDMFactory::CreateContentPDMs() {
- CreateAndStartupPDM<OmxDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-@@ -547,6 +542,11 @@ void PDMFactory::CreateContentPDMs() {
- FFmpegRuntimeLinker::LinkStatusCode());
- }
- #endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
-+#endif
- #ifdef MOZ_WIDGET_ANDROID
- if (StaticPrefs::media_android_media_codec_enabled()) {
- StartupPDM(AndroidDecoderModule::Create(),
-@@ -581,11 +581,6 @@ void PDMFactory::CreateDefaultPDMs() {
- CreateAndStartupPDM<OmxDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-@@ -593,6 +588,11 @@ void PDMFactory::CreateDefaultPDMs() {
- FFmpegRuntimeLinker::LinkStatusCode());
- }
- #endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
-+#endif
- #ifdef MOZ_WIDGET_ANDROID
- if (StaticPrefs::media_android_media_codec_enabled()) {
- StartupPDM(AndroidDecoderModule::Create(),
---
-2.33.1
-
diff --git
a/http/firefox/patches/0029-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0029-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
new file mode 100644
index 0000000..fde5e6f
--- /dev/null
+++
b/http/firefox/patches/0029-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
@@ -0,0 +1,36 @@
+From 9c7d7aa616c4f29c0c5e907d6c0b27ee926d6762 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Thu, 29 Apr 2021 18:48:06 +0200
+Subject: [PATCH 29/31] Enable FLAC on platforms without ffvpx via ffmpeg
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/flac/FlacDecoder.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/dom/media/flac/FlacDecoder.cpp b/dom/media/flac/FlacDecoder.cpp
+index 2f205c9aae..68847b0952 100644
+--- 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);
+ #else
+ return false;
+ #endif
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0030-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0030-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
deleted file mode 100644
index c63bf30..0000000
---
a/http/firefox/patches/0030-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 9b223bec6a30fa66f90304b6fd548643201a431e Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 29 Apr 2021 18:48:06 +0200
-Subject: [PATCH 30/32] Enable FLAC on platforms without ffvpx via ffmpeg
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/flac/FlacDecoder.cpp | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/dom/media/flac/FlacDecoder.cpp b/dom/media/flac/FlacDecoder.cpp
-index 2f205c9aae..68847b0952 100644
---- 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);
- #else
- return false;
- #endif
---
-2.33.1
-
diff --git
a/http/firefox/patches/0030-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0030-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
new file mode 100644
index 0000000..7e36f7d
--- /dev/null
+++
b/http/firefox/patches/0030-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
@@ -0,0 +1,96 @@
+From 461f5af7e1362eac4c751d40c3788d32c2a43572 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 30/31] 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/0031-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0031-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
new file mode 100644
index 0000000..552e27b
--- /dev/null
+++
b/http/firefox/patches/0031-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
@@ -0,0 +1,55 @@
+From b572aa129f6868cb0ffa29a8b1b3c6a6ac54013a Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Fri, 11 Dec 2020 15:46:25 +0100
+Subject: [PATCH 31/31] bmo#1663844: OpenH264: Allow using OpenH264 GMP
decoder
+ as fallback for video decoding
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/gmp/GMPSharedMemManager.h | 2 +-
+ dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp | 2 +-
+ dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp | 2 ++
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/dom/media/gmp/GMPSharedMemManager.h
b/dom/media/gmp/GMPSharedMemManager.h
+index 44c660f6ca..3a2eff3294 100644
+--- a/dom/media/gmp/GMPSharedMemManager.h
++++ b/dom/media/gmp/GMPSharedMemManager.h
+@@ -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 --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+index 641f52a58b..6bd8235073 100644
+--- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
++++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+@@ -82,7 +82,7 @@ bool GMPDecoderModule::SupportsMimeType(const nsACString&
aMimeType,
+
+ bool GMPDecoderModule::SupportsMimeType(
+ const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics)
const {
+- return false;
++ return MP4Decoder::IsH264(aMimeType);
+ }
+
+ /* static */
+diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+index c73bf38be6..0d521d5d7b 100644
+--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
++++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+@@ -69,6 +69,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi420Frame*
aDecodedFrame) {
+ RefPtr<GMPVideoDecoder> self = this;
+ if (v) {
+ mDecodedData.AppendElement(std::move(v));
++ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
++ mDecodedData = DecodedData();
+ } else {
+ mDecodedData.Clear();
+ mDecodePromise.RejectIfExists(
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0031-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0031-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
deleted file mode 100644
index 63c6208..0000000
---
a/http/firefox/patches/0031-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 7e3d196f2d7bd6cd8ec57b7f28a45e4e5db7535c 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 31/32] 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.33.1
-
diff --git
a/http/firefox/patches/0032-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0032-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
deleted file mode 100644
index b480121..0000000
---
a/http/firefox/patches/0032-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 1bc8185805c27e52ca65454f8b4e0e6f9ea60d1c Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Fri, 11 Dec 2020 15:46:25 +0100
-Subject: [PATCH 32/32] bmo#1663844: OpenH264: Allow using OpenH264 GMP
decoder
- as fallback for video decoding
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/gmp/GMPSharedMemManager.h | 2 +-
- dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp | 2 +-
- dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp | 2 ++
- 3 files changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/dom/media/gmp/GMPSharedMemManager.h
b/dom/media/gmp/GMPSharedMemManager.h
-index 44c660f6ca..3a2eff3294 100644
---- a/dom/media/gmp/GMPSharedMemManager.h
-+++ b/dom/media/gmp/GMPSharedMemManager.h
-@@ -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 --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
-index 641f52a58b..6bd8235073 100644
---- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
-+++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
-@@ -82,7 +82,7 @@ bool GMPDecoderModule::SupportsMimeType(const nsACString&
aMimeType,
-
- bool GMPDecoderModule::SupportsMimeType(
- const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics)
const {
-- return false;
-+ return MP4Decoder::IsH264(aMimeType);
- }
-
- /* static */
-diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
-index f1e2cf935b..406fd8a622 100644
---- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
-+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
-@@ -68,6 +68,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi420Frame*
aDecodedFrame) {
- RefPtr<GMPVideoDecoder> self = this;
- if (v) {
- mDecodedData.AppendElement(std::move(v));
-+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
-+ mDecodedData = DecodedData();
- } else {
- mDecodedData.Clear();
- mDecodePromise.RejectIfExists(
---
-2.33.1
-



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (0860d04aae90bf849b6afb758a510ee355ab2a84), Pavel Vinogradov, 12/07/2021

Archive powered by MHonArc 2.6.24.

Top of Page