sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Thomas Orgis (72bdcad021479d442ff9046c3f8403b7dc99090b)
- From: Thomas Orgis <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Thomas Orgis (72bdcad021479d442ff9046c3f8403b7dc99090b)
- Date: Thu, 6 Mar 2025 09:39:22 +0000
GIT changes to master grimoire by Thomas Orgis <sobukus AT sourcemage.org>:
devel/llvm/BUILD
| 2
devel/llvm/HISTORY
| 3
graphics-libs/mesa/BUILD
| 6
graphics-libs/mesa/HISTORY
| 3
http/firefox-esr/BUILD
| 7
http/firefox-esr/DEPENDS
| 24 -
http/firefox-esr/DETAILS
| 6
http/firefox-esr/HISTORY
| 8
http/firefox-esr/PRE_BUILD
| 8
http/firefox-esr/desktop/firefox.desktop
| 2
http/firefox-esr/patches/0001-Don-t-use-build-id.patch
| 46 --
http/firefox-esr/patches/0001-Fortify-sources-properly.patch
| 11
http/firefox-esr/patches/0002-Fortify-sources-properly.patch
| 11
http/firefox-esr/patches/0002-bmo-847568-Support-system-harfbuzz.patch
| 182 ++++++++
http/firefox-esr/patches/0003-bmo-847568-Support-system-graphite2.patch
| 161 +++++++
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-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
| 35 +
http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
| 114 -----
http/firefox-esr/patches/0005-musl-Fix-syscall-wrappers.patch
| 42 ++
http/firefox-esr/patches/0006-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
| 35 -
http/firefox-esr/patches/0006-musl-Only-use-system-heap-reporter-with-glibc.patch
| 33 +
http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
| 42 --
http/firefox-esr/patches/0007-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 +
http/firefox-esr/patches/0008-musl-Only-use-system-heap-reporter-with-glibc.patch
| 33 -
http/firefox-esr/patches/0008-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 51 ++
http/firefox-esr/patches/0009-musl-Set-pthread-name-for-non-glibc-systems.patch
| 29 -
http/firefox-esr/patches/0009-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
| 28 +
http/firefox-esr/patches/0010-build-Disable-Werror.patch
| 24 +
http/firefox-esr/patches/0010-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
| 51 --
http/firefox-esr/patches/0011-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 +
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-bgo-816975-fix-build-on-x86.patch
| 16
http/firefox-esr/patches/0013-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox-esr/patches/0013-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
| 55 --
http/firefox-esr/patches/0014-bmo-1754469-memory_mozalloc_throw.patch
| 69 +++
http/firefox-esr/patches/0015-bmo-1516803-gcc-lto-sandbox.patch
| 16
http/firefox-esr/patches/0015-build-Disable-Werror.patch
| 24 -
http/firefox-esr/patches/0016-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34 -
http/firefox-esr/patches/0016-enable-vaapi-on-all-amd-cards.patch
| 19
http/firefox-esr/patches/0017-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 23 -
http/firefox-esr/patches/0017-bgo-907963-rustflags-single-string.patch
| 76 +++
http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
| 16
http/firefox-esr/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
| 20
http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
| 23 -
http/firefox-esr/patches/0019-gcc-lto-pgo-from-fedora.patch
| 128 ++++++
http/firefox-esr/patches/0020-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox-esr/patches/0020-bmo-1862601-system-icu-74.patch
| 41 +
http/firefox-esr/patches/0021-bgo-748849-RUST_TARGET_override.patch
| 61 ++
http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
| 69 ---
http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
| 49 --
http/firefox-esr/patches/0022-bmo-1559213-Support-system-av1.patch
| 96 ++++
http/firefox-esr/patches/0023-bmo-1874059-fix-libcxx-18.patch
| 16
http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
| 55 --
http/firefox-esr/patches/0024-dont-use-build-id.patch
| 13
http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
| 66 ---
http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
| 35 -
http/firefox-esr/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
| 14
http/firefox-esr/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
| 16
http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
| 16
http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
| 19
http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
| 76 ---
http/firefox-esr/patches/0050-fix-for-icu-74.patch
| 29 -
64 files changed, 1293 insertions(+), 1427 deletions(-)
New commits:
commit 72bdcad021479d442ff9046c3f8403b7dc99090b
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>
mesa: allow a build without any vulkan or gallium drivers
We need to pass empty lists to overwrite the default, which would
auto-detect a list.
commit 9614705feeac6dbfd5ab62311303ae1b211a8177
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>
llvm: actually allow a build with SPIR-V-less libclc
This enables me to get any llvm with libclc at all.
commit 6f01837c87956117dfe48119c25cf7df11bb5c9f
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>
firefox-esr: version 128.8.0esr, ++SECURITY_PATCH
This is a version that shall build again with python-3.12.
diff --git a/devel/llvm/BUILD b/devel/llvm/BUILD
index d654b17..01e6f3f 100755
--- a/devel/llvm/BUILD
+++ b/devel/llvm/BUILD
@@ -58,7 +58,7 @@ if [[ "$LLVM_WITH_LIBCLC" == y ]] ;then
fi &&
# workaround for https://github.com/llvm/llvm-project/issues/109537
-if [[ "$LLVM_WITH_LIBCLC" == y ]] ;then
+if [[ "$LLVM_WITH_LIBCLC" == y ]] && list_find "$LLVM_LIBCLC_TARGETS"
spirv;then
local spirvcmd="$(command -v llvm-spirv)"
if [ -z "$spirvcmd" ] ;then
message "${PROBLEM_COLOR}libclc with SPIR-V support requires llvm-spirv
(https://github.com/llvm/llvm-project/issues/109537),${NORMAL_COLOR}"
diff --git a/devel/llvm/HISTORY b/devel/llvm/HISTORY
index 3d3e354..74d9574 100644
--- a/devel/llvm/HISTORY
+++ b/devel/llvm/HISTORY
@@ -1,6 +1,9 @@
2025-03-05 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 20.1.0, SPIRV_VERSION 19.1.5
+2025-03-06 Thomas Orgis <sobukus AT sourcemage.org>
+ * BUILD: allow build with libclc _without_ SPIR-V in it
+
2025-03-02 Justin Boffemmyer <flux AT sourcemage.org>
* BUILD, PREPARE: explicitly warn the user about libclc SPIR-V builds
needing llvm-spirv
diff --git a/graphics-libs/mesa/BUILD b/graphics-libs/mesa/BUILD
index 89ecc17..20d6216 100755
--- a/graphics-libs/mesa/BUILD
+++ b/graphics-libs/mesa/BUILD
@@ -65,6 +65,9 @@ meson_opt feature "xmlconfig"
"$MESA_XMLCONFIG" &&
if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
meson_opt list "gallium-drivers" "$MESA_GALLIUM"
+else
+ # default would be auto
+ meson_opt list "gallium-drivers" ""
fi &&
if [ -n "$MESA_RUSTICL_DRIVERS" ] ;then
@@ -93,6 +96,9 @@ fi &&
if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
meson_opt list "vulkan-drivers" "$MESA_VULKAN"
+else
+ # default would be auto
+ meson_opt list "vulkan-drivers" ""
fi &&
if [ -n "$MESA_VULKAN_LAYERS" ] && ! list_find "$MESA_VULKAN_LAYERS" none
;then
diff --git a/graphics-libs/mesa/HISTORY b/graphics-libs/mesa/HISTORY
index 0f4d7ec..4e6f9b9 100644
--- a/graphics-libs/mesa/HISTORY
+++ b/graphics-libs/mesa/HISTORY
@@ -1,3 +1,6 @@
+2015-03-06 Thomas Orgis <sobukus AT sourcemage.org>
+ * BUILD: allow to really disable all vulkan or gallium drivers
+
2025-02-20 Pavel Vinogradov <public AT sourcemage.org>
* CONFIGURE: removed dangling && from previous change
diff --git a/http/firefox-esr/BUILD b/http/firefox-esr/BUILD
index 525b1f3..78cbf86 100755
--- a/http/firefox-esr/BUILD
+++ b/http/firefox-esr/BUILD
@@ -57,8 +57,9 @@ else
fi &&
for option in $OPTS; do
- echo "ac_add_options $option" >> .mozconfig
-done &&
+ echo "ac_add_options $option"
+done >> .mozconfig &&
-echo "mk_add_options MOZ_MAKE_FLAGS=\"-j${MAKE_NJOBS:-1}\"" >> .mozconfig &&
+echo "mk_add_options MOZ_MAKE_FLAGS=\"-j$((${#DISTCC_HOSTS[*]} *
JOBS_PER_HOST + MAKE_NJOBS))\"" \
+>> .mozconfig &&
MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none ./mach build
diff --git a/http/firefox-esr/DEPENDS b/http/firefox-esr/DEPENDS
index e2ea84c..06efe7a 100755
--- a/http/firefox-esr/DEPENDS
+++ b/http/firefox-esr/DEPENDS
@@ -9,7 +9,10 @@ depends python3
&&
depends icu "--with-system-icu" &&
depends glib2 &&
-vdepends <<< "at-spi2-core >= 2.45.0" &&
+vdepends <<!
+ at-spi2-core >= 2.45.0
+ cbindgen >= 0.26.0
+!
if [[ $FIREFOX_SCCACHE == 'y' ]]; then
depends sccache
@@ -49,7 +52,7 @@ depends libwebp "--with-system-webp"
&&
depends nspr "--with-system-nspr" &&
-local NSS_BRANCH="3.91" &&
+local NSS_BRANCH="3.101" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
@@ -72,18 +75,12 @@ depends libnotify
&&
depends pixman "--enable-system-pixman" &&
depends rust &&
-depends cbindgen &&
depends nodejs &&
depends startup-notification &&
depends gconf2 &&
-optional_depends wireless_tools \
- "--enable-necko-wifi" \
- "--disable-necko-wifi" \
- "for Necko WiFi scanning" &&
-
for b in $FIREFOX_AUDIO
do
case $b in
@@ -125,7 +122,16 @@ if is_depends_enabled $SPELL alsa-lib; then
depends yasm
fi &&
-depends dbus-glib "--enable-dbus" &&
+optional_depends dbus \
+ "--enable-dbus" \
+ "--disable-dbus --disable-necko-wifi" \
+ "for DBus support" &&
+if is_depends_enabled "${SPELL}" "dbus" ; then
+ optional_depends wireless_tools \
+ "--enable-necko-wifi" \
+ "" \
+ "for Necko WiFi scanning"
+fi &&
# Firefox is currently borked and does not compile without OpenGL headers
#optional_depends OPENGL \
diff --git a/http/firefox-esr/DETAILS b/http/firefox-esr/DETAILS
index 67388d5..cd3cf41 100755
--- a/http/firefox-esr/DETAILS
+++ b/http/firefox-esr/DETAILS
@@ -1,11 +1,11 @@
SPELL=firefox-esr
SPELLX=firefox
- VERSION=115.21.0esr
- SECURITY_PATCH=185
+ VERSION=128.8.0esr
+ SECURITY_PATCH=186
SOURCE="${SPELLX}-${VERSION}.source.tar.xz"
SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELLX}/releases/${VERSION}/source/${SOURCE}"
# Download SHA512SUMS and SHA512SUMS.asc, verify, then place hash here.
-
SOURCE_HASH="sha512:dabdcbe44f38d8405edbb62e193407cde18f7f4740fd4f3187b3c876729bbc6873792c37108713ad2707293d88c5e3c49e4311e7591528404a884412d26f671a:UPSTREAM_HASH"
+
SOURCE_HASH="sha512:7c0ef22bc14d4fa248cbae14d629174c9c967f891f4525f609760595f5a108aedf7dd804d1b63b97ec268613fa98378f4742a9b6ab562454351cf21175fdb802:UPSTREAM_HASH"
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 06ba865..faa2b1e 100644
--- a/http/firefox-esr/HISTORY
+++ b/http/firefox-esr/HISTORY
@@ -1,3 +1,11 @@
+2024-03-05 Thomas Orgis <sobukus AT sourcemage.org>
+ * DETAILS: ++SECURITY_PATCH, version 128.8.0esr
+ * */*: sync with firefox 128.0.3
+ * patches/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch:
+ removed (apparently obsolete)
+ *
patches/0028-bmo-1902227-backport-ffmpeg-av1-vaapi-fixes-for-mesa-24.0.7plus.patch:
+ removed (apparenlty obsolete)
+
2025-03-05 Thomas Orgis <sobukus AT sourcemage.org>
* DETAILS: 115.21.0esr, ++SECURITY_PATCH
diff --git a/http/firefox-esr/PRE_BUILD b/http/firefox-esr/PRE_BUILD
index 0baadc3..490dc71 100755
--- a/http/firefox-esr/PRE_BUILD
+++ b/http/firefox-esr/PRE_BUILD
@@ -1,5 +1,7 @@
default_pre_build &&
cd $SOURCE_DIRECTORY &&
+# allow newer python
+sed -i '/MAX_PYTHON_/s/11/12/' mach &&
# To remove version suffix from some directories
sed 's;-$(MOZ_APP_VERSION);;g' -i config/baseconfig.mk &&
@@ -54,8 +56,8 @@ case "$HOST" in
;;
esac &&
+apply_patch_dir patches &&
+
# 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
+ -exec sed -i -e 's/\("files":{\)[^}]*/\1/' {} \;
diff --git a/http/firefox-esr/desktop/firefox.desktop
b/http/firefox-esr/desktop/firefox.desktop
index e5ef237..0fdf18e 100644
--- a/http/firefox-esr/desktop/firefox.desktop
+++ b/http/firefox-esr/desktop/firefox.desktop
@@ -2,7 +2,7 @@
Encoding=UTF-8
Name=Firefox
Exec=firefox
-Icon=/usr/lib/firefox/browser/icons/mozicon128.png
+Icon=/usr/lib/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Application;Network;Browsers
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
deleted file mode 100644
index 9976c89..0000000
--- a/http/firefox-esr/patches/0001-Don-t-use-build-id.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-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)
-
-- # 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=$build_id"
-- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-- AC_MSG_RESULT([no])
-- LDFLAGS=$_SAVE_LDFLAGS)
--
- _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
- fi
-
-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)
-
-- # 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=$build_id"
-- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-- AC_MSG_RESULT([no])
-- LDFLAGS=$_SAVE_LDFLAGS)
--
- AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
- HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
- _SAVE_LDFLAGS=$LDFLAGS
diff --git a/http/firefox-esr/patches/0001-Fortify-sources-properly.patch
b/http/firefox-esr/patches/0001-Fortify-sources-properly.patch
new file mode 100644
index 0000000..009ca80
--- /dev/null
+++ b/http/firefox-esr/patches/0001-Fortify-sources-properly.patch
@@ -0,0 +1,11 @@
+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",
+- "features.h",
+ "fenv.h",
+ "ffi.h",
+ "fibdef.h",
diff --git a/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
b/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
deleted file mode 100644
index bef79ad..0000000
--- a/http/firefox-esr/patches/0002-Fortify-sources-properly.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-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',
-- 'features.h',
- 'fenv.h',
- 'ffi.h',
- 'fibdef.h',
diff --git
a/http/firefox-esr/patches/0002-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox-esr/patches/0002-bmo-847568-Support-system-harfbuzz.patch
new file mode 100644
index 0000000..f7f877f
--- /dev/null
+++ b/http/firefox-esr/patches/0002-bmo-847568-Support-system-harfbuzz.patch
@@ -0,0 +1,182 @@
+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 aa17660..7f416f9 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1253,6 +1253,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 fb7ed4b..ea65621 100644
+--- a/dom/base/moz.build
++++ b/dom/base/moz.build
+@@ -616,6 +616,9 @@ FINAL_LIBRARY = "xul"
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["MOZ_GTK3_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 56ea317..6cc19f8 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 b589efd..47f49e1 100755
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -95,6 +95,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 7fee545..ba1a403 100644
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -623,6 +623,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 48f2849..5e16334 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -297,6 +297,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+ 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 2396210..092baac 100644
+--- a/intl/unicharutil/util/moz.build
++++ b/intl/unicharutil/util/moz.build
+@@ -24,6 +24,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 c926d14..5082238 100644
+--- a/netwerk/dns/moz.build
++++ b/netwerk/dns/moz.build
+@@ -119,4 +119,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 a9feb0b..1d13418 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -288,6 +288,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 c5dcc65..0c9e5fe 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -718,6 +718,22 @@ def freetype2_combined_info(fontconfig_info,
freetype2_info):
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
+
++# HarfBuzz
++# ==============================================================
++option(
++ "--with-system-harfbuzz",
++ help="Use system harfbuzz (located with pkgconfig)",
++ when=use_pkg_config,
++)
++@depends("--with-system-harfbuzz", when=use_pkg_config)
++def enable_system_harfbuzz_option(enable_system_harfbuzz):
++ return enable_system_harfbuzz
++
++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/0003-bmo-847568-Support-system-graphite2.patch
b/http/firefox-esr/patches/0003-bmo-847568-Support-system-graphite2.patch
new file mode 100644
index 0000000..93b49d5
--- /dev/null
+++ b/http/firefox-esr/patches/0003-bmo-847568-Support-system-graphite2.patch
@@ -0,0 +1,161 @@
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 7f416f9..1193883 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1260,6 +1260,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 0000000..24e8d7a
+--- /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 = 'xul'
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 6cc19f8..14b08db 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 5e16334..7d0a161 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -295,7 +295,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 2d2ad0b..f97051a 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -703,6 +703,27 @@ fi
+ AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
+ AC_SUBST(MOZ_MACBUNDLE_ID)
+
++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 = Child Process Name for IPC
+ dnl ========================================================
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index 1d13418..31c8158 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -288,6 +288,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 0c9e5fe..0c62ade 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -718,6 +718,23 @@ def freetype2_combined_info(fontconfig_info,
freetype2_info):
+ set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
+
+
++# Graphite2
++# ==============================================================
++option(
++ "--with-system-graphite2",
++ help="Use system graphite2 (located with pkgconfig)",
++ when=use_pkg_config,
++)
++
++@depends("--with-system-graphite2", when=use_pkg_config)
++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(
+--
+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
deleted file mode 100644
index 18fb36f..0000000
--- a/http/firefox-esr/patches/0003-bmo-847568-Support-system-harfbuzz.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-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
deleted file mode 100644
index 74d9b24..0000000
--- a/http/firefox-esr/patches/0004-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/0004-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
b/http/firefox-esr/patches/0004-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
new file mode 100644
index 0000000..300846f
--- /dev/null
+++
b/http/firefox-esr/patches/0004-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/0005-bmo-1559213-Support-system-av1.patch
b/http/firefox-esr/patches/0005-bmo-1559213-Support-system-av1.patch
deleted file mode 100644
index e894258..0000000
--- a/http/firefox-esr/patches/0005-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/0005-musl-Fix-syscall-wrappers.patch
b/http/firefox-esr/patches/0005-musl-Fix-syscall-wrappers.patch
new file mode 100644
index 0000000..d9dda49
--- /dev/null
+++ b/http/firefox-esr/patches/0005-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/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
deleted file mode 100644
index 300846f..0000000
---
a/http/firefox-esr/patches/0006-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/0006-musl-Only-use-system-heap-reporter-with-glibc.patch
b/http/firefox-esr/patches/0006-musl-Only-use-system-heap-reporter-with-glibc.patch
new file mode 100644
index 0000000..08f0214
--- /dev/null
+++
b/http/firefox-esr/patches/0006-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/0007-musl-Fix-syscall-wrappers.patch
b/http/firefox-esr/patches/0007-musl-Fix-syscall-wrappers.patch
deleted file mode 100644
index d9dda49..0000000
--- a/http/firefox-esr/patches/0007-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/0007-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox-esr/patches/0007-musl-Set-pthread-name-for-non-glibc-systems.patch
new file mode 100644
index 0000000..fe74bb1
--- /dev/null
+++
b/http/firefox-esr/patches/0007-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/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
deleted file mode 100644
index 08f0214..0000000
---
a/http/firefox-esr/patches/0008-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/0008-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
b/http/firefox-esr/patches/0008-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/0008-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/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
deleted file mode 100644
index fe74bb1..0000000
---
a/http/firefox-esr/patches/0009-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/0009-musl-make-SYS_fork-non-fatal-musl-uses-it-for-fork-2.patch
b/http/firefox-esr/patches/0009-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/0009-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/0010-build-Disable-Werror.patch
b/http/firefox-esr/patches/0010-build-Disable-Werror.patch
new file mode 100644
index 0000000..e1df117
--- /dev/null
+++ b/http/firefox-esr/patches/0010-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/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
deleted file mode 100644
index 121c8cd..0000000
---
a/http/firefox-esr/patches/0010-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/0011-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
b/http/firefox-esr/patches/0011-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/0011-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/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
deleted file mode 100644
index 9de0db7..0000000
---
a/http/firefox-esr/patches/0011-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/0012-Make-PGO-use-toolchain.patch
b/http/firefox-esr/patches/0012-Make-PGO-use-toolchain.patch
deleted file mode 100644
index 3f72b05..0000000
--- a/http/firefox-esr/patches/0012-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/0012-bgo-816975-fix-build-on-x86.patch
b/http/firefox-esr/patches/0012-bgo-816975-fix-build-on-x86.patch
new file mode 100644
index 0000000..4b2289f
--- /dev/null
+++ b/http/firefox-esr/patches/0012-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/0013-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox-esr/patches/0013-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..864741e
--- /dev/null
+++
b/http/firefox-esr/patches/0013-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/0013-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
b/http/firefox-esr/patches/0013-bmo-1516081-Disable-watchdog-during-PGO-builds.patch
deleted file mode 100644
index 70cf5c3..0000000
---
a/http/firefox-esr/patches/0013-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/0014-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox-esr/patches/0014-bmo-1754469-memory_mozalloc_throw.patch
new file mode 100644
index 0000000..634892be
--- /dev/null
+++ b/http/firefox-esr/patches/0014-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/0015-bmo-1516803-gcc-lto-sandbox.patch
b/http/firefox-esr/patches/0015-bmo-1516803-gcc-lto-sandbox.patch
new file mode 100644
index 0000000..eff08f6
--- /dev/null
+++ b/http/firefox-esr/patches/0015-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/0015-build-Disable-Werror.patch
b/http/firefox-esr/patches/0015-build-Disable-Werror.patch
deleted file mode 100644
index e1df117..0000000
--- a/http/firefox-esr/patches/0015-build-Disable-Werror.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naur a/build/moz.configure/warnings.configure
b/build/moz.configure/warnings.configure
---- a/build/moz.configure/warnings.configure 2022-10-10 19:05:25.000000000
+0300
-+++ b/build/moz.configure/warnings.configure 2022-10-18 13:59:24.514026407
+0300
-@@ -160,6 +160,9 @@
- # false positives depending on optimization
- check_and_add_warning("-Wno-error=array-bounds")
-
-+# can't get rid of those PGO warnings
-+check_and_add_warning("-Wno-error=coverage-mismatch")
-+
- # false positives depending on optimizations
- check_and_add_warning("-Wno-error=free-nonheap-object")
-
-@@ -279,8 +282,8 @@
- # build, but we're not sure why.
- check_and_add_warning("-Wno-enum-compare")
-
--# Make it an error to be missing function declarations for C code.
--check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
-+check_and_add_warning("-Werror=implicit-function-declaration",
-+ when="--enable-warnings-as-errors")
-
- # New in clang 11. We can't really do anything about this warning.
- check_and_add_warning("-Wno-psabi")
diff --git
a/http/firefox-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
deleted file mode 100644
index 32bd0eb..0000000
---
a/http/firefox-esr/patches/0016-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/0016-enable-vaapi-on-all-amd-cards.patch
b/http/firefox-esr/patches/0016-enable-vaapi-on-all-amd-cards.patch
new file mode 100644
index 0000000..112cd42
--- /dev/null
+++ b/http/firefox-esr/patches/0016-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/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
deleted file mode 100644
index 5e48dd2..0000000
---
a/http/firefox-esr/patches/0017-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Enable FLAC on platforms without ffvpx like powerpc*
-
---- a/dom/media/flac/FlacDecoder.cpp
-+++ b/dom/media/flac/FlacDecoder.cpp
-@@ -7,6 +7,7 @@
- #include "FlacDecoder.h"
- #include "MediaContainerType.h"
- #include "mozilla/StaticPrefs_media.h"
-+#include "PDMFactory.h"
-
- namespace mozilla {
-
-@@ -14,6 +15,10 @@ namespace mozilla {
- bool FlacDecoder::IsEnabled() {
- #ifdef MOZ_FFVPX
- return StaticPrefs::media_flac_enabled();
-+#elif defined(MOZ_FFMPEG)
-+ RefPtr<PDMFactory> platform = new PDMFactory();
-+ return StaticPrefs::media_flac_enabled() &&
-+ (platform->SupportsMimeType("audio/flac"_ns) !=
media::DecodeSupport::Unsupported);
- #else
- return false;
- #endif
diff --git
a/http/firefox-esr/patches/0017-bgo-907963-rustflags-single-string.patch
b/http/firefox-esr/patches/0017-bgo-907963-rustflags-single-string.patch
new file mode 100644
index 0000000..a56aec4
--- /dev/null
+++ b/http/firefox-esr/patches/0017-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/0018-bgo-816975-fix-build-on-x86.patch
b/http/firefox-esr/patches/0018-bgo-816975-fix-build-on-x86.patch
deleted file mode 100644
index 4b2289f..0000000
--- a/http/firefox-esr/patches/0018-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/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
b/http/firefox-esr/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
new file mode 100644
index 0000000..bb0621a
--- /dev/null
+++
b/http/firefox-esr/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
@@ -0,0 +1,20 @@
+--- a/security/sandbox/linux/Sandbox.cpp 2023-07-10 20:29:48.000000000 +0100
++++ b/security/sandbox/linux/Sandbox.cpp 2023-07-15 09:13:43.561724668
+0100
+@@ -18,6 +18,8 @@
+ #include <dirent.h>
+ #ifdef NIGHTLY_BUILD
+ # include "dlfcn.h"
++#else
++# include <dlfcn.h>
+ #endif
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -685,7 +687,7 @@
+ files->Add("/proc/stat", SandboxOpenedFile::Error{});
+ files->Add("/proc/net/unix", SandboxOpenedFile::Error{});
+ files->Add("/proc/self/maps", SandboxOpenedFile::Error{});
+-
++ Unused << dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY);
+ // Finally, start the sandbox.
+ SetCurrentProcessSandbox(GetMediaSandboxPolicy(files));
+ }
\ No newline at end of file
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
deleted file mode 100644
index 361c0b6..0000000
--- a/http/firefox-esr/patches/0019-bmo-1559213-fix-system-av1-libs.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
-index 0069865..e806fc8 100644
---- a/media/ffvpx/libavcodec/moz.build
-+++ b/media/ffvpx/libavcodec/moz.build
-@@ -108,10 +108,14 @@
- 'vp9prob.c',
- 'vp9recon.c'
- ]
-- USE_LIBS += [
-- 'dav1d',
-- 'media_libdav1d_asm',
-- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
-+ else:
-+ USE_LIBS += [
-+ 'dav1d',
-+ 'media_libdav1d_asm',
-+ ]
- if CONFIG['MOZ_WAYLAND']:
- LOCAL_INCLUDES += ['/media/mozva']
- SOURCES += [
diff --git a/http/firefox-esr/patches/0019-gcc-lto-pgo-from-fedora.patch
b/http/firefox-esr/patches/0019-gcc-lto-pgo-from-fedora.patch
new file mode 100644
index 0000000..3d8a0b1
--- /dev/null
+++ b/http/firefox-esr/patches/0019-gcc-lto-pgo-from-fedora.patch
@@ -0,0 +1,128 @@
+diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo
firefox-128.0/build/moz.configure/lto-pgo.configure
+--- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02
00:34:14.000000000 +0200
++++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02
17:59:44.425650444 +0200
+@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi
+
+ @depends(
+ "--enable-profile-use",
++ c_compiler,
+ pgo_profile_path,
+ llvm_profdata,
+ llvm_profdata_order,
+ build_environment,
+ )
+-def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
++def orderfile_path(profile_use, compiler, path, profdata, profdata_order,
build_env):
++ if compiler.type == "gcc":
++ return None
++
+ if not profile_use:
+ return None
+
+@@ -133,7 +137,7 @@ def pgo_flags(
+ 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 -up firefox-128.0/build/pgo/profileserver.py.pgo
firefox-128.0/build/pgo/profileserver.py
+--- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02
00:34:15.000000000 +0200
++++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444
+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
+@@ -97,9 +97,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-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build
+--- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200
++++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200
+@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
+ # The file uses SSE2 intrinsics, so it needs special compile flags on
some
+ # compilers.
+ SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
+ elif CONFIG["TARGET_CPU"].startswith("mips"):
+diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo
firefox-128.0/gfx/skia/generate_mozbuild.py
+--- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02
17:59:44.425650444 +0200
++++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02
18:17:40.973081400 +0200
+@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/gfx/skia/moz.build.pgo
firefox-128.0/gfx/skia/moz.build
+--- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444
+0200
++++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200
+@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
+--- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2024-07-02 00:34:32.000000000 +0200
++++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
2024-07-02 17:59:44.425650444 +0200
+@@ -332,6 +332,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 --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
deleted file mode 100644
index 864741e..0000000
---
a/http/firefox-esr/patches/0020-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/0020-bmo-1862601-system-icu-74.patch
b/http/firefox-esr/patches/0020-bmo-1862601-system-icu-74.patch
new file mode 100644
index 0000000..617dd76
--- /dev/null
+++ b/http/firefox-esr/patches/0020-bmo-1862601-system-icu-74.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/917599
+https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
+https://hg.mozilla.org/try/rev/d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+
+# HG changeset patch
+# User André Bargull <andre.bargull AT gmail.com>
+# Date 1697435923 -7200
+# Node ID d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+# Parent c63994f8259efdf6e745c960aa9e1409d5477049
+Bug xxx - Part 12: Add new line break classes. r?
+
+diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp
+--- a/intl/lwbrk/LineBreaker.cpp
++++ b/intl/lwbrk/LineBreaker.cpp
+@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
+ /* JT = 34, [JT] */ CLASS_CHARACTER,
+ /* JV = 35, [JV] */ CLASS_CHARACTER,
+ /* CLOSE_PARENTHESIS = 36, [CP] */
CLASS_CLOSE_LIKE_CHARACTER,
+ /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
+ /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER,
+ /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER,
+ /* E_BASE = 40, [EB] */ CLASS_BREAKABLE,
+ /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER,
+- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER};
++ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER,
++ /* AKSARA = 43, [AK] */ CLASS_CHARACTER,
++ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER,
++ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER,
++ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER,
++ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER,
++ };
+
+ static_assert(U_LB_COUNT ==
mozilla::ArrayLength(sUnicodeLineBreakToClass),
+ "Gecko vs ICU LineBreak class mismatch");
+
+ auto cls = GetLineBreakClass(u);
+ MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
+
+ // Overrides based on rules for the different line-break values given in
+
+
diff --git
a/http/firefox-esr/patches/0021-bgo-748849-RUST_TARGET_override.patch
b/http/firefox-esr/patches/0021-bgo-748849-RUST_TARGET_override.patch
new file mode 100644
index 0000000..f109538
--- /dev/null
+++ b/http/firefox-esr/patches/0021-bgo-748849-RUST_TARGET_override.patch
@@ -0,0 +1,61 @@
+From: Sam James <sam AT gentoo.org>
+Subject: Allow RUST_TARGET override for detected Rust triplet (fixes musl
build)
+
+Respect RUST_TARGET from the environment to override Mozilla's
+own triplet detection.
+
+If the variable is unset, the old logic is used.
+
+The issue is that Gentoo supports both, say:
+- x86_64-unknown-linux-musl, and
+- x86-64-gentoo-linux-musl
+
+Our Rust is built to understand
+-gentoo- as a vendor target, but
+our Rust only actually includes
+-unknown-.
+
+Mozilla's configure sees -gentoo-
+in CHOST and that Rust _understands_
+-gentoo- and tries to use it, without
+verifying that we actually have
+-gentoo- installed as a Rust target.
+
+This requires exporting RUST_TARGET
+in the ebuild, possibly like:
+````
+inherit rust-toolchain
+
+src_configure() {
+ [...]
+ export RUST_TARGET=$(rust_abi)
+ [...]
+}
+````
+
+Inspired by Alpine's patch at
+https://git.alpinelinux.org/aports/tree/community/firefox/fix-rust-target.patch?id=740922900cf8042be6751fcfcccdd3fc11bd77d3.
+
+Bug: https://bugs.gentoo.org/748849
+Bug: https://bugs.gentoo.org/779178
+Bug: https://bugs.gentoo.org/836226
+Thanks-to: Georgy Yakovlev <gyakovlev AT gentoo.org>
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -275,6 +275,7 @@ def rust_supported_targets(rustc):
+ return data
+
+
++@imports('os')
+ def detect_rustc_target(
+ host_or_target, compiler_info, arm_target, rust_supported_targets
+ ):
+@@ -396,7 +397,7 @@ def detect_rustc_target(
+
+ return None
+
+- rustc_target = find_candidate(candidates)
++ rustc_target = os.environ.get('RUST_TARGET', find_candidate(candidates))
+
+ if rustc_target is None:
+ die("Don't know how to translate {} for
rustc".format(host_or_target.alias))
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
deleted file mode 100644
index 634892be..0000000
--- a/http/firefox-esr/patches/0021-bmo-1754469-memory_mozalloc_throw.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
-+++ b/memory/mozalloc/throw_gcc.h
-@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
- mozalloc_abort("fatal: STL threw bad_function_call");
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_invalid_argument(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_overflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_underflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
- const char* msg) {
diff --git
a/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
b/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
deleted file mode 100644
index 7cf532a..0000000
--- a/http/firefox-esr/patches/0022-bgo-860033-firefox-wayland-no-dbus.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -2353,18 +2353,6 @@ with only_when(compile_environment & tar
- )
- set_config("MOZ_D3DCOMPILER_VISTA_DLL_PATH", d3d_compiler_dll.path)
-
--# Remoting protocol support
--# ==============================================================
--
--
--@depends(toolkit)
--def has_remote(toolkit):
-- if toolkit in ("gtk", "windows", "cocoa"):
-- return True
--
--
--set_config("MOZ_HAS_REMOTE", has_remote)
--set_define("MOZ_HAS_REMOTE", has_remote)
-
- # RLBox Library Sandboxing wasm support
- # ==============================================================
-@@ -2900,6 +2888,26 @@ with only_when(toolkit_gtk):
- set_config("MOZ_ENABLE_DBUS", True)
- set_define("MOZ_ENABLE_DBUS", True)
-
-+# Remoting protocol support
-+# ==============================================================
-+
-+@depends(
-+ toolkit,
-+ depends("--enable-dbus", when=toolkit_gtk)(lambda x: x),
-+ depends(wayland_headers, when=toolkit_gtk)(lambda x: x),
-+ depends(x11_headers, when=toolkit_gtk)(lambda x: x),
-+)
-+def has_remote(toolkit, dbus, wayland, x11):
-+ if toolkit in ("windows", "cocoa"):
-+ return True
-+ if toolkit == "gtk":
-+ if not dbus and wayland and not x11:
-+ return
-+ return True
-+
-+
-+set_config("MOZ_HAS_REMOTE", has_remote)
-+set_define("MOZ_HAS_REMOTE", has_remote)
-
- # Necko's wifi scanner
- # ==============================================================
diff --git
a/http/firefox-esr/patches/0022-bmo-1559213-Support-system-av1.patch
b/http/firefox-esr/patches/0022-bmo-1559213-Support-system-av1.patch
new file mode 100644
index 0000000..240ef56
--- /dev/null
+++ b/http/firefox-esr/patches/0022-bmo-1559213-Support-system-av1.patch
@@ -0,0 +1,96 @@
+diff --git a/config/external/moz.build b/config/external/moz.build
+index 2fc8df57992e..63d18e50a961 100644
+--- a/config/external/moz.build
++++ b/config/external/moz.build
+@@ -40,8 +40,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/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+index 5c6e25b3980b..ce99ebfb6d3f 100644
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -81,6 +81,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/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+index 761fc8cf4cd9..793a5b8697a8 100644
+--- a/media/ffvpx/libavcodec/moz.build
++++ b/media/ffvpx/libavcodec/moz.build
+@@ -120,10 +120,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
+ 'vp9recon.c',
+ 'vpx_rac.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']
++ CFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
++ else:
++ USE_LIBS += [
++ 'dav1d',
++ 'media_libdav1d_asm',
++ ]
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ LOCAL_INCLUDES += ['/media/mozva']
+ SOURCES += [
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index f93a5d64fec8..814357f4e979 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -744,7 +744,23 @@ def av1(value):
+ return True
+
+
+-@depends(target, when=av1 & compile_environment)
++option("--with-system-av1",
++ help="Use system av1 (located with pkgconfig)")
++
++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
+@@ -760,6 +776,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
+ # ==============================================================
+
+
diff --git a/http/firefox-esr/patches/0023-bmo-1874059-fix-libcxx-18.patch
b/http/firefox-esr/patches/0023-bmo-1874059-fix-libcxx-18.patch
new file mode 100644
index 0000000..b21a93c
--- /dev/null
+++ b/http/firefox-esr/patches/0023-bmo-1874059-fix-libcxx-18.patch
@@ -0,0 +1,16 @@
+--- a/build/moz.configure/toolchain.configure 2024-03-16 22:53:15.409390707
+0000
++++ b/build/moz.configure/toolchain.configure 2024-03-16 22:57:02.661805132
+0000
+@@ -2183,10 +2183,10 @@
+ set_define("_LIBCPP_HIDE_FROM_ABI",
libcxx_override_visibility.hide_from_abi)
+
+
+-@depends(target, build_environment)
+-def visibility_flags(target, env):
++@depends(target, build_environment, c_compiler)
++def visibility_flags(target, env, c_compiler):
+ if target.os != "WINNT":
+- if target.kernel == "Darwin":
++ if target.kernel == "Darwin" or (c_compiler.type == "clang" and
c_compiler.version >= "17.0.0"):
+ return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
+ return (
+ "-I%s/system_wrappers" % os.path.join(env.dist),
\ No newline at end of file
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
deleted file mode 100644
index 51f7faa..0000000
--- a/http/firefox-esr/patches/0023-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel AT octaforge.org>
-Date: Fri, 23 Sep 2022 02:38:29 +0200
-Subject: [PATCH] fix sqlite3 on ppc with clang
-
-The __ppc__ macro is always defined on clang but not gcc, which
-results in sqlite mistakenly thinking that ppc64le with clang
-is big endian.
-
-Also disable some inline assembly stuff on ppc that is never used
-with gcc and probably was never tested with modern machines.
----
- third_party/sqlite3/src/sqlite3.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/third_party/sqlite3/src/sqlite3.c
b/third_party/sqlite3/src/sqlite3.c
-index 4f3dc68..9017062 100644
---- a/third_party/sqlite3/src/sqlite3.c
-+++ b/third_party/sqlite3/src/sqlite3.c
-@@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
- # if defined(i386) || defined(__i386__) || defined(_M_IX86) ||
\
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) ||
\
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) ||
\
-- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
-+ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||
defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--# elif defined(sparc) || defined(__ppc__) || \
-+# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
- defined(__ARMEB__) || defined(__AARCH64EB__)
- # define SQLITE_BYTEORDER 4321
- # else
-@@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char
**sqlite3CompileOptions(int *pnOpt);
- return val;
- }
-
--#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
-+#elif 0
-
- __inline__ sqlite_uint64 sqlite3Hwtime(void){
- unsigned long long retval;
-@@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
- #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
-- defined(__arm__)
-+ defined(__arm__) || defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--#elif defined(sparc) || defined(__ppc__)
-+#elif defined(sparc) || defined(__BIG_ENDIAN__)
- # define SQLITE_BYTEORDER 4321
- #else
- # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
---
-2.37.3
-
diff --git a/http/firefox-esr/patches/0024-dont-use-build-id.patch
b/http/firefox-esr/patches/0024-dont-use-build-id.patch
new file mode 100644
index 0000000..4ec8ac1
--- /dev/null
+++ b/http/firefox-esr/patches/0024-dont-use-build-id.patch
@@ -0,0 +1,13 @@
+diff '--color=auto' -Naur a/build/moz.configure/flags.configure
b/build/moz.configure/flags.configure
+--- a/build/moz.configure/flags.configure 2024-07-08 20:04:44.944708403
+0300
++++ b/build/moz.configure/flags.configure 2024-07-08 20:13:30.867064722
+0300
+@@ -197,9 +197,6 @@
+
+ check_and_add_flag("-pipe", when=building_with_gcc)
+
+-check_and_add_linker_flag("-Wl,--build-id=uuid", when=check_build_id_uuid)
+-check_and_add_linker_flag("-Wl,--build-id=sha1", when=check_build_id_sha1)
+-
+ check_and_add_asm_flag("-Wa,--noexecstack",
when=building_with_gnu_compatible_cc)
+ check_and_add_linker_flag("-Wl,-z,noexecstack",
when=building_with_gnu_compatible_cc)
+ check_and_add_linker_flag("-Wl,-z,text",
when=building_with_gnu_compatible_cc)
diff --git a/http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
b/http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
deleted file mode 100644
index 699d67a..0000000
--- a/http/firefox-esr/patches/0024-fix-building-gcc-pgo.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-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-bgo-908297-ppc64-webrtc.patch
b/http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
deleted file mode 100644
index 14e8c4a..0000000
--- a/http/firefox-esr/patches/0025-bgo-908297-ppc64-webrtc.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-#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/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
b/http/firefox-esr/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
new file mode 100644
index 0000000..1fca899
--- /dev/null
+++
b/http/firefox-esr/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
@@ -0,0 +1,14 @@
+diff -Naur a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+--- a/media/ffvpx/libavcodec/moz.build 2024-06-07 00:33:58.000000000 +0300
++++ b/media/ffvpx/libavcodec/moz.build 2024-06-10 21:13:44.142620997 +0300
+@@ -143,6 +143,10 @@
+ c11_flags = ["-std=gnu11"]
+ if CONFIG["CC_TYPE"] == "clang-cl":
+ c11_flags.insert(0, "-Xclang")
++
++if CONFIG["CC_TYPE"] == "gcc" and int(CONFIG["CC_VERSION"].split(".")[0])
>= 14:
++ c11_flags.insert(0, "-Wno-error=incompatible-pointer-types")
++
+ CFLAGS += c11_flags
+
+ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
diff --git
a/http/firefox-esr/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
b/http/firefox-esr/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
new file mode 100644
index 0000000..7f4b987
--- /dev/null
+++
b/http/firefox-esr/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
@@ -0,0 +1,16 @@
+
+bgo#925101 for some unknown reason some users are having issues with pgo
crashing. Forcing software
+rendering to be used while pgo'ing doesn't have an impact in performance, as
hwaccel isn't used
+during pgo even when it works. The issue could be caused by
wrongly/automatically
+configured/detected gpu access anyway. The issue seems related to mesa, but
hard to pinpoint.
+
+diff '--color=auto' -Naur a/testing/profiles/profileserver/user.js
b/testing/profiles/profileserver/user.js
+--- a/testing/profiles/profileserver/user.js 2024-07-11 10:37:53.889115118
+0300
++++ b/testing/profiles/profileserver/user.js 2024-07-11 10:40:23.086996283
+0300
+@@ -11,3 +11,6 @@
+ user_pref("extensions.webextensions.warnings-as-errors", false);
+ // Turn off update
+ user_pref("app.update.disabledForTesting", true);
++// bgo#925101 mesa issues with pgo, force software rendering during pgo
++user_pref("gfx.webrender.software", true);
++
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
deleted file mode 100644
index eff08f6..0000000
--- a/http/firefox-esr/patches/0027-bmo-1516803-gcc-lto-sandbox.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-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/0028-enable-vaapi-on-all-amd-cards.patch
b/http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
deleted file mode 100644
index 112cd42..0000000
--- a/http/firefox-esr/patches/0028-enable-vaapi-on-all-amd-cards.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-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/0031-bgo-907963-rustflags-single-string.patch
b/http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
deleted file mode 100644
index a56aec4..0000000
--- a/http/firefox-esr/patches/0031-bgo-907963-rustflags-single-string.patch
+++ /dev/null
@@ -1,76 +0,0 @@
---- 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/0050-fix-for-icu-74.patch
b/http/firefox-esr/patches/0050-fix-for-icu-74.patch
deleted file mode 100644
index 3357f50..0000000
--- a/http/firefox-esr/patches/0050-fix-for-icu-74.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-See https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
-
---- a/intl/lwbrk/LineBreaker.cpp
-+++ b/intl/lwbrk/LineBreaker.cpp
-@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
- /* JT = 34, [JT] */ CLASS_CHARACTER,
- /* JV = 35, [JV] */ CLASS_CHARACTER,
- /* CLOSE_PARENTHESIS = 36, [CP] */
CLASS_CLOSE_LIKE_CHARACTER,
- /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
- /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER,
- /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER,
- /* E_BASE = 40, [EB] */ CLASS_BREAKABLE,
- /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER,
-- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER};
-+ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER,
-+ /* AKSARA = 43, [AK] */ CLASS_CHARACTER,
-+ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER,
-+ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER,
-+ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER,
-+ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER,
-+ };
-
- static_assert(U_LB_COUNT ==
mozilla::ArrayLength(sUnicodeLineBreakToClass),
- "Gecko vs ICU LineBreak class mismatch");
-
- auto cls = GetLineBreakClass(u);
- MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
-
- // Overrides based on rules for the different line-break values given in
- [[SM-Commit] ] GIT changes to master grimoire by Thomas Orgis (72bdcad021479d442ff9046c3f8403b7dc99090b), Thomas Orgis, 03/06/2025
Archive powered by MHonArc 2.6.24.