Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Thomas Orgis (759a1e477cc728d9f82f33f79044959c5c7eb229)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Thomas Orgis (759a1e477cc728d9f82f33f79044959c5c7eb229)
  • Date: Sat, 15 Jul 2023 12:57:07 +0000

GIT changes to master grimoire by Thomas Orgis <sobukus AT sourcemage.org>:

dev/null
|binary
devel/rust/BUILD
| 10
devel/rust/DETAILS
| 7
devel/rust/HISTORY
| 4
devel/rust/PRE_BUILD
| 6
http/firefox-esr/CONFIGURE
| 6
http/firefox-esr/DEPENDS
| 39 +
http/firefox-esr/DETAILS
| 7
http/firefox-esr/HISTORY
| 3
http/firefox-esr/PRE_BUILD
| 14
http/firefox-esr/patches/0001-Don-t-use-build-id.patch
| 56 --
http/firefox-esr/patches/0002-Fortify-sources-properly.patch
| 38 -
http/firefox-esr/patches/0003-Check-additional-plugins-dir.patch
| 58 --
http/firefox-esr/patches/0003-bmo-847568-Support-system-harfbuzz.patch
| 175 ++++++
http/firefox-esr/patches/0004-bmo-847568-Support-system-graphite2.patch
| 208 +++++++
http/firefox-esr/patches/0004-bmo-847568-Support-system-harfbuzz.patch
| 181 ------
http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
| 114 ++++
http/firefox-esr/patches/0005-bmo-847568-Support-system-graphite2.patch
| 208 -------
http/firefox-esr/patches/0006-bmo-1559213-Support-system-av1.patch
| 114 ----

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

http/firefox-esr/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
| 36 -
http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
| 42 +
http/firefox-esr/patches/0008-bmo-1516803-Fix-building-sandbox.patch
| 28 -

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

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

http/firefox-esr/patches/0009-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 +
http/firefox-esr/patches/0010-musl-Fix-syscall-wrappers.patch
| 42 -

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

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

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

http/firefox-esr/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 -

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

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

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

http/firefox-esr/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 51 -
http/firefox-esr/patches/0015-build-Disable-Werror.patch
| 24

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

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

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

http/firefox-esr/patches/0017-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 23
http/firefox-esr/patches/0017-Make-PGO-use-toolchain.patch
| 33 -
http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
| 16

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

http/firefox-esr/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
| 32 -
http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
| 23
http/firefox-esr/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
| 84 ---
http/firefox-esr/patches/0020-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
| 69 ++

http/firefox-esr/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
| 28 -
http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
| 49 +
http/firefox-esr/patches/0022-build-Disable-Werror.patch
| 13

http/firefox-esr/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 -
http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
| 55 +
http/firefox-esr/patches/0024-Disable-FFVPX-with-VA-API.patch
| 91 ---
http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
| 66 ++

http/firefox-esr/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 36 -
http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
| 35 +

http/firefox-esr/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
| 96 ---
http/firefox-esr/patches/0026-bmo-1840931-elfhack-pgo-fix.patch
| 165 +++++
http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
| 16

http/firefox-esr/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 35 -
http/firefox-esr/patches/0028-bgo-816975-fix-build-on-x86.patch
| 16
http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
| 19
http/firefox-esr/patches/0029-bmo-1559213-fix-system-av1-libs.patch
| 22

http/firefox-esr/patches/0029-bmo-1839023-arm-unified-build-missing-header.patch
| 77 ++
http/firefox-esr/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
| 76 ++

http/firefox-esr/patches/0032-bmo-1838323-disambiguate-skvx-when-building-with-different-arches.patch
| 85 +++
http/firefox-esr/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
| 64 --
http/firefox-esr/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
| 125 ----
http/firefox-esr/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
| 278 ----------
http/firefox-esr/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
| 139 -----
http/firefox-esr/patches/0036-bmo-1773968-webgl-memory-leak.patch
| 80 --
http/firefox-esr/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
| 28 -
http/firefox-esr/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
| 250 --------
http/firefox-esr/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
| 34 -
http/firefox-esr/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
| 154 -----
http/firefox-esr/patches/0041-p01-bmo-1772719-build-wayland-only.patch
| 36 -

http/firefox-esr/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
| 84 ---
http/firefox-esr/patches/0043-p02-bmo-1772721-build-wayland-only.patch
| 25

http/firefox-esr/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
| 207 -------

http/firefox-esr/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
| 14

http/firefox-esr/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
| 115 ----
http/firefox-esr/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
| 69 --
85 files changed, 1773 insertions(+), 3281 deletions(-)

New commits:
commit 759a1e477cc728d9f82f33f79044959c5c7eb229
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

rust: ignore installed version, always

It is just too fragile to depend on an installed rust, which will fail
to build current rust if it skipped a version too many — especially
likely should we ever do stable grimoires again.

This change comments the bits where the installed rust would be used.
Maybe we come to a better conclusion later. Implement local stepping
over rust versions for bootstrap purposes … ship our own binaries …

commit 64e89b3f30dddbcfe3d3334c00e1aeb26cf02523
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

firefox-esr: sync up with firefox 115.0.1, ++SECURITY_PATCH

diff --git a/devel/rust/BUILD b/devel/rust/BUILD
index ae1cfc1..faf9313 100755
--- a/devel/rust/BUILD
+++ b/devel/rust/BUILD
@@ -15,16 +15,16 @@ export CFLAGS CXXFLAGS &&
# /usr/bin/rustc will be missing its soversion. You cannot win.
# Maybe we need our own bootstrap packages. Or a chain build starting
# with the latest available cache.
-if spell_ok "$SPELL"; then
- _rust_root="$INSTALL_ROOT/usr"
-else
+#if spell_ok "$SPELL"; then
+# _rust_root="$INSTALL_ROOT/usr"
+#else
_rust_root="$SOURCE_DIRECTORY/stage0-bootstrap" &&
install -D -m555 -t "$_rust_root"/bin "${SOURCE3%.tar.xz}"/cargo/bin/cargo
&&
for i in "$SOURCE4" "$SOURCE5"; do
./"${i%.tar.xz}"/install.sh \
--destdir="$_rust_root" --prefix=/ --disable-ldconfig || break
- done
-fi &&
+ done &&
+#fi &&
message "${MESSAGE_COLOR}OPTS=$OPTS${DEFAULT_COLOR}" &&
./configure \
--build="${BUILD/-pc-/-unknown-}" \
diff --git a/devel/rust/DETAILS b/devel/rust/DETAILS
index f95ca7b..b2c9b40 100755
--- a/devel/rust/DETAILS
+++ b/devel/rust/DETAILS
@@ -11,7 +11,10 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/rustc-$VERSION-src
SOURCE2_URL[0]="${SOURCE_URL[0]}.asc"
SOURCE_GPG=rust.gpg:$SOURCE.asc:UPSTREAM_KEY
SOURCE2_IGNORE=signature
-if ! spell_ok "${SPELL}"; then
+# Relying on installed old version is too fragile.
+# Need bootstrap package from upstream, unless we do our own
+# from a build farm.
+#if ! spell_ok "${SPELL}"; then
BUILDX="${BUILD/-pc-/-unknown-}"
SOURCE3="cargo-$VERSION-${BUILDX}.tar.xz"
SOURCE4="rust-std-$VERSION-${BUILDX}.tar.xz"
@@ -31,7 +34,7 @@ if ! spell_ok "${SPELL}"; then
SOURCE6_IGNORE=signature
SOURCE7_IGNORE=signature
SOURCE8_IGNORE=signature
-fi
+#fi
WEB_SITE=https://www.rust-lang.org/
ENTERED=20130529
LICENSE[0]=MIT
diff --git a/devel/rust/HISTORY b/devel/rust/HISTORY
index c562341..7cedc8f 100644
--- a/devel/rust/HISTORY
+++ b/devel/rust/HISTORY
@@ -4,6 +4,10 @@
* PRE_]BUILD: incorporated code from firefox spell to neutralize
checksumming
in all vendored crates

+2023-07-10 Thomas Orgis <sobukus AT sourcemage.org>
+ * DETAILS, PRE_BUILD, BUILD: Never use installed rust for
+ bootstrap, we do not catch errors due to outdated version.
+
2023-06-01 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 1.70.0
* BUILD: dropped --disable-llvm-version-check flag
diff --git a/devel/rust/PRE_BUILD b/devel/rust/PRE_BUILD
index 3615c48..29f1a1b 100755
--- a/devel/rust/PRE_BUILD
+++ b/devel/rust/PRE_BUILD
@@ -11,11 +11,11 @@ find vendor -name .cargo-checksum.json \

# Bootstrapping
# Installed rust will in general NOT WORK!
-if ! spell_ok "$SPELL"; then
+#if ! spell_ok "$SPELL"; then
unpack_file 3 &&
unpack_file 4 &&
- unpack_file 5
-fi &&
+ unpack_file 5 &&
+#fi &&

# avoid rebuilding llvm
rm -r src/llvm-project
diff --git a/http/firefox-esr/CONFIGURE b/http/firefox-esr/CONFIGURE
index 2a0ad0c..44a8901 100755
--- a/http/firefox-esr/CONFIGURE
+++ b/http/firefox-esr/CONFIGURE
@@ -2,6 +2,7 @@

persistent_remove FIREFOX_GTK_VERSION &&
persistent_remove FIREFOX_SAFE &&
+list_remove FIREFOX_AUDIO "pulse" &&

config_query FIREFOX_MOZLINK "Create a symlink to mozilla?" n &&

@@ -17,7 +18,10 @@ config_query FIREFOX_SDK \
config_query FIREFOX_PGO \
'Enable profile guided optimizations (takes twice as
long to build)?' \
n &&
+config_query FIREFOX_SCCACHE \
+ 'Enable sccache support?' \
+ n &&
config_query FIREFOX_WIDEVINE \
'Enable Widevine DRM' n &&
config_query_multi FIREFOX_AUDIO "Select the audio backends:" \
- alsa pulse jack
+ alsa pulseaudio jack oss sndio
diff --git a/http/firefox-esr/DEPENDS b/http/firefox-esr/DEPENDS
index c7ca62d..76ddcfb 100755
--- a/http/firefox-esr/DEPENDS
+++ b/http/firefox-esr/DEPENDS
@@ -8,23 +8,36 @@ depends python3
&&
depends icu "--with-system-icu" &&

depends glib2 &&
-depends gtk+3 "--enable-default-toolkit=cairo-gtk3" &&
if spell_ok at-spi2-core &&
- is_version_less "2.45.1" "$(installed_version at-spi2-core)"; then
+ is_version_less "2.45.0" "$(installed_version at-spi2-core)"; then
depends at-spi2-core
else
depends atk
fi &&
-depends libx11 &&
-depends libxext &&
-depends libxrender &&
-depends libxt &&
-depends libxcomposite &&
+
+if [[ $FIREFOX_SCCACHE == 'y' ]]; then
+ depends sccache
+fi &&
+
+optional_depends libx11 "" "" "for X11 backend" &&
+if is_depends_enabled "${SPELL}" "libx11"; then
+ depends libxext &&
+ depends libxrender &&
+ depends libxt &&
+ depends libxcomposite &&
+ depends libxft
+fi &&
+
+optional_depends wayland "" "" "for Wayland backend" &&
+if is_depends_enabled "${SPELL}" "wayland"; then
+ local WAYLAND_SUFFIX="-wayland"
+fi &&
+
+depends gtk+3 "--enable-default-toolkit=cairo-gtk3${WAYLAND_SUFFIX}" &&

depends pango &&
depends fontconfig &&
depends freetype2 &&
-depends libxft &&

depends tar &&
depends unzip &&
@@ -40,7 +53,7 @@ depends libwebp "--with-system-webp"
&&

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

-local NSS_BRANCH="3.79" &&
+local NSS_BRANCH="3.90" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
@@ -81,12 +94,18 @@ do
alsa)
depends alsa-lib
;;
- pulse)
+pulseaudio)
depends pulseaudio
;;
jack)
depends JACK-DRIVER
;;
+ oss)
+ depends oss
+ ;;
+ sndio)
+ depends sndio
+ ;;
*)
message "${MESSAGE_COLOR}Bad audio choice: $b${DEFAULT_COLOR}"
exit 1
diff --git a/http/firefox-esr/DETAILS b/http/firefox-esr/DETAILS
index ee78eda..8568716 100755
--- a/http/firefox-esr/DETAILS
+++ b/http/firefox-esr/DETAILS
@@ -1,10 +1,11 @@
SPELL=firefox-esr
SPELLX=firefox
- VERSION=102.12.0esr
- SECURITY_PATCH=169
+ VERSION=115.0.1esr
+ SECURITY_PATCH=178
SOURCE="${SPELLX}-${VERSION}.source.tar.xz"

SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELLX}/releases/${VERSION}/source/${SOURCE}";
-
SOURCE_HASH="sha512:2a85cf1e1c83a862c2886a63dcf3e3e8bca9dd3ed72c5d0223db52387fff3796bc0dcbb508adb8c10a30729f20554c5aac37f8ad045b0088a593d28e39d77fe5"
+# Download SHA512SUMS and SHA512SUMS.asc, verify, then place hash here.
+
SOURCE_HASH="sha512:fb0be7eae28df80837eb99778d9d0ca61094210bf8e029cc15d02dc674694eb9f9bf1aed6ce9102ff9e0f83fc3c4a9cf1bdf768f59832ede00a43b9b7c953ed3"
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELLX}-${VERSION%esr}"
WEB_SITE=https://www.mozilla.org/en-US/firefox/fx/
GATHER_DOCS=off
diff --git a/http/firefox-esr/HISTORY b/http/firefox-esr/HISTORY
index e709d46..5c4190d 100644
--- a/http/firefox-esr/HISTORY
+++ b/http/firefox-esr/HISTORY
@@ -1,3 +1,6 @@
+2023-07-10 Thomas Orgis <sobukus AT sourcemage.org>
+ * */*: sync with firefox 115.0.1
+
2023-06-30 Thomas Orgis <sobukus AT sourcemage.org>
* DETAILS: 102.12 with SECURITY_PATCH++

diff --git a/http/firefox-esr/PRE_BUILD b/http/firefox-esr/PRE_BUILD
index 13d1943..0baadc3 100755
--- a/http/firefox-esr/PRE_BUILD
+++ b/http/firefox-esr/PRE_BUILD
@@ -1,8 +1,6 @@
default_pre_build &&
cd $SOURCE_DIRECTORY &&

-apply_patch_dir patches &&
-
# To remove version suffix from some directories
sed 's;-$(MOZ_APP_VERSION);;g' -i config/baseconfig.mk &&

@@ -34,6 +32,10 @@ else
echo "ac_add_options --disable-profiling --disable-tests"
fi >> .mozconfig &&

+if [[ $FIREFOX_SCCACHE == 'y' ]]; then
+ echo 'ac_add_options --with-ccache=sccache' >> .mozconfig
+fi &&
+
if [[ $FIREFOX_WIDEVINE == y ]]; then
echo "ac_add_options --enable-eme=widevine" >> .mozconfig
else
@@ -50,4 +52,10 @@ case "$HOST" in
ac_add_options --disable-gold
!
;;
-esac
+esac &&
+
+# clearing all checksums so the patches wouldn't cause troubles
+find third_party/rust -name .cargo-checksum.json \
+ -exec sed -i -e 's/\("files":{\)[^}]*/\1/' {} \; &&
+
+apply_patch_dir patches
diff --git
a/http/firefox-esr/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp
b/http/firefox-esr/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp
deleted file mode 100644
index 73b00ef..0000000
Binary files
a/http/firefox-esr/patches/.0026-Disable-FFVPX-with-VA-API.patch.swp and
/dev/null differ
diff --git a/http/firefox-esr/patches/0001-Don-t-use-build-id.patch
b/http/firefox-esr/patches/0001-Don-t-use-build-id.patch
index 27c2fc3..9976c89 100644
--- a/http/firefox-esr/patches/0001-Don-t-use-build-id.patch
+++ b/http/firefox-esr/patches/0001-Don-t-use-build-id.patch
@@ -1,29 +1,19 @@
-From db2794973f8a5e580fbceacbfb1b6469c9f162d7 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:14:26 +0200
-Subject: [PATCH 01/30] Don't use build id
-
-We must drop build id as it causes conflicts when merging
-thunderbird/firefox/seamonkey on same system when using
-splitdebug.
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- js/src/old-configure.in | 7 -------
- old-configure.in | 7 -------
- 2 files changed, 14 deletions(-)
-
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
-index 905494b784..15a7a2a852 100644
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -350,13 +350,6 @@ if test "$GNU_CC"; then
+diff -Naur a/js/src/old-configure.in b/js/src/old-configure.in
+--- a/js/src/old-configure.in 2023-06-06 11:04:10.782830435 +0300
++++ b/js/src/old-configure.in 2023-06-06 11:05:30.197519064 +0300
+@@ -233,19 +233,6 @@
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)

-- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- # While sha1 is deterministic, it is slower.
+- if test -z "$DEVELOPER_OPTIONS"; then
+- build_id=sha1
+- else
+- build_id=uuid
+- fi
+- AC_MSG_CHECKING([for --build-id=$build_id option to ld])
- _SAVE_LDFLAGS=$LDFLAGS
-- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
- AC_MSG_RESULT([no])
- LDFLAGS=$_SAVE_LDFLAGS)
@@ -31,17 +21,22 @@ index 905494b784..15a7a2a852 100644
_DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
fi

-diff --git a/old-configure.in b/old-configure.in
-index d1479574d1..f69f5f5456 100644
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -337,13 +337,6 @@ if test "$GNU_CC"; then
+diff -Naur a/old-configure.in b/old-configure.in
+--- a/old-configure.in 2023-06-06 11:04:08.354778655 +0300
++++ b/old-configure.in 2023-06-06 11:05:45.108835132 +0300
+@@ -239,19 +239,6 @@
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)

-- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- # While sha1 is deterministic, it is slower.
+- if test -z "$DEVELOPER_OPTIONS"; then
+- build_id=sha1
+- else
+- build_id=uuid
+- fi
+- AC_MSG_CHECKING([for --build-id=$build_id option to ld])
- _SAVE_LDFLAGS=$LDFLAGS
-- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
- AC_MSG_RESULT([no])
- LDFLAGS=$_SAVE_LDFLAGS)
@@ -49,6 +44,3 @@ index d1479574d1..f69f5f5456 100644
AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
_SAVE_LDFLAGS=$LDFLAGS
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
b/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
index 3abe8b0..bef79ad 100644
--- a/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
+++ b/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
@@ -1,21 +1,7 @@
-From a1395e97ffdbc9404a343b76fd731dc7ef385ffc 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/30] Fortify sources properly
-
-Ensure we fortify properly, features.h is pulled in via fortification.
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/system-headers.mozbuild | 1 -
- third_party/sipcc/sdp_os_defs.h | 3 ---
- 2 files changed, 4 deletions(-)
-
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index a1b58eb59b..ae0c9d6d7c 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -229,7 +229,6 @@ system_headers = [
+diff -Naur a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+--- a/config/system-headers.mozbuild 2023-07-04 13:57:53.418421221 +0300
++++ b/config/system-headers.mozbuild 2023-07-04 13:58:41.177179152 +0300
+@@ -227,7 +227,6 @@
'execinfo.h',
'extras.h',
'fcntl.h',
@@ -23,19 +9,3 @@ index a1b58eb59b..ae0c9d6d7c 100644
'fenv.h',
'ffi.h',
'fibdef.h',
-diff --git a/third_party/sipcc/sdp_os_defs.h
b/third_party/sipcc/sdp_os_defs.h
-index 16c9b33329..df38d9336c 100644
---- a/third_party/sipcc/sdp_os_defs.h
-+++ b/third_party/sipcc/sdp_os_defs.h
-@@ -20,8 +20,5 @@
- typedef uint8_t tinybool;
- typedef unsigned short ushort;
- typedef unsigned long ulong;
--#ifndef __GNUC_STDC_INLINE__
--#define inline
--#endif
-
- #endif /* _SDP_OS_DEFS_H_ */
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0003-Check-additional-plugins-dir.patch
b/http/firefox-esr/patches/0003-Check-additional-plugins-dir.patch
deleted file mode 100644
index ef66d9b..0000000
--- a/http/firefox-esr/patches/0003-Check-additional-plugins-dir.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 4d5eb53fa2ca9eeeadbfcd2be832aa8e97d413fc Mon Sep 17 00:00:00 2001
-From: Arfrever Frehtes Taifersar Arahesis <Arfrever AT Apache.Org>
-Date: Mon, 6 Apr 2020 19:17:43 +0200
-Subject: [PATCH 03/30] Check additional plugins dir
-
-Check original plugins dir along with default plugins dir.
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- xpcom/io/nsAppFileLocationProvider.cpp | 18 +++++++++++++++++-
- 1 file changed, 17 insertions(+), 1 deletion(-)
-
-diff --git a/xpcom/io/nsAppFileLocationProvider.cpp
b/xpcom/io/nsAppFileLocationProvider.cpp
-index ef974f9904..6261eafcc8 100644
---- a/xpcom/io/nsAppFileLocationProvider.cpp
-+++ b/xpcom/io/nsAppFileLocationProvider.cpp
-@@ -50,6 +50,7 @@
- # define NS_MACOSX_LOCAL_PLUGIN_DIR "OSXLocalPlugins"
- #elif XP_UNIX
- # define NS_SYSTEM_PLUGINS_DIR "SysPlugins"
-+# define NS_SYSTEM_NSBROWSER_PLUGINS_DIR "SysNsBrowserPlugins"
- #endif
-
- #define DEFAULTS_DIR_NAME "defaults"_ns
-@@ -172,6 +173,21 @@ nsAppFileLocationProvider::GetFile(const char* aProp,
bool* aPersistent,
- getter_AddRefs(localFile));
- # else
- rv = NS_ERROR_FAILURE;
-+# endif
-+ } else if (nsCRT::strcmp(aProp, NS_SYSTEM_NSBROWSER_PLUGINS_DIR) == 0) {
-+# ifdef ENABLE_SYSTEM_EXTENSION_DIRS
-+ static const char* const sysLPlgDir =
-+# if defined(HAVE_USR_LIB64_DIR) && defined(__LP64__)
-+ "/usr/lib64/nsbrowser/plugins";
-+# elif defined(__OpenBSD__) || defined(__FreeBSD__)
-+ "/usr/local/lib/nsbrowser/plugins";
-+# else
-+ "/usr/lib/nsbrowser/plugins";
-+# endif
-+ rv = NS_NewNativeLocalFile(nsDependentCString(sysLPlgDir), false,
-+ getter_AddRefs(localFile));
-+# else
-+ rv = NS_ERROR_FAILURE;
- # endif
- }
- # endif
-@@ -418,7 +434,7 @@ nsAppFileLocationProvider::GetFiles(const char* aProp,
- #else
- # ifdef XP_UNIX
- static const char* keys[] = {NS_USER_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR,
-- nullptr};
-+ NS_SYSTEM_NSBROWSER_PLUGINS_DIR, nullptr};
- # else
- static const char* keys[] = {NS_USER_PLUGINS_DIR, nullptr};
- # endif
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0003-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox-esr/patches/0003-bmo-847568-Support-system-harfbuzz.patch
new file mode 100644
index 0000000..18fb36f
--- /dev/null
+++ b/http/firefox-esr/patches/0003-bmo-847568-Support-system-harfbuzz.patch
@@ -0,0 +1,175 @@
+Allow building against system-wide harfbuzz.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+---
+ config/system-headers.mozbuild | 7 +++++++
+ dom/base/moz.build | 3 +++
+ gfx/moz.build | 4 +++-
+ gfx/skia/generate_mozbuild.py | 3 +++
+ gfx/skia/moz.build | 3 +++
+ gfx/thebes/moz.build | 3 +++
+ intl/unicharutil/util/moz.build | 3 +++
+ netwerk/dns/moz.build | 3 +++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 9 +++++++++
+ 10 files changed, 40 insertions(+), 1 deletion(-)
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index ae0c9d6d7c..44d08cf06b 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
+ 'vr/gvr/capi/include/gvr.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ system_headers += [
++ 'harfbuzz/hb-glib.h',
++ 'harfbuzz/hb-ot.h',
++ 'harfbuzz/hb.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/dom/base/moz.build b/dom/base/moz.build
+index d390adfc49..4508f19cb6 100644
+--- a/dom/base/moz.build
++++ b/dom/base/moz.build
+@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
+ if CONFIG["MOZ_X11"]:
+ CXXFLAGS += CONFIG["TK_CFLAGS"]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ GeneratedFile(
+ "UseCounterList.h",
+ script="gen-usecounters.py",
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 4d6d63da9d..8222b72333 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -10,6 +10,9 @@ with Files("**"):
+ with Files("wr/**"):
+ BUG_COMPONENT = ("Core", "Graphics: WebRender")
+
++if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ DIRS += ["harfbuzz/src"]
++
+ DIRS += [
+ "cairo",
+ "2d",
+@@ -20,7 +23,6 @@ DIRS += [
+ "gl",
+ "layers",
+ "graphite2/src",
+- "harfbuzz/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
+index 5e0fd17d79..860b80af4f 100755
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
+ LOCAL_INCLUDES += [
+ "/gfx/cairo/cairo/src",
+diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+index 524bd28dac..615c93b266 100755
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
+ LOCAL_INCLUDES += [
+ "/gfx/cairo/cairo/src",
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index baa6f090a9..c51c36e2b4 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -294,6 +294,9 @@
+
+ DEFINES["GRAPHITE2_STATIC"] = True
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ CXXFLAGS += ["-Werror=switch"]
+
+ include("/tools/fuzzing/libfuzzer-config.mozbuild")
+diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
+index 301eb9a854..7cece5e06c 100644
+--- a/intl/unicharutil/util/moz.build
++++ b/intl/unicharutil/util/moz.build
+@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
+ "nsUnicodeProperties.cpp",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ GeneratedFile(
+diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
+index f769e270fa..8f64710257 100644
+--- a/netwerk/dns/moz.build
++++ b/netwerk/dns/moz.build
+@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
+ "/netwerk/protocol/http",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ USE_LIBS += ["icu"]
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index 2c3f86948e..dd6901ba9a 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ "-lgvr",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_JPEG"]:
+ OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 00698656f6..1843188d11 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -460,6 +460,15 @@ add_old_configure_assignment(
+ )
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
++# HarfBuzz
++# ==============================================================
++option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
++
++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
++ when='--with-system-harfbuzz')
++
++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _:
True))
++
+ # Apple platform decoder support
+ # ==============================================================
+ @depends(toolkit)
+--
+2.34.1
+
diff --git
a/http/firefox-esr/patches/0004-bmo-847568-Support-system-graphite2.patch
b/http/firefox-esr/patches/0004-bmo-847568-Support-system-graphite2.patch
new file mode 100644
index 0000000..74d9b24
--- /dev/null
+++ b/http/firefox-esr/patches/0004-bmo-847568-Support-system-graphite2.patch
@@ -0,0 +1,208 @@
+From a7761d4886498eaa0e83d1c9b4399632cdbf314e Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:34:44 +0200
+Subject: [PATCH 05/30] bmo#847568: Support system graphite2
+
+Allow building against system-wide graphite2.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 6 ++++++
+ gfx/graphite2/geckoextra/moz.build | 21 +++++++++++++++++++++
+ gfx/graphite2/moz-gr-update.sh | 7 ++++++-
+ gfx/moz.build | 6 +++++-
+ gfx/thebes/moz.build | 5 ++++-
+ old-configure.in | 21 +++++++++++++++++++++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 13 +++++++++++++
+ 8 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 gfx/graphite2/geckoextra/moz.build
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 44d08cf06b..2f7ae39515 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ 'harfbuzz/hb.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ system_headers += [
++ 'graphite2/Font.h',
++ 'graphite2/Segment.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
+new file mode 100644
+index 0000000000..24e8d7a032
+--- /dev/null
++++ b/gfx/graphite2/geckoextra/moz.build
+@@ -0,0 +1,21 @@
++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
++# vim: set filetype=python:
++# This Source Code Form is subject to the terms of the Mozilla Public
++# License, v. 2.0. If a copy of the MPL was not distributed with this
++# file, You can obtain one at http://mozilla.org/MPL/2.0/.
++
++EXPORTS.graphite2 += [
++ 'include/GraphiteExtra.h',
++ 'include/GraphiteStructsForRLBox.h',
++]
++
++UNIFIED_SOURCES += [
++ '../geckoextra/src/GraphiteExtra.cpp',
++]
++
++CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
++
++# Match bundled graphite2 configuration
++AllowCompilerWarnings()
++
++FINAL_LIBRARY = 'gkmedias'
+diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
+index b91d9c161c..a97e6eb203 100755
+--- a/gfx/graphite2/moz-gr-update.sh
++++ b/gfx/graphite2/moz-gr-update.sh
+@@ -1,6 +1,7 @@
+ #!/bin/bash
+
+ # Script used to update the Graphite2 library in the mozilla source tree
++# and bump version for --with-system-graphite2
+
+ # This script lives in gfx/graphite2, along with the library source,
+ # but must be run from the top level of the mozilla-central tree.
+@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
gfx/graphite2/README.mozilla
+ #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+
++# chase version for --with-system-graphite2
++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
++ if /GR2_VERSION_REQUIRE/" old-configure.in
++
+ # summarize what's been touched
+ echo Updated to $RELEASE.
+ echo Here is what changed in the gfx/graphite2 directory:
+ echo
+
+-hg stat gfx/graphite2
++hg stat old-configure.in gfx/graphite2
+
+ echo
+ echo If gfx/graphite2/src/files.mk has changed, please make corresponding
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 8222b72333..16a2b401db 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -10,6 +10,11 @@ with Files("**"):
+ with Files("wr/**"):
+ BUG_COMPONENT = ("Core", "Graphics: WebRender")
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ DIRS += ["graphite2/geckoextra"]
++else:
++ DIRS += ["graphite2/src"]
++
+ if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ DIRS += ["harfbuzz/src"]
+
+@@ -22,7 +27,6 @@ DIRS += [
+ "qcms",
+ "gl",
+ "layers",
+- "graphite2/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index c51c36e2b4..4f02a9e2a5 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:
+
+ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+-DEFINES["GRAPHITE2_STATIC"] = True
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
++else:
++ DEFINES["GRAPHITE2_STATIC"] = True
+
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+diff --git a/old-configure.in b/old-configure.in
+index f69f5f5456..1c1c8ecef3 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -2204,6 +2204,27 @@ if test "$USE_FC_FREETYPE"; then
+ fi
+ fi
+
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
++ dnl graphite2.pc has bogus version, check manually
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
++ AC_TRY_COMPILE([ #include <graphite2/Font.h>
++ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
++ ( GR2_VERSION_MAJOR * 10000 +
GR2_VERSION_MINOR \
++ * 100 + GR2_VERSION_BUGFIX >= \
++ (major) * 10000 + (minor) * 100 + (bugfix) )
++ ], [
++ #if !GR2_VERSION_REQUIRE(1,3,8)
++ #error "Insufficient graphite2 version."
++ #endif
++ ], [],
++ [AC_MSG_ERROR([--with-system-graphite2 requested but no
working libgraphite2 found])])
++ CFLAGS=$_SAVE_CFLAGS
++fi
++
+ dnl ========================================================
+ dnl Check if we need the 32-bit Linux SSE2 error dialog
+ dnl ========================================================
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index dd6901ba9a..be73ac4bee 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ "-lgvr",
+ ]
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 1843188d11..a68e1b347d 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -460,6 +460,19 @@ add_old_configure_assignment(
+ )
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
++# Graphite2
++# ==============================================================
++option('--with-system-graphite2', help="Use system graphite2 (located with
pkgconfig)")
++
++@depends('--with-system-graphite2')
++def check_for_graphite2(value):
++ return bool(value)
++
++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
++ when=check_for_graphite2)
++
++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _:
True))
++
+ # HarfBuzz
+ # ==============================================================
+ option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
+--
+2.34.1
+
diff --git
a/http/firefox-esr/patches/0004-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox-esr/patches/0004-bmo-847568-Support-system-harfbuzz.patch
deleted file mode 100644
index 37ecef5..0000000
--- a/http/firefox-esr/patches/0004-bmo-847568-Support-system-harfbuzz.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From 61e8f03c526a40dda89b57aad6aec3f37d7125cd Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:32:39 +0200
-Subject: [PATCH 04/30] bmo#847568: Support system harfbuzz
-
-Allow building against system-wide harfbuzz.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/system-headers.mozbuild | 7 +++++++
- dom/base/moz.build | 3 +++
- gfx/moz.build | 4 +++-
- gfx/skia/generate_mozbuild.py | 3 +++
- gfx/skia/moz.build | 3 +++
- gfx/thebes/moz.build | 3 +++
- intl/unicharutil/util/moz.build | 3 +++
- netwerk/dns/moz.build | 3 +++
- toolkit/library/moz.build | 3 +++
- toolkit/moz.configure | 9 +++++++++
- 10 files changed, 40 insertions(+), 1 deletion(-)
-
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index ae0c9d6d7c..44d08cf06b 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
- 'vr/gvr/capi/include/gvr.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ system_headers += [
-+ 'harfbuzz/hb-glib.h',
-+ 'harfbuzz/hb-ot.h',
-+ 'harfbuzz/hb.h',
-+ ]
-+
- if CONFIG['MOZ_JACK']:
- system_headers += [
- 'jack/jack.h',
-diff --git a/dom/base/moz.build b/dom/base/moz.build
-index d390adfc49..4508f19cb6 100644
---- a/dom/base/moz.build
-+++ b/dom/base/moz.build
-@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
- if CONFIG["MOZ_X11"]:
- CXXFLAGS += CONFIG["TK_CFLAGS"]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- GeneratedFile(
- "UseCounterList.h",
- script="gen-usecounters.py",
-diff --git a/gfx/moz.build b/gfx/moz.build
-index 4d6d63da9d..8222b72333 100644
---- a/gfx/moz.build
-+++ b/gfx/moz.build
-@@ -10,6 +10,9 @@ with Files("**"):
- with Files("wr/**"):
- BUG_COMPONENT = ("Core", "Graphics: WebRender")
-
-+if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ DIRS += ["harfbuzz/src"]
-+
- DIRS += [
- "cairo",
- "2d",
-@@ -20,7 +23,6 @@ DIRS += [
- "gl",
- "layers",
- "graphite2/src",
-- "harfbuzz/src",
- "ots/src",
- "thebes",
- "ipc",
-diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index 5e0fd17d79..860b80af4f 100755
---- a/gfx/skia/generate_mozbuild.py
-+++ b/gfx/skia/generate_mozbuild.py
-@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
- '-Wno-unused-private-field',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
- LOCAL_INCLUDES += [
- "/gfx/cairo/cairo/src",
-diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 524bd28dac..615c93b266 100755
---- a/gfx/skia/moz.build
-+++ b/gfx/skia/moz.build
-@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
- '-Wno-unused-private-field',
- ]
-
-+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
- LOCAL_INCLUDES += [
- "/gfx/cairo/cairo/src",
-diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index baa6f090a9..c51c36e2b4 100644
---- a/gfx/thebes/moz.build
-+++ b/gfx/thebes/moz.build
-@@ -288,6 +288,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
-
- DEFINES["GRAPHITE2_STATIC"] = True
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
- # Suppress warnings from Skia header files.
- SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
-diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
-index 301eb9a854..7cece5e06c 100644
---- a/intl/unicharutil/util/moz.build
-+++ b/intl/unicharutil/util/moz.build
-@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
- "nsUnicodeProperties.cpp",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- include("/ipc/chromium/chromium-config.mozbuild")
-
- GeneratedFile(
-diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index f769e270fa..8f64710257 100644
---- a/netwerk/dns/moz.build
-+++ b/netwerk/dns/moz.build
-@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
- "/netwerk/protocol/http",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-+
- USE_LIBS += ["icu"]
-diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index 2c3f86948e..dd6901ba9a 100644
---- a/toolkit/library/moz.build
-+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
- "-lgvr",
- ]
-
-+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
-+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
-+
- if CONFIG["MOZ_SYSTEM_JPEG"]:
- OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
-
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 00698656f6..1843188d11 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -460,6 +460,15 @@ add_old_configure_assignment(
- )
- set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
-
-+# HarfBuzz
-+# ==============================================================
-+option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
-+
-+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
-+ when='--with-system-harfbuzz')
-+
-+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _:
True))
-+
- # Apple platform decoder support
- # ==============================================================
- @depends(toolkit)
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
b/http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
new file mode 100644
index 0000000..e894258
--- /dev/null
+++ b/http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
@@ -0,0 +1,114 @@
+From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:36:02 +0200
+Subject: [PATCH 06/30] bmo#1559213: Support system av1
+
+Allow building against system-wide av1.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/external/moz.build | 5 +++--
+ config/system-headers.mozbuild | 8 ++++++++
+ dom/media/platforms/moz.build | 5 +++++
+ toolkit/moz.configure | 20 ++++++++++++++++++--
+ 4 files changed, 34 insertions(+), 4 deletions(-)
+
+diff --git a/config/external/moz.build b/config/external/moz.build
+index ab771212bf..75595d999c 100644
+--- a/config/external/moz.build
++++ b/config/external/moz.build
+@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
+ external_dirs += ["media/libvpx"]
+
+ if CONFIG["MOZ_AV1"]:
+- external_dirs += ["media/libaom"]
+- external_dirs += ["media/libdav1d"]
++ if not CONFIG["MOZ_SYSTEM_AV1"]:
++ external_dirs += ["media/libaom"]
++ external_dirs += ["media/libdav1d"]
+
+ if not CONFIG["MOZ_SYSTEM_PNG"]:
+ external_dirs += ["media/libpng"]
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 2f7ae39515..96ab3a6466 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
+ 'proxy.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_AV1']:
++ system_headers += [
++ 'aom/aom_decoder.h',
++ 'aom/aomdx.h',
++ 'aom/aom_image.h',
++ 'dav1d/dav1d.h',
++ ]
++
+ if CONFIG['MOZ_SYSTEM_LIBVPX']:
+ system_headers += [
+ 'vpx_mem/vpx_mem.h',
+diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+index 8509aec6ef..7c5a1df63d 100644
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
+ "agnostic/AOMDecoder.cpp",
+ "agnostic/DAV1DDecoder.cpp",
+ ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
+
+ if CONFIG["MOZ_OMX"]:
+ EXPORTS += [
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index a68e1b347d..7b7975bd12 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -544,14 +544,29 @@ def av1(value):
+ if value:
+ return True
+
++option("--with-system-av1", help="Use system av1 (located with pkg-config)")
+
+-@depends(target, when=av1 & compile_environment)
++system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
++ when='--with-system-av1')
++
++system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >=
0.1.1',
++ when='--with-system-av1')
++
++@depends(system_libaom_info, system_libdav1d_info)
++def system_av1(system_libaom_info, system_libdav1d_info):
++ has_av1_libs = False
++ if system_libaom_info and system_libdav1d_info:
++ has_av1_libs = True
++ return has_av1_libs
++
++
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_asm(target):
+ if target.cpu in ("aarch64", "x86", "x86_64"):
+ return True
+
+
+-@depends(target, when=av1 & compile_environment)
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_nasm(target):
+ if target.cpu in ("x86", "x86_64"):
+ return namespace(version="2.14", what="AV1")
+@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
+ set_define("MOZ_DAV1D_ASM", dav1d_asm)
+ set_config("MOZ_AV1", av1)
+ set_define("MOZ_AV1", av1)
++set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
+
+ # JXL Image Codec Support
+ # ==============================================================
+--
+2.34.1
+
diff --git
a/http/firefox-esr/patches/0005-bmo-847568-Support-system-graphite2.patch
b/http/firefox-esr/patches/0005-bmo-847568-Support-system-graphite2.patch
deleted file mode 100644
index 74d9b24..0000000
--- a/http/firefox-esr/patches/0005-bmo-847568-Support-system-graphite2.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From a7761d4886498eaa0e83d1c9b4399632cdbf314e Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:34:44 +0200
-Subject: [PATCH 05/30] bmo#847568: Support system graphite2
-
-Allow building against system-wide graphite2.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/system-headers.mozbuild | 6 ++++++
- gfx/graphite2/geckoextra/moz.build | 21 +++++++++++++++++++++
- gfx/graphite2/moz-gr-update.sh | 7 ++++++-
- gfx/moz.build | 6 +++++-
- gfx/thebes/moz.build | 5 ++++-
- old-configure.in | 21 +++++++++++++++++++++
- toolkit/library/moz.build | 3 +++
- toolkit/moz.configure | 13 +++++++++++++
- 8 files changed, 79 insertions(+), 3 deletions(-)
- create mode 100644 gfx/graphite2/geckoextra/moz.build
-
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 44d08cf06b..2f7ae39515 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
- 'harfbuzz/hb.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
-+ system_headers += [
-+ 'graphite2/Font.h',
-+ 'graphite2/Segment.h',
-+ ]
-+
- if CONFIG['MOZ_JACK']:
- system_headers += [
- 'jack/jack.h',
-diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
-new file mode 100644
-index 0000000000..24e8d7a032
---- /dev/null
-+++ b/gfx/graphite2/geckoextra/moz.build
-@@ -0,0 +1,21 @@
-+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-+# vim: set filetype=python:
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+EXPORTS.graphite2 += [
-+ 'include/GraphiteExtra.h',
-+ 'include/GraphiteStructsForRLBox.h',
-+]
-+
-+UNIFIED_SOURCES += [
-+ '../geckoextra/src/GraphiteExtra.cpp',
-+]
-+
-+CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
-+
-+# Match bundled graphite2 configuration
-+AllowCompilerWarnings()
-+
-+FINAL_LIBRARY = 'gkmedias'
-diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
-index b91d9c161c..a97e6eb203 100755
---- a/gfx/graphite2/moz-gr-update.sh
-+++ b/gfx/graphite2/moz-gr-update.sh
-@@ -1,6 +1,7 @@
- #!/bin/bash
-
- # Script used to update the Graphite2 library in the mozilla source tree
-+# and bump version for --with-system-graphite2
-
- # This script lives in gfx/graphite2, along with the library source,
- # but must be run from the top level of the mozilla-central tree.
-@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
gfx/graphite2/README.mozilla
- #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
- #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
-
-+# chase version for --with-system-graphite2
-+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
-+ if /GR2_VERSION_REQUIRE/" old-configure.in
-+
- # summarize what's been touched
- echo Updated to $RELEASE.
- echo Here is what changed in the gfx/graphite2 directory:
- echo
-
--hg stat gfx/graphite2
-+hg stat old-configure.in gfx/graphite2
-
- echo
- echo If gfx/graphite2/src/files.mk has changed, please make corresponding
-diff --git a/gfx/moz.build b/gfx/moz.build
-index 8222b72333..16a2b401db 100644
---- a/gfx/moz.build
-+++ b/gfx/moz.build
-@@ -10,6 +10,11 @@ with Files("**"):
- with Files("wr/**"):
- BUG_COMPONENT = ("Core", "Graphics: WebRender")
-
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ DIRS += ["graphite2/geckoextra"]
-+else:
-+ DIRS += ["graphite2/src"]
-+
- if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- DIRS += ["harfbuzz/src"]
-
-@@ -22,7 +27,6 @@ DIRS += [
- "qcms",
- "gl",
- "layers",
-- "graphite2/src",
- "ots/src",
- "thebes",
- "ipc",
-diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index c51c36e2b4..4f02a9e2a5 100644
---- a/gfx/thebes/moz.build
-+++ b/gfx/thebes/moz.build
-@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:
-
- LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
-
--DEFINES["GRAPHITE2_STATIC"] = True
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
-+else:
-+ DEFINES["GRAPHITE2_STATIC"] = True
-
- if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
-diff --git a/old-configure.in b/old-configure.in
-index f69f5f5456..1c1c8ecef3 100644
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -2204,6 +2204,27 @@ if test "$USE_FC_FREETYPE"; then
- fi
- fi
-
-+dnl ========================================================
-+dnl Check for graphite2
-+dnl ========================================================
-+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
-+ dnl graphite2.pc has bogus version, check manually
-+ _SAVE_CFLAGS=$CFLAGS
-+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
-+ AC_TRY_COMPILE([ #include <graphite2/Font.h>
-+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
-+ ( GR2_VERSION_MAJOR * 10000 +
GR2_VERSION_MINOR \
-+ * 100 + GR2_VERSION_BUGFIX >= \
-+ (major) * 10000 + (minor) * 100 + (bugfix) )
-+ ], [
-+ #if !GR2_VERSION_REQUIRE(1,3,8)
-+ #error "Insufficient graphite2 version."
-+ #endif
-+ ], [],
-+ [AC_MSG_ERROR([--with-system-graphite2 requested but no
working libgraphite2 found])])
-+ CFLAGS=$_SAVE_CFLAGS
-+fi
-+
- dnl ========================================================
- dnl Check if we need the 32-bit Linux SSE2 error dialog
- dnl ========================================================
-diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index dd6901ba9a..be73ac4bee 100644
---- a/toolkit/library/moz.build
-+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
- "-lgvr",
- ]
-
-+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
-+ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
-+
- if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
- OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
-
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 1843188d11..a68e1b347d 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -460,6 +460,19 @@ add_old_configure_assignment(
- )
- set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
-
-+# Graphite2
-+# ==============================================================
-+option('--with-system-graphite2', help="Use system graphite2 (located with
pkgconfig)")
-+
-+@depends('--with-system-graphite2')
-+def check_for_graphite2(value):
-+ return bool(value)
-+
-+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
-+ when=check_for_graphite2)
-+
-+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _:
True))
-+
- # HarfBuzz
- # ==============================================================
- option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0006-bmo-1559213-Support-system-av1.patch
b/http/firefox-esr/patches/0006-bmo-1559213-Support-system-av1.patch
deleted file mode 100644
index e894258..0000000
--- a/http/firefox-esr/patches/0006-bmo-1559213-Support-system-av1.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:36:02 +0200
-Subject: [PATCH 06/30] bmo#1559213: Support system av1
-
-Allow building against system-wide av1.
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/external/moz.build | 5 +++--
- config/system-headers.mozbuild | 8 ++++++++
- dom/media/platforms/moz.build | 5 +++++
- toolkit/moz.configure | 20 ++++++++++++++++++--
- 4 files changed, 34 insertions(+), 4 deletions(-)
-
-diff --git a/config/external/moz.build b/config/external/moz.build
-index ab771212bf..75595d999c 100644
---- a/config/external/moz.build
-+++ b/config/external/moz.build
-@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
- external_dirs += ["media/libvpx"]
-
- if CONFIG["MOZ_AV1"]:
-- external_dirs += ["media/libaom"]
-- external_dirs += ["media/libdav1d"]
-+ if not CONFIG["MOZ_SYSTEM_AV1"]:
-+ external_dirs += ["media/libaom"]
-+ external_dirs += ["media/libdav1d"]
-
- if not CONFIG["MOZ_SYSTEM_PNG"]:
- external_dirs += ["media/libpng"]
-diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 2f7ae39515..96ab3a6466 100644
---- a/config/system-headers.mozbuild
-+++ b/config/system-headers.mozbuild
-@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
- 'proxy.h',
- ]
-
-+if CONFIG['MOZ_SYSTEM_AV1']:
-+ system_headers += [
-+ 'aom/aom_decoder.h',
-+ 'aom/aomdx.h',
-+ 'aom/aom_image.h',
-+ 'dav1d/dav1d.h',
-+ ]
-+
- if CONFIG['MOZ_SYSTEM_LIBVPX']:
- system_headers += [
- 'vpx_mem/vpx_mem.h',
-diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
-index 8509aec6ef..7c5a1df63d 100644
---- a/dom/media/platforms/moz.build
-+++ b/dom/media/platforms/moz.build
-@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
- "agnostic/AOMDecoder.cpp",
- "agnostic/DAV1DDecoder.cpp",
- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
-+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
-+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
-+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
-
- if CONFIG["MOZ_OMX"]:
- EXPORTS += [
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index a68e1b347d..7b7975bd12 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -544,14 +544,29 @@ def av1(value):
- if value:
- return True
-
-+option("--with-system-av1", help="Use system av1 (located with pkg-config)")
-
--@depends(target, when=av1 & compile_environment)
-+system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
-+ when='--with-system-av1')
-+
-+system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >=
0.1.1',
-+ when='--with-system-av1')
-+
-+@depends(system_libaom_info, system_libdav1d_info)
-+def system_av1(system_libaom_info, system_libdav1d_info):
-+ has_av1_libs = False
-+ if system_libaom_info and system_libdav1d_info:
-+ has_av1_libs = True
-+ return has_av1_libs
-+
-+
-+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
- def dav1d_asm(target):
- if target.cpu in ("aarch64", "x86", "x86_64"):
- return True
-
-
--@depends(target, when=av1 & compile_environment)
-+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
- def dav1d_nasm(target):
- if target.cpu in ("x86", "x86_64"):
- return namespace(version="2.14", what="AV1")
-@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
- set_define("MOZ_DAV1D_ASM", dav1d_asm)
- set_config("MOZ_AV1", av1)
- set_define("MOZ_AV1", av1)
-+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
-
- # JXL Image Codec Support
- # ==============================================================
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0006-musl-Add-alternate-name-for-private-siginfo-struct-m.patch

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

b/http/firefox-esr/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
deleted file mode 100644
index 6b1cde0..0000000
---
a/http/firefox-esr/patches/0007-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From e43f7431036904989cfd520f19de28a72be97ad9 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:41:43 +0200
-Subject: [PATCH 08/30] bmo#878089: Don't fail when TERM is not set
-
-Link: https://github.com/erikrose/blessings/pull/137
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=878089
-Bug: https://bugs.gentoo.org/654316
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- third_party/python/blessings/blessings/__init__.py | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/third_party/python/blessings/blessings/__init__.py
b/third_party/python/blessings/blessings/__init__.py
-index 388cece0b8..1283460cc9 100644
---- a/third_party/python/blessings/blessings/__init__.py
-+++ b/third_party/python/blessings/blessings/__init__.py
-@@ -94,8 +94,13 @@ class Terminal(object):
- # init sequences to the stream if it has a file descriptor, and
- # send them to stdout as a fallback, since they have to go
- # somewhere.
-- setupterm(kind or environ.get('TERM', 'unknown'),
-- self._init_descriptor)
-+ try:
-+ setupterm(kind or environ.get('TERM', 'dumb') or 'dumb',
-+ self._init_descriptor)
-+ except curses.error:
-+ # There was an error setting up the terminal, either curses
is
-+ # not supported or TERM is incorrectly set. Fall back to
dumb.
-+ self._does_styling = False
-
- self.stream = stream
-
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
b/http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
new file mode 100644
index 0000000..d9dda49
--- /dev/null
+++ b/http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
@@ -0,0 +1,42 @@
+From 1b46c0fc085fe93c36320d7ac1004c83efccdccc Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 8 Jan 2017 19:19:23 -0600
+Subject: [PATCH 11/30] musl: Fix syscall wrappers
+
+musl defines p{read,write}64 to their non-suffixed equivalents to avoid
+duplication in its syscall wrappers. This breaks macro expansion here,
+leading to errors such as:
+
+In function size_t sys_pread64(int, void*, size_t, off_t):
+ error: '__NR_pread' was not declared in this scope
+
+The fix here is to undefine the p{read,write}64 macros, so the syscall
+expands to (e.g.) __NR_pread64 instead.
+
+Signed-off-by: Samuel Holland <samuel AT sholland.org>
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../src/third_party/lss/linux_syscall_support.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h

b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+index 1abe0ba5b0..d6087a1674 100644
+---
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
++++
b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+@@ -173,6 +173,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
+--
+2.34.1
+
diff --git
a/http/firefox-esr/patches/0008-bmo-1516803-Fix-building-sandbox.patch
b/http/firefox-esr/patches/0008-bmo-1516803-Fix-building-sandbox.patch
deleted file mode 100644
index 24333b2..0000000
--- a/http/firefox-esr/patches/0008-bmo-1516803-Fix-building-sandbox.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6eeeca1b673a60d3e51427b2a5cf3e916bdb012b Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 19:44:28 +0200
-Subject: [PATCH 09/30] bmo#1516803: Fix building sandbox
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
-Bug: https://bugs.gentoo.org/666580
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/linux/moz.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
-index 573f667812..e62d1a99a4 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -116,7 +116,7 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- # forcing there to be only one partition.
- for f in CONFIG["OS_CXXFLAGS"]:
- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param lto-partitions=1"]
-+ LDFLAGS += ["--param", "lto-partitions=1"]
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0008-musl-Only-use-system-heap-reporter-with-glibc.patch

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

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

b/http/firefox-esr/patches/0009-musl-Set-pthread-name-for-non-glibc-systems.patch
new file mode 100644
index 0000000..fe74bb1
--- /dev/null
+++
b/http/firefox-esr/patches/0009-musl-Set-pthread-name-for-non-glibc-systems.patch
@@ -0,0 +1,29 @@
+From 70d47d18420fe9e3de8f896c08f97ef2596c9c84 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:10:03 +0200
+Subject: [PATCH 13/30] musl: Set pthread name for non glibc systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ js/src/threading/posix/PosixThread.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/js/src/threading/posix/PosixThread.cpp
b/js/src/threading/posix/PosixThread.cpp
+index 35532e375b..983da45326 100644
+--- a/js/src/threading/posix/PosixThread.cpp
++++ b/js/src/threading/posix/PosixThread.cpp
+@@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) {
+ rv = 0;
+ #elif defined(__NetBSD__)
+ rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
+-#else
++#elif defined(__GLIBC__)
+ rv = pthread_setname_np(pthread_self(), name);
++#else
++ rv = 0;
+ #endif
+ MOZ_RELEASE_ASSERT(!rv);
+ }
+--
+2.34.1
+
diff --git a/http/firefox-esr/patches/0010-musl-Fix-syscall-wrappers.patch
b/http/firefox-esr/patches/0010-musl-Fix-syscall-wrappers.patch
deleted file mode 100644
index d9dda49..0000000
--- a/http/firefox-esr/patches/0010-musl-Fix-syscall-wrappers.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 1b46c0fc085fe93c36320d7ac1004c83efccdccc Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel AT sholland.org>
-Date: Sun, 8 Jan 2017 19:19:23 -0600
-Subject: [PATCH 11/30] musl: Fix syscall wrappers
-
-musl defines p{read,write}64 to their non-suffixed equivalents to avoid
-duplication in its syscall wrappers. This breaks macro expansion here,
-leading to errors such as:
-
-In function size_t sys_pread64(int, void*, size_t, off_t):
- error: '__NR_pread' was not declared in this scope
-
-The fix here is to undefine the p{read,write}64 macros, so the syscall
-expands to (e.g.) __NR_pread64 instead.
-
-Signed-off-by: Samuel Holland <samuel AT sholland.org>
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../src/third_party/lss/linux_syscall_support.h | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h

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

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

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

b/http/firefox-esr/patches/0011-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
new file mode 100644
index 0000000..9de0db7
--- /dev/null
+++
b/http/firefox-esr/patches/0011-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
@@ -0,0 +1,28 @@
+From 6d36ed9e971861321bb381e25516500069314eb6 Mon Sep 17 00:00:00 2001
+From: Johannes <johannes.brechtmann AT gmail.com>
+Date: Fri, 1 May 2020 17:20:29 +0200
+Subject: [PATCH 16/30] musl: make SYS_fork non-fatal, musl uses it for
fork(2)
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/linux/SandboxFilter.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/security/sandbox/linux/SandboxFilter.cpp
b/security/sandbox/linux/SandboxFilter.cpp
+index eb72d944c8..8ce22d6f65 100644
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1537,6 +1537,10 @@ class ContentSandboxPolicy : public
SandboxPolicyCommon {
+ // usually do something reasonable on error.
+ case __NR_clone:
+ return ClonePolicy(Error(EPERM));
++# ifdef __NR_fork
++ case __NR_fork:
++ return Error(ENOSYS);
++# endif
+
+ case __NR_clone3:
+ return Error(ENOSYS);
+--
+2.34.1
+
diff --git a/http/firefox-esr/patches/0012-Make-PGO-use-toolchain.patch
b/http/firefox-esr/patches/0012-Make-PGO-use-toolchain.patch
new file mode 100644
index 0000000..3f72b05
--- /dev/null
+++ b/http/firefox-esr/patches/0012-Make-PGO-use-toolchain.patch
@@ -0,0 +1,33 @@
+From 45d43bb2dc1c1c033c860951c93261e98647f851 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:13:34 +0200
+Subject: [PATCH 18/30] Make PGO use toolchain
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/unix/mozconfig.unix | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix
+index 9ca9c97fce..9f86fe0940 100644
+--- a/build/unix/mozconfig.unix
++++ b/build/unix/mozconfig.unix
+@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
+ CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
+ CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+
++ if [ -n "$MOZ_PGO" ]; then
++ if [ -z "$USE_ARTIFACT" ]; then
++ ac_add_options --enable-lto
++ fi
++ export AR="$topsrcdir/gcc/bin/gcc-ar"
++ export NM="$topsrcdir/gcc/bin/gcc-nm"
++ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
++ fi
++
+ # We want to make sure we use binutils and other binaries in the
tooltool
+ # package.
+ mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
+--
+2.34.1
+
diff --git
a/http/firefox-esr/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch

b/http/firefox-esr/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
deleted file mode 100644
index fe74bb1..0000000
---
a/http/firefox-esr/patches/0012-musl-Set-pthread-name-for-non-glibc-systems.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 70d47d18420fe9e3de8f896c08f97ef2596c9c84 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:10:03 +0200
-Subject: [PATCH 13/30] musl: Set pthread name for non glibc systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- js/src/threading/posix/PosixThread.cpp | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/js/src/threading/posix/PosixThread.cpp
b/js/src/threading/posix/PosixThread.cpp
-index 35532e375b..983da45326 100644
---- a/js/src/threading/posix/PosixThread.cpp
-+++ b/js/src/threading/posix/PosixThread.cpp
-@@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) {
- rv = 0;
- #elif defined(__NetBSD__)
- rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
--#else
-+#elif defined(__GLIBC__)
- rv = pthread_setname_np(pthread_self(), name);
-+#else
-+ rv = 0;
- #endif
- MOZ_RELEASE_ASSERT(!rv);
- }
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0013-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

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

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

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

b/http/firefox-esr/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
deleted file mode 100644
index 121c8cd..0000000
---
a/http/firefox-esr/patches/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From beed745f96bbc18a3c22a728095c9a2eef7435ee Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:12:09 +0200
-Subject: [PATCH 15/30] musl: sys/auvx.h avaliable on more then just glibc
- systems
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- .../system_wrappers/source/cpu_features_linux.cc | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git
a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-index 335bed4da3..c2c98dae8a 100644
---- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-+++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
-@@ -12,13 +12,7 @@
- #include <stdlib.h>
- #include <string.h>
-
--#ifdef __GLIBC_PREREQ
--#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
--#else
--#define WEBRTC_GLIBC_PREREQ(a, b) 0
--#endif
--
--#if WEBRTC_GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- #include <sys/auxv.h>
- #else
- #include <errno.h>
-@@ -40,7 +34,7 @@ uint64_t GetCPUFeaturesARM(void) {
- int architecture = 0;
- uint64_t hwcap = 0;
- const char* platform = NULL;
--#if WEBRTC_GLIBC_PREREQ(2, 16)
-+#if defined(__linux__)
- hwcap = getauxval(AT_HWCAP);
- platform = (const char*)getauxval(AT_PLATFORM);
- #else
-@@ -64,7 +58,7 @@ uint64_t GetCPUFeaturesARM(void) {
- }
- close(fd);
- }
--#endif // WEBRTC_GLIBC_PREREQ(2, 16)
-+#endif // (__linux__)
- #if defined(__aarch64__)
- architecture = 8;
- if ((hwcap & HWCAP_FP) != 0)
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0015-build-Disable-Werror.patch
b/http/firefox-esr/patches/0015-build-Disable-Werror.patch
new file mode 100644
index 0000000..e1df117
--- /dev/null
+++ b/http/firefox-esr/patches/0015-build-Disable-Werror.patch
@@ -0,0 +1,24 @@
+diff -Naur a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
+--- a/build/moz.configure/warnings.configure 2022-10-10 19:05:25.000000000
+0300
++++ b/build/moz.configure/warnings.configure 2022-10-18 13:59:24.514026407
+0300
+@@ -160,6 +160,9 @@
+ # false positives depending on optimization
+ check_and_add_warning("-Wno-error=array-bounds")
+
++# can't get rid of those PGO warnings
++check_and_add_warning("-Wno-error=coverage-mismatch")
++
+ # false positives depending on optimizations
+ check_and_add_warning("-Wno-error=free-nonheap-object")
+
+@@ -279,8 +282,8 @@
+ # build, but we're not sure why.
+ check_and_add_warning("-Wno-enum-compare")
+
+-# Make it an error to be missing function declarations for C code.
+-check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
++check_and_add_warning("-Werror=implicit-function-declaration",
++ when="--enable-warnings-as-errors")
+
+ # New in clang 11. We can't really do anything about this warning.
+ check_and_add_warning("-Wno-psabi")
diff --git
a/http/firefox-esr/patches/0015-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch

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

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

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

b/http/firefox-esr/patches/0017-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
new file mode 100644
index 0000000..5e48dd2
--- /dev/null
+++
b/http/firefox-esr/patches/0017-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
@@ -0,0 +1,23 @@
+Enable FLAC on platforms without ffvpx like powerpc*
+
+--- a/dom/media/flac/FlacDecoder.cpp
++++ b/dom/media/flac/FlacDecoder.cpp
+@@ -7,6 +7,7 @@
+ #include "FlacDecoder.h"
+ #include "MediaContainerType.h"
+ #include "mozilla/StaticPrefs_media.h"
++#include "PDMFactory.h"
+
+ namespace mozilla {
+
+@@ -14,6 +15,10 @@ namespace mozilla {
+ bool FlacDecoder::IsEnabled() {
+ #ifdef MOZ_FFVPX
+ return StaticPrefs::media_flac_enabled();
++#elif defined(MOZ_FFMPEG)
++ RefPtr<PDMFactory> platform = new PDMFactory();
++ return StaticPrefs::media_flac_enabled() &&
++ (platform->SupportsMimeType("audio/flac"_ns) !=
media::DecodeSupport::Unsupported);
+ #else
+ return false;
+ #endif
diff --git a/http/firefox-esr/patches/0017-Make-PGO-use-toolchain.patch
b/http/firefox-esr/patches/0017-Make-PGO-use-toolchain.patch
deleted file mode 100644
index 3f72b05..0000000
--- a/http/firefox-esr/patches/0017-Make-PGO-use-toolchain.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 45d43bb2dc1c1c033c860951c93261e98647f851 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Mon, 6 Apr 2020 20:13:34 +0200
-Subject: [PATCH 18/30] Make PGO use toolchain
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/unix/mozconfig.unix | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix
-index 9ca9c97fce..9f86fe0940 100644
---- a/build/unix/mozconfig.unix
-+++ b/build/unix/mozconfig.unix
-@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
- CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
- CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
-
-+ if [ -n "$MOZ_PGO" ]; then
-+ if [ -z "$USE_ARTIFACT" ]; then
-+ ac_add_options --enable-lto
-+ fi
-+ export AR="$topsrcdir/gcc/bin/gcc-ar"
-+ export NM="$topsrcdir/gcc/bin/gcc-nm"
-+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
-+ fi
-+
- # We want to make sure we use binutils and other binaries in the
tooltool
- # package.
- mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
b/http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
new file mode 100644
index 0000000..4b2289f
--- /dev/null
+++ b/http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
@@ -0,0 +1,16 @@
+diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
+index 51d79f9c2ec59..fafd7d6fc1e0d 100644
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,11 @@
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
+
++#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
++typedef long double __double_t;
++#else
+ typedef double __double_t;
++#endif
+ typedef __double_t double_t;
+
+ /*
diff --git
a/http/firefox-esr/patches/0018-bmo-1516081-Disable-watchdog-during-PGO-builds.patch

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

b/http/firefox-esr/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
deleted file mode 100644
index ef8f9b2..0000000
---
a/http/firefox-esr/patches/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0501ed4bbdbf8d16a69a4460d2ada33ac259365d Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Wed, 15 Apr 2020 00:27:25 +0200
-Subject: [PATCH 20/30] bmo#1516803: force one LTO partition for sandbox when
- using GCC
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- security/sandbox/linux/moz.build | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
-index e62d1a99a4..913b9ba2ce 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -114,9 +114,10 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- # gcc lto likes to put the top level asm in syscall.cc in a different
partition
- # from the function using it which breaks the build. Work around that by
- # forcing there to be only one partition.
--for f in CONFIG["OS_CXXFLAGS"]:
-- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param", "lto-partitions=1"]
-+if CONFIG["CC_TYPE"] != "clang" and CONFIG["MOZ_LTO_LDFLAGS"] is not None:
-+ for f in CONFIG["MOZ_LTO_LDFLAGS"]:
-+ if f.startswith("-flto"):
-+ LDFLAGS += ["--param", "lto-partitions=1"]
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
new file mode 100644
index 0000000..361c0b6
--- /dev/null
+++ b/http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
@@ -0,0 +1,23 @@
+diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+index 0069865..e806fc8 100644
+--- a/media/ffvpx/libavcodec/moz.build
++++ b/media/ffvpx/libavcodec/moz.build
+@@ -108,10 +108,14 @@
+ 'vp9prob.c',
+ 'vp9recon.c'
+ ]
+- USE_LIBS += [
+- 'dav1d',
+- 'media_libdav1d_asm',
+- ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
++ else:
++ USE_LIBS += [
++ 'dav1d',
++ 'media_libdav1d_asm',
++ ]
+ if CONFIG['MOZ_WAYLAND']:
+ LOCAL_INCLUDES += ['/media/mozva']
+ SOURCES += [
diff --git
a/http/firefox-esr/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
b/http/firefox-esr/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
deleted file mode 100644
index 81de54b..0000000
--- a/http/firefox-esr/patches/0020-Fix-building-with-PGO-when-using-GCC.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 98e1e605c8fdf7b021d6f1888ce6baed5c1097b5 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 2 Jul 2020 18:05:03 +0200
-Subject: [PATCH 22/30] Fix building with PGO when using GCC
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- build/moz.configure/lto-pgo.configure | 5 +++--
- build/pgo/profileserver.py | 26 ++++++++++++++++++++++----
- 2 files changed, 25 insertions(+), 6 deletions(-)
-
-diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
-index 567ccf0ba4..c6470ef829 100644
---- a/build/moz.configure/lto-pgo.configure
-+++ b/build/moz.configure/lto-pgo.configure
-@@ -83,11 +83,12 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
- @imports("multiprocessing")
- def pgo_flags(compiler, profdata, target_is_windows):
- if compiler.type == "gcc":
-+ profile_use = "-fprofile-use"
- return namespace(
- gen_cflags=["-fprofile-generate",
"-DMOZ_PROFILE_INSTRUMENTATION"],
- gen_ldflags=["-fprofile-generate"],
-- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
-- use_ldflags=["-fprofile-use"],
-+ use_cflags=[profile_use, "-fprofile-correction",
"-Wcoverage-mismatch"],
-+ use_ldflags=[profile_use],
- )
-
- if compiler.type in ("clang-cl", "clang"):
-diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
-index 7f3de106ab..89289a7756 100755
---- a/build/pgo/profileserver.py
-+++ b/build/pgo/profileserver.py
-@@ -11,7 +11,7 @@ import glob
- import subprocess
-
- import mozcrash
--from mozbuild.base import MozbuildObject, BinaryNotFoundException
-+from mozbuild.base import MozbuildObject, BinaryNotFoundException,
BuildEnvironmentNotFoundException
- from mozfile import TemporaryDirectory
- from mozhttpd import MozHttpd
- from mozprofile import FirefoxProfile, Preferences
-@@ -87,9 +87,22 @@ if __name__ == "__main__":
- locations = ServerLocations()
- locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
-
-- old_profraw_files = glob.glob("*.profraw")
-- for f in old_profraw_files:
-- os.remove(f)
-+ using_gcc = False
-+ try:
-+ if build.config_environment.substs.get("CC_TYPE") == "gcc":
-+ using_gcc = True
-+ except BuildEnvironmentNotFoundException:
-+ pass
-+
-+ if using_gcc:
-+ for dirpath, _, filenames in os.walk("."):
-+ for f in filenames:
-+ if f.endswith(".gcda"):
-+ os.remove(os.path.join(dirpath, f))
-+ else:
-+ old_profraw_files = glob.glob("*.profraw")
-+ for f in old_profraw_files:
-+ os.remove(f)
-
- with TemporaryDirectory() as profilePath:
- # TODO: refactor this into mozprofile
-@@ -212,6 +225,11 @@ if __name__ == "__main__":
- print("Firefox exited successfully, but produced a crashreport")
- sys.exit(1)
-
-+ if using_gcc:
-+ print("Copying profile data...")
-+ os.system("pwd");
-+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd
..; tar xf instrumented/profdata.tar.gz;');
-+
- llvm_profdata = env.get("LLVM_PROFDATA")
- if llvm_profdata:
- profraw_files = glob.glob("*.profraw")
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0020-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox-esr/patches/0020-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..864741e
--- /dev/null
+++
b/http/firefox-esr/patches/0020-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
@@ -0,0 +1,13 @@
+diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
+--- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
++++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
+@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
+- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
++ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
++ GDK_FOCUS_CHANGE_MASK;
+
+ /* utility functions */
+ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git
a/http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
new file mode 100644
index 0000000..634892be
--- /dev/null
+++ b/http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
@@ -0,0 +1,69 @@
+--- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
++++ b/memory/mozalloc/throw_gcc.h
+@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
+ mozalloc_abort("fatal: STL threw bad_function_call");
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_invalid_argument(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_overflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_underflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
+ const char* msg) {
diff --git
a/http/firefox-esr/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch

b/http/firefox-esr/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
deleted file mode 100644
index 85c305f..0000000
---
a/http/firefox-esr/patches/0021-libaom-Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-lib.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6e220b49aee7dbdcafd255f6260517c5c551f9b1 Mon Sep 17 00:00:00 2001
-From: Mike Hommey <mh AT glandium.org>
-Date: Mon, 26 Nov 2018 09:59:56 +0900
-Subject: [PATCH 23/30] libaom: Use NEON_FLAGS instead of VPX_ASFLAGS for
- libaom neon code
-
-Bug: https://bugs.gentoo.org/730606
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- media/libaom/moz.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/media/libaom/moz.build b/media/libaom/moz.build
-index fd8c7f2b33..db3f9ca6ec 100644
---- a/media/libaom/moz.build
-+++ b/media/libaom/moz.build
-@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm':
-
- for f in SOURCES:
- if f.endswith('neon.c'):
-- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
-+ SOURCES[f].flags += CONFIG['NEON_FLAGS']
-
- if CONFIG['OS_TARGET'] == 'Android':
- # For cpu-features.h
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
b/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
new file mode 100644
index 0000000..7cf532a
--- /dev/null
+++ b/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
@@ -0,0 +1,49 @@
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -2353,18 +2353,6 @@ with only_when(compile_environment & tar
+ )
+ set_config("MOZ_D3DCOMPILER_VISTA_DLL_PATH", d3d_compiler_dll.path)
+
+-# Remoting protocol support
+-# ==============================================================
+-
+-
+-@depends(toolkit)
+-def has_remote(toolkit):
+- if toolkit in ("gtk", "windows", "cocoa"):
+- return True
+-
+-
+-set_config("MOZ_HAS_REMOTE", has_remote)
+-set_define("MOZ_HAS_REMOTE", has_remote)
+
+ # RLBox Library Sandboxing wasm support
+ # ==============================================================
+@@ -2900,6 +2888,26 @@ with only_when(toolkit_gtk):
+ set_config("MOZ_ENABLE_DBUS", True)
+ set_define("MOZ_ENABLE_DBUS", True)
+
++# Remoting protocol support
++# ==============================================================
++
++@depends(
++ toolkit,
++ depends("--enable-dbus", when=toolkit_gtk)(lambda x: x),
++ depends(wayland_headers, when=toolkit_gtk)(lambda x: x),
++ depends(x11_headers, when=toolkit_gtk)(lambda x: x),
++)
++def has_remote(toolkit, dbus, wayland, x11):
++ if toolkit in ("windows", "cocoa"):
++ return True
++ if toolkit == "gtk":
++ if not dbus and wayland and not x11:
++ return
++ return True
++
++
++set_config("MOZ_HAS_REMOTE", has_remote)
++set_define("MOZ_HAS_REMOTE", has_remote)
+
+ # Necko's wifi scanner
+ # ==============================================================
diff --git a/http/firefox-esr/patches/0022-build-Disable-Werror.patch
b/http/firefox-esr/patches/0022-build-Disable-Werror.patch
deleted file mode 100644
index 1e831ae..0000000
--- a/http/firefox-esr/patches/0022-build-Disable-Werror.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -Naur a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
---- a/build/moz.configure/warnings.configure 2022-05-27 02:16:52.000000000
+0300
-+++ b/build/moz.configure/warnings.configure 2022-05-31 10:48:22.990378071
+0300
-@@ -293,7 +293,8 @@
- check_and_add_warning("-Wno-gnu-zero-variadic-macro-arguments")
-
- # Make it an error to be missing function declarations for C code.
--check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
-+check_and_add_warning("-Werror=implicit-function-declaration",
-+ when="--enable-warnings-as-errors")
-
- # New in clang 11. We can't really do anything about this warning.
- check_and_add_warning("-Wno-psabi")
diff --git
a/http/firefox-esr/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox-esr/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
deleted file mode 100644
index 32bd0eb..0000000
---
a/http/firefox-esr/patches/0023-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 685e82ac82921720c6cd9c6c45703ff034f081e7 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Sat, 29 Aug 2020 22:30:59 +0200
-Subject: [PATCH 25/30] LTO: Only enable LTO for Rust when complete build uses
- LTO
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/makefiles/rust.mk | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
-index 75570d32b9..924722a506 100644
---- a/config/makefiles/rust.mk
-+++ b/config/makefiles/rust.mk
-@@ -87,6 +87,7 @@ endif
- # These flags are passed via `cargo rustc` and only apply to the final rustc
- # invocation (i.e., only the top-level crate, not its dependencies).
- cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
-+ifdef MOZ_LTO
- ifndef DEVELOPER_OPTIONS
- ifndef MOZ_DEBUG_RUST
- # Enable link-time optimization for release builds, but not when linking
-@@ -106,6 +107,7 @@ endif
- endif
- endif
- endif
-+endif
-
- ifdef CARGO_INCREMENTAL
- export CARGO_INCREMENTAL
---
-2.34.1
-
diff --git
a/http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
b/http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
new file mode 100644
index 0000000..51f7faa
--- /dev/null
+++ b/http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
@@ -0,0 +1,55 @@
+From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel AT octaforge.org>
+Date: Fri, 23 Sep 2022 02:38:29 +0200
+Subject: [PATCH] fix sqlite3 on ppc with clang
+
+The __ppc__ macro is always defined on clang but not gcc, which
+results in sqlite mistakenly thinking that ppc64le with clang
+is big endian.
+
+Also disable some inline assembly stuff on ppc that is never used
+with gcc and probably was never tested with modern machines.
+---
+ third_party/sqlite3/src/sqlite3.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/third_party/sqlite3/src/sqlite3.c
b/third_party/sqlite3/src/sqlite3.c
+index 4f3dc68..9017062 100644
+--- a/third_party/sqlite3/src/sqlite3.c
++++ b/third_party/sqlite3/src/sqlite3.c
+@@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
+ # if defined(i386) || defined(__i386__) || defined(_M_IX86) ||
\
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) ||
\
+ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) ||
\
+- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||
defined(__LITTLE_ENDIAN__)
+ # define SQLITE_BYTEORDER 1234
+-# elif defined(sparc) || defined(__ppc__) || \
++# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
+ defined(__ARMEB__) || defined(__AARCH64EB__)
+ # define SQLITE_BYTEORDER 4321
+ # else
+@@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char
**sqlite3CompileOptions(int *pnOpt);
+ return val;
+ }
+
+-#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
++#elif 0
+
+ __inline__ sqlite_uint64 sqlite3Hwtime(void){
+ unsigned long long retval;
+@@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
+ #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
+ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
+- defined(__arm__)
++ defined(__arm__) || defined(__LITTLE_ENDIAN__)
+ # define SQLITE_BYTEORDER 1234
+-#elif defined(sparc) || defined(__ppc__)
++#elif defined(sparc) || defined(__BIG_ENDIAN__)
+ # define SQLITE_BYTEORDER 4321
+ #else
+ # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
+--
+2.37.3
+
diff --git a/http/firefox-esr/patches/0024-Disable-FFVPX-with-VA-API.patch
b/http/firefox-esr/patches/0024-Disable-FFVPX-with-VA-API.patch
deleted file mode 100644
index 42d639f..0000000
--- a/http/firefox-esr/patches/0024-Disable-FFVPX-with-VA-API.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 38068d0801ad85ba36673ab2ad6a53e0fd3ffdde 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 27/30] 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-esr/patches/0024-fix-building-gcc-pgo.patch
b/http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
new file mode 100644
index 0000000..699d67a
--- /dev/null
+++ b/http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
@@ -0,0 +1,66 @@
+diff -up firefox-112.0/build/pgo/profileserver.py.pgo
firefox-112.0/build/pgo/profileserver.py
+--- firefox-112.0/build/pgo/profileserver.py.pgo 2023-04-06
17:27:40.000000000 +0200
++++ firefox-112.0/build/pgo/profileserver.py 2023-04-06 21:29:33.772294479
+0200
+@@ -11,7 +11,7 @@ import subprocess
+ import sys
+
+ import mozcrash
+-from mozbuild.base import BinaryNotFoundException, MozbuildObject
++from mozbuild.base import BinaryNotFoundException, MozbuildObject,
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
+diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-112.0/toolkit/components/terminator/nsTerminator.cpp
+--- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2023-04-06 17:27:57.000000000 +0200
++++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp
2023-04-06 21:27:32.538089108 +0200
+@@ -460,6 +460,11 @@ 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.
++ crashAfterMS = INT32_MAX;
++
+ UniquePtr<Options> options(new Options());
+ // crashAfterTicks is guaranteed to be > 0 as
+ // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >>
HEARTBEAT_INTERVAL_MS
+diff -up firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo
firefox-114.0.2/build/moz.configure/lto-pgo.configure
+--- firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo 2023-06-22
11:17:37.428552356 +0200
++++ firefox-114.0.2/build/moz.configure/lto-pgo.configure 2023-06-22
11:17:51.476033691 +0200
+@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target
+ return namespace(
+ gen_cflags=["-fprofile-generate"],
+ gen_ldflags=["-fprofile-generate"],
+- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
++ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wno-coverage-mismatch"],
+ use_ldflags=["-fprofile-use"],
+ )
+
+
diff --git
a/http/firefox-esr/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox-esr/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
deleted file mode 100644
index 2c6a271..0000000
---
a/http/firefox-esr/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 58b0385412c6d96eb745e2fc5902df347e629f6d 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 28/30] 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-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
b/http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
new file mode 100644
index 0000000..14e8c4a
--- /dev/null
+++ b/http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
@@ -0,0 +1,35 @@
+#https://www.talospace.com/2023/06/firefox-114-on-power.html
+#https://gist.github.com/classilla/95b5dd53627528448f8512a82205672c
+
+diff -r 954df08c7f0b third_party/libwebrtc/moz.build
+--- a/third_party/libwebrtc/moz.build Tue Jun 06 08:55:21 2023 +0000
++++ b/third_party/libwebrtc/moz.build Mon Jun 19 09:33:12 2023 -0700
+@@ -595,16 +595,28 @@
+ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
+ "/third_party/libwebrtc/modules/portal/portal_gn",
+ "/third_party/libwebrtc/third_party/drm/drm_gn",
+ "/third_party/libwebrtc/third_party/gbm/gbm_gn",
+ "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
+ "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
+ ]
+
++if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
++
++ DIRS += [
++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
++ "/third_party/libwebrtc/modules/portal/portal_gn",
++ "/third_party/libwebrtc/third_party/drm/drm_gn",
++ "/third_party/libwebrtc/third_party/gbm/gbm_gn",
++ "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
++ "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
++ ]
++
+ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "OpenBSD":
+
+ DIRS += [
+ "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
+ "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
+ ]
+
+ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "OpenBSD":
diff --git
a/http/firefox-esr/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox-esr/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
deleted file mode 100644
index 856361d..0000000
---
a/http/firefox-esr/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 0b53fcfa8ee76ccc2d77abb947810f631efaecd9 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Fri, 11 Dec 2020 15:37:38 +0100
-Subject: [PATCH 29/30] bmo#1670333: OpenH264: Fix decoding if it starts on
non
- IDR I-frame
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/mp4/MP4Demuxer.cpp | 8 ++++++++
- dom/media/platforms/PDMFactory.cpp | 15 ++++++++++-----
- dom/media/platforms/PDMFactory.h | 2 ++
- 3 files changed, 20 insertions(+), 5 deletions(-)
-
-diff --git a/dom/media/mp4/MP4Demuxer.cpp b/dom/media/mp4/MP4Demuxer.cpp
-index 59bba16577..0304e3e89f 100644
---- a/dom/media/mp4/MP4Demuxer.cpp
-+++ b/dom/media/mp4/MP4Demuxer.cpp
-@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { return
gMediaDemuxerLog; }
- DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
- __func__, ##__VA_ARGS__)
-
-+extern bool gUseKeyframeFromContainer;
-+
- namespace mozilla {
-
- DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
-@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData>
MP4TrackDemuxer::GetNextSample() {
- [[fallthrough]];
- case H264::FrameType::OTHER: {
- bool keyframe = type == H264::FrameType::I_FRAME;
-+ if (gUseKeyframeFromContainer) {
-+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
-+ sample->mKeyframe = keyframe;
-+ }
-+ break;
-+ }
- if (sample->mKeyframe != keyframe) {
- NS_WARNING(nsPrintfCString("Frame incorrectly marked as
%skeyframe "
- "@ pts:%" PRId64 " dur:%" PRId64
-diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
-index 4e377082ae..e778eb9948 100644
---- a/dom/media/platforms/PDMFactory.cpp
-+++ b/dom/media/platforms/PDMFactory.cpp
-@@ -58,6 +58,8 @@
-
- #include <functional>
-
-+bool gUseKeyframeFromContainer = false;
-+
- namespace mozilla {
-
- #define PDM_INIT_LOG(msg, ...) \
-@@ -536,10 +538,12 @@ void PDMFactory::CreateContentPDMs() {
- }
- #endif
- #ifdef MOZ_FFMPEG
-- if (StaticPrefs::media_ffmpeg_enabled() &&
-- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-- FFmpegRuntimeLinker::LinkStatusCode());
-+ if (StaticPrefs::media_ffmpeg_enabled()) {
-+ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
-+ if (!mFFmpegUsed) {
-+ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-+ FFmpegRuntimeLinker::LinkStatusCode());
-+ }
- }
- #endif
- #ifdef MOZ_FFVPX
-@@ -556,8 +560,9 @@ void PDMFactory::CreateContentPDMs() {
-
- CreateAndStartupPDM<AgnosticDecoderModule>();
-
-- if (StaticPrefs::media_gmp_decoder_enabled() &&
-+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
- !CreateAndStartupPDM<GMPDecoderModule>()) {
-+ gUseKeyframeFromContainer = true;
- mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
- }
- }
-diff --git a/dom/media/platforms/PDMFactory.h
b/dom/media/platforms/PDMFactory.h
-index 4fc81c0b37..72f3255b6f 100644
---- a/dom/media/platforms/PDMFactory.h
-+++ b/dom/media/platforms/PDMFactory.h
-@@ -122,6 +122,8 @@ class PDMFactory final {
-
- DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
-
-+ bool mFFmpegUsed = false;
-+
- friend class RemoteVideoDecoderParent;
- static void EnsureInit();
- };
---
-2.34.1
-
diff --git a/http/firefox-esr/patches/0026-bmo-1840931-elfhack-pgo-fix.patch
b/http/firefox-esr/patches/0026-bmo-1840931-elfhack-pgo-fix.patch
new file mode 100644
index 0000000..6d88bc5
--- /dev/null
+++ b/http/firefox-esr/patches/0026-bmo-1840931-elfhack-pgo-fix.patch
@@ -0,0 +1,165 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla AT glandium.org>
+# Date 1688068580 0
+# Node ID 51b78cf4881b07422c0c6e590e863b095257e9e1
+# Parent eef8bff2d6117cc88dcca9ab4718be0f5186924b
+Bug 1840931 - More properly handle files > 4GB in elfhack. r=gsvelto
+
+I'm pretty sure there are other theoretical problems in the code,
+notably when a single section is larger than 4GB, but by the time
+we reach that limit, bug 1839740 will have been fixed.
+
+Differential Revision: https://phabricator.services.mozilla.com/D182447
+
+diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp
+--- a/build/unix/elfhack/elf.cpp
++++ b/build/unix/elfhack/elf.cpp
+@@ -344,17 +344,17 @@ ElfSection* Elf::getSection(int index) {
+ break;
+ default:
+ sections[index] = new ElfSection(*tmp_shdr[index], tmp_file, this);
+ }
+ }
+ return sections[index];
+ }
+
+-ElfSection* Elf::getSectionAt(unsigned int offset) {
++ElfSection* Elf::getSectionAt(Elf64_Off offset) {
+ for (int i = 1; i < ehdr->e_shnum; i++) {
+ ElfSection* section = getSection(i);
+ if ((section != nullptr) && (section->getFlags() & SHF_ALLOC) &&
+ !(section->getFlags() & SHF_TLS) && (offset >= section->getAddr())
&&
+ (offset < section->getAddr() + section->getSize()))
+ return section;
+ }
+ return nullptr;
+@@ -529,38 +529,38 @@ ElfSection::ElfSection(Elf_Shdr& s, std:
+ // Only SHT_REL/SHT_RELA sections use sh_info to store a section
+ // number.
+ if ((shdr.sh_type == SHT_REL) || (shdr.sh_type == SHT_RELA))
+ info.section = shdr.sh_info ? parent->getSection(shdr.sh_info) :
nullptr;
+ else
+ info.index = shdr.sh_info;
+ }
+
+-unsigned int ElfSection::getAddr() {
++Elf64_Addr ElfSection::getAddr() {
+ if (shdr.sh_addr != (Elf64_Addr)-1) return shdr.sh_addr;
+
+ // It should be safe to adjust sh_addr for all allocated sections that
+ // are neither SHT_NOBITS nor SHT_PROGBITS
+ if ((previous != nullptr) && isRelocatable()) {
+ unsigned int addr = previous->getAddr();
+ if (previous->getType() != SHT_NOBITS) addr += previous->getSize();
+
+ if (addr & (getAddrAlign() - 1)) addr = (addr | (getAddrAlign() - 1)) +
1;
+
+ return (shdr.sh_addr = addr);
+ }
+ return shdr.sh_addr;
+ }
+
+-unsigned int ElfSection::getOffset() {
++Elf64_Off ElfSection::getOffset() {
+ if (shdr.sh_offset != (Elf64_Off)-1) return shdr.sh_offset;
+
+ if (previous == nullptr) return (shdr.sh_offset = 0);
+
+- unsigned int offset = previous->getOffset();
++ Elf64_Off offset = previous->getOffset();
+
+ ElfSegment* ptload = getSegmentByType(PT_LOAD);
+ ElfSegment* prev_ptload = previous->getSegmentByType(PT_LOAD);
+
+ if (ptload && (ptload == prev_ptload)) {
+ offset += getAddr() - previous->getAddr();
+ return (shdr.sh_offset = offset);
+ }
+diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp
+--- a/build/unix/elfhack/elfhack.cpp
++++ b/build/unix/elfhack/elfhack.cpp
+@@ -1255,18 +1255,18 @@ int do_relocation_section(Elf* elf, unsi
+ "Expected to find an .eh_frame section adjacent to .eh_frame_hdr");
+ }
+ if (eh_frame && first->getAddr() > relhack->getAddr() &&
+ second->getAddr() < first_executable->getAddr()) {
+ // The distance between both sections needs to be preserved because
+ // eh_frame_hdr contains relative offsets to eh_frame. Well, they could
be
+ // relocated too, but it's not worth the effort for the few number of
bytes
+ // this would save.
+- unsigned int distance = second->getAddr() - first->getAddr();
+- unsigned int origAddr = eh_frame->getAddr();
++ Elf64_Off distance = second->getAddr() - first->getAddr();
++ Elf64_Addr origAddr = eh_frame->getAddr();
+ ElfSection* previous = first->getPrevious();
+ first->getShdr().sh_addr = (previous->getAddr() + previous->getSize() +
+ first->getAddrAlign() - 1) &
+ ~(first->getAddrAlign() - 1);
+ second->getShdr().sh_addr =
+ (first->getAddr() + std::min(first->getSize(), distance) +
+ second->getAddrAlign() - 1) &
+ ~(second->getAddrAlign() - 1);
+diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h
+--- a/build/unix/elfhack/elfxx.h
++++ b/build/unix/elfhack/elfxx.h
+@@ -280,17 +280,17 @@ typedef serializable<Elf_Shdr_Traits> El
+ class Elf {
+ public:
+ Elf(std::ifstream& file);
+ ~Elf();
+
+ /* index == -1 is treated as index == ehdr.e_shstrndx */
+ ElfSection* getSection(int index);
+
+- ElfSection* getSectionAt(unsigned int offset);
++ ElfSection* getSectionAt(Elf64_Off offset);
+
+ ElfSegment* getSegmentByType(unsigned int type, ElfSegment* last =
nullptr);
+
+ ElfDynamic_Section* getDynSection();
+
+ void normalize();
+ void write(std::ofstream& file);
+
+@@ -329,18 +329,18 @@ class ElfSection {
+
+ ElfSection(Elf_Shdr& s, std::ifstream* file, Elf* parent);
+
+ virtual ~ElfSection() { free(data); }
+
+ const char* getName() { return name; }
+ unsigned int getType() { return shdr.sh_type; }
+ unsigned int getFlags() { return shdr.sh_flags; }
+- unsigned int getAddr();
+- unsigned int getSize() { return shdr.sh_size; }
++ Elf64_Addr getAddr();
++ Elf64_Off getSize() { return shdr.sh_size; }
+ unsigned int getAddrAlign() { return shdr.sh_addralign; }
+ unsigned int getEntSize() { return shdr.sh_entsize; }
+ const char* getData() { return data; }
+ ElfSection* getLink() { return link; }
+ SectionInfo getInfo() { return info; }
+
+ void shrink(unsigned int newsize) {
+ if (newsize < shdr.sh_size) {
+@@ -353,17 +353,17 @@ class ElfSection {
+ if (newsize > shdr.sh_size) {
+ data = static_cast<char*>(realloc(data, newsize));
+ memset(data + shdr.sh_size, 0, newsize - shdr.sh_size);
+ shdr.sh_size = newsize;
+ markDirty();
+ }
+ }
+
+- unsigned int getOffset();
++ Elf64_Off getOffset();
+ int getIndex();
+ Elf_Shdr& getShdr();
+
+ ElfSection* getNext() { return next; }
+ ElfSection* getPrevious() { return previous; }
+
+ virtual bool isRelocatable() {
+ return ((getType() == SHT_SYMTAB) || (getType() == SHT_STRTAB) ||
+
diff --git a/http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
b/http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
new file mode 100644
index 0000000..eff08f6
--- /dev/null
+++ b/http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
@@ -0,0 +1,16 @@
+diff -Naur a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+--- a/security/sandbox/linux/moz.build 2023-07-04 13:57:56.029462755 +0300
++++ b/security/sandbox/linux/moz.build 2023-07-04 14:05:08.607221195 +0300
+@@ -114,9 +114,9 @@
+ # 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':
++ LDFLAGS += ['--param', 'lto-partitions=1']
++
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
diff --git
a/http/firefox-esr/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox-esr/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
deleted file mode 100644
index d356425..0000000
---
a/http/firefox-esr/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -up firefox-101.0/dom/media/gmp/GMPSharedMemManager.h.1663844
firefox-101.0/dom/media/gmp/GMPSharedMemManager.h
---- firefox-101.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2022-05-27
01:16:53.000000000 +0200
-+++ firefox-101.0/dom/media/gmp/GMPSharedMemManager.h 2022-05-30
21:15:20.989993419 +0200
-@@ -27,7 +27,7 @@ class GMPSharedMem {
- // returned to the parent pool (which is not included). If more than
- // this are needed, we presume the client has either crashed or hung
- // (perhaps temporarily).
-- static const uint32_t kGMPBufLimit = 20;
-+ static const uint32_t kGMPBufLimit = 40;
-
- GMPSharedMem() {
- for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);
-diff -up
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
----
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
2022-05-30 21:15:20.989993419 +0200
-+++ firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
2022-05-30 21:24:16.615282035 +0200
-@@ -66,6 +66,7 @@ media::DecodeSupportSet GMPDecoderModule
-
- nsCString api = nsLiteralCString(CHROMIUM_CDM_API);
-
-+ // TODO: Do we enable it here?
- if (MP4Decoder::IsH264(aMimeType)) {
- isSupported = HaveGMPFor(api, {"h264"_ns, aGMP.value()});
- } else if (VPXDecoder::IsVP9(aMimeType)) {
-diff -up
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
----
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
2022-05-27 01:16:53.000000000 +0200
-+++ firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
2022-05-30 21:15:20.989993419 +0200
-@@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
- RefPtr<GMPVideoDecoder> self = this;
- if (v) {
- mDecodedData.AppendElement(std::move(v));
-+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
-+ mDecodedData = DecodedData();
- } else {
- mDecodedData.Clear();
- mDecodePromise.RejectIfExists(
diff --git a/http/firefox-esr/patches/0028-bgo-816975-fix-build-on-x86.patch
b/http/firefox-esr/patches/0028-bgo-816975-fix-build-on-x86.patch
deleted file mode 100644
index 4b2289f..0000000
--- a/http/firefox-esr/patches/0028-bgo-816975-fix-build-on-x86.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
-index 51d79f9c2ec59..fafd7d6fc1e0d 100644
---- a/modules/fdlibm/src/math_private.h
-+++ b/modules/fdlibm/src/math_private.h
-@@ -30,7 +30,11 @@
- * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
- */
-
-+#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
-+typedef long double __double_t;
-+#else
- typedef double __double_t;
-+#endif
- typedef __double_t double_t;
-
- /*
diff --git
a/http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
b/http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
new file mode 100644
index 0000000..112cd42
--- /dev/null
+++ b/http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
@@ -0,0 +1,19 @@
+diff -up firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi
firefox-115.0/widget/gtk/GfxInfo.cpp
+--- firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-06-29
12:18:53.179833765 +0200
++++ firefox-115.0/widget/gtk/GfxInfo.cpp 2023-06-29 12:19:33.256212776
+0200
+@@ -970,14 +970,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
+ V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", "");
+
+- // Disable on Release/late Beta on AMD
+-#if !defined(EARLY_BETA_OR_EARLIER)
+- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll,
+- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
+- nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
+- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
+- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE",
"");
+-#endif
+ ////////////////////////////////////
+ // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST
+ APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All,
+
diff --git
a/http/firefox-esr/patches/0029-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox-esr/patches/0029-bmo-1559213-fix-system-av1-libs.patch
deleted file mode 100644
index 2423cca..0000000
--- a/http/firefox-esr/patches/0029-bmo-1559213-fix-system-av1-libs.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
-index 0069865..e806fc8 100644
---- a/media/ffvpx/libavcodec/moz.build
-+++ b/media/ffvpx/libavcodec/moz.build
-@@ -112,9 +112,15 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
- 'vaapi_vp8.c',
- 'vaapi_vp9.c',
- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
-+ else:
-+ USE_LIBS += [
-+ 'dav1d',
-+ 'media_libdav1d_asm',
-+ ]
- USE_LIBS += [
-- 'dav1d',
-- 'media_libdav1d_asm',
- 'mozva'
- ]
-
diff --git
a/http/firefox-esr/patches/0029-bmo-1839023-arm-unified-build-missing-header.patch

b/http/firefox-esr/patches/0029-bmo-1839023-arm-unified-build-missing-header.patch
new file mode 100644
index 0000000..ae426cd
--- /dev/null
+++
b/http/firefox-esr/patches/0029-bmo-1839023-arm-unified-build-missing-header.patch
@@ -0,0 +1,77 @@
+
+# HG changeset patch
+# User serge-sans-paille <sguelton AT mozilla.com>
+# Date 1687447863 0
+# Node ID 34ef9f4d1d2c638f47eb4615a6ea47c011c91e87
+# Parent eecca96ba9040cb07462280dda39d8551fc8c098
+Bug 1839023 - Fix missing arm-specifc header r=nbp
+
+Differential Revision: https://phabricator.services.mozilla.com/D181738
+
+diff --git a/js/src/jit/shared/AtomicOperations-shared-jit.cpp
b/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+--- a/js/src/jit/shared/AtomicOperations-shared-jit.cpp
++++ b/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+@@ -1,16 +1,20 @@
+ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ #include "jit/AtomicOperations.h"
+
++#if defined(__arm__)
++# include "jit/arm/Architecture-arm.h"
++#endif
++
+ #ifdef JS_HAVE_GENERATED_ATOMIC_OPS
+
+ # include <atomic>
+
+ # include "js/GCAPI.h"
+
+ using namespace js;
+ using namespace js::jit;
+@@ -73,18 +77,18 @@ void AtomicMemcpyDownUnsynchronized(uint
+ const uint8_t* lim = src + nbytes;
+
+ // Set up bulk copying. The cases are ordered the way they are on the
+ // assumption that if we can achieve aligned copies even with a little
+ // preprocessing then that is better than unaligned copying on a platform
+ // that supports it.
+
+ if (nbytes >= WORDSIZE) {
+- void (*copyBlock)(uint8_t * dest, const uint8_t* src);
+- void (*copyWord)(uint8_t * dest, const uint8_t* src);
++ void (*copyBlock)(uint8_t* dest, const uint8_t* src);
++ void (*copyWord)(uint8_t* dest, const uint8_t* src);
+
+ if (((uintptr_t(dest) ^ uintptr_t(src)) & WORDMASK) == 0) {
+ const uint8_t* cutoff = (const uint8_t*)RoundUp(uintptr_t(src),
WORDSIZE);
+ MOZ_ASSERT(cutoff <= lim); // because nbytes >= WORDSIZE
+ while (src < cutoff) {
+ AtomicCopyByteUnsynchronized(dest++, src++);
+ }
+ copyBlock = AtomicCopyBlockDownUnsynchronized;
+@@ -126,18 +130,18 @@ void AtomicMemcpyUpUnsynchronized(uint8_
+ JS::AutoSuppressGCAnalysis nogc;
+
+ const uint8_t* lim = src;
+
+ src += nbytes;
+ dest += nbytes;
+
+ if (nbytes >= WORDSIZE) {
+- void (*copyBlock)(uint8_t * dest, const uint8_t* src);
+- void (*copyWord)(uint8_t * dest, const uint8_t* src);
++ void (*copyBlock)(uint8_t* dest, const uint8_t* src);
++ void (*copyWord)(uint8_t* dest, const uint8_t* src);
+
+ if (((uintptr_t(dest) ^ uintptr_t(src)) & WORDMASK) == 0) {
+ const uint8_t* cutoff = (const uint8_t*)(uintptr_t(src) & ~WORDMASK);
+ MOZ_ASSERT(cutoff >= lim); // Because nbytes >= WORDSIZE
+ while (src > cutoff) {
+ AtomicCopyByteUnsynchronized(--dest, --src);
+ }
+ copyBlock = AtomicCopyBlockUpUnsynchronized;
+
diff --git
a/http/firefox-esr/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox-esr/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
deleted file mode 100644
index 864741e..0000000
---
a/http/firefox-esr/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
---- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
-+++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
-@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
-- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
-+ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
-+ GDK_FOCUS_CHANGE_MASK;
-
- /* utility functions */
- static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git
a/http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
b/http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
new file mode 100644
index 0000000..a56aec4
--- /dev/null
+++ b/http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
@@ -0,0 +1,76 @@
+--- firefox-111.0.1/build/moz.configure/rust.configure 2023-03-21
06:16:03.000000000 -0700
++++ firefox-111.0.1/build/moz.configure/rust.configure.new 2023-04-05
08:57:29.403219120 -0700
+@@ -593,7 +593,7 @@
+
+ # ==============================================================
+
+-option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags")
++option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags",
comma_split=False)
+ set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags))
+
+
+--- firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py
2023-03-21 06:16:09.000000000 -0700
++++ firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py.new
2023-04-05 08:57:31.270193468 -0700
+@@ -191,6 +191,10 @@
+ to instantiate an option indirectly. Set this to a positive integer to
+ force the script to look into a deeper stack frame when inferring the
+ `category`.
++ - `comma_split` specifies whether the value string should be split on
++ commas. The default is True. Setting it False is necessary for things
++ like compiler flags which should be a single string that may contain
++ commas.
+ """
+
+ __slots__ = (
+@@ -205,6 +209,7 @@
+ "possible_origins",
+ "category",
+ "define_depth",
++ "comma_split",
+ )
+
+ def __init__(
+@@ -218,6 +223,7 @@
+ category=None,
+ help=None,
+ define_depth=0,
++ comma_split=True,
+ ):
+ if not name and not env:
+ raise InvalidOptionError(
+@@ -335,9 +341,10 @@
+ self.choices = choices
+ self.help = help
+ self.category = category or _infer_option_category(define_depth)
++ self.comma_split = comma_split
+
+ @staticmethod
+- def split_option(option):
++ def split_option(option, comma_split=True):
+ """Split a flag or variable into a prefix, a name and values
+
+ Variables come in the form NAME=values (no prefix).
+@@ -350,7 +357,13 @@
+
+ elements = option.split("=", 1)
+ name = elements[0]
+- values = tuple(elements[1].split(",")) if len(elements) == 2 else ()
++ if len(elements) == 2:
++ if comma_split:
++ values = tuple(elements[1].split(","))
++ else:
++ values = (elements[1],)
++ else:
++ values = ()
+ if name.startswith("--"):
+ name = name[2:]
+ if not name.islower():
+@@ -426,7 +439,7 @@
+ % (option, origin, ", ".join(self.possible_origins))
+ )
+
+- prefix, name, values = self.split_option(option)
++ prefix, name, values = self.split_option(option, self.comma_split)
+ option = self._join_option(prefix, name)
+
+ assert name in (self.name, self.env)
diff --git
a/http/firefox-esr/patches/0032-bmo-1838323-disambiguate-skvx-when-building-with-different-arches.patch

b/http/firefox-esr/patches/0032-bmo-1838323-disambiguate-skvx-when-building-with-different-arches.patch
new file mode 100644
index 0000000..f11821d
--- /dev/null
+++
b/http/firefox-esr/patches/0032-bmo-1838323-disambiguate-skvx-when-building-with-different-arches.patch
@@ -0,0 +1,85 @@
+
+# HG changeset patch
+# User Lee Salzman <lsalzman AT mozilla.com>
+# Date 1688610280 0
+# Node ID 07bc853b8799270e182342be68ddcfca8acb2f28
+# Parent fdcac5f186cb2394b6a7e9a0f03bacd38edff404
+Bug 1838323 - Disambiguate skvx when building with different arch options.
r=glandium
+
+It seems that GCC, under certain circumstances, does not completely inline
code in the skvx namespace in Skia, even though the code specifies
"always_inline". As a side-effect, it leaves around symbols that are
generated with different architecture flags supplied. LTO then picks one of
the symbols, at what may as well be random.
+
+This could potentially be an issue under clang if it ever failed to inline.
+
+As a workaround for both, we force skvx to exist in arch-specific
namespaces, i.e. -Dskvx=skvx_foo, so that even in the worst case, no
ambiguous symbols will be generated.
+
+Differential Revision: https://phabricator.services.mozilla.com/D182855
+
+diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -47,24 +47,24 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ UNIFIED_SOURCES += [
+ 'skia/src/fonts/SkFontMgr_indirect.cpp',
+ 'skia/src/fonts/SkRemotableFontMgr.cpp',
+ ]
+
+ # We should autogenerate these SSE related flags.
+
+ if CONFIG['INTEL_ARCHITECTURE']:
+- SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3']
+- SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2']
+- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx']
+- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c',
'-mfma']
++ SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3', '-mssse3']
++ SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags +=
['-Dskvx=skvx_sse42', '-msse4.2']
++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx',
'-mavx']
++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw',
'-mavx2', '-mf16c', '-mfma']
+ if not CONFIG["MOZ_CODE_COVERAGE"]:
+- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f',
'-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl']
++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags +=
['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw',
'-mavx512vl']
+ elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang',
'gcc'):
+- SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags +=
['-march=armv8-a+crc']
++ SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags +=
['-Dskvx=skvx_crc32', '-march=armv8-a+crc']
+
+ DEFINES['MOZ_SKIA'] = True
+
+ DEFINES['SKIA_IMPLEMENTATION'] = 1
+
+ DEFINES['SK_PDF_USE_HARFBUZZ_SUBSETTING'] = 1
+
+ if CONFIG['MOZ_TREE_FREETYPE']:
+diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -557,24 +557,24 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ UNIFIED_SOURCES += [
+ 'skia/src/fonts/SkFontMgr_indirect.cpp',
+ 'skia/src/fonts/SkRemotableFontMgr.cpp',
+ ]
+
+ # We should autogenerate these SSE related flags.
+
+ if CONFIG['INTEL_ARCHITECTURE']:
+- SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3']
+- SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2']
+- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx']
+- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c',
'-mfma']
++ SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3', '-mssse3']
++ SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags +=
['-Dskvx=skvx_sse42', '-msse4.2']
++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx',
'-mavx']
++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw',
'-mavx2', '-mf16c', '-mfma']
+ if not CONFIG["MOZ_CODE_COVERAGE"]:
+- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f',
'-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl']
++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags +=
['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw',
'-mavx512vl']
+ elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang',
'gcc'):
+- SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags +=
['-march=armv8-a+crc']
++ SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags +=
['-Dskvx=skvx_crc32', '-march=armv8-a+crc']
+
+ DEFINES['MOZ_SKIA'] = True
+
+ DEFINES['SKIA_IMPLEMENTATION'] = 1
+
+ DEFINES['SK_PDF_USE_HARFBUZZ_SUBSETTING'] = 1
+
+ if CONFIG['MOZ_TREE_FREETYPE']:
+
diff --git
a/http/firefox-esr/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
b/http/firefox-esr/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
deleted file mode 100644
index f0c57dd..0000000
--- a/http/firefox-esr/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -up firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff
firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp
---- firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff 2022-05-27
01:16:54.000000000 +0200
-+++ firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp 2022-06-07
11:16:03.791419558 +0200
-@@ -233,13 +233,7 @@ void gfxPlatformGtk::InitDmabufConfig()
- void gfxPlatformGtk::InitVAAPIConfig() {
- FeatureState& feature = gfxConfig::GetFeature(Feature::VAAPI);
- #ifdef MOZ_WAYLAND
-- feature.DisableByDefault(FeatureStatus::Disabled,
-- "VAAPI is disabled by default",
-- "FEATURE_VAAPI_DISABLED"_ns);
--
-- if (StaticPrefs::media_ffmpeg_vaapi_enabled()) {
-- feature.UserForceEnable("Force enabled by pref");
-- }
-+ feature.EnableByDefault();
-
- nsCString failureId;
- int32_t status;
-@@ -253,6 +247,10 @@ void gfxPlatformGtk::InitVAAPIConfig() {
- failureId);
- }
-
-+ if (StaticPrefs::media_ffmpeg_vaapi_enabled()) {
-+ feature.UserForceEnable("Force enabled by pref");
-+ }
-+
- if (!gfxVars::UseEGL()) {
- feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL",
- "FEATURE_FAILURE_REQUIRES_EGL"_ns);
-diff -up firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff
firefox-101.0/widget/gtk/GfxInfo.cpp
---- firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff 2022-05-27
01:17:06.000000000 +0200
-+++ firefox-101.0/widget/gtk/GfxInfo.cpp 2022-06-07 09:52:54.416701418
+0200
-@@ -843,6 +843,31 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- V(495, 44, 0, 0), "FEATURE_FAILURE_NO_GBM", "495.44.0");
-
- ////////////////////////////////////
-+ // FEATURE_VAAPI
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::All, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
-+ V(21, 0, 0, 0), "FEATURE_ROLLOUT_VAAPI_MESA", "Mesa 21.0.0.0");
-+
-+ // Disable on all NVIDIA hardware
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All,
-+ DeviceFamily::NvidiaAll, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_NVIDIA", "");
-+
-+ // Disable on all AMD devices not using Mesa.
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All,
DriverVendor::NonMesaAll,
-+ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_AMD", "");
-+
-+ ////////////////////////////////////
- // FEATURE_WEBRENDER_PARTIAL_PRESENT
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
diff --git
a/http/firefox-esr/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
b/http/firefox-esr/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
deleted file mode 100644
index 1d4bb58..0000000
--- a/http/firefox-esr/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-diff --git a/gfx/gl/GLLibraryEGL.h b/gfx/gl/GLLibraryEGL.h
---- a/gfx/gl/GLLibraryEGL.h
-+++ b/gfx/gl/GLLibraryEGL.h
-@@ -106,10 +106,13 @@
- KHR_swap_buffers_with_damage,
- EXT_buffer_age,
- KHR_partial_update,
- NV_robustness_video_memory_purge,
- MESA_platform_surfaceless,
-+ EXT_image_dma_buf_import,
-+ EXT_image_dma_buf_import_modifiers,
-+ MESA_image_dma_buf_export,
- Max
- };
-
- // -
-
-@@ -461,10 +464,23 @@
- // EGL_KHR_partial_update
- EGLBoolean fSetDamageRegion(EGLDisplay dpy, EGLSurface surface,
- const EGLint* rects, EGLint n_rects) {
- WRAP(fSetDamageRegion(dpy, surface, rects, n_rects));
- }
-+ // EGL_MESA_image_dma_buf_export
-+ EGLBoolean fExportDMABUFImageQuery(EGLDisplay dpy, EGLImage image,
-+ int* fourcc, int* num_planes,
-+ uint64_t* modifiers) {
-+ WRAP(
-+ fExportDMABUFImageQueryMESA(dpy, image, fourcc, num_planes,
modifiers));
-+ }
-+ EGLBoolean fExportDMABUFImage(EGLDisplay dpy, EGLImage image, int* fds,
-+ EGLint* strides, EGLint* offsets) {
-+ WRAP(fExportDMABUFImageMESA(dpy, image, fds, strides, offsets));
-+ }
-+
-+#undef WRAP
-
- #undef WRAP
- #undef PROFILE_CALL
- #undef BEFORE_CALL
- #undef AFTER_CALL
-@@ -593,10 +609,22 @@
- EGLBoolean(GLAPIENTRY* fSetDamageRegion)(EGLDisplay dpy, EGLSurface
surface,
- const EGLint* rects,
- EGLint n_rects);
- EGLClientBuffer(GLAPIENTRY* fGetNativeClientBufferANDROID)(
- const struct AHardwareBuffer* buffer);
-+
-+ // EGL_MESA_image_dma_buf_export
-+ EGLBoolean(GLAPIENTRY* fExportDMABUFImageQueryMESA)(EGLDisplay dpy,
-+ EGLImage image,
-+ int* fourcc,
-+ int* num_planes,
-+ uint64_t*
modifiers);
-+ EGLBoolean(GLAPIENTRY* fExportDMABUFImageMESA)(EGLDisplay dpy,
-+ EGLImage image, int* fds,
-+ EGLint* strides,
-+ EGLint* offsets);
-+
- } mSymbols = {};
- };
-
- class EglDisplay final {
- public:
-@@ -852,10 +880,23 @@
- EGLBoolean fSetDamageRegion(EGLSurface surface, const EGLint* rects,
- EGLint n_rects) {
- MOZ_ASSERT(IsExtensionSupported(EGLExtension::KHR_partial_update));
- return mLib->fSetDamageRegion(mDisplay, surface, rects, n_rects);
- }
-+
-+ EGLBoolean fExportDMABUFImageQuery(EGLImage image, int* fourcc,
-+ int* num_planes,
-+ uint64_t* modifiers) const {
-+
MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export));
-+ return mLib->fExportDMABUFImageQuery(mDisplay, image, fourcc,
num_planes,
-+ modifiers);
-+ }
-+ EGLBoolean fExportDMABUFImage(EGLImage image, int* fds, EGLint* strides,
-+ EGLint* offsets) const {
-+
MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export));
-+ return mLib->fExportDMABUFImage(mDisplay, image, fds, strides, offsets);
-+ }
- };
-
- } /* namespace gl */
- } /* namespace mozilla */
-
-diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp
---- a/gfx/gl/GLLibraryEGL.cpp
-+++ b/gfx/gl/GLLibraryEGL.cpp
-@@ -82,11 +82,14 @@
- "EGL_EXT_swap_buffers_with_damage",
- "EGL_KHR_swap_buffers_with_damage",
- "EGL_EXT_buffer_age",
- "EGL_KHR_partial_update",
- "EGL_NV_robustness_video_memory_purge",
-- "EGL_MESA_platform_surfaceless"};
-+ "EGL_MESA_platform_surfaceless",
-+ "EGL_EXT_image_dma_buf_import",
-+ "EGL_EXT_image_dma_buf_import_modifiers",
-+ "EGL_MESA_image_dma_buf_export"};
-
- PRLibrary* LoadApitraceLibrary() {
- const char* path = nullptr;
-
- #ifdef ANDROID
-@@ -647,10 +650,16 @@
- {
- const SymLoadStruct symbols[] = {SYMBOL(GetPlatformDisplay),
- END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
-+ {
-+ const SymLoadStruct symbols[] = {SYMBOL(ExportDMABUFImageQueryMESA),
-+ SYMBOL(ExportDMABUFImageMESA),
-+ END_OF_SYMBOLS};
-+ (void)fnLoadSymbols(symbols);
-+ }
-
- return true;
- }
-
- // -
-
diff --git
a/http/firefox-esr/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
b/http/firefox-esr/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
deleted file mode 100644
index 52462f2..0000000
--- a/http/firefox-esr/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
+++ /dev/null
@@ -1,278 +0,0 @@
-diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h
---- a/widget/gtk/DMABufSurface.h
-+++ b/widget/gtk/DMABufSurface.h
-@@ -173,13 +173,13 @@
- SurfaceType mSurfaceType;
- uint64_t mBufferModifiers[DMABUF_BUFFER_PLANES];
-
- int mBufferPlaneCount;
- int mDmabufFds[DMABUF_BUFFER_PLANES];
-- uint32_t mDrmFormats[DMABUF_BUFFER_PLANES];
-- uint32_t mStrides[DMABUF_BUFFER_PLANES];
-- uint32_t mOffsets[DMABUF_BUFFER_PLANES];
-+ int32_t mDrmFormats[DMABUF_BUFFER_PLANES];
-+ int32_t mStrides[DMABUF_BUFFER_PLANES];
-+ int32_t mOffsets[DMABUF_BUFFER_PLANES];
-
- struct gbm_bo* mGbmBufferObject[DMABUF_BUFFER_PLANES];
- void* mMappedRegion[DMABUF_BUFFER_PLANES];
- void* mMappedRegionData[DMABUF_BUFFER_PLANES];
- uint32_t mMappedRegionStride[DMABUF_BUFFER_PLANES];
-@@ -198,10 +198,14 @@
- class DMABufSurfaceRGBA : public DMABufSurface {
- public:
- static already_AddRefed<DMABufSurfaceRGBA> CreateDMABufSurface(
- int aWidth, int aHeight, int aDMABufSurfaceFlags);
-
-+ static already_AddRefed<DMABufSurface> CreateDMABufSurface(
-+ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage,
-+ int aWidth, int aHeight);
-+
- bool Serialize(mozilla::layers::SurfaceDescriptor& aOutDescriptor);
-
- DMABufSurfaceRGBA* GetAsDMABufSurfaceRGBA() { return this; }
-
- void Clear();
-@@ -247,10 +251,12 @@
- private:
- ~DMABufSurfaceRGBA();
-
- bool Create(int aWidth, int aHeight, int aDMABufSurfaceFlags);
- bool Create(const mozilla::layers::SurfaceDescriptor& aDesc);
-+ bool Create(mozilla::gl::GLContext* aGLContext, const EGLImageKHR
aEGLImage,
-+ int aWidth, int aHeight);
-
- bool ImportSurfaceDescriptor(const mozilla::layers::SurfaceDescriptor&
aDesc);
-
- bool OpenFileDescriptorForPlane(const mozilla::MutexAutoLock&
aProofOfLock,
- int aPlane);
-diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
---- a/widget/gtk/DMABufSurface.cpp
-+++ b/widget/gtk/DMABufSurface.cpp
-@@ -204,10 +204,12 @@
- }
- }
-
- void DMABufSurface::FenceSet() {
- if (!mGL || !mGL->MakeCurrent()) {
-+ MOZ_DIAGNOSTIC_ASSERT(mGL,
-+ "DMABufSurface::FenceSet(): missing GL context!");
- return;
- }
- const auto& gle = gl::GLContextEGL::Cast(mGL);
- const auto& egl = gle->mEgl;
-
-@@ -228,21 +230,23 @@
- mGL->fFinish();
- }
-
- void DMABufSurface::FenceWait() {
- if (!mGL || mSyncFd < 0) {
-+ MOZ_DIAGNOSTIC_ASSERT(mGL,
-+ "DMABufSurface::FenceWait() missing GL context!");
- return;
- }
-
- const auto& gle = gl::GLContextEGL::Cast(mGL);
- const auto& egl = gle->mEgl;
-
- const EGLint attribs[] = {LOCAL_EGL_SYNC_NATIVE_FENCE_FD_ANDROID, mSyncFd,
- LOCAL_EGL_NONE};
- EGLSync sync = egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID,
attribs);
- if (!sync) {
-- MOZ_ASSERT(false, "Failed to create GLFence!");
-+ MOZ_ASSERT(false, "DMABufSurface::FenceWait(): Failed to create
GLFence!");
- // We failed to create GLFence so clear mSyncFd to avoid another try.
- close(mSyncFd);
- mSyncFd = -1;
- return;
- }
-@@ -338,17 +342,18 @@
- mGmbFormat = GetDMABufDevice()->GetGbmFormat(mSurfaceFlags &
DMABUF_ALPHA);
- if (!mGmbFormat) {
- // Requested DRM format is not supported.
- return false;
- }
-+ mDrmFormats[0] = mGmbFormat->mFormat;
-
- bool useModifiers = (aDMABufSurfaceFlags & DMABUF_USE_MODIFIERS) &&
- mGmbFormat->mModifiersCount > 0;
- if (useModifiers) {
- LOGDMABUF((" Creating with modifiers\n"));
- mGbmBufferObject[0] = nsGbmLib::CreateWithModifiers(
-- GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight,
mGmbFormat->mFormat,
-+ GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight, mDrmFormats[0],
- mGmbFormat->mModifiers, mGmbFormat->mModifiersCount);
- if (mGbmBufferObject[0]) {
- mBufferModifiers[0] = nsGbmLib::GetModifier(mGbmBufferObject[0]);
- }
- }
-@@ -356,11 +361,11 @@
- if (!mGbmBufferObject[0]) {
- LOGDMABUF((" Creating without modifiers\n"));
- mGbmBufferFlags = GBM_BO_USE_LINEAR;
- mGbmBufferObject[0] =
- nsGbmLib::Create(GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight,
-- mGmbFormat->mFormat, mGbmBufferFlags);
-+ mDrmFormats[0], mGbmBufferFlags);
- mBufferModifiers[0] = DRM_FORMAT_MOD_INVALID;
- }
-
- if (!mGbmBufferObject[0]) {
- LOGDMABUF((" Failed to create GbmBufferObject\n"));
-@@ -386,22 +391,51 @@
-
- LOGDMABUF((" Success\n"));
- return true;
- }
-
-+bool DMABufSurfaceRGBA::Create(mozilla::gl::GLContext* aGLContext,
-+ const EGLImageKHR aEGLImage, int aWidth,
-+ int aHeight) {
-+ LOGDMABUF(("DMABufSurfaceRGBA::Create() from EGLImage UID = %d\n", mUID));
-+ if (!aGLContext) {
-+ return false;
-+ }
-+ const auto& gle = gl::GLContextEGL::Cast(aGLContext);
-+ const auto& egl = gle->mEgl;
-+
-+ mGL = aGLContext;
-+ mWidth = aWidth;
-+ mHeight = aHeight;
-+ mEGLImage = aEGLImage;
-+ if (!egl->fExportDMABUFImageQuery(mEGLImage, mDrmFormats,
&mBufferPlaneCount,
-+ mBufferModifiers)) {
-+ LOGDMABUF((" ExportDMABUFImageQueryMESA failed, quit\n"));
-+ return false;
-+ }
-+ if (mBufferPlaneCount > DMABUF_BUFFER_PLANES) {
-+ LOGDMABUF((" wrong plane count %d, quit\n", mBufferPlaneCount));
-+ return false;
-+ }
-+ if (!egl->fExportDMABUFImage(mEGLImage, mDmabufFds, mStrides, mOffsets)) {
-+ LOGDMABUF((" ExportDMABUFImageMESA failed, quit\n"));
-+ return false;
-+ }
-+
-+ LOGDMABUF((" imported size %d x %d format %x planes %d", mWidth, mHeight,
-+ mDrmFormats[0], mBufferPlaneCount));
-+ return true;
-+}
-+
- bool DMABufSurfaceRGBA::ImportSurfaceDescriptor(
- const SurfaceDescriptor& aDesc) {
- const SurfaceDescriptorDMABuf& desc = aDesc.get_SurfaceDescriptorDMABuf();
-
- mWidth = desc.width()[0];
- mHeight = desc.height()[0];
- mBufferModifiers[0] = desc.modifier()[0];
-- if (mBufferModifiers[0] != DRM_FORMAT_MOD_INVALID) {
-- mGmbFormat = GetDMABufDevice()->GetExactGbmFormat(desc.format()[0]);
-- } else {
-- mDrmFormats[0] = desc.format()[0];
-- }
-+ mDrmFormats[0] = desc.format()[0];
- mBufferPlaneCount = desc.fds().Length();
- mGbmBufferFlags = desc.flags();
- MOZ_RELEASE_ASSERT(mBufferPlaneCount <= DMABUF_BUFFER_PLANES);
- mUID = desc.uid();
-
-@@ -431,10 +465,12 @@
-
- if (desc.refCount().Length() > 0) {
-
GlobalRefCountImport(desc.refCount()[0].ClonePlatformHandle().release());
- }
-
-+ LOGDMABUF((" imported size %d x %d format %x planes %d", mWidth, mHeight,
-+ mDrmFormats[0], mBufferPlaneCount));
- return true;
- }
-
- bool DMABufSurfaceRGBA::Create(const SurfaceDescriptor& aDesc) {
- return ImportSurfaceDescriptor(aDesc);
-@@ -460,11 +496,11 @@
- return false;
- }
-
- width.AppendElement(mWidth);
- height.AppendElement(mHeight);
-- format.AppendElement(mGmbFormat->mFormat);
-+ format.AppendElement(mDrmFormats[0]);
- modifiers.AppendElement(mBufferModifiers[0]);
- for (int i = 0; i < mBufferPlaneCount; i++) {
- fds.AppendElement(ipc::FileDescriptor(mDmabufFds[i]));
- strides.AppendElement(mStrides[i]);
- offsets.AppendElement(mOffsets[i]);
-@@ -486,23 +522,20 @@
- fenceFDs, mUID, refCountFDs);
- return true;
- }
-
- bool DMABufSurfaceRGBA::CreateTexture(GLContext* aGLContext, int aPlane) {
-+ LOGDMABUF(("DMABufSurfaceRGBA::CreateTexture() UID %d\n", mUID));
- MOZ_ASSERT(!mEGLImage && !mTexture, "EGLImage is already created!");
-
- nsTArray<EGLint> attribs;
- attribs.AppendElement(LOCAL_EGL_WIDTH);
- attribs.AppendElement(mWidth);
- attribs.AppendElement(LOCAL_EGL_HEIGHT);
- attribs.AppendElement(mHeight);
- attribs.AppendElement(LOCAL_EGL_LINUX_DRM_FOURCC_EXT);
-- if (mGmbFormat) {
-- attribs.AppendElement(mGmbFormat->mFormat);
-- } else {
-- attribs.AppendElement(mDrmFormats[0]);
-- }
-+ attribs.AppendElement(mDrmFormats[0]);
- #define ADD_PLANE_ATTRIBS(plane_idx)
\
- {
\
- attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_FD_EXT);
\
- attribs.AppendElement(mDmabufFds[plane_idx]);
\
- attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_OFFSET_EXT);
\
-@@ -560,10 +593,11 @@
-
- return true;
- }
-
- void DMABufSurfaceRGBA::ReleaseTextures() {
-+ LOGDMABUF(("DMABufSurfaceRGBA::ReleaseTextures() UID %d\n", mUID));
- FenceDelete();
-
- if (!mTexture) {
- return;
- }
-@@ -618,11 +652,11 @@
- zwp_linux_buffer_params_v1_add(params, mDmabufFds[0], 0, mOffsets[0],
- mStrides[0], mBufferModifiers[0] >> 32,
- mBufferModifiers[0] & 0xffffffff);
-
- mWlBuffer = zwp_linux_buffer_params_v1_create_immed(
-- params, GetWidth(), GetHeight(), mGmbFormat->mFormat, 0);
-+ params, GetWidth(), GetHeight(), mDrmFormats[0], 0);
-
- CloseFileDescriptors(lockFD);
-
- return mWlBuffer != nullptr;
- }
-@@ -806,10 +840,20 @@
- return nullptr;
- }
- return surf.forget();
- }
-
-+already_AddRefed<DMABufSurface> DMABufSurfaceRGBA::CreateDMABufSurface(
-+ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage, int
aWidth,
-+ int aHeight) {
-+ RefPtr<DMABufSurfaceRGBA> surf = new DMABufSurfaceRGBA();
-+ if (!surf->Create(aGLContext, aEGLImage, aWidth, aHeight)) {
-+ return nullptr;
-+ }
-+ return surf.forget();
-+}
-+
- already_AddRefed<DMABufSurfaceYUV> DMABufSurfaceYUV::CreateYUVSurface(
- const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) {
- RefPtr<DMABufSurfaceYUV> surf = new DMABufSurfaceYUV();
- LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n",
- surf->GetUID()));
-
diff --git
a/http/firefox-esr/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
b/http/firefox-esr/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
deleted file mode 100644
index 89bb25e..0000000
--- a/http/firefox-esr/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-diff -up firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff
firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp
---- firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff 2022-06-23
09:08:46.000000000 +0200
-+++ firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-28
16:37:52.264835137 +0200
-@@ -9,25 +9,58 @@
- #include "GLContextEGL.h"
- #include "MozFramebuffer.h"
- #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
-+#include "mozilla/gfx/gfxVars.h"
-
- namespace mozilla::gl {
-
-+static bool HasDmaBufExtensions(const GLContextEGL* gl) {
-+ const auto& egl = *(gl->mEgl);
-+ return egl.IsExtensionSupported(EGLExtension::EXT_image_dma_buf_import) &&
-+ egl.IsExtensionSupported(
-+ EGLExtension::EXT_image_dma_buf_import_modifiers) &&
-+ egl.IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export);
-+}
-+
- /*static*/
- UniquePtr<SharedSurface_DMABUF> SharedSurface_DMABUF::Create(
- const SharedSurfaceDesc& desc) {
-- const auto flags = static_cast<DMABufSurfaceFlags>(
-- DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA);
-- const RefPtr<DMABufSurface> surface =
DMABufSurfaceRGBA::CreateDMABufSurface(
-- desc.size.width, desc.size.height, flags);
-- if (!surface || !surface->CreateTexture(desc.gl)) {
-- return nullptr;
-+ const auto& gle = GLContextEGL::Cast(desc.gl);
-+ const auto& context = gle->mContext;
-+ const auto& egl = *(gle->mEgl);
-+
-+ RefPtr<DMABufSurface> surface;
-+ UniquePtr<MozFramebuffer> fb;
-+
-+ if (!HasDmaBufExtensions(gle) || !gfx::gfxVars::UseDMABufSurfaceExport())
{
-+ // Use MESA_image_dma_buf_export is not supported or it's broken.
-+ // Create dmabuf surface directly via. GBM and create
-+ // EGLImage/framebuffer over it.
-+ const auto flags = static_cast<DMABufSurfaceFlags>(
-+ DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA);
-+ surface = DMABufSurfaceRGBA::CreateDMABufSurface(desc.size.width,
-+ desc.size.height,
flags);
-+ if (!surface || !surface->CreateTexture(desc.gl)) {
-+ return nullptr;
-+ }
-+ const auto tex = surface->GetTexture();
-+ fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false,
-+ LOCAL_GL_TEXTURE_2D, tex);
-+ if (!fb) return nullptr;
-+ } else {
-+ // Use MESA_image_dma_buf_export so create EGLImage/framebuffer directly
-+ // and derive dmabuf from it.
-+ fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false);
-+ if (!fb) return nullptr;
-+
-+ const auto buffer = reinterpret_cast<EGLClientBuffer>(fb->ColorTex());
-+ const auto image =
-+ egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr);
-+ if (!image) return nullptr;
-+
-+ surface = DMABufSurfaceRGBA::CreateDMABufSurface(
-+ desc.gl, image, desc.size.width, desc.size.height);
-+ if (!surface) return nullptr;
- }
--
-- const auto tex = surface->GetTexture();
-- auto fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false,
-- LOCAL_GL_TEXTURE_2D, tex);
-- if (!fb) return nullptr;
--
- return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface));
- }
-
-@@ -61,7 +94,7 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
- }
-
- auto dmabufFactory = MakeUnique<SurfaceFactory_DMABUF>(gl);
-- if (dmabufFactory->CanCreateSurface()) {
-+ if (dmabufFactory->CanCreateSurface(gl)) {
- return dmabufFactory;
- }
-
-@@ -71,8 +104,38 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
- return nullptr;
- }
-
-+bool SurfaceFactory_DMABUF::CanCreateSurface(GLContext& gl) {
-+ UniquePtr<SharedSurface> test =
-+ CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB);
-+ if (!test) {
-+ LOGDMABUF((
-+ "SurfaceFactory_DMABUF::CanCreateSurface() failed to create
surface."));
-+ return false;
-+ }
-+ auto desc = test->ToSurfaceDescriptor();
-+ if (!desc) {
-+ LOGDMABUF(
-+ ("SurfaceFactory_DMABUF::CanCreateSurface() failed to serialize "
-+ "surface."));
-+ return false;
-+ }
-+ RefPtr<DMABufSurface> importedSurface =
-+ DMABufSurface::CreateDMABufSurface(*desc);
-+ if (!importedSurface) {
-+ LOGDMABUF((
-+ "SurfaceFactory_DMABUF::CanCreateSurface() failed to import
surface."));
-+ return false;
-+ }
-+ if (!importedSurface->CreateTexture(&gl)) {
-+ LOGDMABUF(
-+ ("SurfaceFactory_DMABUF::CanCreateSurface() failed to create
texture "
-+ "over surface."));
-+ return false;
-+ }
-+ return true;
-+}
-+
- SurfaceFactory_DMABUF::SurfaceFactory_DMABUF(GLContext& gl)
- : SurfaceFactory({&gl, SharedSurfaceType::EGLSurfaceDMABUF,
- layers::TextureType::DMABUF, true}) {}
--
- } // namespace mozilla::gl
-diff -up firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff
firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h
---- firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h 2022-06-28 15:00:20.339991965
+0200
-@@ -59,11 +59,7 @@ class SurfaceFactory_DMABUF : public Sur
- return SharedSurface_DMABUF::Create(desc);
- }
-
-- bool CanCreateSurface() {
-- UniquePtr<SharedSurface> test =
-- CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB);
-- return test != nullptr;
-- }
-+ bool CanCreateSurface(GLContext& gl);
- };
-
- } // namespace gl
diff --git
a/http/firefox-esr/patches/0036-bmo-1773968-webgl-memory-leak.patch
b/http/firefox-esr/patches/0036-bmo-1773968-webgl-memory-leak.patch
deleted file mode 100644
index 6e93f2b..0000000
--- a/http/firefox-esr/patches/0036-bmo-1773968-webgl-memory-leak.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
---- a/widget/gtk/DMABufSurface.cpp
-+++ b/widget/gtk/DMABufSurface.cpp
-@@ -642,11 +642,11 @@
-
- void DMABufSurfaceRGBA::ReleaseTextures() {
- LOGDMABUF(("DMABufSurfaceRGBA::ReleaseTextures() UID %d\n", mUID));
- FenceDelete();
-
-- if (!mTexture) {
-+ if (!mTexture && mEGLImage == LOCAL_EGL_NO_IMAGE) {
- return;
- }
-
- if (!mGL) {
- #ifdef NIGHTLY
-@@ -663,17 +663,17 @@
- const auto& egl = gle->mEgl;
-
- if (mTexture && mGL->MakeCurrent()) {
- mGL->fDeleteTextures(1, &mTexture);
- mTexture = 0;
-- mGL = nullptr;
- }
-
- if (mEGLImage != LOCAL_EGL_NO_IMAGE) {
- egl->fDestroyImage(mEGLImage);
- mEGLImage = LOCAL_EGL_NO_IMAGE;
- }
-+ mGL = nullptr;
- }
-
- void DMABufSurfaceRGBA::ReleaseSurface() {
- MOZ_ASSERT(!IsMapped(), "We can't release mapped buffer!");
-
-@@ -1325,11 +1325,11 @@
-
- FenceDelete();
-
- bool textureActive = false;
- for (int i = 0; i < mBufferPlaneCount; i++) {
-- if (mTexture[i]) {
-+ if (mTexture[i] || mEGLImage[i] != LOCAL_EGL_NO_IMAGE) {
- textureActive = true;
- break;
- }
- }
-
-@@ -1346,18 +1346,23 @@
- "leaking textures!");
- return;
- #endif
- }
-
-- if (textureActive && mGL->MakeCurrent()) {
-- mGL->fDeleteTextures(DMABUF_BUFFER_PLANES, mTexture);
-- for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) {
-- mTexture[i] = 0;
-- }
-- ReleaseEGLImages(mGL);
-- mGL = nullptr;
-+ if (!mGL->MakeCurrent()) {
-+ NS_WARNING(
-+ "DMABufSurfaceYUV::ReleaseTextures(): Failed to create GL context "
-+ "current. We're leaking textures!");
-+ return;
- }
-+
-+ mGL->fDeleteTextures(DMABUF_BUFFER_PLANES, mTexture);
-+ for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) {
-+ mTexture[i] = 0;
-+ }
-+ ReleaseEGLImages(mGL);
-+ mGL = nullptr;
- }
-
- bool DMABufSurfaceYUV::VerifyTextureCreation() {
- LOGDMABUF(("DMABufSurfaceYUV::VerifyTextureCreation() UID %d", mUID));
-
-
diff --git
a/http/firefox-esr/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
b/http/firefox-esr/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
deleted file mode 100644
index 7bc99e4..0000000
--- a/http/firefox-esr/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-changeset: 623785:a6b80ee8c35f
-tag: tip
-parent: 623782:b1ed2fa50612
-user: stransky <stransky AT redhat.com>
-date: Wed Jun 15 14:54:19 2022 +0200
-files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-description:
-Bug 1758948 [FFmpeg] Use AVFrame::pts instead of AVFrame::pkt_pts on ffmpeg
4.x r?alwu
-
-AVFrame::pkt_pts has been deprecated and gives us wrong values for AV1
VA-API. Let's use AVFrame::pts instead on ffmpeg 4.x
-as well as we use on ffmpeg 5.0 where AVFrame::pkt_pts is removed.
-
-Differential Revision: https://phabricator.services.mozilla.com/D149386
-
-
-diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-@@ -774,7 +774,7 @@ void FFmpegVideoDecoder<LIBAV_VER>::Init
- #endif
-
- static int64_t GetFramePts(AVFrame* aFrame) {
--#if LIBAVCODEC_VERSION_MAJOR > 58
-+#if LIBAVCODEC_VERSION_MAJOR > 57
- return aFrame->pts;
- #else
- return aFrame->pkt_pts;
-
diff --git
a/http/firefox-esr/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
b/http/firefox-esr/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
deleted file mode 100644
index 0ab7380..0000000
---
a/http/firefox-esr/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-diff -up firefox-102.0/gfx/gl/GLContextProviderEGL.cpp.D148946.diff
firefox-102.0/gfx/gl/GLContextProviderEGL.cpp
---- firefox-102.0/gfx/gl/GLContextProviderEGL.cpp.D148946.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/gl/GLContextProviderEGL.cpp 2022-06-28
14:47:40.904700050 +0200
-@@ -1182,42 +1182,16 @@ RefPtr<GLContextEGL> GLContextEGL::Creat
- }
-
- /*static*/
--RefPtr<GLContextEGL> GLContextEGL::CreateEGLSurfacelessContext(
-- const std::shared_ptr<EglDisplay> display, const GLContextCreateDesc&
desc,
-- nsACString* const out_failureId) {
-- const EGLConfig config = {};
-- auto fullDesc = GLContextDesc{desc};
-- fullDesc.isOffscreen = true;
-- RefPtr<GLContextEGL> gl = GLContextEGL::CreateGLContext(
-- display, fullDesc, config, EGL_NO_SURFACE, false, out_failureId);
-- if (!gl) {
-- NS_WARNING("Failed to create surfaceless GL context");
-- return nullptr;
-- }
-- return gl;
--}
--
--/*static*/
- already_AddRefed<GLContext> GLContextProviderEGL::CreateHeadless(
- const GLContextCreateDesc& desc, nsACString* const out_failureId) {
- const auto display = DefaultEglDisplay(out_failureId);
- if (!display) {
- return nullptr;
- }
-- RefPtr<GLContextEGL> gl;
--#ifdef MOZ_WAYLAND
-- if (!gdk_display_get_default() &&
--
display->IsExtensionSupported(EGLExtension::MESA_platform_surfaceless)) {
-- gl =
-- GLContextEGL::CreateEGLSurfacelessContext(display, desc,
out_failureId);
-- } else
--#endif
-- {
-- mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
-- gl = GLContextEGL::CreateEGLPBufferOffscreenContext(
-- display, desc, dummySize, out_failureId);
-- }
-- return gl.forget();
-+ mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
-+ auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext(
-+ display, desc, dummySize, out_failureId);
-+ return ret.forget();
- }
-
- // Don't want a global context on Android as 1) share groups across 2
threads
-diff -up firefox-102.0/gfx/gl/GLDefs.h.D148946.diff
firefox-102.0/gfx/gl/GLDefs.h
---- firefox-102.0/gfx/gl/GLDefs.h.D148946.diff 2022-06-23 09:08:47.000000000
+0200
-+++ firefox-102.0/gfx/gl/GLDefs.h 2022-06-28 14:47:40.904700050 +0200
-@@ -104,9 +104,6 @@ bool CheckContextLost(const GLContext* g
- // EGL_ANGLE_image_d3d11_texture
- #define LOCAL_EGL_D3D11_TEXTURE_ANGLE 0x3484
-
--// EGL_MESA_platform_surfaceless
--#define LOCAL_EGL_PLATFORM_SURFACELESS_MESA 0x31DD
--
- // clang-format on
-
- #endif
-diff -up firefox-102.0/gfx/gl/GLLibraryEGL.cpp.D148946.diff
firefox-102.0/gfx/gl/GLLibraryEGL.cpp
---- firefox-102.0/gfx/gl/GLLibraryEGL.cpp.D148946.diff 2022-06-28
14:47:40.900699918 +0200
-+++ firefox-102.0/gfx/gl/GLLibraryEGL.cpp 2022-06-28 14:49:47.810911199
+0200
-@@ -54,9 +54,15 @@ StaticRefPtr<GLLibraryEGL> GLLibraryEGL:
-
- // should match the order of EGLExtensions, and be null-terminated.
- static const char* sEGLLibraryExtensionNames[] = {
-- "EGL_ANDROID_get_native_client_buffer", "EGL_ANGLE_device_creation",
-- "EGL_ANGLE_device_creation_d3d11", "EGL_ANGLE_platform_angle",
-- "EGL_ANGLE_platform_angle_d3d", "EGL_EXT_device_query"};
-+ "EGL_ANDROID_get_native_client_buffer",
-+ "EGL_ANGLE_device_creation",
-+ "EGL_ANGLE_device_creation_d3d11",
-+ "EGL_ANGLE_platform_angle",
-+ "EGL_ANGLE_platform_angle_d3d",
-+ "EGL_EXT_device_enumeration",
-+ "EGL_EXT_device_query",
-+ "EGL_EXT_platform_device",
-+ "EGL_MESA_platform_surfaceless"};
-
- // should match the order of EGLExtensions, and be null-terminated.
- static const char* sEGLExtensionNames[] = {
-@@ -84,7 +90,6 @@ static const char* sEGLExtensionNames[]
- "EGL_EXT_buffer_age",
- "EGL_KHR_partial_update",
- "EGL_NV_robustness_video_memory_purge",
-- "EGL_MESA_platform_surfaceless",
- "EGL_EXT_image_dma_buf_import",
- "EGL_EXT_image_dma_buf_import_modifiers",
- "EGL_MESA_image_dma_buf_export"};
-@@ -157,8 +162,52 @@ static std::shared_ptr<EglDisplay> GetAn
- }
-
- #ifdef MOZ_WAYLAND
-+static std::shared_ptr<EglDisplay> GetAndInitDeviceDisplay(
-+ GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) {
-+ nsAutoCString drmRenderDevice(gfx::gfxVars::DrmRenderDevice());
-+ if (drmRenderDevice.IsEmpty() ||
-+ !egl.IsExtensionSupported(EGLLibExtension::EXT_platform_device) ||
-+ !egl.IsExtensionSupported(EGLLibExtension::EXT_device_enumeration)) {
-+ return nullptr;
-+ }
-+
-+ EGLint maxDevices;
-+ if (!egl.fQueryDevicesEXT(0, nullptr, &maxDevices)) {
-+ return nullptr;
-+ }
-+
-+ std::vector<EGLDeviceEXT> devices(maxDevices);
-+ EGLint numDevices;
-+ if (!egl.fQueryDevicesEXT(devices.size(), devices.data(), &numDevices)) {
-+ return nullptr;
-+ }
-+ devices.resize(numDevices);
-+
-+ EGLDisplay display = EGL_NO_DISPLAY;
-+ for (const auto& device : devices) {
-+ const char* renderNodeString =
-+ egl.fQueryDeviceStringEXT(device,
LOCAL_EGL_DRM_RENDER_NODE_FILE_EXT);
-+ if (renderNodeString &&
-+ strcmp(renderNodeString, drmRenderDevice.get()) == 0) {
-+ const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
-+ display = egl.fGetPlatformDisplay(LOCAL_EGL_PLATFORM_DEVICE_EXT,
device,
-+ attrib_list);
-+ break;
-+ }
-+ }
-+ if (!display) {
-+ return nullptr;
-+ }
-+
-+ return EglDisplay::Create(egl, display, true, aProofOfLock);
-+}
-+
- static std::shared_ptr<EglDisplay> GetAndInitSurfacelessDisplay(
- GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) {
-+ if
(!egl.IsExtensionSupported(EGLLibExtension::MESA_platform_surfaceless)) {
-+ return nullptr;
-+ }
-+
- const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
- const EGLDisplay display = egl.fGetPlatformDisplay(
- LOCAL_EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY,
attrib_list);
-@@ -611,9 +660,9 @@ bool GLLibraryEGL::Init(nsACString* cons
- (void)fnLoadSymbols(symbols);
- }
- {
-- const SymLoadStruct symbols[] = {SYMBOL(QueryDisplayAttribEXT),
-- SYMBOL(QueryDeviceAttribEXT),
-- END_OF_SYMBOLS};
-+ const SymLoadStruct symbols[] = {
-+ SYMBOL(QueryDisplayAttribEXT), SYMBOL(QueryDeviceAttribEXT),
-+ SYMBOL(QueryDeviceStringEXT), END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
- {
-@@ -658,6 +707,10 @@ bool GLLibraryEGL::Init(nsACString* cons
- END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
-+ {
-+ const SymLoadStruct symbols[] = {SYMBOL(QueryDevicesEXT),
END_OF_SYMBOLS};
-+ (void)fnLoadSymbols(symbols);
-+ }
-
- return true;
- }
-@@ -835,7 +888,10 @@ std::shared_ptr<EglDisplay> GLLibraryEGL
- #ifdef MOZ_WAYLAND
- GdkDisplay* gdkDisplay = gdk_display_get_default();
- if (!gdkDisplay) {
-- ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
-+ ret = GetAndInitDeviceDisplay(*this, aProofOfLock);
-+ if (!ret) {
-+ ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
-+ }
- } else if (widget::GdkIsWaylandDisplay(gdkDisplay)) {
- // Wayland does not support EGL_DEFAULT_DISPLAY
- nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay);
-diff -up firefox-102.0/gfx/gl/GLLibraryEGL.h.D148946.diff
firefox-102.0/gfx/gl/GLLibraryEGL.h
---- firefox-102.0/gfx/gl/GLLibraryEGL.h.D148946.diff 2022-06-28
14:47:40.899699885 +0200
-+++ firefox-102.0/gfx/gl/GLLibraryEGL.h 2022-06-28 14:47:40.904700050
+0200
-@@ -71,7 +71,10 @@ enum class EGLLibExtension {
- ANGLE_device_creation_d3d11,
- ANGLE_platform_angle,
- ANGLE_platform_angle_d3d,
-+ EXT_device_enumeration,
- EXT_device_query,
-+ EXT_platform_device,
-+ MESA_platform_surfaceless,
- Max
- };
-
-@@ -107,7 +110,6 @@ enum class EGLExtension {
- EXT_buffer_age,
- KHR_partial_update,
- NV_robustness_video_memory_purge,
-- MESA_platform_surfaceless,
- EXT_image_dma_buf_import,
- EXT_image_dma_buf_import_modifiers,
- MESA_image_dma_buf_export,
-@@ -436,6 +438,10 @@ class GLLibraryEGL final {
- WRAP(fQueryDeviceAttribEXT(device, attribute, value));
- }
-
-+ const char* fQueryDeviceStringEXT(EGLDeviceEXT device, EGLint name) {
-+ WRAP(fQueryDeviceStringEXT(device, name));
-+ }
-+
- private:
- // NV_stream_consumer_gltexture_yuv
- EGLBoolean fStreamConsumerGLTextureExternalAttribsNV(
-@@ -478,6 +484,13 @@ class GLLibraryEGL final {
- WRAP(fExportDMABUFImageMESA(dpy, image, fds, strides, offsets));
- }
-
-+ public:
-+ // EGL_EXT_device_enumeration
-+ EGLBoolean fQueryDevicesEXT(EGLint max_devices, EGLDeviceEXT* devices,
-+ EGLint* num_devices) {
-+ WRAP(fQueryDevicesEXT(max_devices, devices, num_devices));
-+ }
-+
- #undef WRAP
-
- #undef WRAP
-@@ -586,6 +599,9 @@ class GLLibraryEGL final {
- EGLBoolean(GLAPIENTRY* fQueryDeviceAttribEXT)(EGLDeviceEXT device,
- EGLint attribute,
- EGLAttrib* value);
-+ const char*(GLAPIENTRY* fQueryDeviceStringEXT)(EGLDeviceEXT device,
-+ EGLint name);
-+
- // NV_stream_consumer_gltexture_yuv
- EGLBoolean(GLAPIENTRY* fStreamConsumerGLTextureExternalAttribsNV)(
- EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib* attrib_list);
-@@ -623,6 +639,10 @@ class GLLibraryEGL final {
- EGLint* strides,
- EGLint* offsets);
-
-+ EGLBoolean(GLAPIENTRY* fQueryDevicesEXT)(EGLint max_devices,
-+ EGLDeviceEXT* devices,
-+ EGLint* num_devices);
-+
- } mSymbols = {};
- };
-
diff --git
a/http/firefox-esr/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
b/http/firefox-esr/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
deleted file mode 100644
index e89c1bf..0000000
---
a/http/firefox-esr/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -up firefox-102.0/gfx/config/gfxVars.h.D149238.diff
firefox-102.0/gfx/config/gfxVars.h
---- firefox-102.0/gfx/config/gfxVars.h.D149238.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/config/gfxVars.h 2022-06-28 16:40:54.130895063 +0200
-@@ -91,7 +91,8 @@ class gfxVarReceiver;
- _(AllowWebGPU, bool, false) \
- _(UseVP8HwDecode, bool, false) \
- _(UseVP9HwDecode, bool, false) \
-- _(HwDecodedVideoZeroCopy, bool, false)
-+ _(HwDecodedVideoZeroCopy, bool, false) \
-+ _(UseDMABufSurfaceExport, bool, true)
-
- /* Add new entries above this line. */
-
-diff -up firefox-102.0/gfx/thebes/gfxPlatform.cpp.D149238.diff
firefox-102.0/gfx/thebes/gfxPlatform.cpp
---- firefox-102.0/gfx/thebes/gfxPlatform.cpp.D149238.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/thebes/gfxPlatform.cpp 2022-06-28 16:40:54.130895063
+0200
-@@ -2861,6 +2861,17 @@ void gfxPlatform::InitWebGLConfig() {
- gfxVars::SetAllowEglRbab(false);
- }
- }
-+
-+ if (kIsWayland || kIsX11) {
-+ // Disable EGL_MESA_image_dma_buf_export on mesa/radeonsi due to
-+ // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666
-+ nsString adapterDriverVendor;
-+ gfxInfo->GetAdapterDriverVendor(adapterDriverVendor);
-+ if (adapterDriverVendor.Find("mesa") != -1 &&
-+ adapterDriverVendor.Find("radeonsi") != -1) {
-+ gfxVars::SetUseDMABufSurfaceExport(false);
-+ }
-+ }
- }
-
- void gfxPlatform::InitWebGPUConfig() {
diff --git
a/http/firefox-esr/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
b/http/firefox-esr/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
deleted file mode 100644
index 689e584..0000000
--- a/http/firefox-esr/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-
-# HG changeset patch
-# User Martin Stransky <stransky AT redhat.com>
-# Date 1656309292 0
-# Node ID 6dce488087f13c4ffe6ba0c758362968a8e60704
-# Parent 00ef31a00437f25556606342668f1125e86c55b4
-Bug 1774271 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf
surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD
r=jgilbert
-
-Differential Revision: https://phabricator.services.mozilla.com/D149984
-
-diff --git a/gfx/config/gfxFeature.h b/gfx/config/gfxFeature.h
---- a/gfx/config/gfxFeature.h
-+++ b/gfx/config/gfxFeature.h
-@@ -38,17 +38,18 @@ namespace gfx {
- _(WEBGPU, Feature, "WebGPU")
\
- _(X11_EGL, Feature, "X11 EGL")
\
- _(DMABUF, Feature, "DMABUF")
\
- _(WINDOW_OCCLUSION, Feature, "WINDOW_OCCLUSION")
\
- _(VAAPI, Feature, "VA-API video decoding")
\
- _(VIDEO_OVERLAY, Feature, "video overlay")
\
- _(HW_DECODED_VIDEO_ZERO_COPY, Feature, "Hardware decoded video zero
copy") \
- _(VP8_HW_DECODE, Feature, "VP8 hardware decoding")
\
-- _(VP9_HW_DECODE, Feature, "VP9 hardware decoding")
-+ _(VP9_HW_DECODE, Feature, "VP9 hardware decoding")
\
-+ _(DMABUF_SURFACE_EXPORT, Feature, "WebGL DMABuf surface export")
- /* Add new entries above this comment */
-
- enum class Feature : uint32_t {
- #define MAKE_ENUM(name, type, desc) name,
- GFX_FEATURE_MAP(MAKE_ENUM)
- #undef MAKE_ENUM
- NumValues
- };
-diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
---- a/gfx/thebes/gfxPlatform.cpp
-+++ b/gfx/thebes/gfxPlatform.cpp
-@@ -2806,23 +2806,29 @@ void gfxPlatform::InitWebGLConfig() {
- nsAutoString renderer;
- gfxInfo->GetAdapterDeviceID(renderer);
- if (renderer.Find("Adreno (TM) 630") != -1) {
- gfxVars::SetAllowEglRbab(false);
- }
- }
-
- if (kIsWayland || kIsX11) {
-- // Disable EGL_MESA_image_dma_buf_export on mesa/radeonsi due to
-- // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666
-- nsString adapterDriverVendor;
-- gfxInfo->GetAdapterDriverVendor(adapterDriverVendor);
-- if (adapterDriverVendor.Find("mesa") != -1 &&
-- adapterDriverVendor.Find("radeonsi") != -1) {
-+ nsCString discardFailureId;
-+ int32_t status;
-+ FeatureState& feature =
-+ gfxConfig::GetFeature(Feature::DMABUF_SURFACE_EXPORT);
-+ if (NS_FAILED(
-+
gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ discardFailureId, &status)) ||
-+ status != nsIGfxInfo::FEATURE_STATUS_OK) {
-+ feature.DisableByDefault(FeatureStatus::Blocked, "Blocklisted by
gfxInfo",
-+ discardFailureId);
- gfxVars::SetUseDMABufSurfaceExport(false);
-+ } else {
-+ feature.EnableByDefault();
- }
- }
- }
-
- void gfxPlatform::InitWebGPUConfig() {
- if (!XRE_IsParentProcess()) {
- return;
- }
-diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
---- a/widget/GfxInfoBase.cpp
-+++ b/widget/GfxInfoBase.cpp
-@@ -249,16 +249,19 @@ static const char* GetPrefNameForFeature
- name = BLOCKLIST_PREF_BRANCH "hw-video-zero-copy";
- break;
- case nsIGfxInfo::FEATURE_WEBRENDER_SHADER_CACHE:
- name = BLOCKLIST_PREF_BRANCH "webrender.program-binary-disk";
- break;
- case nsIGfxInfo::FEATURE_WEBRENDER_PARTIAL_PRESENT:
- name = BLOCKLIST_PREF_BRANCH "webrender.partial-present";
- break;
-+ case nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT:
-+ name = BLOCKLIST_PREF_BRANCH "dmabuf.surface-export";
-+ break;
- default:
- MOZ_ASSERT_UNREACHABLE("Unexpected nsIGfxInfo feature?!");
- break;
- }
-
- return name;
- }
-
-diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp
---- a/widget/gtk/GfxInfo.cpp
-+++ b/widget/gtk/GfxInfo.cpp
-@@ -822,16 +822,32 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
- DesktopEnvironment::All, WindowProtocol::All,
DriverVendor::NonMesaAll,
- DeviceFamily::NvidiaAll, nsIGfxInfo::FEATURE_DMABUF,
- nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
- V(495, 44, 0, 0), "FEATURE_FAILURE_NO_GBM", "495.44.0");
-
- ////////////////////////////////////
-+ // FEATURE_DMABUF_SURFACE_EXPORT
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
-+ V(21, 1, 2, 0), "FEATURE_FAILURE_BROKEN_MESA", "22.1.2");
-+
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::IntelAll, nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_BROKEN_DRIVER", "");
-+
-+ ////////////////////////////////////
- // FEATURE_VAAPI
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
- DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
- DeviceFamily::All, nsIGfxInfo::FEATURE_VAAPI,
- nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
- V(21, 0, 0, 0), "FEATURE_ROLLOUT_VAAPI_MESA", "Mesa 21.0.0.0");
-
-diff --git a/widget/nsIGfxInfo.idl b/widget/nsIGfxInfo.idl
---- a/widget/nsIGfxInfo.idl
-+++ b/widget/nsIGfxInfo.idl
-@@ -171,16 +171,18 @@ interface nsIGfxInfo : nsISupports
- /* Whether VA-API is supported, starting in 96. */
- const long FEATURE_VAAPI = 37;
- /* Whether WebGPU is supported, starting in 100. */
- const long FEATURE_WEBGPU = 38;
- /* Whether video overlay is supported, starting in 100. */
- const long FEATURE_VIDEO_OVERLAY = 39;
- /* Whether hardware decoded video zero copy is supported, starting in
101. */
- const long FEATURE_HW_DECODED_VIDEO_ZERO_COPY = 40;
-+ /* Whether DMABUF export is supported, starting in 103. */
-+ const long FEATURE_DMABUF_SURFACE_EXPORT = 41;
- /* the maximum feature value. */
- const long FEATURE_MAX_VALUE = FEATURE_HW_DECODED_VIDEO_ZERO_COPY;
-
- /*
- * A set of return values from GetFeatureStatus
- */
-
- /* The driver is safe to the best of our knowledge */
-
diff --git
a/http/firefox-esr/patches/0041-p01-bmo-1772719-build-wayland-only.patch
b/http/firefox-esr/patches/0041-p01-bmo-1772719-build-wayland-only.patch
deleted file mode 100644
index 697d608..0000000
--- a/http/firefox-esr/patches/0041-p01-bmo-1772719-build-wayland-only.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-
-# HG changeset patch
-# User ganguin <ganguin>
-# Date 1654600180 0
-# Node ID 2e739b8c44c72cfcd603a34217c7ca8d8a99c6e3
-# Parent 4d909088d95c2addd0309c2d81d89dae0c4537ea
-Bug 1772719 - fix wayland-only build with mesa X11 support r=stransky
-
-this patch fixes building firefox with
---enable-default-toolkit=cairo-gtk3-wayland-only when system mesa is build
-with X11 support.
-
-Without this patch, it only builds with mesa built without X11 support.
-
-Differential Revision: https://phabricator.services.mozilla.com/D148347
-
-diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
---- a/widget/gtk/nsClipboard.cpp
-+++ b/widget/gtk/nsClipboard.cpp
-@@ -34,12 +34,15 @@
- #include "mozilla/SchedulerGroup.h"
- #include "mozilla/StaticPrefs_widget.h"
- #include "mozilla/TimeStamp.h"
-+#include "GRefPtr.h"
- #include "WidgetUtilsGtk.h"
-
- #include "imgIContainer.h"
-
- #include <gtk/gtk.h>
--#include <gtk/gtkx.h>
-+#if defined(MOZ_X11)
-+# include <gtk/gtkx.h>
-+#endif
-
- #include "mozilla/Encoding.h"
-
diff --git
a/http/firefox-esr/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch

b/http/firefox-esr/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
deleted file mode 100644
index 22a9cb0..0000000
---
a/http/firefox-esr/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/widget/gtk/mozgtk/moz.build b/widget/gtk/mozgtk/moz.build
---- a/widget/gtk/mozgtk/moz.build
-+++ b/widget/gtk/mozgtk/moz.build
-@@ -9,10 +9,11 @@
- SOURCES += [
- "mozgtk.c",
- ]
-
- CFLAGS += CONFIG["MOZ_X11_CFLAGS"]
-+CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
-
- # If LDFLAGS contains -Wl,--as-needed or if it's the default for the
toolchain,
- # we need to add -Wl,--no-as-needed before the gtk libraries, otherwise the
- # linker will drop those dependencies because no symbols are used from them.
- # But those dependencies need to be kept for things to work properly.
-diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
---- a/widget/gtk/mozgtk/mozgtk.c
-+++ b/widget/gtk/mozgtk/mozgtk.c
-@@ -4,10 +4,17 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "mozilla/Types.h"
-
-+#include <gdk/gdk.h>
-+
-+// Dummy call to gtk3 library to prevent the linker from removing
-+// the gtk3 dependency with --as-needed.
-+// see toolkit/library/moz.build for details.
-+MOZ_EXPORT void mozgtk_linker_holder() { gdk_display_get_default(); }
-+
- #ifdef MOZ_X11
- # include <X11/Xlib.h>
- // Bug 1271100
- // We need to trick system Cairo into not using the XShm extension due to
- // a race condition in it that results in frequent BadAccess errors. Cairo
-diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
---- a/widget/gtk/nsWindow.cpp
-+++ b/widget/gtk/nsWindow.cpp
-@@ -266,10 +266,13 @@
- return sTimeConverterSingleton;
- }
-
- bool nsWindow::sTransparentMainWindow = false;
-
-+// forward declare from mozgtk
-+extern "C" MOZ_EXPORT void mozgtk_linker_holder();
-+
- namespace mozilla {
-
- #ifdef MOZ_X11
- class CurrentX11TimeGetter {
- public:
-@@ -426,10 +429,14 @@
- do_GetService("@mozilla.org/widget/clipboard;1");
- NS_ASSERTION(clipboard, "Failed to init clipboard!");
- }
- #endif
- }
-+ // Dummy call to mozgtk to prevent the linker from removing
-+ // the dependency with --as-needed.
-+ // see toolkit/library/moz.build for details.
-+ mozgtk_linker_holder();
- }
-
- nsWindow::~nsWindow() {
- LOG("nsWindow::~nsWindow()");
-
-@@ -5332,14 +5339,10 @@
- //
- // If the window were to get unredirected, there could be visible
- // tearing because Gecko does not align its framebuffer updates with
- // vblank.
- SetCompositorHint(GTK_WIDGET_COMPOSIDED_ENABLED);
--
-- // Dummy call to a function in mozgtk to prevent the linker from
removing
-- // the dependency with --as-needed.
-- XShmQueryExtension(DefaultXDisplay());
- }
- #endif
- #ifdef MOZ_WAYLAND
- if (GdkIsWaylandDisplay()) {
- mSurfaceProvider.Initialize(this);
-
diff --git
a/http/firefox-esr/patches/0043-p02-bmo-1772721-build-wayland-only.patch
b/http/firefox-esr/patches/0043-p02-bmo-1772721-build-wayland-only.patch
deleted file mode 100644
index 63907fd..0000000
--- a/http/firefox-esr/patches/0043-p02-bmo-1772721-build-wayland-only.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Naur a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
---- a/widget/gtk/mozgtk/mozgtk.c 2022-06-18 19:17:31.464160229 -0000
-+++ b/widget/gtk/mozgtk/mozgtk.c 2022-06-18 19:24:34.966749520 -0000
-@@ -8,6 +8,8 @@
-
- #include <gdk/gdk.h>
-
-+MOZ_EXPORT unsigned int gtk_get_debug_flags(void) { return 0; }
-+
- // Dummy call to gtk3 library to prevent the linker from removing
- // the gtk3 dependency with --as-needed.
- // see toolkit/library/moz.build for details.
-diff -Naur a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
---- a/widget/gtk/nsWindow.cpp 2022-06-18 19:17:31.464160229 -0000
-+++ b/widget/gtk/nsWindow.cpp 2022-06-18 19:26:47.689851900 -0000
-@@ -5312,6 +5312,9 @@
- SetCompositorHint(GTK_WIDGET_COMPOSIDED_ENABLED);
- }
- #endif
-+// Dummy call to a function in mozgtk to prevent the linker from removing
-+// the dependency with --as-needed.
-+gtk_get_debug_flags();
- #ifdef MOZ_WAYLAND
- if (GdkIsWaylandDisplay()) {
- mSurfaceProvider.Initialize(this);
diff --git
a/http/firefox-esr/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch

b/http/firefox-esr/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
deleted file mode 100644
index 6caf6eb..0000000
---
a/http/firefox-esr/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-diff --git a/widget/gtk/CompositorWidgetParent.cpp
b/widget/gtk/CompositorWidgetParent.cpp
---- a/widget/gtk/CompositorWidgetParent.cpp
-+++ b/widget/gtk/CompositorWidgetParent.cpp
-@@ -4,13 +4,13 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "CompositorWidgetParent.h"
- #include "mozilla/Unused.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
-+#include "nsWindow.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- CompositorWidgetParent::CompositorWidgetParent(
- const CompositorWidgetInitData& aInitData,
- const layers::CompositorOptions& aOptions)
- : GtkCompositorWidget(aInitData.get_GtkCompositorWidgetInitData(),
aOptions,
-@@ -49,7 +49,6 @@
- const uintptr_t& aXWindow, const bool& aShaped) {
- EnableRendering(aXWindow, aShaped);
- return IPC_OK();
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/GtkCompositorWidget.cpp
b/widget/gtk/GtkCompositorWidget.cpp
---- a/widget/gtk/GtkCompositorWidget.cpp
-+++ b/widget/gtk/GtkCompositorWidget.cpp
-@@ -3,10 +3,11 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "GtkCompositorWidget.h"
-
-+#include "mozilla/gfx/gfxVars.h"
- #include "mozilla/layers/CompositorThread.h"
- #include "mozilla/widget/InProcessCompositorWidget.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
- #include "nsWindow.h"
-
-diff --git a/widget/gtk/IMContextWrapper.cpp
b/widget/gtk/IMContextWrapper.cpp
---- a/widget/gtk/IMContextWrapper.cpp
-+++ b/widget/gtk/IMContextWrapper.cpp
-@@ -5,10 +5,11 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "mozilla/Logging.h"
- #include "nsString.h"
- #include "prtime.h"
-+#include "prenv.h"
-
- #include "IMContextWrapper.h"
- #include "nsGtkKeyUtils.h"
- #include "nsWindow.h"
- #include "mozilla/AutoRestore.h"
-diff --git a/widget/gtk/InProcessGtkCompositorWidget.cpp
b/widget/gtk/InProcessGtkCompositorWidget.cpp
---- a/widget/gtk/InProcessGtkCompositorWidget.cpp
-+++ b/widget/gtk/InProcessGtkCompositorWidget.cpp
-@@ -6,14 +6,14 @@
- #include "HeadlessCompositorWidget.h"
- #include "HeadlessWidget.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
-
- #include "InProcessGtkCompositorWidget.h"
-+#include "VsyncDispatcher.h"
- #include "nsWindow.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- /* static */
- RefPtr<CompositorWidget> CompositorWidget::CreateLocal(
- const CompositorWidgetInitData& aInitData,
- const layers::CompositorOptions& aOptions, nsIWidget* aWidget) {
-@@ -39,7 +39,6 @@
- mWidget->GetCompositorVsyncDispatcher()) {
- cvd->SetCompositorVsyncObserver(aObserver);
- }
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/MPRISServiceHandler.cpp
b/widget/gtk/MPRISServiceHandler.cpp
---- a/widget/gtk/MPRISServiceHandler.cpp
-+++ b/widget/gtk/MPRISServiceHandler.cpp
-@@ -10,10 +10,11 @@
- #include <inttypes.h>
- #include <unordered_map>
-
- #include "MPRISInterfaceDescription.h"
- #include "mozilla/dom/MediaControlUtils.h"
-+#include "mozilla/GRefPtr.h"
- #include "mozilla/GUniquePtr.h"
- #include "mozilla/UniquePtrExtensions.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/ScopeExit.h"
- #include "mozilla/Sprintf.h"
-diff --git a/widget/gtk/WindowSurfaceX11.h b/widget/gtk/WindowSurfaceX11.h
---- a/widget/gtk/WindowSurfaceX11.h
-+++ b/widget/gtk/WindowSurfaceX11.h
-@@ -11,13 +11,13 @@
-
- # include "mozilla/widget/WindowSurface.h"
- # include "mozilla/gfx/Types.h"
-
- # include <X11/Xlib.h>
-+# include "X11UndefineNone.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- class WindowSurfaceX11 : public WindowSurface {
- public:
- WindowSurfaceX11(Display* aDisplay, Window aWindow, Visual* aVisual,
- unsigned int aDepth);
-@@ -31,10 +31,9 @@
- Visual* const mVisual;
- const unsigned int mDepth;
- const gfx::SurfaceFormat mFormat;
- };
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-
- #endif // MOZ_X11
- #endif // _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_H
-diff --git a/widget/gtk/WindowSurfaceX11.cpp
b/widget/gtk/WindowSurfaceX11.cpp
---- a/widget/gtk/WindowSurfaceX11.cpp
-+++ b/widget/gtk/WindowSurfaceX11.cpp
-@@ -4,14 +4,12 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "WindowSurfaceX11.h"
- #include "gfxPlatform.h"
--#include "X11UndefineNone.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- WindowSurfaceX11::WindowSurfaceX11(Display* aDisplay, Window aWindow,
- Visual* aVisual, unsigned int aDepth)
- : mDisplay(aDisplay),
- mWindow(aWindow),
-@@ -44,7 +42,6 @@
- }
-
- return gfx::SurfaceFormat::UNKNOWN;
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/nsApplicationChooser.cpp
b/widget/gtk/nsApplicationChooser.cpp
---- a/widget/gtk/nsApplicationChooser.cpp
-+++ b/widget/gtk/nsApplicationChooser.cpp
-@@ -9,10 +9,11 @@
-
- #include "nsApplicationChooser.h"
- #include "WidgetUtils.h"
- #include "nsIMIMEInfo.h"
- #include "nsIWidget.h"
-+#include "nsIFile.h"
- #include "nsCExternalHandlerService.h"
- #include "nsComponentManagerUtils.h"
- #include "nsGtkUtils.h"
- #include "nsPIDOMWindow.h"
-
-diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
---- a/widget/gtk/nsClipboard.cpp
-+++ b/widget/gtk/nsClipboard.cpp
-@@ -29,10 +29,11 @@
- #include "nsStringStream.h"
- #include "nsIFileURL.h"
- #include "nsIObserverService.h"
- #include "mozilla/Services.h"
- #include "mozilla/RefPtr.h"
-+#include "mozilla/GRefPtr.h"
- #include "mozilla/SchedulerGroup.h"
- #include "mozilla/StaticPrefs_widget.h"
- #include "mozilla/TimeStamp.h"
- #include "WidgetUtilsGtk.h"
-
-diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h
---- a/widget/gtk/nsGtkKeyUtils.h
-+++ b/widget/gtk/nsGtkKeyUtils.h
-@@ -18,10 +18,11 @@
- #endif
- #ifdef MOZ_WAYLAND
- # include <gdk/gdkwayland.h>
- # include <xkbcommon/xkbcommon.h>
- #endif
-+#include "X11UndefineNone.h"
-
- class nsWindow;
-
- namespace mozilla {
- namespace widget {
-
diff --git
a/http/firefox-esr/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch

b/http/firefox-esr/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
deleted file mode 100644
index e6696a4..0000000
---
a/http/firefox-esr/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
---- a/widget/gtk/moz.build
-+++ b/widget/gtk/moz.build
-@@ -185,8 +185,7 @@
- ]
- UNIFIED_SOURCES += [
- "AsyncDBus.cpp",
- ]
- CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
-+
- CXXFLAGS += ["-Werror=switch"]
--
--REQUIRES_UNIFIED_BUILD = True
-
diff --git
a/http/firefox-esr/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch

b/http/firefox-esr/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
deleted file mode 100644
index 1c27926..0000000
---
a/http/firefox-esr/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/gfx/gl/GLContextProviderEGL.cpp
b/gfx/gl/GLContextProviderEGL.cpp
---- a/gfx/gl/GLContextProviderEGL.cpp
-+++ b/gfx/gl/GLContextProviderEGL.cpp
-@@ -77,10 +77,11 @@
- #if defined(MOZ_WIDGET_GTK)
- # include "mozilla/widget/GtkCompositorWidget.h"
- # if defined(MOZ_WAYLAND)
- # include <gdk/gdkwayland.h>
- # include <wayland-egl.h>
-+# include "mozilla/WidgetUtilsGtk.h"
- # include "mozilla/widget/nsWaylandDisplay.h"
- # endif
- #endif
-
- struct wl_egl_window;
-diff --git a/gfx/gl/GLContextProviderLinux.cpp
b/gfx/gl/GLContextProviderLinux.cpp
---- a/gfx/gl/GLContextProviderLinux.cpp
-+++ b/gfx/gl/GLContextProviderLinux.cpp
-@@ -11,49 +11,59 @@
- namespace mozilla::gl {
-
- using namespace mozilla::gfx;
- using namespace mozilla::widget;
-
-+#ifdef MOZ_X11
- static class GLContextProviderGLX sGLContextProviderGLX;
-+#endif
- static class GLContextProviderEGL sGLContextProviderEGL;
-
- already_AddRefed<GLContext>
GLContextProviderLinux::CreateForCompositorWidget(
- CompositorWidget* aCompositorWidget, bool aHardwareWebRender,
- bool aForceAccelerated) {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.CreateForCompositorWidget(
- aCompositorWidget, aHardwareWebRender, aForceAccelerated);
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.CreateForCompositorWidget(
- aCompositorWidget, aHardwareWebRender, aForceAccelerated);
-+#endif
- }
- }
-
- /*static*/
- already_AddRefed<GLContext> GLContextProviderLinux::CreateHeadless(
- const GLContextCreateDesc& desc, nsACString* const out_failureId) {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.CreateHeadless(desc, out_failureId);
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.CreateHeadless(desc, out_failureId);
-+#endif
- }
- }
-
- /*static*/
- GLContext* GLContextProviderLinux::GetGlobalContext() {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.GetGlobalContext();
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.GetGlobalContext();
-+#endif
- }
- }
-
- /*static*/
- void GLContextProviderLinux::Shutdown() {
- if (gfxVars::UseEGL()) {
- sGLContextProviderEGL.Shutdown();
-+#ifdef MOZ_X11
- } else {
- sGLContextProviderGLX.Shutdown();
-+#endif
- }
- }
-
- } // namespace mozilla::gl
-diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
---- a/gfx/gl/moz.build
-+++ b/gfx/gl/moz.build
-@@ -105,14 +105,15 @@
-
- elif gl_provider == "Linux":
- # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
- # as it includes X11 headers which cause conflicts.
- SOURCES += [
-- "GLContextProviderGLX.cpp",
- "GLContextProviderLinux.cpp",
- ]
- EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
-+ if CONFIG["MOZ_X11"]:
-+ SOURCES += ["GLContextProviderGLX.cpp"]
-
- if CONFIG["MOZ_WAYLAND"]:
- SOURCES += ["SharedSurfaceDMABUF.cpp"]
-
- UNIFIED_SOURCES += [
-diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
---- a/gfx/thebes/gfxPlatformGtk.cpp
-+++ b/gfx/thebes/gfxPlatformGtk.cpp
-@@ -991,11 +991,11 @@
- }
-
- RefPtr<VsyncSource> softwareVsync = new XrandrSoftwareVsyncSource();
- return softwareVsync.forget();
- #else
-- return CreateSoftwareVsyncSource();
-+ return GetSoftwareVsyncSource();
- #endif
- }
-
- void gfxPlatformGtk::BuildContentDeviceData(ContentDeviceData* aOut) {
- gfxPlatform::BuildContentDeviceData(aOut);
-
diff --git
a/http/firefox-esr/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox-esr/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
deleted file mode 100644
index 634892be..0000000
--- a/http/firefox-esr/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
-+++ b/memory/mozalloc/throw_gcc.h
-@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
- mozalloc_abort("fatal: STL threw bad_function_call");
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_invalid_argument(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_overflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_underflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
- const char* msg) {



  • [SM-Commit] GIT changes to master grimoire by Thomas Orgis (759a1e477cc728d9f82f33f79044959c5c7eb229), Thomas Orgis, 07/15/2023

Archive powered by MHonArc 2.6.24.

Top of Page