Skip to Content.
Sympa Menu

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

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (3abd98dfc7c297f4a1b69c78fa1693c54ec9e84a)
  • Date: Mon, 12 Oct 2026 16:58:31 +0000

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

http/firefox/DEPENDS
| 2
http/firefox/DETAILS
| 4
http/firefox/HISTORY
| 5
http/firefox/patches-for-musl/0009-bgo-748849-RUST_TARGET_override.patch
| 61 +
http/firefox/patches-for-musl/0010-bgo-748849-RUST_TARGET_override.patch
| 61 -
http/firefox/patches-for-musl/0011-bgo-929967-fix-pgo-on-musl.patch
| 14
http/firefox/patches-for-musl/0012-bgo-929967-fix-pgo-on-musl.patch
| 14

http/firefox/patches-for-musl/0013-bmo-1657849-musl-sandbox-sched_setscheduler.patch
| 48 +

http/firefox/patches-for-musl/0014-bmo-1657849-musl-sandbox-sched_setscheduler.patch
| 57 -

http/firefox/patches-for-musl/0018-bgo-967694-musl-prctrl-exception-on-musl.patch
| 14

http/firefox/patches-for-musl/0019-bgo-967694-musl-prctrl-exception-on-musl.patch
| 14

http/firefox/patches-for-musl/0019-bgo-970694-fix-missing-stdint.h-on-musl.patch
| 12

http/firefox/patches-for-musl/0020-bgo-970537-add-missing-header-for-musl.patch
| 12

http/firefox/patches-for-musl/0020-bgo-970694-fix-missing-stdint.h-on-musl.patch
| 12

http/firefox/patches-for-musl/0021-bgo-970537-add-missing-header-for-musl.patch
| 12

http/firefox/patches-for-musl/0025-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
| 9

http/firefox/patches-for-musl/0026-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
| 9

http/firefox/patches-for-musl/0027-bmo-2071536-audio_thread_priority-musl-fix.patch
| 395 +++++++++

http/firefox/patches-for-musl/0028-bmo-2071536-audio_thread_priority-musl-fix.patch
| 429 ----------
http/firefox/patches-for-musl/0028-bmo-2074346-musl-fix-parakeet-cpp.patch
| 11
http/firefox/patches-for-musl/0029-bmo-2074346-musl-fix-parakeet-cpp.patch
| 11
http/firefox/patches/0002-bmo-847568-support-system-harfbuzz-graphite2.patch
| 40

http/firefox/patches/0007-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 34
http/firefox/patches/0007-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 12
http/firefox/patches/0008-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 12
http/firefox/patches/0008-gcc-lto-pgo-gentoo.patch
| 152 +++
http/firefox/patches/0009-gcc-lto-pgo-gentoo.patch
| 152 ---
http/firefox/patches/0010-dont-use-build-id.patch
| 13
http/firefox/patches/0011-dont-use-build-id.patch
| 13
http/firefox/patches/0012-gcc-always-inline-from-fedora.patch
| 14
http/firefox/patches/0013-gcc-always-inline-from-fedora.patch
| 14
http/firefox/patches/0014-bgo-940031-wasm-support-firefox-155.patch
| 12
http/firefox/patches/0015-bgo-940031-wasm-support-firefox-155.patch
| 12
http/firefox/patches/0015-bgo-962985-libcxx-visibility-fix.patch
| 19

http/firefox/patches/0016-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
| 22
http/firefox/patches/0016-bgo-962985-libcxx-visibility-fix.patch
| 19

http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
| 22
http/firefox/patches/0017-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
| 10
http/firefox/patches/0018-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
| 10

http/firefox/patches/0021-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
| 20

http/firefox/patches/0022-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
| 21

http/firefox/patches/0022-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
| 20

http/firefox/patches/0023-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
| 21

http/firefox/patches/0023-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
| 10

http/firefox/patches/0024-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
| 10
http/firefox/patches/0024-bmo-2061241-fix-llama-cpp-with-neon.patch
| 67 +
http/firefox/patches/0025-bmo-2061241-fix-llama-cpp-with-neon.patch
| 67 -
http/firefox/patches/0026-bgo-981812-bindgen-libcxx-fix.patch
| 301 +++++++
http/firefox/patches/0027-bgo-981812-bindgen-libcxx-fix.patch
| 301 -------
http/firefox/patches/0029-firefox-158-fix-build-without-dbus.patch
| 15

http/firefox/patches/0030-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
| 15
51 files changed, 1307 insertions(+), 1349 deletions(-)

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

http/firefox: version 158.0, SECURITY_PATCH++

diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index 6d8effe..09035e3 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -51,7 +51,7 @@ depends libwebp "--with-system-webp"
&&

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

-local NSS_BRANCH="3.129" &&
+local NSS_BRANCH="3.130" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
diff --git a/http/firefox/DETAILS b/http/firefox/DETAILS
index 65cdcc7..a61bce7 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,6 +1,6 @@
SPELL=firefox
- VERSION=157.0.1
- SECURITY_PATCH=234
+ VERSION=158.0
+ SECURITY_PATCH=235
SOURCE="${SPELL}-${VERSION}.source.tar.xz"

SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}";
SOURCE2="${SOURCE}.asc"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index fe9355e..dc2eaf2 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2026-10-12 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 158.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.130
+ * patches/*, patches-for-musl/*: updated
+
2026-10-06 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: SECURITY_PATCH++ for 157.0.1

diff --git
a/http/firefox/patches-for-musl/0009-bgo-748849-RUST_TARGET_override.patch
b/http/firefox/patches-for-musl/0009-bgo-748849-RUST_TARGET_override.patch
new file mode 100644
index 0000000..b159cb5
--- /dev/null
+++ b/http/firefox/patches-for-musl/0009-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
+@@ -278,6 +278,7 @@ def rust_supported_targets(rustc):
+ return data
+
+
++@imports('os')
+ def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
+ # Rust's --target options are similar to, but not exactly the same
+ # as, the autoconf-derived targets we use. An example would be that
+@@ -431,7 +432,7 @@ def detect_rustc_target(host_or_target, arm_target,
rust_supported_targets):
+
+ 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/patches-for-musl/0010-bgo-748849-RUST_TARGET_override.patch
b/http/firefox/patches-for-musl/0010-bgo-748849-RUST_TARGET_override.patch
deleted file mode 100644
index b159cb5..0000000
--- a/http/firefox/patches-for-musl/0010-bgo-748849-RUST_TARGET_override.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-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
-@@ -278,6 +278,7 @@ def rust_supported_targets(rustc):
- return data
-
-
-+@imports('os')
- def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
- # Rust's --target options are similar to, but not exactly the same
- # as, the autoconf-derived targets we use. An example would be that
-@@ -431,7 +432,7 @@ def detect_rustc_target(host_or_target, arm_target,
rust_supported_targets):
-
- 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/patches-for-musl/0011-bgo-929967-fix-pgo-on-musl.patch
b/http/firefox/patches-for-musl/0011-bgo-929967-fix-pgo-on-musl.patch
new file mode 100644
index 0000000..3c8457e
--- /dev/null
+++ b/http/firefox/patches-for-musl/0011-bgo-929967-fix-pgo-on-musl.patch
@@ -0,0 +1,14 @@
+diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
+index 7354714..0385792 100755
+--- a/build/pgo/profileserver.py
++++ b/build/pgo/profileserver.py
+@@ -171,6 +171,9 @@ if __name__ == "__main__":
+ env["UPLOAD_PATH"], "profile-run-1.log"
+ )
+
++ # Workaround for https://bugs.gentoo.org/929967
++ env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin")
++
+ # Run Firefox a first time to initialize its profile
+ runner = FirefoxRunner(
+ profile=profile,
diff --git
a/http/firefox/patches-for-musl/0012-bgo-929967-fix-pgo-on-musl.patch
b/http/firefox/patches-for-musl/0012-bgo-929967-fix-pgo-on-musl.patch
deleted file mode 100644
index 3c8457e..0000000
--- a/http/firefox/patches-for-musl/0012-bgo-929967-fix-pgo-on-musl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
-index 7354714..0385792 100755
---- a/build/pgo/profileserver.py
-+++ b/build/pgo/profileserver.py
-@@ -171,6 +171,9 @@ if __name__ == "__main__":
- env["UPLOAD_PATH"], "profile-run-1.log"
- )
-
-+ # Workaround for https://bugs.gentoo.org/929967
-+ env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin")
-+
- # Run Firefox a first time to initialize its profile
- runner = FirefoxRunner(
- profile=profile,
diff --git
a/http/firefox/patches-for-musl/0013-bmo-1657849-musl-sandbox-sched_setscheduler.patch

b/http/firefox/patches-for-musl/0013-bmo-1657849-musl-sandbox-sched_setscheduler.patch
new file mode 100644
index 0000000..4107656
--- /dev/null
+++
b/http/firefox/patches-for-musl/0013-bmo-1657849-musl-sandbox-sched_setscheduler.patch
@@ -0,0 +1,48 @@
+diff --git a/security/sandbox/linux/SandboxFilter.cpp
b/security/sandbox/linux/SandboxFilter.cpp
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1924,12 +1924,20 @@ class GMPSandboxPolicy : public SandboxPolicyCommon {
+ // bug 2071378.
+ case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+- case __NR_sched_getscheduler:
+- case __NR_sched_setscheduler: {
++#if defined(LIBC_GLIBC)
++ case __NR_sched_setscheduler:
++#endif
++ case __NR_sched_getscheduler: {
+ Arg<pid_t> pid(0);
+ return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr));
+ }
+
++#if !defined(LIBC_GLIBC)
++ // For pthread_create(3) on musl; bug 1657849.
++ case __NR_sched_setscheduler:
++ return Allow();
++#endif
++
+ // For clock(3) on older glibcs; bug 1304220.
+ case __NR_times:
+ return Allow();
+@@ -2209,13 +2217,21 @@ class RDDSandboxPolicy final : public
SandboxPolicyCommon {
+ case __NR_sched_getparam:
+ case __NR_sched_setparam:
+ case __NR_sched_getscheduler:
++#if defined(LIBC_GLIBC)
+ case __NR_sched_setscheduler:
++#endif
+ case __NR_sched_getattr:
+ case __NR_sched_setattr: {
+ Arg<pid_t> pid(0);
+ return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr));
+ }
+
++#if !defined(LIBC_GLIBC)
++ // For pthread_create(3) on musl; bug 1657849.
++ case __NR_sched_setscheduler:
++ return Allow();
++#endif
++
+ // The priority bounds are also used, sometimes (bug 1838675):
+ case __NR_sched_get_priority_min:
+ case __NR_sched_get_priority_max:
diff --git
a/http/firefox/patches-for-musl/0014-bmo-1657849-musl-sandbox-sched_setscheduler.patch

b/http/firefox/patches-for-musl/0014-bmo-1657849-musl-sandbox-sched_setscheduler.patch
deleted file mode 100644
index 87b6e66..0000000
---
a/http/firefox/patches-for-musl/0014-bmo-1657849-musl-sandbox-sched_setscheduler.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/security/sandbox/linux/SandboxFilter.cpp
b/security/sandbox/linux/SandboxFilter.cpp
---- a/security/sandbox/linux/SandboxFilter.cpp
-+++ b/security/sandbox/linux/SandboxFilter.cpp
-@@ -1759,16 +1759,24 @@
- return Allow();
- case __NR_sched_get_priority_min:
- case __NR_sched_get_priority_max:
- return Allow();
- case __NR_sched_getparam:
-- case __NR_sched_getscheduler:
-- case __NR_sched_setscheduler: {
-+#if defined(LIBC_GLIBC)
-+ case __NR_sched_setscheduler:
-+#endif
-+ case __NR_sched_getscheduler: {
- Arg<pid_t> pid(0);
- return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr));
- }
-
-+#if !defined(LIBC_GLIBC)
-+ // For pthread_create(3) on musl; bug 1657849.
-+ case __NR_sched_setscheduler:
-+ return Allow();
-+#endif
-+
- // For clock(3) on older glibcs; bug 1304220.
- case __NR_times:
- return Allow();
-
- // Bug 1372428
-@@ -1950,17 +1958,25 @@
- case __NR_sched_getaffinity:
- case __NR_sched_setaffinity:
- case __NR_sched_getparam:
- case __NR_sched_setparam:
- case __NR_sched_getscheduler:
-+#if defined(LIBC_GLIBC)
- case __NR_sched_setscheduler:
-+#endif
- case __NR_sched_getattr:
- case __NR_sched_setattr: {
- Arg<pid_t> pid(0);
- return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr));
- }
-
-+#if !defined(LIBC_GLIBC)
-+ // For pthread_create(3) on musl; bug 1657849.
-+ case __NR_sched_setscheduler:
-+ return Allow();
-+#endif
-+
- // The priority bounds are also used, sometimes (bug 1838675):
- case __NR_sched_get_priority_min:
- case __NR_sched_get_priority_max:
- return Allow();
-
-
diff --git
a/http/firefox/patches-for-musl/0018-bgo-967694-musl-prctrl-exception-on-musl.patch

b/http/firefox/patches-for-musl/0018-bgo-967694-musl-prctrl-exception-on-musl.patch
new file mode 100644
index 0000000..94a4f5b
--- /dev/null
+++
b/http/firefox/patches-for-musl/0018-bgo-967694-musl-prctrl-exception-on-musl.patch
@@ -0,0 +1,14 @@
+Including linux/prrctl.h and sys/prctl.h with musl results in the
redifinition
+of `struct prctl_mm_map`.
+--- a/third_party/libwebrtc/rtc_base/platform_thread_types.cc
++++ b/third_party/libwebrtc/rtc_base/platform_thread_types.cc
+@@ -12,7 +12,9 @@
+
+ // IWYU pragma: begin_keep
+ #if defined(WEBRTC_LINUX)
++#if defined(__GLIBC__)
+ #include <linux/prctl.h>
++#endif
+ #include <sys/prctl.h>
+ #include <sys/syscall.h>
+
diff --git
a/http/firefox/patches-for-musl/0019-bgo-967694-musl-prctrl-exception-on-musl.patch

b/http/firefox/patches-for-musl/0019-bgo-967694-musl-prctrl-exception-on-musl.patch
deleted file mode 100644
index 94a4f5b..0000000
---
a/http/firefox/patches-for-musl/0019-bgo-967694-musl-prctrl-exception-on-musl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Including linux/prrctl.h and sys/prctl.h with musl results in the
redifinition
-of `struct prctl_mm_map`.
---- a/third_party/libwebrtc/rtc_base/platform_thread_types.cc
-+++ b/third_party/libwebrtc/rtc_base/platform_thread_types.cc
-@@ -12,7 +12,9 @@
-
- // IWYU pragma: begin_keep
- #if defined(WEBRTC_LINUX)
-+#if defined(__GLIBC__)
- #include <linux/prctl.h>
-+#endif
- #include <sys/prctl.h>
- #include <sys/syscall.h>
-
diff --git
a/http/firefox/patches-for-musl/0019-bgo-970694-fix-missing-stdint.h-on-musl.patch

b/http/firefox/patches-for-musl/0019-bgo-970694-fix-missing-stdint.h-on-musl.patch
new file mode 100644
index 0000000..6155f06
--- /dev/null
+++
b/http/firefox/patches-for-musl/0019-bgo-970694-fix-missing-stdint.h-on-musl.patch
@@ -0,0 +1,12 @@
+diff --git a/xpcom/base/nsVersionComparator.h
b/xpcom/base/nsVersionComparator.h
+index 1e16bcb..a5a19e3 100644
+--- a/xpcom/base/nsVersionComparator.h
++++ b/xpcom/base/nsVersionComparator.h
+@@ -9,6 +9,7 @@
+ #define nsVersionComparator_h_
+
+ #include <assert.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #if defined(XP_WIN) && !defined(UPDATER_NO_STRING_GLUE_STL)
diff --git
a/http/firefox/patches-for-musl/0020-bgo-970537-add-missing-header-for-musl.patch

b/http/firefox/patches-for-musl/0020-bgo-970537-add-missing-header-for-musl.patch
new file mode 100644
index 0000000..59716d8
--- /dev/null
+++
b/http/firefox/patches-for-musl/0020-bgo-970537-add-missing-header-for-musl.patch
@@ -0,0 +1,12 @@
+diff --git
a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
+index 9b1efa0..a2dbee2 100644
+--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
+@@ -17,6 +17,7 @@
+ #include <string>
+ #include <type_traits>
+ #include <vector>
++#include <sys/types.h>
+
+ // TODO(alcooper): Update include usage in downstream consumers and then
change
+ // this to a forward declaration.
diff --git
a/http/firefox/patches-for-musl/0020-bgo-970694-fix-missing-stdint.h-on-musl.patch

b/http/firefox/patches-for-musl/0020-bgo-970694-fix-missing-stdint.h-on-musl.patch
deleted file mode 100644
index 6155f06..0000000
---
a/http/firefox/patches-for-musl/0020-bgo-970694-fix-missing-stdint.h-on-musl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/xpcom/base/nsVersionComparator.h
b/xpcom/base/nsVersionComparator.h
-index 1e16bcb..a5a19e3 100644
---- a/xpcom/base/nsVersionComparator.h
-+++ b/xpcom/base/nsVersionComparator.h
-@@ -9,6 +9,7 @@
- #define nsVersionComparator_h_
-
- #include <assert.h>
-+#include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
- #if defined(XP_WIN) && !defined(UPDATER_NO_STRING_GLUE_STL)
diff --git
a/http/firefox/patches-for-musl/0021-bgo-970537-add-missing-header-for-musl.patch

b/http/firefox/patches-for-musl/0021-bgo-970537-add-missing-header-for-musl.patch
deleted file mode 100644
index 59716d8..0000000
---
a/http/firefox/patches-for-musl/0021-bgo-970537-add-missing-header-for-musl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git
a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
-index 9b1efa0..a2dbee2 100644
---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
-+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.h
-@@ -17,6 +17,7 @@
- #include <string>
- #include <type_traits>
- #include <vector>
-+#include <sys/types.h>
-
- // TODO(alcooper): Update include usage in downstream consumers and then
change
- // this to a forward declaration.
diff --git
a/http/firefox/patches-for-musl/0025-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch

b/http/firefox/patches-for-musl/0025-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
new file mode 100644
index 0000000..3590e71
--- /dev/null
+++
b/http/firefox/patches-for-musl/0025-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
@@ -0,0 +1,9 @@
+--- a/dom/base/PrefetchCandidates.h 2026-08-24 16:18:13.000000000 -0400
++++ b/dom/base/PrefetchCandidates.h 2026-09-04 08:15:11.208426255 -0400
+@@ -5,6 +5,7 @@
+ #ifndef mozilla_dom_PrefetchCandidates_h
+ #define mozilla_dom_PrefetchCandidates_h
+
++#include <stdint.h>
+ #include "mozilla/UniquePtr.h"
+ #include "nsTArrayForwardDeclare.h"
diff --git
a/http/firefox/patches-for-musl/0026-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch

b/http/firefox/patches-for-musl/0026-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
deleted file mode 100644
index 3590e71..0000000
---
a/http/firefox/patches-for-musl/0026-bgo-981931-musl-unkwown-type-name-uint32_t-fix.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/dom/base/PrefetchCandidates.h 2026-08-24 16:18:13.000000000 -0400
-+++ b/dom/base/PrefetchCandidates.h 2026-09-04 08:15:11.208426255 -0400
-@@ -5,6 +5,7 @@
- #ifndef mozilla_dom_PrefetchCandidates_h
- #define mozilla_dom_PrefetchCandidates_h
-
-+#include <stdint.h>
- #include "mozilla/UniquePtr.h"
- #include "nsTArrayForwardDeclare.h"
diff --git
a/http/firefox/patches-for-musl/0027-bmo-2071536-audio_thread_priority-musl-fix.patch

b/http/firefox/patches-for-musl/0027-bmo-2071536-audio_thread_priority-musl-fix.patch
new file mode 100644
index 0000000..5568ec9
--- /dev/null
+++
b/http/firefox/patches-for-musl/0027-bmo-2071536-audio_thread_priority-musl-fix.patch
@@ -0,0 +1,395 @@
+From 81443b2080eba962852906534a2b205ee11d5ad5 Mon Sep 17 00:00:00 2001
+From: Paul Adenot <paul AT paul.cx>
+Date: Wed, 7 Oct 2026 12:45:26 +0000
+Subject: [PATCH] Bug 2071536 - Fix the build on musl.
+ r=cubeb-reviewers,supply-chain-reviewers,pehrsons
+
+audio_thread_priority didn't compile on musl, this has been fixed
+upstream. audioipc is also updated, the tree now only uses 0.38.
+
+Differential Revision: https://phabricator.services.mozilla.com/D327331
+---
+ .cargo/config.toml.in | 4 +--
+ Cargo.lock | 10 +++---
+ supply-chain/imports.lock | 4 +--
+ .../.cargo-checksum.json | 2 +-
+ .../.cargo_vcs_info.json | 2 +-
+ .../.github/workflows/rust.yml | 36 +++++++++++++++++++
+ .../rust/audio_thread_priority/Cargo.lock | 2 +-
+ .../rust/audio_thread_priority/Cargo.toml | 2 +-
+ .../audio_thread_priority/Cargo.toml.orig | 2 +-
+ .../audio_thread_priority/src/rt_linux.rs | 6 ++--
+ .../src/rt_linux_native.rs | 32 +++++++++++++----
+ .../audioipc2-client/.cargo-checksum.json | 2 +-
+ third_party/rust/audioipc2-client/Cargo.toml | 2 +-
+ .../audioipc2-server/.cargo-checksum.json | 2 +-
+ third_party/rust/audioipc2-server/Cargo.toml | 2 +-
+ .../rust/audioipc2/.cargo-checksum.json | 2 +-
+ third_party/rust/audioipc2/Cargo.toml | 2 +-
+ toolkit/library/rust/shared/Cargo.toml | 6 ++--
+ 18 files changed, 89 insertions(+), 31 deletions(-)
+
+diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in
+index a903b00463844..8b4f608287727 100644
+--- a/.cargo/config.toml.in
++++ b/.cargo/config.toml.in
+@@ -65,9 +65,9 @@ git = "https://github.com/martinthomson/ohttp";
+ rev = "600931b5a1e947776cbaad931ed78f1e89005352"
+ replace-with = "vendored-sources"
+
+-[source."git+https://github.com/mozilla/audioipc?rev=d3c9825";]
++[source."git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8";]
+ git = "https://github.com/mozilla/audioipc";
+-rev = "d3c9825"
++rev = "ef46a7bd05032d1577208ff048d444cc7412c7b8"
+ replace-with = "vendored-sources"
+
+ [source."git+https://github.com/mozilla/authenticator-rs?tag=v0.6.0";]
+diff --git a/Cargo.lock b/Cargo.lock
+index 02c727c6a2241..5ecd60bee9daa 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -336,9 +336,9 @@ dependencies = [
+
+ [[package]]
+ name = "audio_thread_priority"
+-version = "0.37.0"
++version = "0.38.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index";
+-checksum =
"e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6"
++checksum =
"e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab"
+ dependencies = [
+ "cfg-if",
+ "dbus",
+@@ -351,7 +351,7 @@ dependencies = [
+ [[package]]
+ name = "audioipc2"
+ version = "0.6.0"
+-source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
++source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
+ dependencies = [
+ "arrayvec",
+ "ashmem",
+@@ -377,7 +377,7 @@ dependencies = [
+ [[package]]
+ name = "audioipc2-client"
+ version = "0.6.0"
+-source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
++source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
+ dependencies = [
+ "audio_thread_priority",
+ "audioipc2",
+@@ -388,7 +388,7 @@ dependencies = [
+ [[package]]
+ name = "audioipc2-server"
+ version = "0.6.0"
+-source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
++source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
+ dependencies = [
+ "audio_thread_priority",
+ "audioipc2",
+diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
+index 3ee5c35efa206..1f8eb40c6c31c 100644
+--- a/supply-chain/imports.lock
++++ b/supply-chain/imports.lock
+@@ -30,8 +30,8 @@ user-login = "Amanieu"
+ user-name = "Amanieu d'Antras"
+
+ [[publisher.audio_thread_priority]]
+-version = "0.37.0"
+-when = "2026-08-10"
++version = "0.38.0"
++when = "2026-09-17"
+ user-id = 1258
+ user-login = "padenot"
+ user-name = "Paul Adenot"
+diff --git a/third_party/rust/audio_thread_priority/.cargo-checksum.json
b/third_party/rust/audio_thread_priority/.cargo-checksum.json
+index 9690a6292e384..e1e8974824974 100644
+--- a/third_party/rust/audio_thread_priority/.cargo-checksum.json
++++ b/third_party/rust/audio_thread_priority/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{".cargo_vcs_info.json":"13629c1e0aabfcffbae3bddf6a472231b10f973817c0bd549f5e2782036184dd",".github/workflows/rust.yml":"f1ff0376f6d30c204620d50af9c60c4374b7e5001ad290e3bf3595925923f8f2","Cargo.lock":"fff166a1e4746a81e6b2b060692ed73790e8472e7c0526f60f2870baf5edb480","Cargo.toml":"ada29a3c844b5aaa099cea6854b1ca73cf98795ab52b8085c196c2931d08688d","Cargo.toml.orig":"6bdedb288e992ab55fb7d728a7941b1c85fb430c75c72fae685126b87c5f9372","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"53204f6aa158b270a22b4099cde58558ec5ff96292ac8955581b4bcfbf3443d3","src/rt_linux_native.rs":"283ba4e200a1de707a4c336cae5d7f2fec9fc9c7a5a0794c286b4228bfe926b4","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6"}
+\ No newline at end of file
++{"files":{".cargo_vcs_info.json":"941d7dd364a5ca6de04e5a1129197df302d661f809bab3d5ba6d63eb63e364e6",".github/workflows/rust.yml":"0b36b48d6f1976ae3a089596945ef398e02cfcb584a8dd04cb1fc2f16d2fd45f","Cargo.lock":"338d7d500e7cd330949216e3e9e7242cf91439b3eec90a5a75812df7f1fa4108","Cargo.toml":"8f76e327c4ac3c0e333491e7d35c52053574c7ec403b0cc4344893459eaadef8","Cargo.toml.orig":"0f774ee30569ad64f6de4affb15469b240f91086ef2e02320d60e248c853938f","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"6bfb616de5a089279aaa306ca408433c873fe66812b144750f77f9d975cc166d","src/rt_linux_native.rs":"0634c3bc9ad4f4cf86f30735b3234fbd1d544ce28009305fede08ca27e745538","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab"}
+\ No newline at end of file
+diff --git a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
+index 7daddfc03701d..c818c1ab58f09 100644
+--- a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
++++ b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
+@@ -1,6 +1,6 @@
+ {
+ "git": {
+- "sha1": "0aa1ecd7719b582b54f7648eec1f76e9f18cdd3c"
++ "sha1": "f7823feae23ac705d09156eaa84a4deea75fa55e"
+ },
+ "path_in_vcs": ""
+ }
+\ No newline at end of file
+diff --git
a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
+index 8c71d5acb1919..916a27cb5b3a5 100644
+--- a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
++++ b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
+@@ -91,3 +91,39 @@ jobs:
+ sudo prlimit --pid $$ --rtprio=10:10
+ echo "RLIMIT_RTPRIO soft=$(ulimit -Sr) hard=$(ulimit -Hr)"
+ rustup run ${{ matrix.rust }} cargo test --no-default-features
++
++ # musl defines pthread_t as a pointer instead of an integer, unlike glibc.
++ build-musl:
++ runs-on: ubuntu-24.04
++ strategy:
++ matrix:
++ rust: [stable, nightly]
++
++ steps:
++ - uses: actions/checkout@v2
++
++ - name: Install Rust (musl target)
++ run: |
++ rustup toolchain install ${{ matrix.rust }} --profile minimal
++ rustup target add x86_64-unknown-linux-musl --toolchain ${{
matrix.rust }}
++
++ - name: Install Dependencies
++ run: sudo apt-get update && sudo apt-get install libdbus-1-dev
++
++ - name: Build (musl, with dbus)
++ shell: bash
++ # The crate is a staticlib/rlib, so this doesn't link, and hence
needs no musl libdbus: only
++ # the headers, which pkg-config finds for the host.
++ run: PKG_CONFIG_ALLOW_CROSS=1 rustup run ${{ matrix.rust }} cargo
build --target x86_64-unknown-linux-musl --features dbus
++
++ - name: Build (musl, without dbus)
++ shell: bash
++ run: rustup run ${{ matrix.rust }} cargo build --target
x86_64-unknown-linux-musl --no-default-features
++
++ - name: Test (musl, without dbus)
++ shell: bash
++ # Statically linked musl test binaries run fine on the glibc runner.
As in the fallback job,
++ # the native promotion path needs permission to request real-time
scheduling.
++ run: |
++ sudo prlimit --pid $$ --rtprio=10:10
++ rustup run ${{ matrix.rust }} cargo test --target
x86_64-unknown-linux-musl --no-default-features -- --nocapture
+diff --git a/third_party/rust/audio_thread_priority/Cargo.lock
b/third_party/rust/audio_thread_priority/Cargo.lock
+index fa8f0b5f0a7a1..de676cf7f087e 100644
+--- a/third_party/rust/audio_thread_priority/Cargo.lock
++++ b/third_party/rust/audio_thread_priority/Cargo.lock
+@@ -4,7 +4,7 @@ version = 4
+
+ [[package]]
+ name = "audio_thread_priority"
+-version = "0.37.0"
++version = "0.38.0"
+ dependencies = [
+ "cfg-if",
+ "dbus",
+diff --git a/third_party/rust/audio_thread_priority/Cargo.toml
b/third_party/rust/audio_thread_priority/Cargo.toml
+index 8456277e7ed7f..fa1177ffeccf5 100644
+--- a/third_party/rust/audio_thread_priority/Cargo.toml
++++ b/third_party/rust/audio_thread_priority/Cargo.toml
+@@ -12,7 +12,7 @@
+ [package]
+ edition = "2018"
+ name = "audio_thread_priority"
+-version = "0.37.0"
++version = "0.38.0"
+ authors = ["Paul Adenot <paul AT paul.cx>"]
+ build = false
+ autolib = false
+diff --git a/third_party/rust/audio_thread_priority/Cargo.toml.orig
b/third_party/rust/audio_thread_priority/Cargo.toml.orig
+index 1d96d3d8e7a7a..cab6972721335 100644
+--- a/third_party/rust/audio_thread_priority/Cargo.toml.orig
++++ b/third_party/rust/audio_thread_priority/Cargo.toml.orig
+@@ -1,6 +1,6 @@
+ [package]
+ name = "audio_thread_priority"
+-version = "0.37.0"
++version = "0.38.0"
+ authors = ["Paul Adenot <paul AT paul.cx>"]
+ description = "Bump a thread to real-time priority, for audio work, on
Linux, Android, Windows and macOS"
+ license = "MPL-2.0"
+diff --git a/third_party/rust/audio_thread_priority/src/rt_linux.rs
b/third_party/rust/audio_thread_priority/src/rt_linux.rs
+index 982803c3242d5..82f9bff22a499 100644
+--- a/third_party/rust/audio_thread_priority/src/rt_linux.rs
++++ b/third_party/rust/audio_thread_priority/src/rt_linux.rs
+@@ -62,7 +62,9 @@ impl RtPriorityThreadInfoInternal {
+ /// struct, so no uninitialized padding bytes are ever read. Any
trailing padding stays zero.
+ pub fn serialize(&self) -> [u8; std::mem::size_of::<Self>()] {
+ let thread_id = self.thread_id.to_ne_bytes();
+- let pthread_id = self.pthread_id.to_ne_bytes();
++ // `pthread_t` is an integer with glibc but a pointer with musl: go
through `usize`, which
++ // is as wide as both.
++ let pthread_id = (self.pthread_id as usize).to_ne_bytes();
+ let pid = self.pid.to_ne_bytes();
+ let policy = self.policy.to_ne_bytes();
+ let priority = self.priority.to_ne_bytes();
+@@ -91,7 +93,7 @@ impl RtPriorityThreadInfoInternal {
+ let mut src = bytes.iter().copied();
+ RtPriorityThreadInfoInternal {
+ thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)),
+- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)),
++ pthread_id: usize::from_ne_bytes(take(&mut src)) as
libc::pthread_t,
+ pid: libc::pid_t::from_ne_bytes(take(&mut src)),
+ policy: libc::c_int::from_ne_bytes(take(&mut src)),
+ priority: libc::c_int::from_ne_bytes(take(&mut src)),
+diff --git a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
+index def33b09f14ea..9420e89fe6e3f 100644
+--- a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
++++ b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
+@@ -78,7 +78,9 @@ impl RtPriorityThreadInfoInternal {
+ /// struct, so no uninitialized padding bytes are ever read. Any
trailing padding stays zero.
+ pub fn serialize(&self) -> [u8; std::mem::size_of::<Self>()] {
+ let thread_id = self.thread_id.to_ne_bytes();
+- let pthread_id = self.pthread_id.to_ne_bytes();
++ // `pthread_t` is an integer with glibc but a pointer with musl: go
through `usize`, which
++ // is as wide as both.
++ let pthread_id = (self.pthread_id as usize).to_ne_bytes();
+ let pid = self.pid.to_ne_bytes();
+ let policy = self.policy.to_ne_bytes();
+ let priority = self.priority.to_ne_bytes();
+@@ -107,7 +109,7 @@ impl RtPriorityThreadInfoInternal {
+ let mut src = bytes.iter().copied();
+ RtPriorityThreadInfoInternal {
+ thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)),
+- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)),
++ pthread_id: usize::from_ne_bytes(take(&mut src)) as
libc::pthread_t,
+ pid: libc::pid_t::from_ne_bytes(take(&mut src)),
+ policy: libc::c_int::from_ne_bytes(take(&mut src)),
+ priority: libc::c_int::from_ne_bytes(take(&mut src)),
+@@ -140,6 +142,26 @@ fn sched_error(context: &str) ->
AudioThreadPriorityError {
+ AudioThreadPriorityError::new(&format!("{}: {}", context,
OSError::last_os_error()))
+ }
+
++/// Set the scheduling policy and priority of the thread with tid `tid`.
++///
++/// This goes through the syscall directly because musl's
`sched_setscheduler` is a stub that always
++/// fails with `ENOSYS`: POSIX specifies it as process-scoped, which Linux
does not provide. The
++/// syscall is per-thread, which is what is needed here.
++fn sched_setscheduler(
++ tid: libc::pid_t,
++ policy: libc::c_int,
++ param: &libc::sched_param,
++) -> libc::c_long {
++ unsafe {
++ libc::syscall(
++ libc::SYS_sched_setscheduler,
++ tid,
++ policy,
++ param as *const libc::sched_param,
++ )
++ }
++}
++
+ /// A thread's system-wide tid narrowed to `pid_t` for the scheduler
syscalls. A tid always fits in
+ /// `pid_t` (it is a pid), but convert defensively rather than truncating.
+ fn scheduler_tid(thread_id: kernel_pid_t) -> Result<libc::pid_t,
AudioThreadPriorityError> {
+@@ -236,8 +258,7 @@ pub fn promote_thread_to_real_time_internal(
+ let mut param = unsafe { std::mem::zeroed::<libc::sched_param>() };
+ param.sched_priority = requested_priority();
+
+- let rc =
+- unsafe { libc::sched_setscheduler(tid, libc::SCHED_FIFO |
SCHED_RESET_ON_FORK, &param) };
++ let rc = sched_setscheduler(tid, libc::SCHED_FIFO |
SCHED_RESET_ON_FORK, &param);
+ if rc < 0 {
+ return Err(sched_error("could not promote thread"));
+ }
+@@ -254,8 +275,7 @@ pub fn demote_thread_from_real_time_internal(
+ let tid = scheduler_tid(thread_info.thread_id)?;
+ let mut param = unsafe { std::mem::zeroed::<libc::sched_param>() };
+ param.sched_priority = thread_info.priority;
+- let rc =
+- unsafe { libc::sched_setscheduler(tid, thread_info.policy |
SCHED_RESET_ON_FORK, &param) };
++ let rc = sched_setscheduler(tid, thread_info.policy |
SCHED_RESET_ON_FORK, &param);
+ if rc < 0 {
+ return Err(sched_error("could not demote thread"));
+ }
+diff --git a/third_party/rust/audioipc2-client/.cargo-checksum.json
b/third_party/rust/audioipc2-client/.cargo-checksum.json
+index d1b5b396f9b6b..d223c59ba80f7 100644
+--- a/third_party/rust/audioipc2-client/.cargo-checksum.json
++++ b/third_party/rust/audioipc2-client/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"e16f57291b3e7be5e035f2b1793b5864ae091d573df060ff032d484ca608c6a8","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null}
+\ No newline at end of file
++{"files":{"Cargo.toml":"b74876a8e35719161990b55d3b83127d883efcdddce79c866044ba59ab17e849","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null}
+\ No newline at end of file
+diff --git a/third_party/rust/audioipc2-client/Cargo.toml
b/third_party/rust/audioipc2-client/Cargo.toml
+index 19c71182ce6fb..c0abc1f74e091 100644
+--- a/third_party/rust/audioipc2-client/Cargo.toml
++++ b/third_party/rust/audioipc2-client/Cargo.toml
+@@ -36,7 +36,7 @@ cubeb-backend = "0.34"
+ log = "0.4"
+
+ [dependencies.audio_thread_priority]
+-version = "0.37"
++version = "0.38"
+ default-features = false
+
+ [dependencies.audioipc]
+diff --git a/third_party/rust/audioipc2-server/.cargo-checksum.json
b/third_party/rust/audioipc2-server/.cargo-checksum.json
+index d7bab1720f7c1..931775e6ec78b 100644
+--- a/third_party/rust/audioipc2-server/.cargo-checksum.json
++++ b/third_party/rust/audioipc2-server/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"80d2db99b52346498fbdfd082fa294bf962d2442eefaaeb001ef04b009e5100b","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null}
+\ No newline at end of file
++{"files":{"Cargo.toml":"7169f1242e389376f935ea01e29d17d7ebe52fcac3631c332357e1272fab1ba0","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null}
+\ No newline at end of file
+diff --git a/third_party/rust/audioipc2-server/Cargo.toml
b/third_party/rust/audioipc2-server/Cargo.toml
+index 7e00b45c32106..dc16be95944ea 100644
+--- a/third_party/rust/audioipc2-server/Cargo.toml
++++ b/third_party/rust/audioipc2-server/Cargo.toml
+@@ -38,7 +38,7 @@ once_cell = "1.2.0"
+ slab = "0.4"
+
+ [dependencies.audio_thread_priority]
+-version = "0.37"
++version = "0.38"
+ default-features = false
+
+ [dependencies.audioipc]
+diff --git a/third_party/rust/audioipc2/.cargo-checksum.json
b/third_party/rust/audioipc2/.cargo-checksum.json
+index cae4359f76de7..a49135bb208bc 100644
+--- a/third_party/rust/audioipc2/.cargo-checksum.json
++++ b/third_party/rust/audioipc2/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"e5f446c16280d1294e630015be9bda06c489f20dde65c6d3c3b974325e676fdc","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
+\ No newline at end of file
++{"files":{"Cargo.toml":"4381ef3bff9eb36cfb1f0ef7793f09204229d3f7260144a2501ae83ca40b70c1","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
+\ No newline at end of file
+diff --git a/third_party/rust/audioipc2/Cargo.toml
b/third_party/rust/audioipc2/Cargo.toml
+index d9aba1e0d6c9e..c60630877f11e 100644
+--- a/third_party/rust/audioipc2/Cargo.toml
++++ b/third_party/rust/audioipc2/Cargo.toml
+@@ -68,7 +68,7 @@ features = ["html_reports"]
+ ashmem = "0.1.2"
+
+ [target.'cfg(target_os = "linux")'.dependencies.audio_thread_priority]
+-version = "0.37"
++version = "0.38"
+ default-features = false
+
+ [target."cfg(unix)".dependencies]
+diff --git a/toolkit/library/rust/shared/Cargo.toml
b/toolkit/library/rust/shared/Cargo.toml
+index 13f9259c2d5c5..a8cb59c7853eb 100644
+--- a/toolkit/library/rust/shared/Cargo.toml
++++ b/toolkit/library/rust/shared/Cargo.toml
+@@ -27,8 +27,8 @@ webrender_bindings = { path =
"../../../../gfx/webrender_bindings" }
+ cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs";,
rev = "840f69c1b3f95accd582555e10abcef8ee67514b", optional = true }
+ cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs";,
rev="88194f91c8778fa608a19af7b91306094525595d", optional = true,
features=["pulse-dlopen"] }
+ cubeb-sys = { version = "0.34", optional = true, features=["gecko-in-tree"]
}
+-audioipc2-client = { git = "https://github.com/mozilla/audioipc";, rev =
"d3c9825", optional = true }
+-audioipc2-server = { git = "https://github.com/mozilla/audioipc";, rev =
"d3c9825", optional = true }
++audioipc2-client = { git = "https://github.com/mozilla/audioipc";, rev =
"ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true }
++audioipc2-server = { git = "https://github.com/mozilla/audioipc";, rev =
"ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true }
+ encoding_glue = { path = "../../../../intl/encoding_glue" }
+ locale_service_glue = { path =
"../../../../intl/locale/rust/locale_service_glue" }
+ app_collator_glue = { path = "../../../../intl/app_collator_glue" }
+@@ -48,7 +48,7 @@ storage = { path = "../../../../storage/rust" }
+ bookmark_sync = { path = "../../../components/places/bookmark_sync",
optional = true }
+ buildid_reader_ffi = { path = "../../buildid_reader/ffi" }
+ chardetng_c = "1.0.0"
+-audio_thread_priority = { version = "0.37", default-features = false }
++audio_thread_priority = { version = "0.38.0", default-features = false }
+ mdns_service = {
path="../../../../dom/media/webrtc/transport/mdns_service", features =
["profiler"], optional = true }
+ neqo_glue = { path = "../../../../netwerk/socket/neqo_glue" }
+ wgpu_bindings = { path = "../../../../gfx/wgpu_bindings" }
+
diff --git
a/http/firefox/patches-for-musl/0028-bmo-2071536-audio_thread_priority-musl-fix.patch

b/http/firefox/patches-for-musl/0028-bmo-2071536-audio_thread_priority-musl-fix.patch
deleted file mode 100644
index 8a3f373..0000000
---
a/http/firefox/patches-for-musl/0028-bmo-2071536-audio_thread_priority-musl-fix.patch
+++ /dev/null
@@ -1,429 +0,0 @@
-diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in
---- a/.cargo/config.toml.in
-+++ b/.cargo/config.toml.in
-@@ -63,13 +63,13 @@
-
[source."git+https://github.com/martinthomson/ohttp?rev=600931b5a1e947776cbaad931ed78f1e89005352";]
- git = "https://github.com/martinthomson/ohttp";
- rev = "600931b5a1e947776cbaad931ed78f1e89005352"
- replace-with = "vendored-sources"
-
--[source."git+https://github.com/mozilla/audioipc?rev=d3c9825";]
-+[source."git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8";]
- git = "https://github.com/mozilla/audioipc";
--rev = "d3c9825"
-+rev = "ef46a7bd05032d1577208ff048d444cc7412c7b8"
- replace-with = "vendored-sources"
-
- [source."git+https://github.com/mozilla/authenticator-rs?tag=v0.6.0";]
- git = "https://github.com/mozilla/authenticator-rs";
- tag = "v0.6.0"
-diff --git a/Cargo.lock b/Cargo.lock
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -348,13 +348,13 @@
- "bitflags 1.999.999",
- ]
-
- [[package]]
- name = "audio_thread_priority"
--version = "0.37.0"
-+version = "0.38.0"
- source = "registry+https://github.com/rust-lang/crates.io-index";
--checksum =
"e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6"
-+checksum =
"e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab"
- dependencies = [
- "cfg-if",
- "dbus",
- "libc",
- "log",
-@@ -363,11 +363,11 @@
- ]
-
- [[package]]
- name = "audioipc2"
- version = "0.6.0"
--source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
-+source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
- dependencies = [
- "arrayvec",
- "ashmem",
- "audio_thread_priority",
- "bincode",
-@@ -389,22 +389,22 @@
- ]
-
- [[package]]
- name = "audioipc2-client"
- version = "0.6.0"
--source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
-+source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
- dependencies = [
- "audio_thread_priority",
- "audioipc2",
- "cubeb-backend",
- "log",
- ]
-
- [[package]]
- name = "audioipc2-server"
- version = "0.6.0"
--source =
"git+https://github.com/mozilla/audioipc?rev=d3c9825#d3c9825a876a5fc7b54101bd40d685acfc542917";
-+source =
"git+https://github.com/mozilla/audioipc?rev=ef46a7bd05032d1577208ff048d444cc7412c7b8#ef46a7bd05032d1577208ff048d444cc7412c7b8";
- dependencies = [
- "audio_thread_priority",
- "audioipc2",
- "cubeb-core",
- "log",
-diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
---- a/supply-chain/imports.lock
-+++ b/supply-chain/imports.lock
-@@ -32,12 +32,12 @@
- user-id = 2915
- user-login = "Amanieu"
- user-name = "Amanieu d'Antras"
-
- [[publisher.audio_thread_priority]]
--version = "0.37.0"
--when = "2026-08-10"
-+version = "0.38.0"
-+when = "2026-09-17"
- user-id = 1258
- user-login = "padenot"
- user-name = "Paul Adenot"
-
- [[publisher.bhttp]]
-diff --git a/third_party/rust/audio_thread_priority/.cargo-checksum.json
b/third_party/rust/audio_thread_priority/.cargo-checksum.json
---- a/third_party/rust/audio_thread_priority/.cargo-checksum.json
-+++ b/third_party/rust/audio_thread_priority/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{".cargo_vcs_info.json":"13629c1e0aabfcffbae3bddf6a472231b10f973817c0bd549f5e2782036184dd",".github/workflows/rust.yml":"f1ff0376f6d30c204620d50af9c60c4374b7e5001ad290e3bf3595925923f8f2","Cargo.lock":"fff166a1e4746a81e6b2b060692ed73790e8472e7c0526f60f2870baf5edb480","Cargo.toml":"ada29a3c844b5aaa099cea6854b1ca73cf98795ab52b8085c196c2931d08688d","Cargo.toml.orig":"6bdedb288e992ab55fb7d728a7941b1c85fb430c75c72fae685126b87c5f9372","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"53204f6aa158b270a22b4099cde58558ec5ff96292ac8955581b4bcfbf3443d3","src/rt_linux_native.rs":"283ba4e200a1de707a4c336cae5d7f2fec9fc9c7a5a0794c286b4228bfe926b4","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e58c7a923538aa84eef9947d81924fb9f34d7db6004e179218ab57a7bb7700b6"}
-\ No newline at end of file
-+{"files":{".cargo_vcs_info.json":"941d7dd364a5ca6de04e5a1129197df302d661f809bab3d5ba6d63eb63e364e6",".github/workflows/rust.yml":"0b36b48d6f1976ae3a089596945ef398e02cfcb584a8dd04cb1fc2f16d2fd45f","Cargo.lock":"338d7d500e7cd330949216e3e9e7242cf91439b3eec90a5a75812df7f1fa4108","Cargo.toml":"8f76e327c4ac3c0e333491e7d35c52053574c7ec403b0cc4344893459eaadef8","Cargo.toml.orig":"0f774ee30569ad64f6de4affb15469b240f91086ef2e02320d60e248c853938f","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"c32ac62eaa6b9482e5a56c407a47ec470ccadcdc8c95b06d38bd593987975a74","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"6e384fb8103be42882a162f22f5f7350a427ef797d895f662f54953dd9aea59b","src/rt_android.rs":"2e54e3ac527bef0c11790013c9399e1f388752a952af667c85da0f6f53eeb7c9","src/rt_linux.rs":"6bfb616de5a089279aaa306ca408433c873fe66812b144750f77f9d975cc166d","src/rt_linux_native.rs":"0634c3bc9ad4f4cf86f30735b3234fbd1d544ce28009305fede08ca27e745538","src/rt_mach.rs":"723e29ee7392b10c30f803b90a23ec6cd7a8aaaf6e81fe711e86cb6588a13ff0","src/rt_win.rs":"1743f579aea1b29940fee2f0652e23f76e08153ec7cbca621e5720d526e25b96"},"package":"e0b30b2f3d2da482d0faeaafd8f88a38fbc62abb58d3b402cfa195793f4c92ab"}
-\ No newline at end of file
-diff --git a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
---- a/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
-+++ b/third_party/rust/audio_thread_priority/.cargo_vcs_info.json
-@@ -1,6 +1,6 @@
- {
- "git": {
-- "sha1": "0aa1ecd7719b582b54f7648eec1f76e9f18cdd3c"
-+ "sha1": "f7823feae23ac705d09156eaa84a4deea75fa55e"
- },
- "path_in_vcs": ""
- }
-\ No newline at end of file
-diff --git
a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
---- a/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
-+++ b/third_party/rust/audio_thread_priority/.github/workflows/rust.yml
-@@ -89,5 +89,41 @@
- # inherit it. This mirrors a real deployment rather than running the
tests as root.
- run: |
- sudo prlimit --pid $$ --rtprio=10:10
- echo "RLIMIT_RTPRIO soft=$(ulimit -Sr) hard=$(ulimit -Hr)"
- rustup run ${{ matrix.rust }} cargo test --no-default-features
-+
-+ # musl defines pthread_t as a pointer instead of an integer, unlike glibc.
-+ build-musl:
-+ runs-on: ubuntu-24.04
-+ strategy:
-+ matrix:
-+ rust: [stable, nightly]
-+
-+ steps:
-+ - uses: actions/checkout@v2
-+
-+ - name: Install Rust (musl target)
-+ run: |
-+ rustup toolchain install ${{ matrix.rust }} --profile minimal
-+ rustup target add x86_64-unknown-linux-musl --toolchain ${{
matrix.rust }}
-+
-+ - name: Install Dependencies
-+ run: sudo apt-get update && sudo apt-get install libdbus-1-dev
-+
-+ - name: Build (musl, with dbus)
-+ shell: bash
-+ # The crate is a staticlib/rlib, so this doesn't link, and hence
needs no musl libdbus: only
-+ # the headers, which pkg-config finds for the host.
-+ run: PKG_CONFIG_ALLOW_CROSS=1 rustup run ${{ matrix.rust }} cargo
build --target x86_64-unknown-linux-musl --features dbus
-+
-+ - name: Build (musl, without dbus)
-+ shell: bash
-+ run: rustup run ${{ matrix.rust }} cargo build --target
x86_64-unknown-linux-musl --no-default-features
-+
-+ - name: Test (musl, without dbus)
-+ shell: bash
-+ # Statically linked musl test binaries run fine on the glibc runner.
As in the fallback job,
-+ # the native promotion path needs permission to request real-time
scheduling.
-+ run: |
-+ sudo prlimit --pid $$ --rtprio=10:10
-+ rustup run ${{ matrix.rust }} cargo test --target
x86_64-unknown-linux-musl --no-default-features -- --nocapture
-diff --git a/third_party/rust/audio_thread_priority/Cargo.lock
b/third_party/rust/audio_thread_priority/Cargo.lock
---- a/third_party/rust/audio_thread_priority/Cargo.lock
-+++ b/third_party/rust/audio_thread_priority/Cargo.lock
-@@ -2,11 +2,11 @@
- # It is not intended for manual editing.
- version = 4
-
- [[package]]
- name = "audio_thread_priority"
--version = "0.37.0"
-+version = "0.38.0"
- dependencies = [
- "cfg-if",
- "dbus",
- "libc",
- "log 0.4.33",
-diff --git a/third_party/rust/audio_thread_priority/Cargo.toml
b/third_party/rust/audio_thread_priority/Cargo.toml
---- a/third_party/rust/audio_thread_priority/Cargo.toml
-+++ b/third_party/rust/audio_thread_priority/Cargo.toml
-@@ -10,11 +10,11 @@
- # See Cargo.toml.orig for the original contents.
-
- [package]
- edition = "2018"
- name = "audio_thread_priority"
--version = "0.37.0"
-+version = "0.38.0"
- authors = ["Paul Adenot <paul AT paul.cx>"]
- build = false
- autolib = false
- autobins = false
- autoexamples = false
-diff --git a/third_party/rust/audio_thread_priority/Cargo.toml.orig
b/third_party/rust/audio_thread_priority/Cargo.toml.orig
---- a/third_party/rust/audio_thread_priority/Cargo.toml.orig
-+++ b/third_party/rust/audio_thread_priority/Cargo.toml.orig
-@@ -1,8 +1,8 @@
- [package]
- name = "audio_thread_priority"
--version = "0.37.0"
-+version = "0.38.0"
- authors = ["Paul Adenot <paul AT paul.cx>"]
- description = "Bump a thread to real-time priority, for audio work, on
Linux, Android, Windows and macOS"
- license = "MPL-2.0"
- repository = "https://github.com/mozilla/audio_thread_priority";
- edition = "2018"
-diff --git a/third_party/rust/audio_thread_priority/src/rt_linux.rs
b/third_party/rust/audio_thread_priority/src/rt_linux.rs
---- a/third_party/rust/audio_thread_priority/src/rt_linux.rs
-+++ b/third_party/rust/audio_thread_priority/src/rt_linux.rs
-@@ -60,11 +60,13 @@
- impl RtPriorityThreadInfoInternal {
- /// Serialize to a byte buffer. The fields are packed explicitly rather
than transmuting the
- /// struct, so no uninitialized padding bytes are ever read. Any
trailing padding stays zero.
- pub fn serialize(&self) -> [u8; std::mem::size_of::<Self>()] {
- let thread_id = self.thread_id.to_ne_bytes();
-- let pthread_id = self.pthread_id.to_ne_bytes();
-+ // `pthread_t` is an integer with glibc but a pointer with musl: go
through `usize`, which
-+ // is as wide as both.
-+ let pthread_id = (self.pthread_id as usize).to_ne_bytes();
- let pid = self.pid.to_ne_bytes();
- let policy = self.policy.to_ne_bytes();
- let priority = self.priority.to_ne_bytes();
-
- let mut bytes = [0u8; std::mem::size_of::<Self>()];
-@@ -89,11 +91,11 @@
- chunk
- }
- let mut src = bytes.iter().copied();
- RtPriorityThreadInfoInternal {
- thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)),
-- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)),
-+ pthread_id: usize::from_ne_bytes(take(&mut src)) as
libc::pthread_t,
- pid: libc::pid_t::from_ne_bytes(take(&mut src)),
- policy: libc::c_int::from_ne_bytes(take(&mut src)),
- priority: libc::c_int::from_ne_bytes(take(&mut src)),
- }
- }
-diff --git a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
---- a/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
-+++ b/third_party/rust/audio_thread_priority/src/rt_linux_native.rs
-@@ -76,11 +76,13 @@
- impl RtPriorityThreadInfoInternal {
- /// Serialize to a byte buffer. The fields are packed explicitly rather
than transmuting the
- /// struct, so no uninitialized padding bytes are ever read. Any
trailing padding stays zero.
- pub fn serialize(&self) -> [u8; std::mem::size_of::<Self>()] {
- let thread_id = self.thread_id.to_ne_bytes();
-- let pthread_id = self.pthread_id.to_ne_bytes();
-+ // `pthread_t` is an integer with glibc but a pointer with musl: go
through `usize`, which
-+ // is as wide as both.
-+ let pthread_id = (self.pthread_id as usize).to_ne_bytes();
- let pid = self.pid.to_ne_bytes();
- let policy = self.policy.to_ne_bytes();
- let priority = self.priority.to_ne_bytes();
-
- let mut bytes = [0u8; std::mem::size_of::<Self>()];
-@@ -105,11 +107,11 @@
- chunk
- }
- let mut src = bytes.iter().copied();
- RtPriorityThreadInfoInternal {
- thread_id: kernel_pid_t::from_ne_bytes(take(&mut src)),
-- pthread_id: libc::pthread_t::from_ne_bytes(take(&mut src)),
-+ pthread_id: usize::from_ne_bytes(take(&mut src)) as
libc::pthread_t,
- pid: libc::pid_t::from_ne_bytes(take(&mut src)),
- policy: libc::c_int::from_ne_bytes(take(&mut src)),
- priority: libc::c_int::from_ne_bytes(take(&mut src)),
- }
- }
-@@ -138,10 +140,30 @@
- /// The `sched_*` functions are thin syscall wrappers: they return -1 and
set `errno`.
- fn sched_error(context: &str) -> AudioThreadPriorityError {
- AudioThreadPriorityError::new(&format!("{}: {}", context,
OSError::last_os_error()))
- }
-
-+/// Set the scheduling policy and priority of the thread with tid `tid`.
-+///
-+/// This goes through the syscall directly because musl's
`sched_setscheduler` is a stub that always
-+/// fails with `ENOSYS`: POSIX specifies it as process-scoped, which Linux
does not provide. The
-+/// syscall is per-thread, which is what is needed here.
-+fn sched_setscheduler(
-+ tid: libc::pid_t,
-+ policy: libc::c_int,
-+ param: &libc::sched_param,
-+) -> libc::c_long {
-+ unsafe {
-+ libc::syscall(
-+ libc::SYS_sched_setscheduler,
-+ tid,
-+ policy,
-+ param as *const libc::sched_param,
-+ )
-+ }
-+}
-+
- /// A thread's system-wide tid narrowed to `pid_t` for the scheduler
syscalls. A tid always fits in
- /// `pid_t` (it is a pid), but convert defensively rather than truncating.
- fn scheduler_tid(thread_id: kernel_pid_t) -> Result<libc::pid_t,
AudioThreadPriorityError> {
- libc::pid_t::try_from(thread_id)
- .map_err(|_| AudioThreadPriorityError::new("thread id does not fit
in pid_t"))
-@@ -234,12 +256,11 @@
- let tid = scheduler_tid(thread_info.thread_id)?;
-
- let mut param = unsafe { std::mem::zeroed::<libc::sched_param>() };
- param.sched_priority = requested_priority();
-
-- let rc =
-- unsafe { libc::sched_setscheduler(tid, libc::SCHED_FIFO |
SCHED_RESET_ON_FORK, &param) };
-+ let rc = sched_setscheduler(tid, libc::SCHED_FIFO |
SCHED_RESET_ON_FORK, &param);
- if rc < 0 {
- return Err(sched_error("could not promote thread"));
- }
-
- Ok(RtPriorityHandleInternal { thread_info })
-@@ -252,12 +273,11 @@
- // Keep SCHED_RESET_ON_FORK set (see
demote_current_thread_from_real_time_internal): clearing it
- // as an unprivileged thread would fail with EPERM.
- let tid = scheduler_tid(thread_info.thread_id)?;
- let mut param = unsafe { std::mem::zeroed::<libc::sched_param>() };
- param.sched_priority = thread_info.priority;
-- let rc =
-- unsafe { libc::sched_setscheduler(tid, thread_info.policy |
SCHED_RESET_ON_FORK, &param) };
-+ let rc = sched_setscheduler(tid, thread_info.policy |
SCHED_RESET_ON_FORK, &param);
- if rc < 0 {
- return Err(sched_error("could not demote thread"));
- }
- Ok(())
- }
-diff --git a/third_party/rust/audioipc2-client/.cargo-checksum.json
b/third_party/rust/audioipc2-client/.cargo-checksum.json
---- a/third_party/rust/audioipc2-client/.cargo-checksum.json
-+++ b/third_party/rust/audioipc2-client/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{"Cargo.toml":"e16f57291b3e7be5e035f2b1793b5864ae091d573df060ff032d484ca608c6a8","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null}
-\ No newline at end of file
-+{"files":{"Cargo.toml":"b74876a8e35719161990b55d3b83127d883efcdddce79c866044ba59ab17e849","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"c351b782e9bb83a1fbc5127e07a4d06c59978256bb0dc265df256eb948a6cf4e","src/lib.rs":"0322bba9529c81c891bc2c033d402590058014da0df0730dbf9532380c2dabe8","src/send_recv.rs":"cd396a704f205d4ef680f484461a065aa29f624603d5031f9973779826fb3c19","src/stream.rs":"d7d4967c8ef760a58592aff23157357646528c1c83c9de394e1f9c8043f72a81"},"package":null}
-\ No newline at end of file
-diff --git a/third_party/rust/audioipc2-client/Cargo.toml
b/third_party/rust/audioipc2-client/Cargo.toml
---- a/third_party/rust/audioipc2-client/Cargo.toml
-+++ b/third_party/rust/audioipc2-client/Cargo.toml
-@@ -34,11 +34,11 @@
- [dependencies]
- cubeb-backend = "0.34"
- log = "0.4"
-
- [dependencies.audio_thread_priority]
--version = "0.37"
-+version = "0.38"
- default-features = false
-
- [dependencies.audioipc]
- path = "../audioipc"
- package = "audioipc2"
-diff --git a/third_party/rust/audioipc2-server/.cargo-checksum.json
b/third_party/rust/audioipc2-server/.cargo-checksum.json
---- a/third_party/rust/audioipc2-server/.cargo-checksum.json
-+++ b/third_party/rust/audioipc2-server/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{"Cargo.toml":"80d2db99b52346498fbdfd082fa294bf962d2442eefaaeb001ef04b009e5100b","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null}
-\ No newline at end of file
-+{"files":{"Cargo.toml":"7169f1242e389376f935ea01e29d17d7ebe52fcac3631c332357e1272fab1ba0","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"a19c1bad94e16a0cfcd1e93c25b97bf58cc00e9666b5c31652d8a2242decb36c","src/server.rs":"28d494e2d4a6ad673f77912578179eb7b1b8b927d7fd63048d099284d03aeda7"},"package":null}
-\ No newline at end of file
-diff --git a/third_party/rust/audioipc2-server/Cargo.toml
b/third_party/rust/audioipc2-server/Cargo.toml
---- a/third_party/rust/audioipc2-server/Cargo.toml
-+++ b/third_party/rust/audioipc2-server/Cargo.toml
-@@ -36,11 +36,11 @@
- log = "0.4"
- once_cell = "1.2.0"
- slab = "0.4"
-
- [dependencies.audio_thread_priority]
--version = "0.37"
-+version = "0.38"
- default-features = false
-
- [dependencies.audioipc]
- path = "../audioipc"
- package = "audioipc2"
-diff --git a/third_party/rust/audioipc2/.cargo-checksum.json
b/third_party/rust/audioipc2/.cargo-checksum.json
---- a/third_party/rust/audioipc2/.cargo-checksum.json
-+++ b/third_party/rust/audioipc2/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{"Cargo.toml":"e5f446c16280d1294e630015be9bda06c489f20dde65c6d3c3b974325e676fdc","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
-\ No newline at end of file
-+{"files":{"Cargo.toml":"4381ef3bff9eb36cfb1f0ef7793f09204229d3f7260144a2501ae83ca40b70c1","benches/serialization.rs":"495e9128fb7892c3460bf55c6dc56a3d9e8853331f566d43231e30fad2c00ff4","src/codec.rs":"49120cd77f09e4acace1629936157fc9afa0a846c9018ad2dd021b5f0e6577fd","src/errors.rs":"36fe5299aee55761366ddc5dcf2f6fb5d81d8a718c59394b6baeb4075fdfc1a7","src/ipccore.rs":"a06cf09aa600df1280538e7946223ab979f088848213fc9c1a394af312f81fbd","src/lib.rs":"98ba1fe514326d2ef374c9ccc3a7125836cdcc3abe62abcf9a4af0084205538a","src/messages.rs":"d294f24ce018603d2e141af3a06a983421a8da191275937bd2cfa8523064def1","src/rpccore.rs":"058477df2304b4d8c5d1a347663301bcdea3f772762f806963e63a0c8df9ea73","src/shm.rs":"61c9f5d158914cb0ed34d7ce898d1ab24d1a892c68ee0406ff03d01e5c172d32","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"e7b7154d55ce57e16ba93d4982630077bf6c70fa56e572956f14ae15aa43cb4c","src/sys/unix/mod.rs":"de0cd5c7a44cfd7c1f5b8cd0260089dc7245373ff9baa0ce44acfdc2d407a9d1","src/sys/unix/msg.rs":"25244de3eba920fa42e032f8fa4ea4913a9fdeb5124ade61e707f6cc6dd946b0","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
-\ No newline at end of file
-diff --git a/third_party/rust/audioipc2/Cargo.toml
b/third_party/rust/audioipc2/Cargo.toml
---- a/third_party/rust/audioipc2/Cargo.toml
-+++ b/third_party/rust/audioipc2/Cargo.toml
-@@ -66,11 +66,11 @@
-
- [target.'cfg(target_os = "android")'.dependencies]
- ashmem = "0.1.2"
-
- [target.'cfg(target_os = "linux")'.dependencies.audio_thread_priority]
--version = "0.37"
-+version = "0.38"
- default-features = false
-
- [target."cfg(unix)".dependencies]
- arrayvec = "0.7"
- iovec = "0.1"
-diff --git a/toolkit/library/rust/shared/Cargo.toml
b/toolkit/library/rust/shared/Cargo.toml
---- a/toolkit/library/rust/shared/Cargo.toml
-+++ b/toolkit/library/rust/shared/Cargo.toml
-@@ -25,12 +25,12 @@
- harfbuzz_glue = { path = "../../../../gfx/harfbuzz_glue" }
- webrender_bindings = { path = "../../../../gfx/webrender_bindings" }
- cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs";,
rev = "840f69c1b3f95accd582555e10abcef8ee67514b", optional = true }
- cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs";,
rev="88194f91c8778fa608a19af7b91306094525595d", optional = true,
features=["pulse-dlopen"] }
- cubeb-sys = { version = "0.34", optional = true, features=["gecko-in-tree"]
}
--audioipc2-client = { git = "https://github.com/mozilla/audioipc";, rev =
"d3c9825", optional = true }
--audioipc2-server = { git = "https://github.com/mozilla/audioipc";, rev =
"d3c9825", optional = true }
-+audioipc2-client = { git = "https://github.com/mozilla/audioipc";, rev =
"ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true }
-+audioipc2-server = { git = "https://github.com/mozilla/audioipc";, rev =
"ef46a7bd05032d1577208ff048d444cc7412c7b8", optional = true }
- encoding_glue = { path = "../../../../intl/encoding_glue" }
- locale_service_glue = { path =
"../../../../intl/locale/rust/locale_service_glue" }
- app_collator_glue = { path = "../../../../intl/app_collator_glue" }
- authrs_bridge = { path = "../../../../dom/webauthn/authrs_bridge" }
- gkrust_utils = { path = "../../../../xpcom/rust/gkrust_utils" }
-@@ -46,11 +46,11 @@
- bitsdownload = { path = "../../../components/bitsdownload", optional = true
}
- storage = { path = "../../../../storage/rust" }
- bookmark_sync = { path = "../../../components/places/bookmark_sync",
optional = true }
- buildid_reader_ffi = { path = "../../buildid_reader/ffi" }
- chardetng_c = "1.0.0"
--audio_thread_priority = { version = "0.37", default-features = false }
-+audio_thread_priority = { version = "0.38.0", default-features = false }
- mdns_service = {
path="../../../../dom/media/webrtc/transport/mdns_service", optional = true }
- neqo_glue = { path = "../../../../netwerk/socket/neqo_glue" }
- wgpu_bindings = { path = "../../../../gfx/wgpu_bindings" }
- fontations_glue = { path = "../../../../gfx/fontations_glue", optional =
true }
- mapped_hyph = { git = "https://github.com/jfkthame/mapped_hyph.git";, rev =
"eff105f6ad7ec9b79816cfc1985a28e5340ad14b" }
-
diff --git
a/http/firefox/patches-for-musl/0028-bmo-2074346-musl-fix-parakeet-cpp.patch
b/http/firefox/patches-for-musl/0028-bmo-2074346-musl-fix-parakeet-cpp.patch
new file mode 100644
index 0000000..30b12ea
--- /dev/null
+++
b/http/firefox/patches-for-musl/0028-bmo-2074346-musl-fix-parakeet-cpp.patch
@@ -0,0 +1,11 @@
+diff --git a/third_party/parakeet.cpp/src/backend.hpp
b/third_party/parakeet.cpp/src/backend.hpp
+index d534ec9..f17ec23 100644
+--- a/third_party/parakeet.cpp/src/backend.hpp
++++ b/third_party/parakeet.cpp/src/backend.hpp
+@@ -1,5 +1,6 @@
+ #pragma once
+ #include <cstddef>
++#include <cstdint>
+ #include <functional>
+ #include <string>
+ #include <vector>
diff --git
a/http/firefox/patches-for-musl/0029-bmo-2074346-musl-fix-parakeet-cpp.patch
b/http/firefox/patches-for-musl/0029-bmo-2074346-musl-fix-parakeet-cpp.patch
deleted file mode 100644
index 30b12ea..0000000
---
a/http/firefox/patches-for-musl/0029-bmo-2074346-musl-fix-parakeet-cpp.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/third_party/parakeet.cpp/src/backend.hpp
b/third_party/parakeet.cpp/src/backend.hpp
-index d534ec9..f17ec23 100644
---- a/third_party/parakeet.cpp/src/backend.hpp
-+++ b/third_party/parakeet.cpp/src/backend.hpp
-@@ -1,5 +1,6 @@
- #pragma once
- #include <cstddef>
-+#include <cstdint>
- #include <functional>
- #include <string>
- #include <vector>
diff --git
a/http/firefox/patches/0002-bmo-847568-support-system-harfbuzz-graphite2.patch

b/http/firefox/patches/0002-bmo-847568-support-system-harfbuzz-graphite2.patch
index c3c0882..31399d6 100644
---
a/http/firefox/patches/0002-bmo-847568-support-system-harfbuzz-graphite2.patch
+++
b/http/firefox/patches/0002-bmo-847568-support-system-harfbuzz-graphite2.patch
@@ -1,8 +1,8 @@
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 0202ed3..2d8fbdf 100644
+index b8c1415..fafdbb9 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1321,6 +1321,19 @@ if CONFIG["MOZ_SYSTEM_AV1"]:
+@@ -1331,6 +1331,19 @@ if CONFIG["MOZ_SYSTEM_AV1"]:
"dav1d/dav1d.h",
]

@@ -23,10 +23,10 @@ index 0202ed3..2d8fbdf 100644
system_headers += [
"unicode/calendar.h",
diff --git a/dom/base/moz.build b/dom/base/moz.build
-index 7e8d942..93b1822 100644
+index 108ccbf..73cbb21 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
-@@ -610,6 +610,9 @@ FINAL_LIBRARY = "xul"
+@@ -628,6 +628,9 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]

@@ -68,12 +68,12 @@ index 0000000..e0c5c51
+
+FINAL_LIBRARY = 'xul'
diff --git a/gfx/moz.build b/gfx/moz.build
-index 853d855..bdcbb48 100644
+index 86d559e..9415cec 100644
--- a/gfx/moz.build
+++ b/gfx/moz.build
-@@ -8,6 +8,14 @@ with Files("**"):
- with Files("wr/**"):
- BUG_COMPONENT = ("Core", "Graphics: WebRender")
+@@ -14,6 +14,14 @@ with Files("skia/**"):
+ with Files("angle/**"):
+ BUG_COMPONENT = ("Core", "Graphics: ANGLE")

+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
+ DIRS += ["graphite2/geckoextra"]
@@ -86,7 +86,7 @@ index 853d855..bdcbb48 100644
DIRS += [
"cairo",
"2d",
-@@ -17,8 +25,6 @@ DIRS += [
+@@ -23,8 +31,6 @@ DIRS += [
"qcms",
"gl",
"layers",
@@ -96,7 +96,7 @@ index 853d855..bdcbb48 100644
"thebes",
"ipc",
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index c9332ae..e593f2d 100755
+index 2599b54..4f24b22 100755
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -98,6 +98,9 @@ LOCAL_INCLUDES += [
@@ -110,10 +110,10 @@ index c9332ae..e593f2d 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 4f0f150..c74ac83 100644
+index 29e5adf..eeb3765 100644
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
-@@ -651,6 +651,9 @@ LOCAL_INCLUDES += [
+@@ -650,6 +650,9 @@ LOCAL_INCLUDES += [
"/gfx/harfbuzz/src",
]

@@ -124,10 +124,10 @@ index 4f0f150..c74ac83 100644
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index 2bb893d..d69c722 100644
+index 68c4f26..1e3c14f 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
-@@ -294,7 +294,13 @@ if CONFIG["MOZ_WAYLAND"]:
+@@ -287,7 +287,13 @@ if CONFIG["MOZ_WAYLAND"]:

LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]

@@ -157,10 +157,10 @@ index c936134..3528895 100644

GeneratedFile(
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index 2369794..186d279 100644
+index 7e3bff4..693292f 100644
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
-@@ -105,6 +105,9 @@ GeneratedFile(
+@@ -107,6 +107,9 @@ GeneratedFile(
"etld_data.inc", script="prepare_tlds.py",
inputs=["effective_tld_names.dat"]
)

@@ -185,10 +185,10 @@ index 64545f5..a8f9235 100644
if CONFIG["MOZ_WASM_SANDBOXING_OGG"]:
include("/media/libogg/sources.mozbuild")
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index 08de21d..1214623 100644
+index 7ce1adf..a590148 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
-@@ -293,6 +293,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
+@@ -294,6 +294,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
if CONFIG["MOZ_SYSTEM_WEBP"]:
OS_LIBS += CONFIG["MOZ_WEBP_LIBS"]

@@ -202,10 +202,10 @@ index 08de21d..1214623 100644
OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"]

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 75e99bb..30058b3 100644
+index f8149b7..1efab61 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -1341,6 +1341,26 @@ def enable_cairo_ft(target, tree_freetype,
freetype2_info):
+@@ -1289,6 +1289,26 @@ def enable_cairo_ft(target, tree_freetype,
freetype2_info):
set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft)
set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft)

diff --git
a/http/firefox/patches/0007-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0007-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
deleted file mode 100644
index 32bd0eb..0000000
---
a/http/firefox/patches/0007-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 685e82ac82921720c6cd9c6c45703ff034f081e7 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Sat, 29 Aug 2020 22:30:59 +0200
-Subject: [PATCH 25/30] LTO: Only enable LTO for Rust when complete build uses
- LTO
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- config/makefiles/rust.mk | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
-index 75570d32b9..924722a506 100644
---- a/config/makefiles/rust.mk
-+++ b/config/makefiles/rust.mk
-@@ -87,6 +87,7 @@ endif
- # These flags are passed via `cargo rustc` and only apply to the final rustc
- # invocation (i.e., only the top-level crate, not its dependencies).
- cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
-+ifdef MOZ_LTO
- ifndef DEVELOPER_OPTIONS
- ifndef MOZ_DEBUG_RUST
- # Enable link-time optimization for release builds, but not when linking
-@@ -106,6 +107,7 @@ endif
- endif
- endif
- endif
-+endif
-
- ifdef CARGO_INCREMENTAL
- export CARGO_INCREMENTAL
---
-2.34.1
-
diff --git
a/http/firefox/patches/0007-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0007-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..ac405c6
--- /dev/null
+++ b/http/firefox/patches/0007-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
@@ -0,0 +1,12 @@
+diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777
firefox-133.0/widget/gtk/nsWindow.cpp
+--- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22
09:32:52.293470407 +0100
++++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520
+0100
+@@ -191,7 +191,7 @@ constexpr gint kEvents =
+ GDK_VISIBILITY_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_SMOOTH_SCROLL_MASK |
+ GDK_TOUCH_MASK | GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK |
+- GDK_PROPERTY_CHANGE_MASK;
++ GDK_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK;
+
+ /* utility functions */
+ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git
a/http/firefox/patches/0008-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0008-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
deleted file mode 100644
index ac405c6..0000000
--- a/http/firefox/patches/0008-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777
firefox-133.0/widget/gtk/nsWindow.cpp
---- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22
09:32:52.293470407 +0100
-+++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520
+0100
-@@ -191,7 +191,7 @@ constexpr gint kEvents =
- GDK_VISIBILITY_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_SMOOTH_SCROLL_MASK |
- GDK_TOUCH_MASK | GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK |
-- GDK_PROPERTY_CHANGE_MASK;
-+ GDK_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK;
-
- /* utility functions */
- static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git a/http/firefox/patches/0008-gcc-lto-pgo-gentoo.patch
b/http/firefox/patches/0008-gcc-lto-pgo-gentoo.patch
new file mode 100644
index 0000000..8956bf7
--- /dev/null
+++ b/http/firefox/patches/0008-gcc-lto-pgo-gentoo.patch
@@ -0,0 +1,152 @@
+diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
+index 165541b79842..372e100bc6c2 100644
+--- a/build/moz.configure/lto-pgo.configure
++++ b/build/moz.configure/lto-pgo.configure
+@@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
+
+ @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
+
+@@ -145,7 +149,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 --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
+index faf15719a053..dde982ef09a4 100755
+--- a/build/pgo/profileserver.py
++++ b/build/pgo/profileserver.py
+@@ -96,9 +96,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
+@@ -228,6 +241,11 @@ if __name__ == "__main__":
+ print("Firefox exited successfully, but produced a crashreport")
+ sys.exit(1)
+
++ if using_gcc:
++ print('Copying profile data....')
++ os.system('pwd');
++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd
..; tar xf instrumented/profdata.tar.gz;');
++
+ llvm_profdata = env.get("LLVM_PROFDATA")
+ if llvm_profdata:
+ profraw_files = glob.glob("*.profraw")
+diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build
+index 47de487..c4f4322 100644
+--- a/gfx/2d/moz.build
++++ b/gfx/2d/moz.build
+@@ -132,11 +132,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
+ DEFINES["USE_SSE2"] = True
+ # The file uses SSE2 intrinsics, so it needs special compile flags on
some
+ # compilers.
+- 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"]
+
+diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
+index 8f2fa5ddbd49..8ed44780fdc3 100755
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ 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 --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+index b944b3fad445..329aa846385b 100644
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -603,8 +603,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ 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 --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+index c346b8574921..f682ef9f2923 100644
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -112,9 +112,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+ # gcc lto likes to put the top level asm in syscall.cc in a different
partition
+ # from the function using it which breaks the build. Work around that by
+ # forcing there to be only one partition.
+-for f in CONFIG["OS_CXXFLAGS"]:
+- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
+- LDFLAGS += ["--param lto-partitions=1"]
++if CONFIG['CC_TYPE'] != 'clang':
++ LDFLAGS += ['--param', 'lto-partitions=1']
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
+diff --git a/toolkit/components/terminator/nsTerminator.cpp
b/toolkit/components/terminator/nsTerminator.cpp
+--- a/toolkit/components/terminator/nsTerminator.cpp
++++ b/toolkit/components/terminator/nsTerminator.cpp
+@@ -403,6 +403,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;
++
+ // Guarantee that gCrashAfterTicks is non-zero
+ gCrashAfterTicks = std::max(1, crashAfterMS / HEARTBEAT_INTERVAL_MS);
+
diff --git a/http/firefox/patches/0009-gcc-lto-pgo-gentoo.patch
b/http/firefox/patches/0009-gcc-lto-pgo-gentoo.patch
deleted file mode 100644
index 581d362..0000000
--- a/http/firefox/patches/0009-gcc-lto-pgo-gentoo.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-diff --git a/build/moz.configure/lto-pgo.configure
b/build/moz.configure/lto-pgo.configure
-index 165541b79842..372e100bc6c2 100644
---- a/build/moz.configure/lto-pgo.configure
-+++ b/build/moz.configure/lto-pgo.configure
-@@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
-
- @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
-
-@@ -145,7 +149,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 --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
-index faf15719a053..dde982ef09a4 100755
---- a/build/pgo/profileserver.py
-+++ b/build/pgo/profileserver.py
-@@ -96,9 +96,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
-@@ -228,6 +241,11 @@ if __name__ == "__main__":
- print("Firefox exited successfully, but produced a crashreport")
- sys.exit(1)
-
-+ if using_gcc:
-+ print('Copying profile data....')
-+ os.system('pwd');
-+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd
..; tar xf instrumented/profdata.tar.gz;');
-+
- llvm_profdata = env.get("LLVM_PROFDATA")
- if llvm_profdata:
- profraw_files = glob.glob("*.profraw")
-diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build
-index 47de487..c4f4322 100644
---- a/gfx/2d/moz.build
-+++ b/gfx/2d/moz.build
-@@ -132,11 +132,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
- DEFINES["USE_SSE2"] = True
- # The file uses SSE2 intrinsics, so it needs special compile flags on
some
- # compilers.
-- 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"]
-
-diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index 8f2fa5ddbd49..8ed44780fdc3 100755
---- a/gfx/skia/generate_mozbuild.py
-+++ b/gfx/skia/generate_mozbuild.py
-@@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- 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 --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index b944b3fad445..329aa846385b 100644
---- a/gfx/skia/moz.build
-+++ b/gfx/skia/moz.build
-@@ -603,8 +603,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- 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 --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
-index c346b8574921..f682ef9f2923 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -112,9 +112,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- # gcc lto likes to put the top level asm in syscall.cc in a different
partition
- # from the function using it which breaks the build. Work around that by
- # forcing there to be only one partition.
--for f in CONFIG["OS_CXXFLAGS"]:
-- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param lto-partitions=1"]
-+if CONFIG['CC_TYPE'] != 'clang':
-+ LDFLAGS += ['--param', 'lto-partitions=1']
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
-diff -up firefox-149.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-149.0/toolkit/components/terminator/nsTerminator.cpp
---- firefox-149.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2026-03-18 19:54:05.000000000 +0100
-+++ firefox-149.0/toolkit/components/terminator/nsTerminator.cpp
2026-03-19 16:01:55.737755729 +0100
-@@ -338,6 +338,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());
- // Guarantee that crashAfterTicks is non-zero
- options->crashAfterTicks = std::max(1, crashAfterMS /
HEARTBEAT_INTERVAL_MS);
diff --git a/http/firefox/patches/0010-dont-use-build-id.patch
b/http/firefox/patches/0010-dont-use-build-id.patch
new file mode 100644
index 0000000..4ec8ac1
--- /dev/null
+++ b/http/firefox/patches/0010-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/patches/0011-dont-use-build-id.patch
b/http/firefox/patches/0011-dont-use-build-id.patch
deleted file mode 100644
index 4ec8ac1..0000000
--- a/http/firefox/patches/0011-dont-use-build-id.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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/patches/0012-gcc-always-inline-from-fedora.patch
b/http/firefox/patches/0012-gcc-always-inline-from-fedora.patch
new file mode 100644
index 0000000..d7af60f
--- /dev/null
+++ b/http/firefox/patches/0012-gcc-always-inline-from-fedora.patch
@@ -0,0 +1,14 @@
+diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline
firefox-114.0.2/gfx/wr/swgl/src/gl.cc
+--- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22
11:08:53.294593327 +0200
++++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734
+0200
+@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF
+ }
+
+ #else
+-// GCC is slower when dealing with always_inline, especially in debug
builds.
+-// When using Clang, use always_inline more aggressively.
+-# if defined(__clang__) || defined(NDEBUG)
++# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG)
+ # define ALWAYS_INLINE __attribute__((always_inline)) inline
+ # else
+ # define ALWAYS_INLINE inline
diff --git a/http/firefox/patches/0013-gcc-always-inline-from-fedora.patch
b/http/firefox/patches/0013-gcc-always-inline-from-fedora.patch
deleted file mode 100644
index d7af60f..0000000
--- a/http/firefox/patches/0013-gcc-always-inline-from-fedora.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline
firefox-114.0.2/gfx/wr/swgl/src/gl.cc
---- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22
11:08:53.294593327 +0200
-+++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734
+0200
-@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF
- }
-
- #else
--// GCC is slower when dealing with always_inline, especially in debug
builds.
--// When using Clang, use always_inline more aggressively.
--# if defined(__clang__) || defined(NDEBUG)
-+# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG)
- # define ALWAYS_INLINE __attribute__((always_inline)) inline
- # else
- # define ALWAYS_INLINE inline
diff --git
a/http/firefox/patches/0014-bgo-940031-wasm-support-firefox-155.patch
b/http/firefox/patches/0014-bgo-940031-wasm-support-firefox-155.patch
new file mode 100644
index 0000000..c43715b
--- /dev/null
+++ b/http/firefox/patches/0014-bgo-940031-wasm-support-firefox-155.patch
@@ -0,0 +1,12 @@
+diff '--color=auto' -Naur a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure 2026-09-01 18:05:09.492296661 +0300
++++ b/toolkit/moz.configure 2026-09-01 18:08:20.854288110 +0300
+@@ -2900,7 +2900,7 @@
+ def wasi_sysroot_flags(wasi_sysroot):
+ if wasi_sysroot:
+ log.info("Using wasi sysroot in %s", wasi_sysroot)
+- return ["--sysroot=%s" % wasi_sysroot]
++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc",
"-lwasi-emulated-process-clocks", "-isystem",
"%s/include/wasm32-wasip1/noeh/c++/v1" % wasi_sysroot,
"%s/lib/wasm32-wasip1/noeh/libc++.a" % wasi_sysroot,
"%s/lib/wasm32-wasip1/noeh/libc++abi.a" % wasi_sysroot,
"%%PORTAGE_WORKDIR%%/wasi-sdk-%%WASI_SDK_VER%%-%%WASI_ARCH%%-linux/lib/clang/%%WASI_SDK_LLVM_VER%%/lib/wasm32-unknown-wasip1/libclang_rt.builtins.a"]
+ return []
+
+ set_config("WASI_SYSROOT", wasi_sysroot)
diff --git
a/http/firefox/patches/0015-bgo-940031-wasm-support-firefox-155.patch
b/http/firefox/patches/0015-bgo-940031-wasm-support-firefox-155.patch
deleted file mode 100644
index c43715b..0000000
--- a/http/firefox/patches/0015-bgo-940031-wasm-support-firefox-155.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff '--color=auto' -Naur a/toolkit/moz.configure b/toolkit/moz.configure
---- a/toolkit/moz.configure 2026-09-01 18:05:09.492296661 +0300
-+++ b/toolkit/moz.configure 2026-09-01 18:08:20.854288110 +0300
-@@ -2900,7 +2900,7 @@
- def wasi_sysroot_flags(wasi_sysroot):
- if wasi_sysroot:
- log.info("Using wasi sysroot in %s", wasi_sysroot)
-- return ["--sysroot=%s" % wasi_sysroot]
-+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc",
"-lwasi-emulated-process-clocks", "-isystem",
"%s/include/wasm32-wasip1/noeh/c++/v1" % wasi_sysroot,
"%s/lib/wasm32-wasip1/noeh/libc++.a" % wasi_sysroot,
"%s/lib/wasm32-wasip1/noeh/libc++abi.a" % wasi_sysroot,
"%%PORTAGE_WORKDIR%%/wasi-sdk-%%WASI_SDK_VER%%-%%WASI_ARCH%%-linux/lib/clang/%%WASI_SDK_LLVM_VER%%/lib/wasm32-unknown-wasip1/libclang_rt.builtins.a"]
- return []
-
- set_config("WASI_SYSROOT", wasi_sysroot)
diff --git a/http/firefox/patches/0015-bgo-962985-libcxx-visibility-fix.patch
b/http/firefox/patches/0015-bgo-962985-libcxx-visibility-fix.patch
new file mode 100644
index 0000000..13f7e71
--- /dev/null
+++ b/http/firefox/patches/0015-bgo-962985-libcxx-visibility-fix.patch
@@ -0,0 +1,19 @@
+diff --git a/build/moz.configure/toolchain.configure
b/build/moz.configure/toolchain.configure
+index b2192e4066..9c8de4636b 100644
+--- a/build/moz.configure/toolchain.configure
++++ b/build/moz.configure/toolchain.configure
+@@ -2217,10 +2217,11 @@ set_define("_LIBCPP_HIDE_FROM_ABI",
libcxx_override_visibility.hide_from_abi)
+ set_define("_LIBCPP_REMOVE_TRANSITIVE_INCLUDES", True, when=using_libcxx)
+
+
+-@depends(target, build_environment)
+-def visibility_flags(target, env):
++@depends(target, build_environment,
++ try_compile(language="C++", includes=["new"], body="#ifndef
_LIBCPP_VERSION\n#error 1\n#endif"))
++def visibility_flags(target, env, using_libcxx):
+ if target.os != "WINNT":
+- if target.kernel in ("Darwin", "FreeBSD", "OpenBSD"):
++ if using_libcxx:
+ return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
+ return (
+ "-I%s/system_wrappers" % os.path.join(env.dist),
diff --git
a/http/firefox/patches/0016-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch

b/http/firefox/patches/0016-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
new file mode 100644
index 0000000..49d3433
--- /dev/null
+++
b/http/firefox/patches/0016-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
@@ -0,0 +1,22 @@
+diff '--color=auto' -Naur a/security/sandbox/linux/Sandbox.cpp
b/security/sandbox/linux/Sandbox.cpp
+--- a/security/sandbox/linux/Sandbox.cpp 2026-08-18 09:10:53.293670719
+0300
++++ b/security/sandbox/linux/Sandbox.cpp 2026-08-18 09:12:21.961307710
+0300
+@@ -18,9 +18,7 @@
+ #include <sys/syscall.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+-#ifdef NIGHTLY_BUILD
+-# include <dlfcn.h>
+-#endif
++#include <dlfcn.h>
+
+ #include "LinuxSched.h"
+ #include "SandboxBrokerClient.h"
+@@ -771,6 +769,7 @@
+ files->Add("/proc/net/unix", SandboxOpenedFile::Error{});
+ files->Add("/proc/self/maps", SandboxOpenedFile::Error{});
+
++ (void)dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY);
+ // Finally, start the sandbox.
+ SetCurrentProcessSandbox(GetMediaSandboxPolicy(files));
+ }
diff --git a/http/firefox/patches/0016-bgo-962985-libcxx-visibility-fix.patch
b/http/firefox/patches/0016-bgo-962985-libcxx-visibility-fix.patch
deleted file mode 100644
index 13f7e71..0000000
--- a/http/firefox/patches/0016-bgo-962985-libcxx-visibility-fix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/build/moz.configure/toolchain.configure
b/build/moz.configure/toolchain.configure
-index b2192e4066..9c8de4636b 100644
---- a/build/moz.configure/toolchain.configure
-+++ b/build/moz.configure/toolchain.configure
-@@ -2217,10 +2217,11 @@ set_define("_LIBCPP_HIDE_FROM_ABI",
libcxx_override_visibility.hide_from_abi)
- set_define("_LIBCPP_REMOVE_TRANSITIVE_INCLUDES", True, when=using_libcxx)
-
-
--@depends(target, build_environment)
--def visibility_flags(target, env):
-+@depends(target, build_environment,
-+ try_compile(language="C++", includes=["new"], body="#ifndef
_LIBCPP_VERSION\n#error 1\n#endif"))
-+def visibility_flags(target, env, using_libcxx):
- if target.os != "WINNT":
-- if target.kernel in ("Darwin", "FreeBSD", "OpenBSD"):
-+ if using_libcxx:
- return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
- return (
- "-I%s/system_wrappers" % os.path.join(env.dist),
diff --git
a/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch

b/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
deleted file mode 100644
index 49d3433..0000000
---
a/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff '--color=auto' -Naur a/security/sandbox/linux/Sandbox.cpp
b/security/sandbox/linux/Sandbox.cpp
---- a/security/sandbox/linux/Sandbox.cpp 2026-08-18 09:10:53.293670719
+0300
-+++ b/security/sandbox/linux/Sandbox.cpp 2026-08-18 09:12:21.961307710
+0300
-@@ -18,9 +18,7 @@
- #include <sys/syscall.h>
- #include <sys/time.h>
- #include <unistd.h>
--#ifdef NIGHTLY_BUILD
--# include <dlfcn.h>
--#endif
-+#include <dlfcn.h>
-
- #include "LinuxSched.h"
- #include "SandboxBrokerClient.h"
-@@ -771,6 +769,7 @@
- files->Add("/proc/net/unix", SandboxOpenedFile::Error{});
- files->Add("/proc/self/maps", SandboxOpenedFile::Error{});
-
-+ (void)dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY);
- // Finally, start the sandbox.
- SetCurrentProcessSandbox(GetMediaSandboxPolicy(files));
- }
diff --git
a/http/firefox/patches/0017-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
b/http/firefox/patches/0017-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
new file mode 100644
index 0000000..2346358
--- /dev/null
+++
b/http/firefox/patches/0017-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
@@ -0,0 +1,10 @@
+--- a/intl/components/src/TimeZone.cpp
++++ b/intl/components/src/TimeZone.cpp
+@@ -4,6 +4,7 @@
+
+ #include "mozilla/intl/TimeZone.h"
+
++#include "mozilla/Try.h"
+ #include "mozilla/Vector.h"
+
+ #include <algorithm>
diff --git
a/http/firefox/patches/0018-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
b/http/firefox/patches/0018-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
deleted file mode 100644
index 2346358..0000000
---
a/http/firefox/patches/0018-bgo-966424-PR_GetEnv-non-unified-build-fix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/intl/components/src/TimeZone.cpp
-+++ b/intl/components/src/TimeZone.cpp
-@@ -4,6 +4,7 @@
-
- #include "mozilla/intl/TimeZone.h"
-
-+#include "mozilla/Try.h"
- #include "mozilla/Vector.h"
-
- #include <algorithm>
diff --git
a/http/firefox/patches/0021-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch

b/http/firefox/patches/0021-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
new file mode 100644
index 0000000..5454760
--- /dev/null
+++
b/http/firefox/patches/0021-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
@@ -0,0 +1,20 @@
+# Shuffle -Wno-incompatible-pointer-types from clang-only to match with gcc
as well.
+#
+# <+sam_> I'd expect that to fail with clang too, but I think only with >=22
(https://github.com/llvm/llvm-project/issues/74605)
+
+diff '--color=auto' -Naur a/media/ffvpx/ffvpxcommon.mozbuild
b/media/ffvpx/ffvpxcommon.mozbuild
+--- a/media/ffvpx/ffvpxcommon.mozbuild 2026-04-20 19:12:06.303537185 +0300
++++ b/media/ffvpx/ffvpxcommon.mozbuild 2026-04-20 19:13:00.046200239 +0300
+@@ -35,11 +35,11 @@
+ '-Wno-unused-function',
+ # XXX This does not seem to have any effect on some versions of GCC.
+ '-Wno-deprecated-declarations',
++ '-Wno-incompatible-pointer-types',
+ ]
+ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ CFLAGS += [
+ '-Wno-absolute-value',
+- '-Wno-incompatible-pointer-types',
+ '-Wno-string-conversion',
+ '-Wno-visibility',
+ ]
diff --git
a/http/firefox/patches/0022-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch

b/http/firefox/patches/0022-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
new file mode 100644
index 0000000..5adc2a3
--- /dev/null
+++
b/http/firefox/patches/0022-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
@@ -0,0 +1,21 @@
+--- a/ipc/glue/SharedMemoryHandle.h 2026-05-08 09:41:05.625846466 -0400
++++ b/ipc/glue/SharedMemoryHandle.h 2026-05-08 09:40:58.170035583 -0400
+@@ -5,6 +5,7 @@
+ #ifndef mozilla_ipc_SharedMemoryHandle_h
+ #define mozilla_ipc_SharedMemoryHandle_h
+
++#include <cstdint>
+ #include <utility>
+
+ #include "mozilla/UniquePtrExtensions.h"
+--- a/modules/woff2/include/woff2/output.h 2026-04-27 09:33:07.000000000
-0400
++++ b/modules/woff2/include/woff2/output.h 2026-05-08 20:55:09.770322838
-0400
+@@ -10,6 +10,7 @@
+ #define WOFF2_WOFF2_OUT_H_
+
+ #include <algorithm>
++#include <cstdint>
+ #include <cstring>
+ #include <memory>
+ #include <string>
+
\ No newline at end of file
diff --git
a/http/firefox/patches/0022-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch

b/http/firefox/patches/0022-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
deleted file mode 100644
index 5454760..0000000
---
a/http/firefox/patches/0022-ignore-Wincompatible-pointer-types-with-gcc-when-building-ffmpeg.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-# Shuffle -Wno-incompatible-pointer-types from clang-only to match with gcc
as well.
-#
-# <+sam_> I'd expect that to fail with clang too, but I think only with >=22
(https://github.com/llvm/llvm-project/issues/74605)
-
-diff '--color=auto' -Naur a/media/ffvpx/ffvpxcommon.mozbuild
b/media/ffvpx/ffvpxcommon.mozbuild
---- a/media/ffvpx/ffvpxcommon.mozbuild 2026-04-20 19:12:06.303537185 +0300
-+++ b/media/ffvpx/ffvpxcommon.mozbuild 2026-04-20 19:13:00.046200239 +0300
-@@ -35,11 +35,11 @@
- '-Wno-unused-function',
- # XXX This does not seem to have any effect on some versions of GCC.
- '-Wno-deprecated-declarations',
-+ '-Wno-incompatible-pointer-types',
- ]
- if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
- CFLAGS += [
- '-Wno-absolute-value',
-- '-Wno-incompatible-pointer-types',
- '-Wno-string-conversion',
- '-Wno-visibility',
- ]
diff --git
a/http/firefox/patches/0023-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch

b/http/firefox/patches/0023-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
deleted file mode 100644
index 5adc2a3..0000000
---
a/http/firefox/patches/0023-bgo-973544-add-cstdints-to-ipc-glue-and-woff2.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ipc/glue/SharedMemoryHandle.h 2026-05-08 09:41:05.625846466 -0400
-+++ b/ipc/glue/SharedMemoryHandle.h 2026-05-08 09:40:58.170035583 -0400
-@@ -5,6 +5,7 @@
- #ifndef mozilla_ipc_SharedMemoryHandle_h
- #define mozilla_ipc_SharedMemoryHandle_h
-
-+#include <cstdint>
- #include <utility>
-
- #include "mozilla/UniquePtrExtensions.h"
---- a/modules/woff2/include/woff2/output.h 2026-04-27 09:33:07.000000000
-0400
-+++ b/modules/woff2/include/woff2/output.h 2026-05-08 20:55:09.770322838
-0400
-@@ -10,6 +10,7 @@
- #define WOFF2_WOFF2_OUT_H_
-
- #include <algorithm>
-+#include <cstdint>
- #include <cstring>
- #include <memory>
- #include <string>
-
\ No newline at end of file
diff --git
a/http/firefox/patches/0023-bgo-976592-file-path-include-fstream-gcc-17-fix.patch

b/http/firefox/patches/0023-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
new file mode 100644
index 0000000..8cc49e7
--- /dev/null
+++
b/http/firefox/patches/0023-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
@@ -0,0 +1,10 @@
+--- a/ipc/chromium/src/base/file_path.h 2026-06-01 23:46:34.196804054
+0100
++++ b/ipc/chromium/src/base/file_path.h 2026-06-01 23:46:50.452943680
+0100
+@@ -65,6 +65,7 @@
+ #ifndef BASE_FILE_PATH_H_
+ #define BASE_FILE_PATH_H_
+
++#include <fstream>
+ #include <string>
+
+ #include "base/basictypes.h"
diff --git
a/http/firefox/patches/0024-bgo-976592-file-path-include-fstream-gcc-17-fix.patch

b/http/firefox/patches/0024-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
deleted file mode 100644
index 8cc49e7..0000000
---
a/http/firefox/patches/0024-bgo-976592-file-path-include-fstream-gcc-17-fix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/ipc/chromium/src/base/file_path.h 2026-06-01 23:46:34.196804054
+0100
-+++ b/ipc/chromium/src/base/file_path.h 2026-06-01 23:46:50.452943680
+0100
-@@ -65,6 +65,7 @@
- #ifndef BASE_FILE_PATH_H_
- #define BASE_FILE_PATH_H_
-
-+#include <fstream>
- #include <string>
-
- #include "base/basictypes.h"
diff --git
a/http/firefox/patches/0024-bmo-2061241-fix-llama-cpp-with-neon.patch
b/http/firefox/patches/0024-bmo-2061241-fix-llama-cpp-with-neon.patch
new file mode 100644
index 0000000..be4ec07
--- /dev/null
+++ b/http/firefox/patches/0024-bmo-2061241-fix-llama-cpp-with-neon.patch
@@ -0,0 +1,67 @@
+upstream: https://github.com/ggml-org/llama.cpp/pull/26860
+
+From acb20b139639ec1b7c78739d98f3b04f500ff689 Mon Sep 17 00:00:00 2001
+From: Pascal <admin AT serveurperso.com>
+Date: Mon, 10 Aug 2026 20:51:29 +0200
+Subject: [PATCH 1/2] ggml-cpu: gate __fp16 on __ARM_FP16_FORMAT_IEEE
+
+__ARM_NEON only signals NEON availability. The __fp16 type also needs
+the IEEE half format, implied on AArch64 but selected with
+-mfp16-format=ieee on 32 bit Arm, where the compiler otherwise rejects
+the type.
+
+The guard keeps every toolchain that provides the type on the same code
+and sends that one configuration to the generic lookup path.
+---
+ ggml/src/ggml-cpu/simd-mappings.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
+index fca5119e1..4179605d5 100644
+--- a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
++++ b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
+@@ -29,13 +29,14 @@ extern "C" {
+ // FP16 to FP32 conversion
+
+ // 16-bit float
+-// on Arm, we use __fp16
++// on Arm, we use __fp16, which requires the IEEE fp16 format: implied on
AArch64, selected by
++// -mfp16-format=ieee on 32-bit Arm, where the compiler may otherwise
reject the type
+ // on x86, we use uint16_t
+ //
+ // for old CUDA compilers (<= 11), we use uint16_t: ref
https://github.com/ggml-org/llama.cpp/pull/10616
+ // for MUSA compilers , we use uint16_t: ref
https://github.com/ggml-org/llama.cpp/pull/11843
+ //
+-#if defined(__ARM_NEON) && !(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <=
11) && !defined(__MUSACC__)
++#if defined(__ARM_NEON) && defined(__ARM_FP16_FORMAT_IEEE) &&
!(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <= 11) && !defined(__MUSACC__)
+ #define GGML_CPU_COMPUTE_FP16_TO_FP32(x) neon_compute_fp16_to_fp32(x)
+ #define GGML_CPU_COMPUTE_FP32_TO_FP16(x) neon_compute_fp32_to_fp16(x)
+
+
+From cf1070103a1d10e4f73d258f51f121021b05919c Mon Sep 17 00:00:00 2001
+From: Pascal <admin AT serveurperso.com>
+Date: Tue, 11 Aug 2026 13:09:21 +0200
+Subject: [PATCH 2/2] ggml-cpu: gate the NEON+FMA block on
+ __ARM_FP16_FORMAT_IEEE
+
+Both halves of the F16 section dereference __fp16, so armv7 with
+neon-vfpv4 hits the same unknown type error. Without the IEEE
+format the configuration now falls back to the scalar path.
+
+Address review from @JonathanC-ARM
+---
+ ggml/src/ggml-cpu/simd-mappings.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
+index 8c6a15680096..10ce4bfc593b 100644
+--- a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
++++ b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
+@@ -328,7 +328,7 @@ inline static float ggml_lookup_fp16_to_fp32(ggml_fp16_t
f) {
+ #define GGML_F16_VEC_REDUCE GGML_F32Cx4_REDUCE
+ #endif
+
+-#elif defined(__ARM_NEON) && defined(__ARM_FEATURE_FMA)
++#elif defined(__ARM_NEON) && defined(__ARM_FEATURE_FMA) &&
defined(__ARM_FP16_FORMAT_IEEE)
+
+ #define GGML_SIMD
diff --git
a/http/firefox/patches/0025-bmo-2061241-fix-llama-cpp-with-neon.patch
b/http/firefox/patches/0025-bmo-2061241-fix-llama-cpp-with-neon.patch
deleted file mode 100644
index be4ec07..0000000
--- a/http/firefox/patches/0025-bmo-2061241-fix-llama-cpp-with-neon.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-upstream: https://github.com/ggml-org/llama.cpp/pull/26860
-
-From acb20b139639ec1b7c78739d98f3b04f500ff689 Mon Sep 17 00:00:00 2001
-From: Pascal <admin AT serveurperso.com>
-Date: Mon, 10 Aug 2026 20:51:29 +0200
-Subject: [PATCH 1/2] ggml-cpu: gate __fp16 on __ARM_FP16_FORMAT_IEEE
-
-__ARM_NEON only signals NEON availability. The __fp16 type also needs
-the IEEE half format, implied on AArch64 but selected with
--mfp16-format=ieee on 32 bit Arm, where the compiler otherwise rejects
-the type.
-
-The guard keeps every toolchain that provides the type on the same code
-and sends that one configuration to the generic lookup path.
----
- ggml/src/ggml-cpu/simd-mappings.h | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-index fca5119e1..4179605d5 100644
---- a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-+++ b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-@@ -29,13 +29,14 @@ extern "C" {
- // FP16 to FP32 conversion
-
- // 16-bit float
--// on Arm, we use __fp16
-+// on Arm, we use __fp16, which requires the IEEE fp16 format: implied on
AArch64, selected by
-+// -mfp16-format=ieee on 32-bit Arm, where the compiler may otherwise
reject the type
- // on x86, we use uint16_t
- //
- // for old CUDA compilers (<= 11), we use uint16_t: ref
https://github.com/ggml-org/llama.cpp/pull/10616
- // for MUSA compilers , we use uint16_t: ref
https://github.com/ggml-org/llama.cpp/pull/11843
- //
--#if defined(__ARM_NEON) && !(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <=
11) && !defined(__MUSACC__)
-+#if defined(__ARM_NEON) && defined(__ARM_FP16_FORMAT_IEEE) &&
!(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <= 11) && !defined(__MUSACC__)
- #define GGML_CPU_COMPUTE_FP16_TO_FP32(x) neon_compute_fp16_to_fp32(x)
- #define GGML_CPU_COMPUTE_FP32_TO_FP16(x) neon_compute_fp32_to_fp16(x)
-
-
-From cf1070103a1d10e4f73d258f51f121021b05919c Mon Sep 17 00:00:00 2001
-From: Pascal <admin AT serveurperso.com>
-Date: Tue, 11 Aug 2026 13:09:21 +0200
-Subject: [PATCH 2/2] ggml-cpu: gate the NEON+FMA block on
- __ARM_FP16_FORMAT_IEEE
-
-Both halves of the F16 section dereference __fp16, so armv7 with
-neon-vfpv4 hits the same unknown type error. Without the IEEE
-format the configuration now falls back to the scalar path.
-
-Address review from @JonathanC-ARM
----
- ggml/src/ggml-cpu/simd-mappings.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-index 8c6a15680096..10ce4bfc593b 100644
---- a/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-+++ b/third_party/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h
-@@ -328,7 +328,7 @@ inline static float ggml_lookup_fp16_to_fp32(ggml_fp16_t
f) {
- #define GGML_F16_VEC_REDUCE GGML_F32Cx4_REDUCE
- #endif
-
--#elif defined(__ARM_NEON) && defined(__ARM_FEATURE_FMA)
-+#elif defined(__ARM_NEON) && defined(__ARM_FEATURE_FMA) &&
defined(__ARM_FP16_FORMAT_IEEE)
-
- #define GGML_SIMD
diff --git a/http/firefox/patches/0026-bgo-981812-bindgen-libcxx-fix.patch
b/http/firefox/patches/0026-bgo-981812-bindgen-libcxx-fix.patch
new file mode 100644
index 0000000..ec96d31
--- /dev/null
+++ b/http/firefox/patches/0026-bgo-981812-bindgen-libcxx-fix.patch
@@ -0,0 +1,301 @@
+From 0acdfdd74054caec85a75ba20c7ac236f6ebd893 Mon Sep 17 00:00:00 2001
+From: Erick Tryzelaar <etryzelaar AT google.com>
+Date: Thu, 30 Jul 2026 20:53:45 +0000
+Subject: [PATCH] Fix variadic template union layout recursion and generic
+ field codegen
+
+In llvm/llvm-project#185449, LLVM's libc++ changed a header to use a
+recursive self-referential type, which looks approximately like:
+
+```
+template <class A0, class... As> union RUnion { A0 arg; RUnion<As...> u; };
+template <class A> union RUnion<A> { A arg; };
+struct Wrap { RUnion<int, float> u; };
+```
+
+This code caused bindgen to panic. The problem seems to be that bindgen
+can't handle the recursive self-referential union. Digging into the
+code, it seems that when this type is being parsed, `with_loaned_item`
+removes the type from the context. Later on, when parsing the
+CompKind::Union, CompInfo::layout would call resolve_type on an item
+that was loaned out, so it panics. This bug was filed in #3397.
+
+This patch avoids that by first keeping track of which items we have
+loaed out with `with_loaned_item`, then changing `safe_resolve_type` to
+panic if we don't have an entry for that type, or it has been loaned
+out. Then we've updated the call sites to use it.
+
+This also adds LLVM-21 tests, since clang generates different code than
+LLVM-20.
+
+Test: cargo test -p bindgen-tests
+
+TAG=agy
+CONV=619bdf72-4d2d-494f-8cb0-f61a6db9674c
+---
+ .github/workflows/bindgen.yml | 8 +--
+ bindgen-tests/Cargo.toml | 1 +
+ .../libclang-21/issue-544-stylo-creduce-2.rs | 17 +++++
+ .../tests/libclang-21/nsBaseHashtable.rs | 57 +++++++++++++++++
+ .../tests/recursive_alias_canonicalization.rs | 32 ++++++++++
+ .../tests/expectations/tests/transform-op.rs | 64 +++----------------
+ .../tests/variadic_template_union.rs | 59 +++++++++++++++++
+ .../variadic_template_union_alignment.rs | 53 +++++++++++++++
+ .../recursive_alias_canonicalization.hpp | 11 ++++
+ .../tests/headers/variadic_template_union.hpp | 9 +++
+ .../variadic_template_union_alignment.hpp | 33 ++++++++++
+ bindgen-tests/tests/tests.rs | 10 ++-
+ bindgen/ir/comp.rs | 58 ++++++++++++++++-
+ bindgen/ir/context.rs | 52 +++++++++++++--
+ bindgen/ir/enum_ty.rs | 4 +-
+ bindgen/ir/ty.rs | 14 ++--
+ 16 files changed, 402 insertions(+), 80 deletions(-)
+ create mode 100644
bindgen-tests/tests/expectations/tests/libclang-21/issue-544-stylo-creduce-2.rs
+ create mode 100644
bindgen-tests/tests/expectations/tests/libclang-21/nsBaseHashtable.rs
+ create mode 100644
bindgen-tests/tests/expectations/tests/recursive_alias_canonicalization.rs
+ create mode 100644
bindgen-tests/tests/expectations/tests/variadic_template_union.rs
+ create mode 100644
bindgen-tests/tests/expectations/tests/variadic_template_union_alignment.rs
+ create mode 100644
bindgen-tests/tests/headers/recursive_alias_canonicalization.hpp
+ create mode 100644 bindgen-tests/tests/headers/variadic_template_union.hpp
+ create mode 100644
bindgen-tests/tests/headers/variadic_template_union_alignment.hpp
+
+diff --git a/third_party/rust/bindgen/ir/comp.rs
b/third_party/rust/bindgen/ir/comp.rs
+index 2760775cea..5fb4d8b73d 100644
+--- a/third_party/rust/bindgen/ir/comp.rs
++++ b/third_party/rust/bindgen/ir/comp.rs
+@@ -1082,6 +1082,12 @@ impl CompInfo {
+ return None;
+ }
+
++ // Uninstantiated template unions do not have layout in C++ and can
cause
++ // infinite layout recursion if fields reference the union template.
++ if self.kind == CompKind::Union && !self.template_params.is_empty()
{
++ return None;
++ }
++
+ let mut max_size = 0;
+ // Don't allow align(0)
+ let mut max_align = 1;
+@@ -1707,13 +1713,61 @@ impl CompInfo {
+ ctx.options().default_non_copy_union_style
+ };
+
++ let field_can_copy = |field_data: &FieldData| -> bool {
++ let ty = field_data.ty();
++ if !ty.can_derive_copy(ctx) {
++ return false;
++ }
++ if ctx.in_codegen_phase() &&
++ ctx.uses_any_template_parameters(ty.into())
++ {
++ return false;
++ }
++ true
++ };
++
+ let all_can_copy = self.fields().iter().all(|f| match *f {
++ Field::DataMember(ref field_data) => field_can_copy(field_data),
++ Field::Bitfields(_) => true,
++ });
++
++ let has_generic_params = self.fields().iter().any(|f| match *f {
+ Field::DataMember(ref field_data) => {
+- field_data.ty().can_derive_copy(ctx)
++ ctx.in_codegen_phase() &&
++ ctx.uses_any_template_parameters(field_data.ty().into())
+ }
+- Field::Bitfields(_) => true,
++ Field::Bitfields(_) => false,
+ });
+
++ let has_by_value_recursive_field =
++ self.fields().iter().any(|f| match *f {
++ Field::DataMember(ref field_data) => {
++ let mut ty = ctx.safe_resolve_type(field_data.ty());
++ while let Some(t) = ty {
++ if t.name().is_some_and(|n| name.ends_with(n)) {
++ return true;
++ }
++ match *t.kind() {
++ super::ty::TypeKind::ResolvedTypeRef(inner) |
++ super::ty::TypeKind::Alias(inner) => {
++ ty = ctx.safe_resolve_type(inner);
++ }
++ _ => return false,
++ }
++ }
++ false
++ }
++ Field::Bitfields(_) => false,
++ });
++
++ // If the union has generic template parameters and does not
contain a recursive
++ // template field by value (which would produce E0072 in Rust),
emit as a native
++ // Rust union with ManuallyDrop<T> fields ((true, false)) so the
Rust compiler
++ // computes the correct size and alignment upon instantiation.
++ if has_generic_params && !has_by_value_recursive_field {
++ return (true, false);
++ }
++
+ if !all_can_copy && union_style ==
NonCopyUnionStyle::BindgenWrapper {
+ return (false, false);
+ }
+diff --git a/third_party/rust/bindgen/ir/context.rs
b/third_party/rust/bindgen/ir/context.rs
+index b5b6b4a000..3d5f6a8e79 100644
+--- a/third_party/rust/bindgen/ir/context.rs
++++ b/third_party/rust/bindgen/ir/context.rs
+@@ -349,6 +349,13 @@ pub(crate) struct BindgenContext {
+ /// potentially break that assumption.
+ currently_parsed_types: Vec<PartialType>,
+
++ /// A stack of items currently loaned out by `with_loaned_item`.
++ ///
++ /// This allows us to distinguish between:
++ /// 1) An existing item that is currently being traversed recursively.
++ /// 2) An unknown or invalid item ID (which should panic).
++ currently_loaned_items: Vec<ItemId>,
++
+ /// A map with all the already parsed macro names. This is done to avoid
+ /// hard errors while parsing duplicated macros, as well to allow macro
+ /// expression parsing.
+@@ -586,6 +593,7 @@ If you encounter an error missing from this list, please
file an issue or a PR!"
+ current_module: root_module_id,
+ semantic_parents: Default::default(),
+ currently_parsed_types: vec![],
++ currently_loaned_items: vec![],
+ parsed_macros: Default::default(),
+ replacements: Default::default(),
+ collected_typerefs: false,
+@@ -984,9 +992,13 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
+ F: (FnOnce(&BindgenContext, &mut Item) -> T),
+ {
+ let mut item = self.items[id.0].take().unwrap();
++ self.currently_loaned_items.push(id);
+
+ let result = f(self, &mut item);
+
++ let popped = self.currently_loaned_items.pop();
++ debug_assert_eq!(popped, Some(id));
++
+ let existing = self.items[id.0].replace(item);
+ assert!(existing.is_none());
+
+@@ -1464,13 +1476,38 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
+ self.resolve_item(func_id).kind().expect_function()
+ }
+
+- /// Resolve the given `ItemId` as a type, or `None` if there is no item
with
+- /// the given ID.
++ /// Returns `true` if `id` is currently loaned out by
`with_loaned_item`.
++ pub(crate) fn is_currently_loaned_item<Id: Into<ItemId>>(
++ &self,
++ id: Id,
++ ) -> bool {
++ self.currently_loaned_items.contains(&id.into())
++ }
++
++ /// Resolve the given `ItemId` as a type.
++ ///
++ /// Returns `Some(&Type)` if the item resolves to a type.
++ /// Returns `None` if the item is currently loaned out by
`with_loaned_item`
++ /// (indicating an intentional recursive reference).
+ ///
+- /// Panics if the ID resolves to an item that is not a type.
++ /// Panics if bindgen has no awareness of the given type ID during
codegen.
+ pub(crate) fn safe_resolve_type(&self, type_id: TypeId) ->
Option<&Type> {
+- self.resolve_item_fallible(type_id)
+- .map(|t| t.kind().expect_type())
++ let id: ItemId = type_id.into();
++ match self.items.get(id.0) {
++ Some(Some(item)) => item.kind().as_type(),
++ // When an item slot is `None` because it is currently loaned
out by
++ // `with_loaned_item`, intentionally return `None` to signal
recursion.
++ Some(None) if self.is_currently_loaned_item(id) => None,
++ _ => {
++ // During AST parsing and template resolution
(`!self.in_codegen_phase()`),
++ // forward-declared items or template references may not
yet be populated
++ // in `self.items`, so returning `None` is expected. During
codegen,
++ // however, all valid IR items must be present in
`self.items`.
++ assert!(!self.in_codegen_phase(), "Not an item:
{type_id:?}");
++
++ None
++ }
++ }
+ }
+
+ /// Resolve the given `ItemId` into an `Item`, or `None` if no such item
+@@ -1624,8 +1661,9 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
+ ty: &clang::Type,
+ location: Cursor,
+ ) -> Option<TypeId> {
+- let num_expected_args =
+- self.resolve_type(template).num_self_template_params(self);
++ let num_expected_args = self
++ .safe_resolve_type(template)
++ .map_or(0, |t| t.num_self_template_params(self));
+ if num_expected_args == 0 {
+ warn!(
+ "Tried to instantiate a template for which we could not \
+diff --git a/third_party/rust/bindgen/ir/enum_ty.rs
b/third_party/rust/bindgen/ir/enum_ty.rs
+index 8566622100..20b2de73b3 100644
+--- a/third_party/rust/bindgen/ir/enum_ty.rs
++++ b/third_party/rust/bindgen/ir/enum_ty.rs
+@@ -71,8 +71,8 @@ impl Enum {
+ .and_then(|et| Item::from_ty(&et, declaration, None, ctx).ok());
+ let mut variants = vec![];
+
+- let variant_ty =
+- repr.and_then(|r| ctx.resolve_type(r).safe_canonical_type(ctx));
++ let variant_ty = repr
++ .and_then(|r|
ctx.safe_resolve_type(r)?.safe_canonical_type(ctx));
+ let is_bool = variant_ty.is_some_and(Type::is_bool);
+
+ // Assume signedness since the default type by the C standard is an
int.
+diff --git a/third_party/rust/bindgen/ir/ty.rs
b/third_party/rust/bindgen/ir/ty.rs
+index 805138b7a9..8c0a2fd0df 100644
+--- a/third_party/rust/bindgen/ir/ty.rs
++++ b/third_party/rust/bindgen/ir/ty.rs
+@@ -209,9 +209,9 @@ impl Type {
+ None
+ }
+ }
+- TypeKind::ResolvedTypeRef(inner) => {
+- ctx.resolve_type(inner).is_incomplete_array(ctx)
+- }
++ TypeKind::ResolvedTypeRef(inner) => ctx
++ .safe_resolve_type(inner)
++ .and_then(|t| t.is_incomplete_array(ctx)),
+ _ => None,
+ }
+ }
+@@ -223,7 +223,7 @@ impl Type {
+ TypeKind::Comp(ref ci) => ci.layout(ctx),
+ TypeKind::Array(inner, 0) => Some(Layout::new(
+ 0,
+- ctx.resolve_type(inner).layout(ctx)?.align,
++ ctx.safe_resolve_type(inner)?.layout(ctx)?.align,
+ )),
+ // FIXME(emilio): This is a hack for anonymous union
templates.
+ // Use the actual pointer size!
+@@ -232,7 +232,7 @@ impl Type {
+ ctx.target_pointer_size(),
+ )),
+ TypeKind::ResolvedTypeRef(inner) => {
+- ctx.resolve_type(inner).layout(ctx)
++ ctx.safe_resolve_type(inner)?.layout(ctx)
+ }
+ _ => None,
+ }
+@@ -327,10 +327,10 @@ impl Type {
+ TypeKind::ResolvedTypeRef(inner) |
+ TypeKind::Alias(inner) |
+ TypeKind::TemplateAlias(inner, _) => {
+- ctx.resolve_type(inner).safe_canonical_type(ctx)
++ ctx.safe_resolve_type(inner)?.safe_canonical_type(ctx)
+ }
+ TypeKind::TemplateInstantiation(ref inst) => ctx
+- .resolve_type(inst.template_definition())
++ .safe_resolve_type(inst.template_definition())?
+ .safe_canonical_type(ctx),
+
+ TypeKind::UnresolvedTypeRef(..) => None,
diff --git a/http/firefox/patches/0027-bgo-981812-bindgen-libcxx-fix.patch
b/http/firefox/patches/0027-bgo-981812-bindgen-libcxx-fix.patch
deleted file mode 100644
index ec96d31..0000000
--- a/http/firefox/patches/0027-bgo-981812-bindgen-libcxx-fix.patch
+++ /dev/null
@@ -1,301 +0,0 @@
-From 0acdfdd74054caec85a75ba20c7ac236f6ebd893 Mon Sep 17 00:00:00 2001
-From: Erick Tryzelaar <etryzelaar AT google.com>
-Date: Thu, 30 Jul 2026 20:53:45 +0000
-Subject: [PATCH] Fix variadic template union layout recursion and generic
- field codegen
-
-In llvm/llvm-project#185449, LLVM's libc++ changed a header to use a
-recursive self-referential type, which looks approximately like:
-
-```
-template <class A0, class... As> union RUnion { A0 arg; RUnion<As...> u; };
-template <class A> union RUnion<A> { A arg; };
-struct Wrap { RUnion<int, float> u; };
-```
-
-This code caused bindgen to panic. The problem seems to be that bindgen
-can't handle the recursive self-referential union. Digging into the
-code, it seems that when this type is being parsed, `with_loaned_item`
-removes the type from the context. Later on, when parsing the
-CompKind::Union, CompInfo::layout would call resolve_type on an item
-that was loaned out, so it panics. This bug was filed in #3397.
-
-This patch avoids that by first keeping track of which items we have
-loaed out with `with_loaned_item`, then changing `safe_resolve_type` to
-panic if we don't have an entry for that type, or it has been loaned
-out. Then we've updated the call sites to use it.
-
-This also adds LLVM-21 tests, since clang generates different code than
-LLVM-20.
-
-Test: cargo test -p bindgen-tests
-
-TAG=agy
-CONV=619bdf72-4d2d-494f-8cb0-f61a6db9674c
----
- .github/workflows/bindgen.yml | 8 +--
- bindgen-tests/Cargo.toml | 1 +
- .../libclang-21/issue-544-stylo-creduce-2.rs | 17 +++++
- .../tests/libclang-21/nsBaseHashtable.rs | 57 +++++++++++++++++
- .../tests/recursive_alias_canonicalization.rs | 32 ++++++++++
- .../tests/expectations/tests/transform-op.rs | 64 +++----------------
- .../tests/variadic_template_union.rs | 59 +++++++++++++++++
- .../variadic_template_union_alignment.rs | 53 +++++++++++++++
- .../recursive_alias_canonicalization.hpp | 11 ++++
- .../tests/headers/variadic_template_union.hpp | 9 +++
- .../variadic_template_union_alignment.hpp | 33 ++++++++++
- bindgen-tests/tests/tests.rs | 10 ++-
- bindgen/ir/comp.rs | 58 ++++++++++++++++-
- bindgen/ir/context.rs | 52 +++++++++++++--
- bindgen/ir/enum_ty.rs | 4 +-
- bindgen/ir/ty.rs | 14 ++--
- 16 files changed, 402 insertions(+), 80 deletions(-)
- create mode 100644
bindgen-tests/tests/expectations/tests/libclang-21/issue-544-stylo-creduce-2.rs
- create mode 100644
bindgen-tests/tests/expectations/tests/libclang-21/nsBaseHashtable.rs
- create mode 100644
bindgen-tests/tests/expectations/tests/recursive_alias_canonicalization.rs
- create mode 100644
bindgen-tests/tests/expectations/tests/variadic_template_union.rs
- create mode 100644
bindgen-tests/tests/expectations/tests/variadic_template_union_alignment.rs
- create mode 100644
bindgen-tests/tests/headers/recursive_alias_canonicalization.hpp
- create mode 100644 bindgen-tests/tests/headers/variadic_template_union.hpp
- create mode 100644
bindgen-tests/tests/headers/variadic_template_union_alignment.hpp
-
-diff --git a/third_party/rust/bindgen/ir/comp.rs
b/third_party/rust/bindgen/ir/comp.rs
-index 2760775cea..5fb4d8b73d 100644
---- a/third_party/rust/bindgen/ir/comp.rs
-+++ b/third_party/rust/bindgen/ir/comp.rs
-@@ -1082,6 +1082,12 @@ impl CompInfo {
- return None;
- }
-
-+ // Uninstantiated template unions do not have layout in C++ and can
cause
-+ // infinite layout recursion if fields reference the union template.
-+ if self.kind == CompKind::Union && !self.template_params.is_empty()
{
-+ return None;
-+ }
-+
- let mut max_size = 0;
- // Don't allow align(0)
- let mut max_align = 1;
-@@ -1707,13 +1713,61 @@ impl CompInfo {
- ctx.options().default_non_copy_union_style
- };
-
-+ let field_can_copy = |field_data: &FieldData| -> bool {
-+ let ty = field_data.ty();
-+ if !ty.can_derive_copy(ctx) {
-+ return false;
-+ }
-+ if ctx.in_codegen_phase() &&
-+ ctx.uses_any_template_parameters(ty.into())
-+ {
-+ return false;
-+ }
-+ true
-+ };
-+
- let all_can_copy = self.fields().iter().all(|f| match *f {
-+ Field::DataMember(ref field_data) => field_can_copy(field_data),
-+ Field::Bitfields(_) => true,
-+ });
-+
-+ let has_generic_params = self.fields().iter().any(|f| match *f {
- Field::DataMember(ref field_data) => {
-- field_data.ty().can_derive_copy(ctx)
-+ ctx.in_codegen_phase() &&
-+ ctx.uses_any_template_parameters(field_data.ty().into())
- }
-- Field::Bitfields(_) => true,
-+ Field::Bitfields(_) => false,
- });
-
-+ let has_by_value_recursive_field =
-+ self.fields().iter().any(|f| match *f {
-+ Field::DataMember(ref field_data) => {
-+ let mut ty = ctx.safe_resolve_type(field_data.ty());
-+ while let Some(t) = ty {
-+ if t.name().is_some_and(|n| name.ends_with(n)) {
-+ return true;
-+ }
-+ match *t.kind() {
-+ super::ty::TypeKind::ResolvedTypeRef(inner) |
-+ super::ty::TypeKind::Alias(inner) => {
-+ ty = ctx.safe_resolve_type(inner);
-+ }
-+ _ => return false,
-+ }
-+ }
-+ false
-+ }
-+ Field::Bitfields(_) => false,
-+ });
-+
-+ // If the union has generic template parameters and does not
contain a recursive
-+ // template field by value (which would produce E0072 in Rust),
emit as a native
-+ // Rust union with ManuallyDrop<T> fields ((true, false)) so the
Rust compiler
-+ // computes the correct size and alignment upon instantiation.
-+ if has_generic_params && !has_by_value_recursive_field {
-+ return (true, false);
-+ }
-+
- if !all_can_copy && union_style ==
NonCopyUnionStyle::BindgenWrapper {
- return (false, false);
- }
-diff --git a/third_party/rust/bindgen/ir/context.rs
b/third_party/rust/bindgen/ir/context.rs
-index b5b6b4a000..3d5f6a8e79 100644
---- a/third_party/rust/bindgen/ir/context.rs
-+++ b/third_party/rust/bindgen/ir/context.rs
-@@ -349,6 +349,13 @@ pub(crate) struct BindgenContext {
- /// potentially break that assumption.
- currently_parsed_types: Vec<PartialType>,
-
-+ /// A stack of items currently loaned out by `with_loaned_item`.
-+ ///
-+ /// This allows us to distinguish between:
-+ /// 1) An existing item that is currently being traversed recursively.
-+ /// 2) An unknown or invalid item ID (which should panic).
-+ currently_loaned_items: Vec<ItemId>,
-+
- /// A map with all the already parsed macro names. This is done to avoid
- /// hard errors while parsing duplicated macros, as well to allow macro
- /// expression parsing.
-@@ -586,6 +593,7 @@ If you encounter an error missing from this list, please
file an issue or a PR!"
- current_module: root_module_id,
- semantic_parents: Default::default(),
- currently_parsed_types: vec![],
-+ currently_loaned_items: vec![],
- parsed_macros: Default::default(),
- replacements: Default::default(),
- collected_typerefs: false,
-@@ -984,9 +992,13 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
- F: (FnOnce(&BindgenContext, &mut Item) -> T),
- {
- let mut item = self.items[id.0].take().unwrap();
-+ self.currently_loaned_items.push(id);
-
- let result = f(self, &mut item);
-
-+ let popped = self.currently_loaned_items.pop();
-+ debug_assert_eq!(popped, Some(id));
-+
- let existing = self.items[id.0].replace(item);
- assert!(existing.is_none());
-
-@@ -1464,13 +1476,38 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
- self.resolve_item(func_id).kind().expect_function()
- }
-
-- /// Resolve the given `ItemId` as a type, or `None` if there is no item
with
-- /// the given ID.
-+ /// Returns `true` if `id` is currently loaned out by
`with_loaned_item`.
-+ pub(crate) fn is_currently_loaned_item<Id: Into<ItemId>>(
-+ &self,
-+ id: Id,
-+ ) -> bool {
-+ self.currently_loaned_items.contains(&id.into())
-+ }
-+
-+ /// Resolve the given `ItemId` as a type.
-+ ///
-+ /// Returns `Some(&Type)` if the item resolves to a type.
-+ /// Returns `None` if the item is currently loaned out by
`with_loaned_item`
-+ /// (indicating an intentional recursive reference).
- ///
-- /// Panics if the ID resolves to an item that is not a type.
-+ /// Panics if bindgen has no awareness of the given type ID during
codegen.
- pub(crate) fn safe_resolve_type(&self, type_id: TypeId) ->
Option<&Type> {
-- self.resolve_item_fallible(type_id)
-- .map(|t| t.kind().expect_type())
-+ let id: ItemId = type_id.into();
-+ match self.items.get(id.0) {
-+ Some(Some(item)) => item.kind().as_type(),
-+ // When an item slot is `None` because it is currently loaned
out by
-+ // `with_loaned_item`, intentionally return `None` to signal
recursion.
-+ Some(None) if self.is_currently_loaned_item(id) => None,
-+ _ => {
-+ // During AST parsing and template resolution
(`!self.in_codegen_phase()`),
-+ // forward-declared items or template references may not
yet be populated
-+ // in `self.items`, so returning `None` is expected. During
codegen,
-+ // however, all valid IR items must be present in
`self.items`.
-+ assert!(!self.in_codegen_phase(), "Not an item:
{type_id:?}");
-+
-+ None
-+ }
-+ }
- }
-
- /// Resolve the given `ItemId` into an `Item`, or `None` if no such item
-@@ -1624,8 +1661,9 @@ If you encounter an error missing from this list,
please file an issue or a PR!"
- ty: &clang::Type,
- location: Cursor,
- ) -> Option<TypeId> {
-- let num_expected_args =
-- self.resolve_type(template).num_self_template_params(self);
-+ let num_expected_args = self
-+ .safe_resolve_type(template)
-+ .map_or(0, |t| t.num_self_template_params(self));
- if num_expected_args == 0 {
- warn!(
- "Tried to instantiate a template for which we could not \
-diff --git a/third_party/rust/bindgen/ir/enum_ty.rs
b/third_party/rust/bindgen/ir/enum_ty.rs
-index 8566622100..20b2de73b3 100644
---- a/third_party/rust/bindgen/ir/enum_ty.rs
-+++ b/third_party/rust/bindgen/ir/enum_ty.rs
-@@ -71,8 +71,8 @@ impl Enum {
- .and_then(|et| Item::from_ty(&et, declaration, None, ctx).ok());
- let mut variants = vec![];
-
-- let variant_ty =
-- repr.and_then(|r| ctx.resolve_type(r).safe_canonical_type(ctx));
-+ let variant_ty = repr
-+ .and_then(|r|
ctx.safe_resolve_type(r)?.safe_canonical_type(ctx));
- let is_bool = variant_ty.is_some_and(Type::is_bool);
-
- // Assume signedness since the default type by the C standard is an
int.
-diff --git a/third_party/rust/bindgen/ir/ty.rs
b/third_party/rust/bindgen/ir/ty.rs
-index 805138b7a9..8c0a2fd0df 100644
---- a/third_party/rust/bindgen/ir/ty.rs
-+++ b/third_party/rust/bindgen/ir/ty.rs
-@@ -209,9 +209,9 @@ impl Type {
- None
- }
- }
-- TypeKind::ResolvedTypeRef(inner) => {
-- ctx.resolve_type(inner).is_incomplete_array(ctx)
-- }
-+ TypeKind::ResolvedTypeRef(inner) => ctx
-+ .safe_resolve_type(inner)
-+ .and_then(|t| t.is_incomplete_array(ctx)),
- _ => None,
- }
- }
-@@ -223,7 +223,7 @@ impl Type {
- TypeKind::Comp(ref ci) => ci.layout(ctx),
- TypeKind::Array(inner, 0) => Some(Layout::new(
- 0,
-- ctx.resolve_type(inner).layout(ctx)?.align,
-+ ctx.safe_resolve_type(inner)?.layout(ctx)?.align,
- )),
- // FIXME(emilio): This is a hack for anonymous union
templates.
- // Use the actual pointer size!
-@@ -232,7 +232,7 @@ impl Type {
- ctx.target_pointer_size(),
- )),
- TypeKind::ResolvedTypeRef(inner) => {
-- ctx.resolve_type(inner).layout(ctx)
-+ ctx.safe_resolve_type(inner)?.layout(ctx)
- }
- _ => None,
- }
-@@ -327,10 +327,10 @@ impl Type {
- TypeKind::ResolvedTypeRef(inner) |
- TypeKind::Alias(inner) |
- TypeKind::TemplateAlias(inner, _) => {
-- ctx.resolve_type(inner).safe_canonical_type(ctx)
-+ ctx.safe_resolve_type(inner)?.safe_canonical_type(ctx)
- }
- TypeKind::TemplateInstantiation(ref inst) => ctx
-- .resolve_type(inst.template_definition())
-+ .safe_resolve_type(inst.template_definition())?
- .safe_canonical_type(ctx),
-
- TypeKind::UnresolvedTypeRef(..) => None,
diff --git
a/http/firefox/patches/0029-firefox-158-fix-build-without-dbus.patch
b/http/firefox/patches/0029-firefox-158-fix-build-without-dbus.patch
new file mode 100644
index 0000000..a5b96b7
--- /dev/null
+++ b/http/firefox/patches/0029-firefox-158-fix-build-without-dbus.patch
@@ -0,0 +1,15 @@
+diff '--color=auto' -Naur a/widget/gtk/nsAppShell.cpp
b/widget/gtk/nsAppShell.cpp
+--- a/widget/gtk/nsAppShell.cpp 2026-10-12 17:21:50.264444160 +0300
++++ b/widget/gtk/nsAppShell.cpp 2026-10-12 17:40:13.130522641 +0300
+@@ -29,9 +29,10 @@
+ #include "prenv.h"
+ #ifdef MOZ_ENABLE_DBUS
+ # include <gio/gio.h>
++#endif
+
+ # include "WidgetUtilsGtk.h"
+-#endif
++
+ #include "HeadlessScreenHelper.h"
+ #include "ScreenHelperGTK.h"
+ #include "WakeLockListener.h"
diff --git
a/http/firefox/patches/0030-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch

b/http/firefox/patches/0030-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
new file mode 100644
index 0000000..add323e
--- /dev/null
+++
b/http/firefox/patches/0030-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
@@ -0,0 +1,15 @@
+diff '--color=auto' -Naur a/config/makefiles/rust.mk
b/config/makefiles/rust.mk
+--- a/config/makefiles/rust.mk 2026-10-12 17:21:50.315996077 +0300
++++ b/config/makefiles/rust.mk 2026-10-12 17:23:48.665727741 +0300
+@@ -55,9 +55,11 @@
+ # invocation (i.e., only the top-level crate, not its dependencies).
+ cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
+ # Enable link-time optimization for release builds.
++ifdef MOZ_LTO
+ ifdef RUST_LIBRARY_LTO
+ cargo_rustc_flags += -Clto
+ endif
++endif
+
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL


  • [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (3abd98dfc7c297f4a1b69c78fa1693c54ec9e84a), Pavel Vinogradov, 10/12/2026

Archive powered by MHonArc 2.6.24.

Top of Page