git: 46a4933e863e - main - www/waterfox: Update 6.5.9 => 6.6.0-beta-2

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Fri, 18 Jul 2025 23:29:30 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=46a4933e863e1da25fcbbe76718d11aedd094f4b

commit 46a4933e863e1da25fcbbe76718d11aedd094f4b
Author:     Martin Filla <freebsd@sysctl.cz>
AuthorDate: 2025-07-18 23:20:46 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-07-18 23:29:10 +0000

    www/waterfox: Update 6.5.9 => 6.6.0-beta-2
    
    Changes:
    Platform Changes (128.0 to 140.0)
    https://www.waterfox.net/docs/releases/6.6.0-beta-1/
    https://www.waterfox.net/docs/releases/6.6.0-beta-2/
    
    Improve port:
    - Fix build on i386 - use www/node24 on i386 and hande sse2.
    - Unification of Makefile with Firefox - make it more similar.
    - Use ${DESKTOPDIR} instead if ${PREFIX}/share/applications.
    
    PR:     288283 288109
    MFH:    2025Q3
---
 www/waterfox/Makefile                              |    52 +-
 www/waterfox/distinfo                              |    10 +-
 www/waterfox/files/patch-bug1559213                |   131 -
 www/waterfox/files/patch-bug1859752                |    42 -
 www/waterfox/files/patch-bug847568                 |    83 +-
 ...__processor.py => patch-build_gn__processor.py} |    20 +-
 ...patch-gfx_skia_skia_src_core_SkRasterPipeline.h |    13 -
 .../files/patch-ipc_glue_GeckoChildProcessHost.cpp |    13 +
 www/waterfox/files/patch-libwebrtc-generated       | 43345 ++++++++++++-------
 .../files/patch-memory_mozalloc_throw__gcc.h       |     2 +-
 www/waterfox/files/patch-python_sites_mach.txt     |    18 +
 ...rd__party_libwebrtc_build_config_BUILDCONFIG.gn |    73 +-
 ...hird__party_sqlite3_ext_sqlite-vec_sqlite-vec.c |    15 +
 ...toolkit_components_processtools_procinfo__bsd.c |   104 -
 .../files/patch-toolkit_xre_nsEmbedFunctions.cpp   |    17 +
 www/waterfox/files/waterfox.desktop.in             |   218 +
 16 files changed, 27612 insertions(+), 16544 deletions(-)

diff --git a/www/waterfox/Makefile b/www/waterfox/Makefile
index abb3805240ba..6713597f1081 100644
--- a/www/waterfox/Makefile
+++ b/www/waterfox/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	waterfox
-DISTVERSION=	6.5.9
-PORTREVISION=	2
+DISTVERSION=	6.6.0-beta-2
 PORTEPOCH=	1
 CATEGORIES=	www
 
@@ -12,8 +11,8 @@ LICENSE=	MPL20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	nspr>=4.32:devel/nspr \
-		nss>=3.108:security/nss \
-		icu>=73.1,1:devel/icu \
+		nss>=3.112:security/nss \
+		icu>=76.1:devel/icu \
 		libevent>=2.1.8:devel/libevent \
 		harfbuzz>=10.1.0:print/harfbuzz \
 		graphite2>=1.3.14:graphics/graphite2 \
@@ -22,7 +21,6 @@ BUILD_DEPENDS=	nspr>=4.32:devel/nspr \
 		libvpx>=1.15.0:multimedia/libvpx \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
 		v4l_compat>0:multimedia/v4l_compat \
-		autoconf2.13:devel/autoconf2.13 \
 		nasm:devel/nasm \
 		yasm:devel/yasm \
 		zip:archivers/zip \
@@ -33,29 +31,26 @@ BUILD_DEPENDS=	nspr>=4.32:devel/nspr \
 USE_GECKO=	gecko
 USE_GITHUB=	yes
 GH_ACCOUNT=	BrowserWorks
-GH_PROJECT=	Waterfox
-GH_TUPLE=	BrowserWorks:l10n:3046738:l10n/waterfox/browser/locales
+GH_TUPLE=	BrowserWorks:l10n:39f141a:l10n/waterfox/browser/locales
 USE_MOZILLA=	-sqlite
-
 # work around bindgen not finding ICU, e.g.
 # dist/include/mozilla/intl/ICU4CGlue.h:8:10: fatal error: 'unicode/uenum.h' file not found, err: true
-CONFIGURE_ENV+=		BINDGEN_CFLAGS="-I${LOCALBASE}/include" \
-			MOZ_REQUIRE_SIGNING=""
-
-CFLAGS_powerpc64=	-DHWY_COMPILE_ONLY_SCALAR
-CFLAGS_powerpc64le=	-DSQLITE_BYTEORDER=1234
+CONFIGURE_ENV+=	BINDGEN_CFLAGS="-I${LOCALBASE}/include"
+CONFIGURE_ENV+=	MOZ_REQUIRE_SIGNING=""
 
-BINARY_ALIAS+=		python3=${PYTHON_CMD}
+FIREFOX_ICON=		${MOZILLA}.png
+FIREFOX_ICON_SRC=	${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
 
 MOZILLA_CAP=	${MOZILLA:C/^(.).*/\1/:tu}${MOZILLA:C/^.//}
 
-MOZ_EXPORT+=	MOZ_TELEMETRY_REPORTING="" \
+MOZ_EXPORT=	MOZ_TELEMETRY_REPORTING="" \
 		MOZILLA_OFFICIAL="1" \
 		MOZ_OFFICIAL_BRANDING="1" \
 		MOZ_APP_DISPLAYNAME="${MOZILLA_CAP}" \
 		MOZ_APP_NAME="${MOZILLA}"
 
-MOZ_OPTIONS+=	--enable-application=browser \
+MOZ_OPTIONS=	--enable-application=browser \
+		--with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot \
 		--allow-addon-sideload \
 		--disable-crashreporter \
 		--disable-debug \
@@ -68,33 +63,36 @@ MOZ_OPTIONS+=	--enable-application=browser \
 		--with-app-name=${MOZILLA} \
 		--with-unsigned-addon-scopes=app,system \
 		--enable-bootstrap \
-		--with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot \
 		MOZ_CRASHREPORTER=0 \
 		MOZ_DATA_REPORTING=0
 
-FIREFOX_ICON=		${MOZILLA}.png
-FIREFOX_ICON_SRC=	${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
-FIREFOX_DESKTOP=	${MOZSRC}/taskcluster/docker/firefox-snap/firefox.desktop
-
 .include "${.CURDIR}/../../www/firefox/Makefile.options"
 
 .include <bsd.port.options.mk>
 
+.if ${ARCH} == i386
+BUILD_DEPENDS+=	node${NODEJS_VERSION}>=24:www/node${NODEJS_VERSION}
+USES+=		nodejs:24,build,env
+.  if ${MACHINE_CPU:Msse2}
+# is not enabled on i386 by default
+# Fix for error: always_inline function '_mm_setzero_si64' requires target feature 'sse2'
+CFLAGS_i386+=	-msse2
+.  endif
+.endif
+
 .if ${ARCH} == amd64
 MOZ_OPTIONS+=	--enable-rust-simd
 .endif
 
+post-extract:
+	@${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON:R}|;s|@MOZILLA@|${MOZILLA}|' \
+		<${FILESDIR}/waterfox.desktop.in >${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop
 post-patch:
-	@${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \
-		-e 's/firefox/${MOZILLA}/' \
-		-e 's/Firefox/${MOZILLA_CAP}/' \
-		-e '/^Icon/s/=.*/=${FIREFOX_ICON:R}/' \
-		${FIREFOX_DESKTOP}
 	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 		${WRKSRC}/browser/app/nsBrowserApp.cpp
 
 post-install:
-	${INSTALL_DATA} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/${MOZILLA}.desktop
+	${INSTALL_DATA} ${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop ${STAGEDIR}${DESKTOPDIR}
 	${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
 	${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON}
 
diff --git a/www/waterfox/distinfo b/www/waterfox/distinfo
index f673aa4859f4..4e754204af90 100644
--- a/www/waterfox/distinfo
+++ b/www/waterfox/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1747990122
-SHA256 (BrowserWorks-Waterfox-6.5.9_GH0.tar.gz) = 46efa015c068975c81c1beba86ea8773cf0927cdc1642dd054f6cd32aa9bc150
-SIZE (BrowserWorks-Waterfox-6.5.9_GH0.tar.gz) = 824230212
-SHA256 (BrowserWorks-l10n-3046738_GH0.tar.gz) = f9a16202b73558188af3157d427845153a89b3f3b3269c1e5d8ebc9e60eb9bd1
-SIZE (BrowserWorks-l10n-3046738_GH0.tar.gz) = 19480746
+TIMESTAMP = 1752800000
+SHA256 (BrowserWorks-waterfox-6.6.0-beta-2_GH0.tar.gz) = ac486c24f35d4fe8159f2850fa393f5e932f5fff24e71e0379f35fff329c151d
+SIZE (BrowserWorks-waterfox-6.6.0-beta-2_GH0.tar.gz) = 919136111
+SHA256 (BrowserWorks-l10n-39f141a_GH0.tar.gz) = 269b2f6c59e19ec07a9e231ab8bfb1d8d834b811136c07720955de0747c2d0fc
+SIZE (BrowserWorks-l10n-39f141a_GH0.tar.gz) = 23702129
diff --git a/www/waterfox/files/patch-bug1559213 b/www/waterfox/files/patch-bug1559213
deleted file mode 100644
index ead3425fa70b..000000000000
--- a/www/waterfox/files/patch-bug1559213
+++ /dev/null
@@ -1,131 +0,0 @@
-commit 25a5572d5cd137aa6d893e09a00bd39908a59a18
-Author: Christoph Moench-Tegeder <cmt@burggraben.net>
-Date:   Tue Sep 10 22:23:32 2024 +0200
-
-    based on:
-     commit 717bba28411c
-     Author: Jory A. Pratt <anarchy@gentoo.org>
-     Date:   Thu Jun 13 11:53:00 2019 -0700
-    
-         Bug 1559213 - Allow to use system av1 libs instead of bundled.
-
-diff --git config/external/moz.build config/external/moz.build
-index a24b470396cf..547f5f5c9e04 100644
---- config/external/moz.build
-+++ config/external/moz.build
-@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
-     external_dirs += ["media/libvpx"]
- 
- if CONFIG["MOZ_AV1"]:
--    external_dirs += ["media/libaom"]
--    external_dirs += ["media/libdav1d"]
-+    if not CONFIG["MOZ_SYSTEM_AV1"]:
-+        external_dirs += ["media/libaom"]
-+        external_dirs += ["media/libdav1d"]
- 
- if not CONFIG["MOZ_SYSTEM_PNG"]:
-     external_dirs += ["media/libpng"]
-diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
-index 61536cc6e225..29cf635bbb44 100644
---- dom/media/platforms/moz.build
-+++ dom/media/platforms/moz.build
-@@ -71,6 +71,11 @@ if CONFIG["MOZ_AV1"]:
-         "agnostic/AOMDecoder.cpp",
-         "agnostic/DAV1DDecoder.cpp",
-     ]
-+    if CONFIG['MOZ_SYSTEM_AV1']:
-+        CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
-+        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
-+        CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
- 
- if CONFIG["MOZ_OMX"]:
-     EXPORTS += [
-diff --git media/ffvpx/libavcodec/moz.build media/ffvpx/libavcodec/moz.build
-index 6f09049a6068..90a82a19a9d1 100644
---- media/ffvpx/libavcodec/moz.build
-+++ media/ffvpx/libavcodec/moz.build
-@@ -119,10 +119,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
-         'vp9recon.c',
-         'vpx_rac.c',
-     ]
--    USE_LIBS += [
--        'dav1d',
--        'media_libdav1d_asm',
--    ]
-+    if CONFIG["MOZ_SYSTEM_AV1"]:
-+        CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
-+        CFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
-+        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
-+    else:
-+        USE_LIBS += [
-+            'dav1d',
-+            'media_libdav1d_asm',
-+        ]
-     if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
-         LOCAL_INCLUDES += ['/media/mozva']
-         SOURCES += [
-diff --git media/libopus/moz.build media/libopus/moz.build
-index 943aee79ee99..4ad07e3e98af 100644
---- media/libopus/moz.build
-+++ media/libopus/moz.build
-@@ -58,7 +58,7 @@ if not CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]:
-     DEFINES["FIXED_POINT"] = 1
-     DEFINES["DISABLE_FLOAT_API"] = True
- 
--if CONFIG["OS_ARCH"] == "Linux":
-+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"):
-     OS_LIBS += [
-         "m",
-     ]
-diff --git media/libvorbis/moz.build media/libvorbis/moz.build
-index cd17d4f89759..816edd72a000 100644
---- media/libvorbis/moz.build
-+++ media/libvorbis/moz.build
-@@ -45,7 +45,7 @@ LOCAL_INCLUDES += ['lib']
- if CONFIG['OS_ARCH'] == 'SunOS':
-     DEFINES['HAVE_ALLOCA_H'] = True
- 
--if CONFIG["OS_ARCH"] == "Linux":
-+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"):
-     OS_LIBS += [
-         "m",
-     ]
-diff --git toolkit/moz.configure toolkit/moz.configure
-index 1f85d2831f2f..07294b93f850 100644
---- toolkit/moz.configure
-+++ toolkit/moz.configure
-@@ -883,7 +883,23 @@ def av1(value):
-         return True
- 
- 
--@depends(target, when=av1 & compile_environment)
-+option("--with-system-av1",
-+       help="Use system av1 (located with pkgconfig)")
-+
-+system_libaom_info = pkg_check_modules("MOZ_SYSTEM_LIBAOM", "aom >= 1.0.0",
-+                                       when="--with-system-av1")
-+
-+system_libdav1d_info = pkg_check_modules("MOZ_SYSTEM_LIBDAV1D", "dav1d >= 0.1.1",
-+                                         when="--with-system-av1")
-+
-+@depends(system_libaom_info, system_libdav1d_info)
-+def system_av1(system_libaom_info, system_libdav1d_info):
-+    has_av1_libs = False
-+    if system_libaom_info and system_libdav1d_info:
-+        has_av1_libs = True
-+    return has_av1_libs
-+
-+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
- def dav1d_asm(target):
-     if target.cpu in ("aarch64", "x86", "x86_64"):
-         return True
-@@ -899,6 +915,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
- set_define("MOZ_DAV1D_ASM", dav1d_asm)
- set_config("MOZ_AV1", av1)
- set_define("MOZ_AV1", av1)
-+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
- 
- # JXL Image Codec Support
- # ==============================================================
diff --git a/www/waterfox/files/patch-bug1859752 b/www/waterfox/files/patch-bug1859752
deleted file mode 100644
index 3050a31cf0cf..000000000000
--- a/www/waterfox/files/patch-bug1859752
+++ /dev/null
@@ -1,42 +0,0 @@
-# HG changeset patch
-# User André Bargull <andre.bargull@gmail.com>
-# Date 1699346749 0
-# Node ID 0e7eefda24250041d7f008cc77dfa79045afa791
-# Parent  1e39572cb1c784039a9e14b8c36396c66cf58a5d
-Bug 1859752 - Part 9: Add new line break classes. r=platform-i18n-reviewers,dminor
-
-Use `CLASS_CHARACTER` because that matches the previous character class for most
-characters which are now part of the new character classes.
-
-Depends on D192733
-
-Differential Revision: https://phabricator.services.mozilla.com/D192734
-
-diff --git intl/lwbrk/LineBreaker.cpp intl/lwbrk/LineBreaker.cpp
---- intl/lwbrk/LineBreaker.cpp
-+++ intl/lwbrk/LineBreaker.cpp
-@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
-       /* JT = 34,                           [JT] */ CLASS_CHARACTER,
-       /* JV = 35,                           [JV] */ CLASS_CHARACTER,
-       /* CLOSE_PARENTHESIS = 36,            [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
-       /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
-       /* HEBREW_LETTER = 38,                [HL] */ CLASS_CHARACTER,
-       /* REGIONAL_INDICATOR = 39,           [RI] */ CLASS_CHARACTER,
-       /* E_BASE = 40,                       [EB] */ CLASS_BREAKABLE,
-       /* E_MODIFIER = 41,                   [EM] */ CLASS_CHARACTER,
--      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER};
-+      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER,
-+      /* AKSARA = 43,                       [AK] */ CLASS_CHARACTER,
-+      /* AKSARA_PREBASE = 44,               [AP] */ CLASS_CHARACTER,
-+      /* AKSARA_START = 45,                 [AS] */ CLASS_CHARACTER,
-+      /* VIRAMA_FINAL = 46,                 [VF] */ CLASS_CHARACTER,
-+      /* VIRAMA = 47,                       [VI] */ CLASS_CHARACTER,
-+  };
- 
-   static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
-                 "Gecko vs ICU LineBreak class mismatch");
- 
-   auto cls = GetLineBreakClass(u);
-   MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
- 
-   // Overrides based on rules for the different line-break values given in
diff --git a/www/waterfox/files/patch-bug847568 b/www/waterfox/files/patch-bug847568
index 2ee46579d43d..5b557e0e5a86 100644
--- a/www/waterfox/files/patch-bug847568
+++ b/www/waterfox/files/patch-bug847568
@@ -1,10 +1,10 @@
-# Allow building against system-wide graphite2/harfbuzz.
+Allow building against system-wide graphite2/harfbuzz
 
 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
-index 0c06f581b33b..10f125be25ab 100644
+index af44c89057fc..c0ac271917fb 100644
 --- config/system-headers.mozbuild
 +++ config/system-headers.mozbuild
-@@ -1307,6 +1307,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]:
+@@ -1304,6 +1304,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]:
          "proxy.h",
      ]
  
@@ -25,10 +25,10 @@ index 0c06f581b33b..10f125be25ab 100644
      system_headers += [
          "unicode/calendar.h",
 diff --git dom/base/moz.build dom/base/moz.build
-index 14c9f9dd96fb..bd1c8f241e9b 100644
+index 170d19f09aa9..a47fc8b1193c 100644
 --- dom/base/moz.build
 +++ dom/base/moz.build
-@@ -606,6 +606,9 @@ FINAL_LIBRARY = "xul"
+@@ -620,6 +620,9 @@ FINAL_LIBRARY = "xul"
  if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
      CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
  
@@ -40,7 +40,7 @@ index 14c9f9dd96fb..bd1c8f241e9b 100644
      script="gen-usecounters.py",
 diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
 new file mode 100644
-index 000000000000..24e8d7a03274
+index 000000000000..ed0323eba9d5
 --- /dev/null
 +++ gfx/graphite2/geckoextra/moz.build
 @@ -0,0 +1,21 @@
@@ -104,10 +104,10 @@ index 56ea317bedfc..07dd7f66f1bc 100644
      "thebes",
      "ipc",
 diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
-index c161d24df853..8c7dd395b371 100755
+index b589efde1c5c..47f49e10df70 100755
 --- gfx/skia/generate_mozbuild.py
 +++ gfx/skia/generate_mozbuild.py
-@@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+@@ -95,6 +95,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
          '-Wno-unused-private-field',
      ]
  
@@ -118,10 +118,10 @@ index c161d24df853..8c7dd395b371 100755
      LOCAL_INCLUDES += [
          "/gfx/cairo/cairo/src",
 diff --git gfx/skia/moz.build gfx/skia/moz.build
-index 83aa2957a938..0859316a1f09 100644
+index 7fee54534878..ba1a4038e4a0 100644
 --- gfx/skia/moz.build
 +++ gfx/skia/moz.build
-@@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+@@ -623,6 +623,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
          '-Wno-unused-private-field',
      ]
  
@@ -132,10 +132,10 @@ index 83aa2957a938..0859316a1f09 100644
      LOCAL_INCLUDES += [
          "/gfx/cairo/cairo/src",
 diff --git gfx/thebes/moz.build gfx/thebes/moz.build
-index fd1fcf236d81..958d3f699ffd 100644
+index 48f2849e2025..7d0a161a91b4 100644
 --- gfx/thebes/moz.build
 +++ gfx/thebes/moz.build
-@@ -293,7 +293,13 @@ if CONFIG["MOZ_WAYLAND"]:
+@@ -295,7 +295,13 @@ if CONFIG["MOZ_WAYLAND"]:
  
  LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
  
@@ -151,7 +151,7 @@ index fd1fcf236d81..958d3f699ffd 100644
  CXXFLAGS += ["-Werror=switch"]
  
 diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
-index 2bbd00415cae..f66bd37695d4 100644
+index 2396210428ee..092baac6f79c 100644
 --- intl/unicharutil/util/moz.build
 +++ intl/unicharutil/util/moz.build
 @@ -24,6 +24,9 @@ UNIFIED_SOURCES += [
@@ -165,10 +165,10 @@ index 2bbd00415cae..f66bd37695d4 100644
  
  GeneratedFile(
 diff --git netwerk/dns/moz.build netwerk/dns/moz.build
-index c926d14707d1..35a3f33e2885 100644
+index 1bb0430f01aa..0360e0f468c0 100644
 --- netwerk/dns/moz.build
 +++ netwerk/dns/moz.build
-@@ -112,6 +112,9 @@ GeneratedFile(
+@@ -111,6 +111,9 @@ GeneratedFile(
      "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
  )
  
@@ -178,43 +178,24 @@ index c926d14707d1..35a3f33e2885 100644
  # need to include etld_data.inc
  LOCAL_INCLUDES += [
      "/netwerk/base",
-diff --git old-configure.in old-configure.in
-index 2ca88a20a4b3..88bc9b873eff 100644
---- old-configure.in
-+++ old-configure.in
-@@ -1067,6 +1067,27 @@ fi
- AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
- AC_SUBST(MOZ_MACBUNDLE_ID)
- 
-+dnl ========================================================
-+dnl Check for graphite2
-+dnl ========================================================
-+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
-+    dnl graphite2.pc has bogus version, check manually
-+    _SAVE_CFLAGS=$CFLAGS
-+    CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
-+    AC_TRY_COMPILE([ #include <graphite2/Font.h>
-+                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
-+                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
-+                               * 100 + GR2_VERSION_BUGFIX >= \
-+                               (major) * 10000 + (minor) * 100 + (bugfix) )
-+                   ], [
-+                     #if !GR2_VERSION_REQUIRE(1,3,14)
-+                     #error "Insufficient graphite2 version."
-+                     #endif
-+                   ], [],
-+                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
-+    CFLAGS=$_SAVE_CFLAGS
-+fi
-+
- dnl ========================================================
- dnl = Child Process Name for IPC
- dnl ========================================================
+diff --git security/rlbox/moz.build security/rlbox/moz.build
+index 7ad8d076f0f1..835b9d905e03 100644
+--- security/rlbox/moz.build
++++ security/rlbox/moz.build
+@@ -47,6 +47,8 @@ if CONFIG["MOZ_WASM_SANDBOXING_GRAPHITE"]:
+     for k, v in graphite_defines:
+         WASM_DEFINES[k] = v
+     LOCAL_INCLUDES += ["/gfx/graphite2/src"]
++    if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++      WASM_CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
+ 
+ if CONFIG["MOZ_WASM_SANDBOXING_OGG"]:
+     include("/media/libogg/sources.mozbuild")
 diff --git toolkit/library/moz.build toolkit/library/moz.build
-index 76746f308011..f6844f4c400b 100644
+index ee6051567c8e..c24a5a513bbc 100644
 --- toolkit/library/moz.build
 +++ toolkit/library/moz.build
-@@ -292,6 +292,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
+@@ -298,6 +298,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
  if CONFIG["MOZ_SYSTEM_WEBP"]:
      OS_LIBS += CONFIG["MOZ_WEBP_LIBS"]
  
@@ -228,10 +209,10 @@ index 76746f308011..f6844f4c400b 100644
      OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"]
  
 diff --git toolkit/moz.configure toolkit/moz.configure
-index a060a59f728f..f0778d1ae2d6 100644
+index 1f85d2831f2f..04ce56e2cc0b 100644
 --- toolkit/moz.configure
 +++ toolkit/moz.configure
-@@ -1218,6 +1218,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info):
+@@ -1397,6 +1397,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/www/waterfox/files/patch-python_mozbuild_mozbuild_gn__processor.py b/www/waterfox/files/patch-build_gn__processor.py
similarity index 76%
rename from www/waterfox/files/patch-python_mozbuild_mozbuild_gn__processor.py
rename to www/waterfox/files/patch-build_gn__processor.py
index 94584d8b160b..be5e10347483 100644
--- a/www/waterfox/files/patch-python_mozbuild_mozbuild_gn__processor.py
+++ b/www/waterfox/files/patch-build_gn__processor.py
@@ -1,13 +1,13 @@
-commit 6bfdff4afcc9e3843b9c3a5d7e884e281a305398
+commit 0e5bcbefae64b35a5c8df360e3980258a565fa72
 Author: Christoph Moench-Tegeder <cmt@burggraben.net>
 
-    chase gn_processor.py changes
+    chase gn_processor.py move
 
-diff --git python/mozbuild/mozbuild/gn_processor.py python/mozbuild/mozbuild/gn_processor.py
-index a77b6c7759f1..e5498ac5e9df 100644
---- python/mozbuild/mozbuild/gn_processor.py
-+++ python/mozbuild/mozbuild/gn_processor.py
-@@ -185,6 +185,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target):
+diff --git build/gn_processor.py build/gn_processor.py
+index 2ba8b92c2751..91170efb9a5d 100644
+--- build/gn_processor.py
++++ build/gn_processor.py
+@@ -186,6 +186,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target):
      }
      oses = {
          "android": "Android",
@@ -15,7 +15,7 @@ index a77b6c7759f1..e5498ac5e9df 100644
          "linux": "Linux",
          "mac": "Darwin",
          "openbsd": "OpenBSD",
-@@ -742,17 +743,17 @@ def main():
+@@ -780,17 +781,17 @@ def main():
  
      vars_set = []
      for is_debug in (True, False):
@@ -35,10 +35,10 @@ index a77b6c7759f1..e5498ac5e9df 100644
                  target_cpus.append("riscv64")
 -            if target_os == "linux":
 +            if target_os in ("freebsd", "linux"):
-                 target_cpus.extend(["ppc64", "mipsel", "mips64el"])
+                 target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"])
              for target_cpu in target_cpus:
                  vars = {
-@@ -761,7 +762,7 @@ def main():
+@@ -799,7 +800,7 @@ def main():
                      "target_cpu": target_cpu,
                      "target_os": target_os,
                  }
diff --git a/www/waterfox/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h b/www/waterfox/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h
deleted file mode 100644
index 05cf110b1192..000000000000
--- a/www/waterfox/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git gfx/skia/skia/src/core/SkRasterPipeline.h gfx/skia/skia/src/core/SkRasterPipeline.h
-index 2475ea0d398d..67967483656d 100644
---- gfx/skia/skia/src/core/SkRasterPipeline.h
-+++ gfx/skia/skia/src/core/SkRasterPipeline.h
-@@ -27,7 +27,7 @@ struct SkImageInfo;
- struct skcms_TransferFunction;
- 
- #if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && \
--        !defined(SK_CPU_LOONGARCH)
-+        !defined(SK_CPU_LOONGARCH) && !defined(__powerpc__)
-     #define SK_HAS_MUSTTAIL 1
- #else
-     #define SK_HAS_MUSTTAIL 0
diff --git a/www/waterfox/files/patch-ipc_glue_GeckoChildProcessHost.cpp b/www/waterfox/files/patch-ipc_glue_GeckoChildProcessHost.cpp
new file mode 100644
index 000000000000..42f5f25add33
--- /dev/null
+++ b/www/waterfox/files/patch-ipc_glue_GeckoChildProcessHost.cpp
@@ -0,0 +1,13 @@
+diff --git ipc/glue/GeckoChildProcessHost.cpp ipc/glue/GeckoChildProcessHost.cpp
+index 9bb8314bd98c..2bc0382a9385 100644
+--- ipc/glue/GeckoChildProcessHost.cpp
++++ ipc/glue/GeckoChildProcessHost.cpp
+@@ -1121,7 +1121,7 @@ Result<Ok, LaunchError> BaseProcessLauncher::DoSetup() {
+ #if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN)
+     geckoargs::sCrashReporter.Put(CrashReporter::GetChildNotificationPipe(),
+                                   mChildArgs);
+-#elif defined(XP_UNIX) && !defined(XP_IOS)
++#elif defined(XP_UNIX) && !defined(XP_IOS) && !defined(XP_FREEBSD)
+     UniqueFileHandle childCrashFd = CrashReporter::GetChildNotificationPipe();
+     if (!childCrashFd) {
+       return Err(LaunchError("DuplicateFileHandle failed"));
diff --git a/www/waterfox/files/patch-libwebrtc-generated b/www/waterfox/files/patch-libwebrtc-generated
index a37c207e58b7..eb715bc55fbe 100644
--- a/www/waterfox/files/patch-libwebrtc-generated
+++ b/www/waterfox/files/patch-libwebrtc-generated
@@ -1,20 +1,19 @@
-commit a5f947661b12af9fbe95bd197027a6ab64019440
+commit f65492631f8fa8714d72d09ba3fa5edf3b08bac3
 Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
 
-    regenerate FreeBSD libwebrtc patch for Firefox 128.7esr
+    regenerate FreeBSD libwebrtc patch for gecko 140
 
 diff --git third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
-index 2dbd5881583e..332ca04819ee 100644
+index a29aef4b45e5..c193c4232adf 100644
 --- third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
 +++ third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
-@@ -12,11 +12,21 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+@@ -13,11 +13,20 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
  DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
  DEFINES["RTC_ENABLE_VP9"] = True
 +DEFINES["USE_GLIB"] = "1"
 +DEFINES["USE_OZONE"] = "1"
 +DEFINES["WEBRTC_BSD"] = True
-+DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
  DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
  DEFINES["WEBRTC_LIBRARY_IMPL"] = True
  DEFINES["WEBRTC_MOZILLA_BUILD"] = True
@@ -29,7 +28,7 @@ index 2dbd5881583e..332ca04819ee 100644
  
  FINAL_LIBRARY = "xul"
  
-@@ -43,178 +53,32 @@ if not CONFIG["MOZ_DEBUG"]:
+@@ -44,179 +53,32 @@ if not CONFIG["MOZ_DEBUG"]:
  if CONFIG["MOZ_DEBUG"] == "1":
  
      DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
@@ -41,7 +40,6 @@ index 2dbd5881583e..332ca04819ee 100644
 -    DEFINES["HAVE_SYS_UIO_H"] = True
 -    DEFINES["WEBRTC_ANDROID"] = True
 -    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_GNU_SOURCE"] = True
@@ -68,7 +66,6 @@ index 2dbd5881583e..332ca04819ee 100644
 -    DEFINES["USE_NSS_CERTS"] = "1"
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -83,7 +80,6 @@ index 2dbd5881583e..332ca04819ee 100644
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_X11"] = "1"
 -    DEFINES["WEBRTC_BSD"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
 -    DEFINES["_LARGEFILE64_SOURCE"] = True
@@ -133,6 +129,10 @@ index 2dbd5881583e..332ca04819ee 100644
 -    DEFINES["WEBRTC_ARCH_ARM"] = True
 -    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
 -    DEFINES["WEBRTC_HAS_NEON"] = True
+-
+-if CONFIG["TARGET_CPU"] == "loongarch64":
+-
+-    DEFINES["_GNU_SOURCE"] = True
 -
  if CONFIG["TARGET_CPU"] == "mips32":
  
@@ -215,17 +215,16 @@ index 2dbd5881583e..332ca04819ee 100644
  
  Library("resource_adaptation_api_gn")
 diff --git third_party/libwebrtc/api/array_view_gn/moz.build third_party/libwebrtc/api/array_view_gn/moz.build
-index df2c86715cac..6c4e403f6dc1 100644
+index 642158f0b8be..994364e58ce4 100644
 --- third_party/libwebrtc/api/array_view_gn/moz.build
 +++ third_party/libwebrtc/api/array_view_gn/moz.build
-@@ -12,11 +12,21 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+@@ -13,11 +13,20 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
  DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
  DEFINES["RTC_ENABLE_VP9"] = True
 +DEFINES["USE_GLIB"] = "1"
 +DEFINES["USE_OZONE"] = "1"
 +DEFINES["WEBRTC_BSD"] = True
-+DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
  DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
  DEFINES["WEBRTC_LIBRARY_IMPL"] = True
  DEFINES["WEBRTC_MOZILLA_BUILD"] = True
@@ -240,7 +239,7 @@ index df2c86715cac..6c4e403f6dc1 100644
  
  FINAL_LIBRARY = "xul"
  
-@@ -39,111 +49,17 @@ if not CONFIG["MOZ_DEBUG"]:
+@@ -40,112 +49,17 @@ if not CONFIG["MOZ_DEBUG"]:
  if CONFIG["MOZ_DEBUG"] == "1":
  
      DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
@@ -252,7 +251,6 @@ index df2c86715cac..6c4e403f6dc1 100644
 -    DEFINES["HAVE_SYS_UIO_H"] = True
 -    DEFINES["WEBRTC_ANDROID"] = True
 -    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_GNU_SOURCE"] = True
@@ -279,7 +277,6 @@ index df2c86715cac..6c4e403f6dc1 100644
 -    DEFINES["USE_NSS_CERTS"] = "1"
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -294,7 +291,6 @@ index df2c86715cac..6c4e403f6dc1 100644
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_X11"] = "1"
 -    DEFINES["WEBRTC_BSD"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
 -    DEFINES["_LARGEFILE64_SOURCE"] = True
@@ -340,6 +336,10 @@ index df2c86715cac..6c4e403f6dc1 100644
 -    DEFINES["WEBRTC_ARCH_ARM"] = True
 -    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
 -    DEFINES["WEBRTC_HAS_NEON"] = True
+-
+-if CONFIG["TARGET_CPU"] == "loongarch64":
+-
+-    DEFINES["_GNU_SOURCE"] = True
 -
  if CONFIG["TARGET_CPU"] == "mips32":
  
@@ -353,7 +353,7 @@ index df2c86715cac..6c4e403f6dc1 100644
  
  if CONFIG["TARGET_CPU"] == "x86":
  
-@@ -153,50 +69,8 @@ if CONFIG["TARGET_CPU"] == "x86_64":
+@@ -155,50 +69,8 @@ if CONFIG["TARGET_CPU"] == "x86_64":
  
      DEFINES["WEBRTC_ENABLE_AVX2"] = True
  
@@ -406,17 +406,16 @@ index df2c86715cac..6c4e403f6dc1 100644
 -
  Library("array_view_gn")
 diff --git third_party/libwebrtc/api/async_dns_resolver_gn/moz.build third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
-index 4d678a1de7c9..e163a7c1f440 100644
+index c7f482cc2e28..e44aba4a8252 100644
 --- third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
 +++ third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
-@@ -12,11 +12,21 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+@@ -13,11 +13,20 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
  DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
  DEFINES["RTC_ENABLE_VP9"] = True
 +DEFINES["USE_GLIB"] = "1"
 +DEFINES["USE_OZONE"] = "1"
 +DEFINES["WEBRTC_BSD"] = True
-+DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
  DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
  DEFINES["WEBRTC_LIBRARY_IMPL"] = True
  DEFINES["WEBRTC_MOZILLA_BUILD"] = True
@@ -431,7 +430,7 @@ index 4d678a1de7c9..e163a7c1f440 100644
  
  FINAL_LIBRARY = "xul"
  
-@@ -39,119 +49,17 @@ if not CONFIG["MOZ_DEBUG"]:
+@@ -40,120 +49,17 @@ if not CONFIG["MOZ_DEBUG"]:
  if CONFIG["MOZ_DEBUG"] == "1":
  
      DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
@@ -443,7 +442,6 @@ index 4d678a1de7c9..e163a7c1f440 100644
 -    DEFINES["HAVE_SYS_UIO_H"] = True
 -    DEFINES["WEBRTC_ANDROID"] = True
 -    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_GNU_SOURCE"] = True
@@ -471,7 +469,6 @@ index 4d678a1de7c9..e163a7c1f440 100644
 -    DEFINES["USE_NSS_CERTS"] = "1"
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -486,7 +483,6 @@ index 4d678a1de7c9..e163a7c1f440 100644
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_X11"] = "1"
 -    DEFINES["WEBRTC_BSD"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
 -    DEFINES["_LARGEFILE64_SOURCE"] = True
@@ -539,6 +535,10 @@ index 4d678a1de7c9..e163a7c1f440 100644
 -    DEFINES["WEBRTC_ARCH_ARM"] = True
 -    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
 -    DEFINES["WEBRTC_HAS_NEON"] = True
+-
+-if CONFIG["TARGET_CPU"] == "loongarch64":
+-
+-    DEFINES["_GNU_SOURCE"] = True
 -
  if CONFIG["TARGET_CPU"] == "mips32":
  
@@ -552,7 +552,7 @@ index 4d678a1de7c9..e163a7c1f440 100644
  
  if CONFIG["TARGET_CPU"] == "x86":
  
-@@ -161,50 +69,8 @@ if CONFIG["TARGET_CPU"] == "x86_64":
+@@ -163,50 +69,8 @@ if CONFIG["TARGET_CPU"] == "x86_64":
  
      DEFINES["WEBRTC_ENABLE_AVX2"] = True
  
@@ -605,17 +605,16 @@ index 4d678a1de7c9..e163a7c1f440 100644
 -
  Library("async_dns_resolver_gn")
 diff --git third_party/libwebrtc/api/audio/aec3_config_gn/moz.build third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
-index cbd6f2e6f0d5..3bfa575693b2 100644
+index 8113afb08273..123471602ffd 100644
 --- third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
 +++ third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
-@@ -12,11 +12,21 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+@@ -13,11 +13,20 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
  DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
  DEFINES["RTC_ENABLE_VP9"] = True
 +DEFINES["USE_GLIB"] = "1"
 +DEFINES["USE_OZONE"] = "1"
 +DEFINES["WEBRTC_BSD"] = True
-+DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
  DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
  DEFINES["WEBRTC_LIBRARY_IMPL"] = True
  DEFINES["WEBRTC_MOZILLA_BUILD"] = True
@@ -630,7 +629,7 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
  
  FINAL_LIBRARY = "xul"
  
-@@ -43,178 +53,32 @@ if not CONFIG["MOZ_DEBUG"]:
+@@ -44,179 +53,32 @@ if not CONFIG["MOZ_DEBUG"]:
  if CONFIG["MOZ_DEBUG"] == "1":
  
      DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
@@ -642,7 +641,6 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
 -    DEFINES["HAVE_SYS_UIO_H"] = True
 -    DEFINES["WEBRTC_ANDROID"] = True
 -    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_GNU_SOURCE"] = True
@@ -669,7 +667,6 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
 -    DEFINES["USE_NSS_CERTS"] = "1"
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -684,7 +681,6 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_X11"] = "1"
 -    DEFINES["WEBRTC_BSD"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
 -    DEFINES["_LARGEFILE64_SOURCE"] = True
@@ -734,6 +730,10 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
 -    DEFINES["WEBRTC_ARCH_ARM"] = True
 -    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
 -    DEFINES["WEBRTC_HAS_NEON"] = True
+-
+-if CONFIG["TARGET_CPU"] == "loongarch64":
+-
+-    DEFINES["_GNU_SOURCE"] = True
 -
  if CONFIG["TARGET_CPU"] == "mips32":
  
@@ -816,18 +816,17 @@ index cbd6f2e6f0d5..3bfa575693b2 100644
  
  Library("aec3_config_gn")
 diff --git third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
-index 746585483f96..33ea9b79d47b 100644
+index 658f1cf59805..da98391aded6 100644
 --- third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
 +++ third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
-@@ -12,12 +12,22 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
  DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
  DEFINES["RTC_ENABLE_VP9"] = True
 +DEFINES["USE_GLIB"] = "1"
 +DEFINES["USE_OZONE"] = "1"
  DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
 +DEFINES["WEBRTC_BSD"] = True
-+DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
  DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
  DEFINES["WEBRTC_LIBRARY_IMPL"] = True
  DEFINES["WEBRTC_MOZILLA_BUILD"] = True
@@ -842,7 +841,7 @@ index 746585483f96..33ea9b79d47b 100644
  
  FINAL_LIBRARY = "xul"
  
-@@ -44,189 +54,32 @@ if not CONFIG["MOZ_DEBUG"]:
+@@ -45,190 +54,32 @@ if not CONFIG["MOZ_DEBUG"]:
  if CONFIG["MOZ_DEBUG"] == "1":
  
      DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
@@ -854,7 +853,6 @@ index 746585483f96..33ea9b79d47b 100644
 -    DEFINES["HAVE_SYS_UIO_H"] = True
 -    DEFINES["WEBRTC_ANDROID"] = True
 -    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_GNU_SOURCE"] = True
@@ -881,7 +879,6 @@ index 746585483f96..33ea9b79d47b 100644
 -    DEFINES["USE_NSS_CERTS"] = "1"
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_LINUX"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -900,7 +897,6 @@ index 746585483f96..33ea9b79d47b 100644
 -    DEFINES["USE_OZONE"] = "1"
 -    DEFINES["USE_X11"] = "1"
 -    DEFINES["WEBRTC_BSD"] = True
--    DEFINES["WEBRTC_ENABLE_LIBEVENT"] = True
 -    DEFINES["WEBRTC_POSIX"] = True
 -    DEFINES["_FILE_OFFSET_BITS"] = "64"
 -    DEFINES["_LARGEFILE64_SOURCE"] = True
@@ -957,6 +953,10 @@ index 746585483f96..33ea9b79d47b 100644
 -    DEFINES["WEBRTC_ARCH_ARM"] = True
 -    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
 -    DEFINES["WEBRTC_HAS_NEON"] = True
+-
+-if CONFIG["TARGET_CPU"] == "loongarch64":
+-
+-    DEFINES["_GNU_SOURCE"] = True
 -
  if CONFIG["TARGET_CPU"] == "mips32":
  
@@ -1038,18 +1038,17 @@ index 746585483f96..33ea9b79d47b 100644
 +    DEFINES["USE_X11"] = "1"
  
  Library("aec3_factory_gn")
-diff --git third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
-index e2561db08f06..59da7761dd35 100644
---- third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
-+++ third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
-@@ -12,11 +12,21 @@ AllowCompilerWarnings()
- DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
+diff --git third_party/libwebrtc/api/audio/audio_device_gn/moz.build third_party/libwebrtc/api/audio/audio_device_gn/moz.build
+index 01d48ab0e9bf..3885140cb11b 100644
*** 74749 LINES SKIPPED ***