pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/firefox: Add firefox-155.0.1



Module Name:	pkgsrc-wip
Committed By:	Ryo ONODERA <ryoon%NetBSD.org@localhost>
Pushed By:	ryoon
Date:		Fri Sep 11 02:03:57 2026 +0900
Changeset:	bc183de47e8f065b18f10f40fe365cb6c61d1f5f

Added Files:
	firefox/DESCR
	firefox/Makefile
	firefox/PLIST
	firefox/PLIST.Linux
	firefox/distinfo
	firefox/files/desktop.in
	firefox/files/firefox.sh
	firefox/files/node-wrapper.sh
	firefox/files/replace-moz.build.awk
	firefox/mozilla-common.mk
	firefox/options.mk
	firefox/patches/patch-browser_app_profile_firefox.js
	firefox/patches/patch-build_gn__processor.py
	firefox/patches/patch-build_moz.configure_init.configure
	firefox/patches/patch-build_moz.configure_rust.configure
	firefox/patches/patch-config_gcc-stl-wrapper.template.h
	firefox/patches/patch-config_makefiles_rust.mk
	firefox/patches/patch-dom_base_nsAttrName.h
	firefox/patches/patch-dom_canvas_WebGLMethodDispatcher.h
	firefox/patches/patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp
	firefox/patches/patch-dom_media_webrtc_libwebrtc__overrides_moz.build
	firefox/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp
	firefox/patches/patch-gfx_ots_src_name.cc
	firefox/patches/patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp
	firefox/patches/patch-gfx_wr_swgl_src_gl.cc
	firefox/patches/patch-gfx_wr_swgl_src_glsl.h
	firefox/patches/patch-gfx_wr_swgl_src_rasterize.h
	firefox/patches/patch-gfx_wr_swgl_src_swgl__ext.h
	firefox/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
	firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
	firefox/patches/patch-ipc_glue_ForkServer.cpp
	firefox/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
	firefox/patches/patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp
	firefox/patches/patch-js_public_Utility.h
	firefox/patches/patch-js_src_editline_editline.c
	firefox/patches/patch-js_src_intgemm_moz.build
	firefox/patches/patch-js_src_jit_FlushICache.cpp
	firefox/patches/patch-js_src_jit_arm64_vixl_Registers-vixl.h
	firefox/patches/patch-js_src_util_NativeStack.cpp
	firefox/patches/patch-js_src_vm_TypedArrayObject-inl.h
	firefox/patches/patch-media_ffvpx_libavutil_arm_bswap.h
	firefox/patches/patch-media_libpng_pngpriv.h
	firefox/patches/patch-memory_build_mozjemalloc__types.h
	firefox/patches/patch-mozglue_misc_Now.cpp
	firefox/patches/patch-netwerk_protocol_http_nsHttpHandler.cpp
	firefox/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
	firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake.py
	firefox/patches/patch-python_sites_build.txt
	firefox/patches/patch-python_sites_mach.txt
	firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc
	firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc
	firefox/patches/patch-third__party_angle_angle__common__gn_moz.build
	firefox/patches/patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in
	firefox/patches/patch-third__party_angle_angle__program__version__id__gn_moz.build
	firefox/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
	firefox/patches/patch-third__party_js_cfworker_build.sh
	firefox/patches/patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc
	firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build
	firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
	firefox/patches/patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build
	firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc
	firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc
	firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build
	firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc
	firefox/patches/patch-third__party_libwebrtc_rtc__base_memory__usage.cc
	firefox/patches/patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc
	firefox/patches/patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc
	firefox/patches/patch-third__party_python_dlmanager_check.py
	firefox/patches/patch-third__party_rust_mtu_src_bindings_netbsd.rs
	firefox/patches/patch-third__party_sqlite3_ext_moz.build
	firefox/patches/patch-third__party_sqlite3_src_moz.build
	firefox/patches/patch-third__party_wasm2c_src_c-writer.cc
	firefox/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc
	firefox/patches/patch-toolkit_components_terminator_nsTerminator.cpp
	firefox/patches/patch-toolkit_moz.configure
	firefox/patches/patch-toolkit_mozapps_installer_packager.mk
	firefox/patches/patch-xpcom_base_nscore.h
	firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build

Log Message:
wip/firefox: Add firefox-155.0.1

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bc183de47e8f065b18f10f40fe365cb6c61d1f5f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 firefox/DESCR                                      |  13 +
 firefox/Makefile                                   | 208 +++++
 firefox/PLIST                                      |  40 +
 firefox/PLIST.Linux                                |   2 +
 firefox/distinfo                                   |  75 ++
 firefox/files/desktop.in                           | 191 +++++
 firefox/files/firefox.sh                           |  14 +
 firefox/files/node-wrapper.sh                      |   9 +
 firefox/files/replace-moz.build.awk                | 106 +++
 firefox/mozilla-common.mk                          | 301 +++++++
 firefox/options.mk                                 | 105 +++
 .../patches/patch-browser_app_profile_firefox.js   |  44 ++
 firefox/patches/patch-build_gn__processor.py       |  46 ++
 .../patch-build_moz.configure_init.configure       |  15 +
 .../patch-build_moz.configure_rust.configure       |  15 +
 .../patch-config_gcc-stl-wrapper.template.h        |  32 +
 firefox/patches/patch-config_makefiles_rust.mk     |  30 +
 firefox/patches/patch-dom_base_nsAttrName.h        |  18 +
 .../patch-dom_canvas_WebGLMethodDispatcher.h       |  26 +
 ...diacapabilities_MediaCapabilitiesValidation.cpp |  13 +
 ...dom_media_webrtc_libwebrtc__overrides_moz.build |  13 +
 ...nsport_api_WebTransportDatagramDuplexStream.cpp |  40 +
 firefox/patches/patch-gfx_ots_src_name.cc          |  13 +
 ...kia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp |  13 +
 firefox/patches/patch-gfx_wr_swgl_src_gl.cc        |  15 +
 firefox/patches/patch-gfx_wr_swgl_src_glsl.h       |  14 +
 firefox/patches/patch-gfx_wr_swgl_src_rasterize.h  |  13 +
 firefox/patches/patch-gfx_wr_swgl_src_swgl__ext.h  |  13 +
 ...pc_chromium_src_base_message__pump__libevent.cc |  22 +
 ...pc_chromium_src_base_platform__thread__posix.cc |  16 +
 firefox/patches/patch-ipc_glue_ForkServer.cpp      |  14 +
 .../patch-ipc_glue_GeckoChildProcessHost.cpp       |  20 +
 .../patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp    |  15 +
 firefox/patches/patch-js_public_Utility.h          |  27 +
 firefox/patches/patch-js_src_editline_editline.c   |  31 +
 firefox/patches/patch-js_src_intgemm_moz.build     |  49 ++
 firefox/patches/patch-js_src_jit_FlushICache.cpp   |  34 +
 .../patch-js_src_jit_arm64_vixl_Registers-vixl.h   |  20 +
 firefox/patches/patch-js_src_util_NativeStack.cpp  |  32 +
 .../patches/patch-js_src_vm_TypedArrayObject-inl.h |  17 +
 .../patch-media_ffvpx_libavutil_arm_bswap.h        |  36 +
 firefox/patches/patch-media_libpng_pngpriv.h       |  16 +
 .../patch-memory_build_mozjemalloc__types.h        |  23 +
 firefox/patches/patch-mozglue_misc_Now.cpp         |  27 +
 .../patch-netwerk_protocol_http_nsHttpHandler.cpp  |  15 +
 .../patch-nsprpub_pr_src_pthreads_ptsynch.c        | 112 +++
 ...thon_mozbuild_mozbuild_backend_recursivemake.py |  27 +
 firefox/patches/patch-python_sites_build.txt       |  15 +
 firefox/patches/patch-python_sites_mach.txt        |  31 +
 ...-cpp_absl_debugging_internal_elf__mem__image.cc |  27 +
 ...il-cpp_absl_debugging_internal_vdso__support.cc |  18 +
 ...-third__party_angle_angle__common__gn_moz.build |  40 +
 ...EShaderProgramVersion.h-22c710649c380411.rsp.in | 873 +++++++++++++++++++++
 ...angle_angle__program__version__id__gn_moz.build |  31 +
 ...party_angle_src_common_system__utils__linux.cpp |  15 +
 .../patch-third__party_js_cfworker_build.sh        |  20 +
 ...tc_modules_audio__device_audio__device__impl.cc |  34 +
 ...desktop__capture_desktop__capture__gn_moz.build |  45 ++
 ...s_desktop__capture_linux_wayland_egl__dmabuf.cc |  14 +
 ...y_libwebrtc_modules_portal_portal__gn_moz.build |  29 +
 ...ules_video__capture_linux_device__info__v4l2.cc |  37 +
 ...es_video__capture_linux_video__capture__v4l2.cc |  42 +
 ...re_video__capture__internal__impl__gn_moz.build |  40 +
 ...dules_video__capture_video__capture__options.cc |  13 +
 ...ird__party_libwebrtc_rtc__base_memory__usage.cc |  23 +
 ...libwebrtc_rtc__base_physical__socket__server.cc |  13 +
 ..._libwebrtc_rtc__base_platform__thread__types.cc |  29 +
 .../patch-third__party_python_dlmanager_check.py   |  24 +
 ...ch-third__party_rust_mtu_src_bindings_netbsd.rs |  69 ++
 .../patch-third__party_sqlite3_ext_moz.build       |  13 +
 .../patch-third__party_sqlite3_src_moz.build       |  15 +
 .../patch-third__party_wasm2c_src_c-writer.cc      |  13 +
 ...wasm2c_src_prebuilt_wasm2c__source__includes.cc |  13 +
 ...-toolkit_components_terminator_nsTerminator.cpp |  27 +
 firefox/patches/patch-toolkit_moz.configure        |  31 +
 .../patch-toolkit_mozapps_installer_packager.mk    |  15 +
 firefox/patches/patch-xpcom_base_nscore.h          |  15 +
 .../patch-xpcom_reflect_xptcall_md_unix_moz.build  |  17 +
 78 files changed, 3631 insertions(+)

diffs:
diff --git a/firefox/DESCR b/firefox/DESCR
new file mode 100644
index 0000000000..6bfb590d10
--- /dev/null
+++ b/firefox/DESCR
@@ -0,0 +1,13 @@
+Mozilla Firefox is a free, open-source and cross-platform web browser
+for Windows, Linux, MacOS X and many other operating systems.
+
+It is fast and easy to use, and offers many advantages over other web
+browsers, such as tabbed browsing and the ability to block pop-up
+windows.
+
+Firefox also offers excellent bookmark and history management, and it
+can be extended by developers using industry standards such as XML,
+CSS, JavaScript, C++, etc. Many extensions are available.
+
+Note: Due to upstream's trademark policies, this package identifies as
+"Nightly" rather than "Firefox" by default.
diff --git a/firefox/Makefile b/firefox/Makefile
new file mode 100644
index 0000000000..f38e10e786
--- /dev/null
+++ b/firefox/Makefile
@@ -0,0 +1,208 @@
+# $NetBSD: Makefile,v 1.672 2026/09/02 19:04:57 wiz Exp $
+
+FIREFOX_VER=		${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
+MOZ_BRANCH=		155.0
+MOZ_BRANCH_MINOR=	.1
+CANDIDATE_BUILD=	# for release, make this empty
+
+DISTNAME=	firefox-${FIREFOX_VER}.source
+
+.if empty(CANDIDATE_BUILD)
+MASTER_SITES=	${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
+.else
+RCVER=		build${CANDIDATE_BUILD}
+MASTER_SITES=	${MASTER_SITE_MOZILLA_ALL:=firefox/candidates/${FIREFOX_VER}-candidates/${RCVER}/source/}
+DIST_SUBDIR=	${PKGNAME_NOREV}
+.endif
+
+PKGNAME=	${DISTNAME:S/.source/${RCVER:S/build/rc/}/:S/esr//}
+CATEGORIES=	www
+EXTRACT_SUFX=	.tar.xz
+
+NODEJSKIT=		nodejs-output-155.0.1.tgz
+DISTFILES=		${DEFAULT_DISTFILES} ${NODEJSKIT}
+SITES.${NODEJSKIT}=	${MASTER_SITE_LOCAL}
+
+MAINTAINER=	ryoon%NetBSD.org@localhost
+HOMEPAGE=	https://www.mozilla.org/en-US/firefox/
+COMMENT=	Web browser with support for extensions (version ${FIREFOX_VER:tu:C/\\.[[:digit:]\.]*//})
+LICENSE=	mpl-1.1
+
+# -------- BEFORE UPDATING THIS PACKAGE PLEASE READ & UNDERSTAND: -------
+#
+# This package works around a (stupid) build time dependency on nodejs
+# (which is not available for all architectures and unnecessary for the
+# real build). To do this, it places some additional burden on the
+# maintainer.
+#
+# While working on the package, please make sure you have
+#
+#	FIREFOX_MAINTAINER=yes
+#
+# set in your build environment.
+# When the package is ready for commit (but before commit), do:
+#
+#	make maintainer-files
+#
+# This will do another round (depending on state of your work dir at this
+# moment) of one or two builds and generate a cache of all output that
+# nodejs generates during a build.
+#
+# When this is done, just commit the results (they will be in the files/
+# directory).
+#
+# -----------------------------------------------------------------------
+
+WRKSRC=		${WRKDIR}/firefox-${FIREFOX_VER:C/b.*//}
+
+MOZILLA_DIR=	# empty
+
+# Note: In --enable-chrome-format=flat case,
+#       when updating remember to conditionalise about-background.png in PLIST
+CONFIGURE_ARGS+=	--enable-application=browser
+
+#CFLAGS+=	-I${PREFIX}/include/nspr
+# for lang/gcc6
+CFLAGS+=	-D_GLIBCXX_INCLUDE_NEXT_C_HEADERS
+CFLAGS.SunOS+=	-D_POSIX_PTHREAD_SEMANTICS
+# Do not use uselocale() in third_party/pipewire.
+CFLAGS.NetBSD+=	-D__LOCALE_C_ONLY
+
+LDFLAGS+=		${COMPILER_RPATH_FLAG}${PREFIX}/lib/${PKGBASE}
+LDFLAGS+=		${COMPILER_RPATH_FLAG}${PREFIX}/lib
+LDFLAGS.DragonFly+=	-lplc4 -lnspr4
+LDFLAGS.FreeBSD+=	-lplc4 -lnspr4
+LDFLAGS.Linux+=		-lnspr4
+LDFLAGS.SunOS+=		-lm
+
+# Should revisit to complete mprotect support.
+NOT_PAX_MPROTECT_SAFE+=	lib/${PKGBASE}/${MOZILLA}
+NOT_PAX_MPROTECT_SAFE+=	lib/${PKGBASE}/${MOZILLA}-bin
+
+# Avoid ld "invalid section index" errors.
+BUILDLINK_TRANSFORM.SunOS+=	rm:-fdata-sections
+BUILDLINK_TRANSFORM.SunOS+=	rm:-ffunction-sections
+BUILDLINK_TRANSFORM.SunOS+=	rm:-pie
+
+BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,-rpath-link,${WRKDIR}/build/dist/bin
+BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,-rpath-link,${PREFIX}/lib
+
+# Workaround for https://bugs.llvm.org/show_bug.cgi?id=46366
+BUILDLINK_TRANSFORM.NetBSD+=	rm:-fexperimental-new-pass-manager
+
+SUBST_CLASSES+=			dfly_malloc_h
+SUBST_STAGE.dfly_malloc_h=	pre-configure
+SUBST_MESSAGE.dfly_malloc_h=	Dont include malloc.h on dragonflybsd
+SUBST_SED.dfly_malloc_h=	-e 's,HAVE_MALLOC_H,HAVE_MALLOC_H \&\& !defined(__DragonFly__),g'
+SUBST_FILES.dfly_malloc_h+=	media/ffvpx/libavutil/mem.c
+
+SUBST_CLASSES+=			paths
+SUBST_STAGE.paths=		pre-configure
+SUBST_FILES.paths=		../firefox.sh
+SUBST_VARS.paths=		PREFIX MOZILLA
+
+.include "mozilla-common.mk"
+.include "options.mk"
+
+CHECK_INTERPRETER_SKIP+=	lib/firefox-sdk/sdk/bin/header.py
+CHECK_INTERPRETER_SKIP+=	lib/firefox-sdk/sdk/bin/typelib.py
+CHECK_INTERPRETER_SKIP+=	lib/firefox-sdk/sdk/bin/xpidl.py
+CHECK_INTERPRETER_SKIP+=	lib/firefox-sdk/sdk/bin/xpt.py
+
+CHECK_WRKREF_SKIP+=	lib/${MOZILLA}/omni.ja
+
+MOZILLA=	${PKGBASE}
+
+.if !empty(PKG_OPTIONS:Mofficial-mozilla-branding)
+MOZILLA_NAME=		Firefox
+MOZILLA_BRANDING=	official
+.else
+MOZILLA_NAME=		Browser
+MOZILLA_BRANDING=	unofficial
+.endif
+
+pre-configure:
+# As of 106.0, .in template files are not patched.
+#	cd ${WRKSRC} && autoconf
+#	cd ${WRKSRC}/js/src && autoconf
+	cd ${WRKSRC} && mkdir ${OBJDIR}
+	cd ${WRKSRC}/${OBJDIR} && touch old-configure.vars
+#	Do not fetch Rust Cargo file via network during build
+.if !defined(FIREFOX_MAINTAINER)
+	mv ${WRKDIR}/dist ${WRKSRC}/${OBJDIR}
+.endif
+
+.if defined(FIREFOX_MAINTAINER)
+# Create files needed only by the firefox maintainer when updating
+# the package
+# XXX - manually removing the .*_done files is wrong!
+.PHONY: build-list
+build-list:
+	cd ${WRKSRC}/${OBJDIR}/dist/bin/browser/chrome && \
+		find . -type f | sort > ${OUT:Q}
+
+NODE_LIST=	"${WRKDIR}/node.list"
+NO_NODE_LIST=	"${WRKDIR}/no-node.list"
+NODE_FILES=	"${WRKDIR}/node.flist"
+
+.PHONY: maintainer-files
+maintainer-files:
+	rm -f ${FILESDIR}/node-wrapper.sh
+	V=$$( node -v ) && \
+	    printf '#! /bin/sh\n\nVERS=%s\n\nif [ "$$1" = "-v" ] || [ "$$1" = "--version" ]; then\n\tprintf "$${VERS}\\n"\nfi\n\nexit 0\n' $$V \
+	    > ${FILESDIR}/node-wrapper.sh && \
+	    chmod 0755 ${FILESDIR}/node-wrapper.sh
+	rm -f ${WRKDIR}/.build_done ${WRKDIR}/.configure_done
+	${MAKE} MAINTAINER_INTERNAL=yes build
+	${MAKE} MAINTAINER_INTERNAL=yes OUT="${NO_NODE_LIST}" build-list
+	${MAKE} OUT="${NODE_LIST}" build-list
+	${DIFF} -u "${NO_NODE_LIST}" "${NODE_LIST}" | \
+	    ${AWK} \
+	    '/^\+\.\//{ printf("dist/bin/browser/chrome/%s\n", gensub(/^\+\.\//, "", "")) }' \
+	    > "${NODE_FILES}"
+	cd ${WRKSRC}/${OBJDIR} && tar -c -T "${NODE_FILES}" -z \
+	    -f ${FILESDIR}/nodejs-output-${PKGVERSION_NOREV}.tgz
+.endif
+
+pre-patch:
+	for f in $$(find ${WRKSRC}/third_party/libwebrtc -name moz.build -type f) ; \
+	do \
+		${AWK} -f ${FILESDIR}/replace-moz.build.awk $$f > $$f.new; mv $$f.new $$f ; \
+	done
+	for f in $$(find ${WRKSRC}/third_party/abseil-cpp -name moz.build -type f) ; \
+	do \
+		${AWK} -f ${FILESDIR}/replace-moz.build.awk $$f > $$f.new; mv $$f.new $$f ; \
+	done
+
+post-build:
+	${SED} -e 's|@MOZILLA@|${MOZILLA}|g'				\
+	  -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|g'			\
+	  -e 's|@FIREFOX_ICON@|${MOZILLA}|g'				\
+	  < ${FILESDIR}/desktop.in					\
+	  > ${WRKDIR}/desktop
+
+INSTALLATION_DIRS+=	share/applications
+
+post-extract:
+	${CP} ${FILESDIR}/firefox.sh ${WRKDIR}/firefox.sh
+
+post-install:
+.if ${OPSYS} == "NetBSD" && ${X11_TYPE} == "native"
+	${INSTALL_SCRIPT} ${WRKDIR}/firefox.sh ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+.else
+	${ECHO} '#! /bin/sh' > ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+	${ECHO} '${PREFIX}/lib/${MOZILLA}/${MOZILLA} "$$@"' >> \
+		${DESTDIR}${PREFIX}/bin/${MOZILLA}
+	${CHMOD} 755 ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+.endif
+	${INSTALL_DATA} ${WRKDIR}/desktop				\
+	  ${DESTDIR}${PREFIX}/share/applications/${MOZILLA}.desktop
+.for i in 16 22 24 32 48 64 128 256
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/icons/hicolor/${i}x${i}/apps
+	${INSTALL_DATA} ${WRKSRC}/browser/branding/${MOZILLA_BRANDING}/default${i}.png \
+	  ${DESTDIR}${PREFIX}/share/icons/hicolor/${i}x${i}/apps/${MOZILLA}.png
+.endfor
+
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/firefox/PLIST b/firefox/PLIST
new file mode 100644
index 0000000000..7935e0faec
--- /dev/null
+++ b/firefox/PLIST
@@ -0,0 +1,40 @@
+@comment $NetBSD: PLIST,v 1.195 2026/08/26 21:44:35 gutteridge Exp $
+bin/${MOZILLA}
+lib/${MOZILLA}/application.ini
+lib/${MOZILLA}/browser/chrome/icons/default/default128.png
+lib/${MOZILLA}/browser/chrome/icons/default/default16.png
+lib/${MOZILLA}/browser/chrome/icons/default/default32.png
+lib/${MOZILLA}/browser/chrome/icons/default/default48.png
+lib/${MOZILLA}/browser/chrome/icons/default/default64.png
+lib/${MOZILLA}/browser/omni.ja
+lib/${MOZILLA}/defaults/pref/channel-prefs.js
+lib/${MOZILLA}/dependentlibs.list
+lib/${MOZILLA}/${MOZILLA}
+lib/${MOZILLA}/${MOZILLA}-bin
+lib/${MOZILLA}/fonts/TwemojiMozilla.ttf
+lib/${MOZILLA}/gfxtest
+lib/${MOZILLA}/gmp-clearkey/0.1/libclearkey.so
+lib/${MOZILLA}/gmp-clearkey/0.1/manifest.json
+lib/${MOZILLA}/libgkcodecs.so
+lib/${MOZILLA}/liblgpllibs.so
+${PLIST.ffvpx}lib/${MOZILLA}/libmozavcodec.so
+${PLIST.ffvpx}lib/${MOZILLA}/libmozavutil.so
+lib/${MOZILLA}/libmozgtk.so
+lib/${MOZILLA}/libmozinference.so
+lib/${MOZILLA}/libmozsqlite3.so
+${PLIST.wayland}lib/${MOZILLA}/libmozwayland.so
+lib/${MOZILLA}/libxul.so
+lib/${MOZILLA}/omni.ja
+lib/${MOZILLA}/pingsender
+lib/${MOZILLA}/platform.ini
+lib/${MOZILLA}/removed-files
+${PLIST.v4l2_decode}lib/${MOZILLA}/v4l2test
+share/applications/${MOZILLA}.desktop
+share/icons/hicolor/128x128/apps/${MOZILLA}.png
+share/icons/hicolor/16x16/apps/${MOZILLA}.png
+share/icons/hicolor/22x22/apps/${MOZILLA}.png
+share/icons/hicolor/24x24/apps/${MOZILLA}.png
+share/icons/hicolor/256x256/apps/${MOZILLA}.png
+share/icons/hicolor/32x32/apps/${MOZILLA}.png
+share/icons/hicolor/48x48/apps/${MOZILLA}.png
+share/icons/hicolor/64x64/apps/${MOZILLA}.png
diff --git a/firefox/PLIST.Linux b/firefox/PLIST.Linux
new file mode 100644
index 0000000000..d3e7860e9d
--- /dev/null
+++ b/firefox/PLIST.Linux
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Linux,v 1.5 2026/08/24 12:51:47 ryoon Exp $
+lib/${MOZILLA}/libmozsandbox.so
diff --git a/firefox/distinfo b/firefox/distinfo
new file mode 100644
index 0000000000..60b5ffa385
--- /dev/null
+++ b/firefox/distinfo
@@ -0,0 +1,75 @@
+$NetBSD: distinfo,v 1.593 2026/09/01 15:55:09 ryoon Exp $
+
+BLAKE2s (firefox-155.0.1.source.tar.xz) = c528b9294d88f959d62d46f8b2fafdd89b7fc8a3af34fe456d30eb608fcba0ea
+SHA512 (firefox-155.0.1.source.tar.xz) = 6d137a7a315cb1d0aac1a3fe314af80fe290c49b7c2e47f8687b25d4720927b2a0dc71a3da9d75f6cab479067db114caa6732d17e888b0abfce99238a8af0f39
+Size (firefox-155.0.1.source.tar.xz) = 811591200 bytes
+BLAKE2s (nodejs-output-155.0.1.tgz) = 2f7a76708bf539bb6ce29417fb0a70212db83e23e17125e595002e6a65283084
+SHA512 (nodejs-output-155.0.1.tgz) = a85f4b63427c5868acc96caf777d43e0dfcff7cd55958634022b3f7d7b0a50867c9e0ef4c04d586b36b5d4770ce91dbf18d9446b96b4a04fb8e5c795d97c9419
+Size (nodejs-output-155.0.1.tgz) = 251187 bytes
+SHA1 (patch-browser_app_profile_firefox.js) = f111e03a9c70b6ad5ba64bf95d45302b9256687a
+SHA1 (patch-build_gn__processor.py) = 078f773104bf4c1b30584564aefe365db6ba6daf
+SHA1 (patch-build_moz.configure_init.configure) = 65deb3c233df0aab81eb1fca05d708e5a4ed169a
+SHA1 (patch-build_moz.configure_rust.configure) = 25ddfacd29cebbc6db005dbe61a2a7446d480678
+SHA1 (patch-config_gcc-stl-wrapper.template.h) = b5b4f2aef747836b09584b77d6332a7010963b0b
+SHA1 (patch-config_makefiles_rust.mk) = 62c823e5f11f047a54c7ebcce7534469c3f0d515
+SHA1 (patch-dom_base_nsAttrName.h) = ac7ba441a3b27df2855cf2673eea36b1cb44ad49
+SHA1 (patch-dom_canvas_WebGLMethodDispatcher.h) = 78f6e44116a939615523339fb73ac93f40777749
+SHA1 (patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp) = 2f471067387bb63d530ba1299f0542d3b3a785b6
+SHA1 (patch-dom_media_webrtc_libwebrtc__overrides_moz.build) = a2ff7cf1e6aaf888ee78581d89c7e658f46c3fcd
+SHA1 (patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp) = b93b4c6367bd2fb3d1868ab7d97ca56c100be414
+SHA1 (patch-gfx_ots_src_name.cc) = 35ae5b2689eae8fab1ea351612f3628c14001f9e
+SHA1 (patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp) = 3eb9855e20fe8b7784a9620fce4ffb96f4736f82
+SHA1 (patch-gfx_wr_swgl_src_gl.cc) = bfd63e477f695af2cc070e22a54a6dfc7db85b5f
+SHA1 (patch-gfx_wr_swgl_src_glsl.h) = ee08102822bdc1aef5c3cd3d3bb054fb486d2e12
+SHA1 (patch-gfx_wr_swgl_src_rasterize.h) = aee4ed07cc8acacc42164226618757eeeb35d7d1
+SHA1 (patch-gfx_wr_swgl_src_swgl__ext.h) = 14915b93b10cb2a7a495c9188bb0194935d06a2a
+SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 298642a3527804115b398fb7904a3596962932e3
+SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = ee40764b100728d8fb73b8c6f1251456e368bd53
+SHA1 (patch-ipc_glue_ForkServer.cpp) = 91d3141795ba19c27c6e46fc205f97bfef1fdd6c
+SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 00bd08bb68b9aad3c4478c8849b53341da4a0d29
+SHA1 (patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp) = d90fca47d79551fd74214d47f8184670b901b792
+SHA1 (patch-js_public_Utility.h) = bb5464a0398b91693ab362e6b9b06d48429b9e7d
+SHA1 (patch-js_src_editline_editline.c) = ba44a33cc19d19aeaa777548ac74fc7144ea7d70
+SHA1 (patch-js_src_intgemm_moz.build) = 460d64d188e145dae2a917cef116e0483d86552e
+SHA1 (patch-js_src_jit_FlushICache.cpp) = f5d1fcb391c36a29fb71a78dbf731ee6a1cb17b6
+SHA1 (patch-js_src_jit_arm64_vixl_Registers-vixl.h) = 0e64f5b7ebc92ba12949181f78f716d88adcb67e
+SHA1 (patch-js_src_util_NativeStack.cpp) = a0a16d8d8d78d3cc3f4d2a508586f1a7821f7dba
+SHA1 (patch-js_src_vm_TypedArrayObject-inl.h) = e7913c8d4b2b05b67040baa64dae62d6ba40390e
+SHA1 (patch-media_ffvpx_libavutil_arm_bswap.h) = d0bdc30d23447bd56185eb9dc5c86de591f9cc02
+SHA1 (patch-media_libpng_pngpriv.h) = ee952a703ee08e8ff2269c7178e55e00b12faa29
+SHA1 (patch-memory_build_mozjemalloc__types.h) = af87ef935653cb845a6b702af2f5645a6ada27db
+SHA1 (patch-mozglue_misc_Now.cpp) = 760724be1bdc4ca6e19edaf2c8df6dd84192d93f
+SHA1 (patch-netwerk_protocol_http_nsHttpHandler.cpp) = 67493b4635041d21ff9fbfda80b3197fed542a26
+SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = c99c3ce679f4196fc3baaf65051471a13d6fe8cd
+SHA1 (patch-python_mozbuild_mozbuild_backend_recursivemake.py) = 5be4183d9075f5a3a3c6b3e0338473af185fb50e
+SHA1 (patch-python_sites_build.txt) = f03f059bbe79bfdf7f1db5475279edb3c9d6ebed
+SHA1 (patch-python_sites_mach.txt) = be62d091430daaa2ceeff3aff07f71275896352f
+SHA1 (patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc) = b1067a6804470f7e365f347683b7d505853fd799
+SHA1 (patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc) = f9c44d0d6fd952296f23c24f56053958b30d8e5c
+SHA1 (patch-third__party_angle_angle__common__gn_moz.build) = bf799093eeb61677a257e947d2481a35ddb506f4
+SHA1 (patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in) = 64de7b9f179adfcd6ab2f2a1af1449631b7080fc
+SHA1 (patch-third__party_angle_angle__program__version__id__gn_moz.build) = b367cb16b059627a6033bdce664ba591ca3527e6
+SHA1 (patch-third__party_angle_src_common_system__utils__linux.cpp) = ed9936b0fa5807cdc8df871183589130784b6bc1
+SHA1 (patch-third__party_js_cfworker_build.sh) = 46cdf97b99cf01080f290ae8d9a33b5f869fc3e4
+SHA1 (patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc) = 127284a1a9b6e12581d325f5a5aadae443b0e57b
+SHA1 (patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build) = da85f4a3e22c4a346f1f8e87ecdc62bf8c0bddd7
+SHA1 (patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc) = 89f8f8eb5dcb877e0c70120f742050f1b32676fb
+SHA1 (patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build) = 87fe72745f7a01596b8be70d618491387e1aaa36
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc) = a4b04c390f93ffbc79e049f532251bfa00376eff
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc) = 9f1e606242b2ab2625dabc06f25b593f4721d387
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build) = 2a214979769cbf57b1d534610e524138aac7fc2b
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc) = e15f7e365ef6d57cd262f920f49c4d73f3a13305
+SHA1 (patch-third__party_libwebrtc_rtc__base_memory__usage.cc) = a831145ba15b30d30c6e6e216b574d416253ed4a
+SHA1 (patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc) = 6909c4da9e7b3785252e5bce9be0ff47ebb87e01
+SHA1 (patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc) = 8ae75100775037347008d168eedc151e0e993b0f
+SHA1 (patch-third__party_python_dlmanager_check.py) = 69054522d8ced8cb47e65e5a8b1a87ed5ce6708e
+SHA1 (patch-third__party_rust_mtu_src_bindings_netbsd.rs) = dc28ab3a4b6a5bee76ea6fd2485e34b9d6f1b195
+SHA1 (patch-third__party_sqlite3_ext_moz.build) = 4d94ea324617a20b3524016dd02fb717e518ece1
+SHA1 (patch-third__party_sqlite3_src_moz.build) = b26856a4b87aa12211575d9982f62dc899474b52
+SHA1 (patch-third__party_wasm2c_src_c-writer.cc) = 38eb2ee0e00722aa1380540b83648b43723719aa
+SHA1 (patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc) = 99d0db944f0c2d0c623460991efd423d9127c988
+SHA1 (patch-toolkit_components_terminator_nsTerminator.cpp) = e905e38ef1b88d764c695c019f15609350c1c43b
+SHA1 (patch-toolkit_moz.configure) = 1306e7ac3c3939886aff38a58dd3162e6517409b
+SHA1 (patch-toolkit_mozapps_installer_packager.mk) = c77481a1f8fe1e237b7fe87e3e586ca886ac1d3d
+SHA1 (patch-xpcom_base_nscore.h) = 1ac4d34d3c9e80bc1ac966c6c84cb320bc0fa1ec
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_moz.build) = 8980398051fa16c7283acb6d323419993cce1420
diff --git a/firefox/files/desktop.in b/firefox/files/desktop.in
new file mode 100644
index 0000000000..d72090e1aa
--- /dev/null
+++ b/firefox/files/desktop.in
@@ -0,0 +1,191 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@MOZILLA_NAME@ Web Browser
+Name[am]=
+Name[ar]=
+Name[az]=@MOZILLA_NAME@ Veb Səyyahı
+Name[be]=
+Name[bg]=Интернет браузър @MOZILLA_NAME@
+Name[bn]=
+Name[bs]=@MOZILLA_NAME@ web preglednik
+Name[ca]=Navegador web @MOZILLA_NAME@
+Name[cs]=Prohlížeč WWW @MOZILLA_NAME@
+Name[cy]=Y Porwr Gwe @MOZILLA_NAME@
+Name[da]=@MOZILLA_NAME@ - internetsurfning
+Name[de]=@MOZILLA_NAME@ Webbrowser
+Name[el]=Περιηγητής Διαδικτύου @MOZILLA_NAME@
+Name[en_CA]=@MOZILLA_NAME@ Web Browser
+Name[en_GB]=@MOZILLA_NAME@ Web Browser
+Name[es]=Navegador Web @MOZILLA_NAME@
+Name[et]=@MOZILLA_NAME@ veebibrauser
+Name[eu]=@MOZILLA_NAME@ web arakatzailea
+Name[fi]=@MOZILLA_NAME@, WWW-selain
+Name[fr]=Navigateur Web @MOZILLA_NAME@
+Name[ga]=Brabhsálaí Lín @MOZILLA_NAME@
+Name[gu]=એપીફની વૅબ બ્રાઉઝર
+Name[he]=דפדפן @MOZILLA_NAME@
+Name[hi]=
+Name[hr]=@MOZILLA_NAME@ Web preglednik
+Name[hu]=@MOZILLA_NAME@ webböngésző
+Name[id]=Web Browser @MOZILLA_NAME@
+Name[it]=Browser web @MOZILLA_NAME@
+Name[ja]=@MOZILLA_NAME@ ウェブ・ブラウザ
+Name[ko]=@MOZILLA_NAME@ 웹 브라우저
+Name[li]=@MOZILLA_NAME@ Web Browser
+Name[lt]=@MOZILLA_NAME@ web naršyklė
+Name[mk]=@MOZILLA_NAME@ веб прелистувач
+Name[ml]=എപ്പിഫാനി വെബ്ബ് ബ്രൌസ‌ര്
+Name[mn]=@MOZILLA_NAME@ веб хөтөч
+Name[ms]=Pelungsur Web @MOZILLA_NAME@
+Name[nb]=@MOZILLA_NAME@ nettleser
+Name[nl]=@MOZILLA_NAME@ Webbrowser
+Name[nn]=@MOZILLA_NAME@ nettlesar
+Name[no]=@MOZILLA_NAME@ nettleser
+Name[pa]=ਏਪੀਫਾਨੀ ਵੈੱਬ ਬਰਾਊਜ਼ਰ
+Name[pl]=Przeglądarka WWW @MOZILLA_NAME@
+Name[pt]=Navegador Web @MOZILLA_NAME@
+Name[pt_BR]=Navegador Web @MOZILLA_NAME@
+Name[ro]=Navigatorul @MOZILLA_NAME@
+Name[ru]=Веб-браузер @MOZILLA_NAME@
+Name[sk]=
+Name[sl]=Spletni brskalnik @MOZILLA_NAME@
+Name[sq]=@MOZILLA_NAME@ - Shfletuesi Web
+Name[sr]=
+Name[sr@Latn]=Veb čitač Spoznaja
+Name[sv]=Webbläsaren @MOZILLA_NAME@
+Name[ta]=எபிபனி வலை உலாவி
+Name[tk]=@MOZILLA_NAME@ Web Ahtarçisi
+Name[tr]=@MOZILLA_NAME@ Web Tarayıcı
+Name[uk]=Переглядач web @MOZILLA_NAME@
+Name[vi]=Trình Duyệt Web @MOZILLA_NAME@
+Name[wa]=Betchteu waibe epiphany
+Name[zh_CN]=@MOZILLA_NAME@ Web 浏览器
+Name[zh_TW]=@MOZILLA_NAME@ 網頁瀏覽器
+GenericName=Web Browser
+GenericName[ar]=متصفّح الانترنت
+GenericName[az]=Veb Səyyahı
+GenericName[be]=Вандроўнік па павуціньню
+GenericName[bg]=Браузър
+GenericName[bn]=ওয়েব ব্রাউজার
+GenericName[bs]=Web preglednik
+GenericName[ca]=Navegador web
+GenericName[cs]=Prohlížeč WWW
+GenericName[cy]=Porwr Gwe
+GenericName[da]=Internetsurfning
+GenericName[de]=Webbrowser
+GenericName[el]=Περιηγητής Ιστοσελίδων
+GenericName[en_CA]=Web Browser
+GenericName[en_GB]=Web Browser
+GenericName[es]=Navegador web
+GenericName[et]=Veebilehitseja
+GenericName[eu]=Web arakatzailea
+GenericName[fi]=WWW-selain
+GenericName[fr]=Navigateur Web @MOZILLA_NAME@
+GenericName[ga]=Brabhsálaí Lín
+GenericName[gu]=વેબ બ્રાઉઝર
+GenericName[he]=דפדפן אינטרנט
+GenericName[hi]=वेब ब्राउज़र
+GenericName[hr]=Web preglednik
+GenericName[hu]=Webböngésző
+GenericName[id]=Browser Web
+GenericName[it]=Browser web
+GenericName[ja]=GNOME ウェブ・ブラウザ
+GenericName[ko]=웹 브라우저
+GenericName[li]=Wèb Browser
+GenericName[lt]=Web naršyklė
+GenericName[mk]=Веб прелистувач
+GenericName[mn]=Веб хөтөч
+GenericName[ms]=Pelungsur Web
+GenericName[nb]=Nettleser
+GenericName[nl]=Web-browser
+GenericName[nn]=Nettlesar
+GenericName[no]=Nettleser
+GenericName[pa]=ਵੈਬ ਬਰਾਊਜ਼
+GenericName[pl]=Przeglądarka WWW
+GenericName[pt]=Navegador Web
+GenericName[pt_BR]=Navegador Web
+GenericName[ro]=Navigator Internet
+GenericName[ru]=Веб-браузер
+GenericName[sk]=WWW prehliadač
+GenericName[sl]=Spletni brskalnik
+GenericName[sq]=Shfletuesi Web
+GenericName[sr]=Веб читач
+GenericName[sr@Latn]=Veb čitač
+GenericName[sv]=Webbläsare
+GenericName[ta]=வலை உலாவி
+GenericName[th]=เว็บบราวเซอร์
+GenericName[tk]=Web Ahtarçysy
+GenericName[tr]=Web Tarayıcı
+GenericName[uk]=Переглядач web-сторінок
+GenericName[vi]=Trình duyệt Web
+GenericName[wa]=Betchteu waibe
+GenericName[zh_CN]=Web 浏览器
+GenericName[zh_TW]=網頁瀏覽器
+Comment=Browse the web
+Comment[ar]=تصفح الانترنت
+Comment[az]=Vebi gəzin
+Comment[be]=Вандраваць па павуціньню
+Comment[bg]=Сърфиране в интернет
+Comment[bn]=ওয়েব ব্রাউজ করুন
+Comment[bs]=Pregledaj na internetu
+Comment[ca]=Navegueu per la web
+Comment[cs]=Prohlížet WWW
+Comment[cy]=Pori'r we
+Comment[da]=Surf på internettet
+Comment[de]=Im Web surfen
+Comment[el]=Περιήγηση στον παγκόσμιο ιστό
+Comment[en_CA]=Browse the web
+Comment[en_GB]=Browse the web
+Comment[es]=Navegar por la web
+Comment[et]=Sirvi veebi
+Comment[eu]=Arakatu web-a
+Comment[fi]=Selaa WWW:tä
+Comment[fr]=Naviguer sur Internet
+Comment[ga]=Brabhsáil an Líon
+Comment[gu]=વેબમાં શોધો
+Comment[he]=גלוש ברשת
+Comment[hi]=वेब ब्राउज़ करें
+Comment[hr]=Pregledaj Web
+Comment[hu]=A világháló böngészése
+Comment[id]=Jelajah web
+Comment[it]=Esplora il web
+Comment[ja]=ウェブを閲覧します
+Comment[ko]=웹을 돌아 다닙니다
+Comment[li]=Blajere op internet
+Comment[lt]=Naršyti internete
+Comment[mk]=Прелистувајте на веб
+Comment[ml]=വലക്കെട്ട് തിരയുക
+Comment[mn]=Веб броузе хийх
+Comment[ms]=Layari web
+Comment[nb]=Surf på nettet
+Comment[nl]=Websurfen
+Comment[nn]=Surf på nettet
+Comment[no]=Surf på nettet
+Comment[pa]=ਵੈਬ ਬਰਾਊਜ਼
+Comment[pl]=Przeglądanie stron WWW
+Comment[pt]=Navegar na web
+Comment[pt_BR]=Navegar na web
+Comment[ro]=Navigare Internet
+Comment[ru]=Веб-браузер
+Comment[sk]=Prehliadať internet
+Comment[sl]=Brskaj po spletu
+Comment[sq]=Eksploro web-in
+Comment[sr]=Прегледај веб
+Comment[sr@Latn]=Pregledaj veb
+Comment[sv]=Surfa på nätet
+Comment[ta]=வலையில் உலாவு
+Comment[th]=ใช้งานเว็บบราวเซอร์ @MOZILLA_NAME@
+Comment[tk]=Webi Ahtar
+Comment[tr]=Web'e Gözat
+Comment[uk]=Програма перегляду web-сторінок
+Comment[vi]=Duyệt web
+Comment[wa]=Naivyî avå les waibes
+Comment[zh_CN]=浏览 Web
+Comment[zh_TW]=瀏覽網頁
+Exec=@MOZILLA@ %u
+Icon=@FIREFOX_ICON@
+StartupNotify=false
+Terminal=false
+Type=Application
+Categories=Application;Network;
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
diff --git a/firefox/files/firefox.sh b/firefox/files/firefox.sh
new file mode 100755
index 0000000000..b2b1ab5655
--- /dev/null
+++ b/firefox/files/firefox.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+if [ -f /usr/X11R7/lib/libEGL.so ] && [ -z "$LD_PRELOAD" ] && \
+  nm /usr/X11R7/lib/libGL.so | grep -Fq "B _glapi_tls_Dispatch"; then
+    # Workaround for PR#57445/50277 for netbsd-9 & netbsd-10 pre 2023-08-05
+    # This may not avoid a crash 100% of the time, but changes at least some
+    # cases of 100% crash on startup to "have not yet seen crash on startup"
+    echo "Applying libEGL LD_PRELOAD workaround for NetBSD" >&2
+    export LD_PRELOAD=/usr/X11R7/lib/libEGL.so
+    # Note that there is an _additional_ issue with firefox >= 111 that
+    # needs to be addressed, and that is worked around by disabling webgl
+    # by default, but it's not even worth looking at that on a system without
+    # the fixed libGL
+fi
+exec @PREFIX@/lib/@MOZILLA@/@MOZILLA@ "$@"
diff --git a/firefox/files/node-wrapper.sh b/firefox/files/node-wrapper.sh
new file mode 100755
index 0000000000..4b811bfb9b
--- /dev/null
+++ b/firefox/files/node-wrapper.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+VERS=v26.8.1
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
+	printf "${VERS}\n"
+fi
+
+exit 0
diff --git a/firefox/files/replace-moz.build.awk b/firefox/files/replace-moz.build.awk
new file mode 100644
index 0000000000..4de20ea8a0
--- /dev/null
+++ b/firefox/files/replace-moz.build.awk
@@ -0,0 +1,106 @@
+/^if CONFIG\[\"OS_TARGET\"\] == \"Android\":/{
+	flag = 1;
+	print $0;
+	next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\":");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"arm\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"arm\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"aarch64\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"aarch64\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86_64\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86_64\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	print $0;
+	next;
+}
+/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"aarch64\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"aarch64\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"arm\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"arm\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"arm\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86_64\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\" and CONFIG\[\"TARGET_CPU\"\] == \"x86_64\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+	flag = 0;
+	sub(/^if CONFIG\[\"MOZ_X11\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"MOZ_X11\"\] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+}
+{
+	if (flag != 1) {
+		sub(/^    DEFINES\[\"WEBRTC_LINUX\"\] = True/, "    if CONFIG\[\"OS_TARGET\"\] == \"Linux\":\n        DEFINES\[\"WEBRTC_LINUX\"\] = True\n    else:\n        DEFINES\[\"WEBRTC_BSD\"\] = True");
+		sub(/^if not CONFIG\[\"MOZ_DEBUG\"\] and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if not CONFIG[\"MOZ_DEBUG\"] and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+		sub(/^if CONFIG\[\"MOZ_DEBUG\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"MOZ_DEBUG\"] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+		sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"TARGET_CPU\"] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+		sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"TARGET_CPU\"] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+		sub(/^if CONFIG\[\"TARGET_CPU\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"TARGET_CPU\"] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+	}
+	print $0;
+}
diff --git a/firefox/mozilla-common.mk b/firefox/mozilla-common.mk
new file mode 100644
index 0000000000..d543f3c1cd
--- /dev/null
+++ b/firefox/mozilla-common.mk
@@ -0,0 +1,301 @@
+# $NetBSD: mozilla-common.mk,v 1.324 2026/09/05 03:51:59 tsutsui Exp $
+#
+# common Makefile fragment for mozilla packages based on gecko 2.0.
+#
+# used by www/firefox/Makefile
+
+.include "../../mk/bsd.prefs.mk"
+
+PYTHON_VERSIONS_INCOMPATIBLE=	27
+PYTHON_FOR_BUILD_ONLY=		tool
+ALL_ENV+=			PYTHON3=${PYTHONBIN}
+
+REPLACE_PYTHON=		build/cargo-linker
+
+HAS_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--prefix=${PREFIX}
+USE_TOOLS+=		pkg-config perl gmake gm4 unzip zip # autoconf213
+UNLIMIT_RESOURCES+=	datasize stacksize virtualsize
+
+OVERRIDE_GNU_CONFIG_SCRIPTS=	yes
+OVERRIDE_DIRDEPTH=		4
+
+USE_LANGUAGES+=		c c++
+USE_CXX_FEATURES+=	c++20
+
+# XXX: As of 145.0
+GCC_REQD+=		10
+
+TOOL_DEPENDS+=		cbindgen>=0.29.4:../../devel/cbindgen
+
+.if defined(FIREFOX_MAINTAINER) && !defined(MAINTAINER_INTERNAL)
+BUILDLINK_DEPMETHOD.nodejs=	build
+.include "../../lang/nodejs/nodeversion.mk"
+USE_TOOLS+=		diff
+.else
+CONFIGURE_ENV+=		NODEJS="${FILESDIR}/node-wrapper.sh"
+.endif
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+TOOL_DEPENDS+=		nasm>=2.14:../../devel/nasm
+TOOL_DEPENDS+=		yasm>=1.1:../../devel/yasm
+CFLAGS+=		-msse2
+.endif
+
+CKSUM_CRATES+=		third_party/rust/mtu
+
+CKSUMS+=		9fbb89ab042627182477b35adc61eed71cffada9d3d5d522766d6d369ad02d80
+CKSUMS+=		986f84f01a44521224c7a7c1b1883cc6a4f89cbcb24b36844bfffea5f285747e
+
+SUBST_CLASSES+=		cksum
+SUBST_STAGE.cksum=	pre-configure
+.for crate in ${CKSUM_CRATES}
+SUBST_FILES.cksum+=	${crate}/.cargo-checksum.json
+.endfor
+.for from to in ${CKSUMS}
+SUBST_SED.cksum+=	-e 's,${from},${to},g'
+.endfor
+
+# This is to work around build failures where an upstream configuration script
+# is confused by having more than one approximate match to MACHINE_GNU_PLATFORM
+# "i486" when attempting to select the Rust compiler target.
+.if ${MACHINE_PLATFORM:MNetBSD-*-i386}
+CONFIGURE_ARGS+=	--target=i586-unknown-netbsd
+CONFIGURE_ARGS+=	--host=i586-unknown-netbsd
+.elif ${MACHINE_PLATFORM:MSunOS-*-x86_64}
+CONFIGURE_ARGS+=	--host=x86_64-unknown-illumos
+CONFIGURE_ARGS+=	--target=x86_64-unknown-illumos
+.else
+CONFIGURE_ARGS+=	--target=${MACHINE_GNU_PLATFORM}
+CONFIGURE_ARGS+=	--host=${MACHINE_GNU_PLATFORM}
+.endif
+
+CONFIGURE_ENV+=		BINDGEN_CFLAGS="-isystem${PREFIX}/include/nspr \
+			-isystem${X11BASE}/include/pixman-1"
+
+do-test:
+	cd ${WRKSRC}/${OBJDIR}/dist/bin &&	\
+	     ./run-mozilla.sh ${WRKSRC}/mach check-spidermonkey
+
+# tar(1) of OpenBSD 5.5 has no --exclude command line option.
+.if ${OPSYS} == "OpenBSD"
+TOOLS_PLATFORM.tar=	${TOOLS_PATH.bsdtar}
+USE_TOOLS+=		bsdtar
+.else
+USE_TOOLS+=		tar
+.endif
+
+.if ${MACHINE_ARCH} == "i386"
+# This is required for SSE2 code under i386.
+CFLAGS+=	-mstackrealign
+.endif
+
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}security/nss/tests/*/*.sh
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}js/src/tests/update-test262.sh
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}intl/icu/source/configure
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}browser/components/loop/run-all-loop-tests.sh
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}browser/extensions/loop/run-all-loop-tests.sh
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}third_party/libwebrtc/tools_webrtc/iwyu/apply-iwyu
+CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}third_party/rust/dogear/.github/workflows/upload-to-codecov.sh
+
+CONFIGURE_ARGS+=	--enable-release
+# Disable Rust SIMD option to fix build with lang/rust-1.33.0
+# This should be enabled later again.
+#CONFIGURE_ARGS+=	--enable-rust-simd
+CONFIGURE_ARGS+=	--disable-tests
+# Mozilla Bug 1432751
+#CONFIGURE_ARGS+=	--enable-system-cairo
+CONFIGURE_ARGS+=	--enable-system-pixman
+CONFIGURE_ARGS+=	--with-system-libvpx
+CONFIGURE_ARGS+=	--enable-system-ffi
+CONFIGURE_ARGS+=	--with-system-icu
+CONFIGURE_ARGS+=	--with-intl-api
+CONFIGURE_ARGS+=	--with-system-nss
+CONFIGURE_ARGS+=	--with-system-nspr
+#CONFIGURE_ARGS+=	--with-system-jpeg
+CONFIGURE_ARGS+=	--with-system-zlib
+CONFIGURE_ARGS+=	--with-system-libevent
+CONFIGURE_ARGS+=	--disable-crashreporter
+CONFIGURE_ARGS+=	--enable-chrome-format=omni
+CONFIGURE_ARGS+=	--with-system-webp
+CONFIGURE_ARGS+=	--enable-forkserver
+
+#CONFIGURE_ARGS+=	--enable-readline
+CONFIGURE_ARGS+=	--disable-icf
+CONFIGURE_ARGS+=	--disable-updater
+
+.include "../../mk/compiler.mk"
+
+.if empty(PKGSRC_COMPILER:Mclang)
+# Set path to "clang for cbindgen" when target compiler is not clang.
+CONFIGURE_ARGS+=	--with-clang-path=${PREFIX}/bin/clang
+.endif
+CONFIGURE_ARGS+=	--with-libclang-path=${PREFIX}/lib
+
+# RLBox WASM sandbox
+.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
+# For wasm-ld command
+TOOL_DEPENDS+=		lld-[0-9]*:../../devel/lld
+.include "../../lang/wasi-libc/buildlink3.mk"
+.include "../../lang/wasi-libcxx/buildlink3.mk"
+.include "../../lang/wasi-compiler-rt/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-wasi-sysroot=${PREFIX}/wasi
+CONFIGURE_ENV+=		WASM_CC=${PREFIX}/bin/clang
+CONFIGURE_ENV+=		WASM_CXX=${PREFIX}/bin/clang++
+.else
+CONFIGURE_ARGS+=	--without-wasm-sandboxed-libraries
+.endif
+
+.include "../../sysutils/pciutils/libname.mk"
+SUBST_CLASSES+=				fix-libpci-soname
+SUBST_STAGE.fix-libpci-soname=		pre-configure
+SUBST_MESSAGE.fix-libpci-soname=	Fixing libpci soname
+SUBST_FILES.fix-libpci-soname+=		${MOZILLA_DIR}toolkit/xre/gfxtest/glxtest.cpp
+SUBST_SED.fix-libpci-soname+=		-e 's,"libpci.so, "lib${PCIUTILS_LIBNAME}.so,'
+
+.if ${MACHINE_PLATFORM:MNetBSD-*-i386}
+SQLITE3OPTFLAG=			'-O0',
+.else
+SQLITE3OPTFLAG=			# empty
+.endif
+SUBST_CLASSES+=			sqlite3-opt
+SUBST_STAGE.sqlite3-opt=	pre-configure
+SUBST_MESSAGE.sqlite3-opt=	Fixing segfault in libmozsqlite3.so
+SUBST_FILES.sqlite3-opt+=	${MOZILLA_DIR}third_party/sqlite3/src/moz.build
+SUBST_VARS.sqlite3-opt+=	SQLITE3OPTFLAG
+
+.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "aarch64"
+SUBST_CLASSES+=			sve2
+SUBST_STAGE.sve2=		pre-configure
+SUBST_FILES.sve2=		media/libyuv/libyuv/source/convert.cc
+SUBST_FILES.sve2+=		media/libyuv/libyuv/source/scale_argb.cc
+SUBST_FILES.sve2+=		media/libyuv/libyuv/source/convert_argb.cc
+SUBST_SED.sve2=			-e 's/_SVE2/_NEON/g'
+.endif
+
+# Do not pass '-j1 -j1' for MAKE_JOBS=1 for NetBSD 9.3 or earlier.
+RUST_MAKE_JOBS=		# empty by default
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 090400
+.  if defined(MAKE_JOBS) && !empty(MAKE_JOBS) && !(defined(MAKE_JOBS_SAFE) && ${MAKE_JOBS_SAFE:U:tl} == no)
+.    if ${MAKE_JOBS} > 1
+RUST_MAKE_JOBS=		-j1 # for MAKE_JOBS=1, RUST_MAKE_JOBS should be empty.
+.    endif
+.  endif
+.endif
+
+SUBST_CLASSES+=		njobs
+SUBST_STAGE.njobs=	pre-configure
+SUBST_MESSAGE.njobs=	Setting MAKE_JOBS for cairo
+SUBST_FILES.njobs+=	${MOZILLA_DIR}config/makefiles/rust.mk
+SUBST_VARS.njobs+=	RUST_MAKE_JOBS
+
+# Workaround for link of libxul.so as of 96.0.
+# There are too many -ldl under third_paty/libwebrtc.
+.include "../../mk/dlopen.buildlink3.mk"
+BUILDLINK_TRANSFORM+=	opt:-ldl:${BUILDLINK_LDADD.dl:Q}
+
+CONFIG_GUESS_OVERRIDE+=		${MOZILLA_DIR}build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=		${MOZILLA_DIR}js/src/build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=		${MOZILLA_DIR}nsprpub/build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=		${MOZILLA_DIR}/js/ctypes/libffi/config.guess
+CONFIG_SUB_OVERRIDE+=		${MOZILLA_DIR}build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=		${MOZILLA_DIR}js/src/build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=		${MOZILLA_DIR}nsprpub/build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=		${MOZILLA_DIR}/js/ctypes/libffi/config.sub
+
+CONFIGURE_ENV+=		CPP=${CPP:Q}
+ALL_ENV+=		SHELL=${CONFIG_SHELL:Q}
+ALL_ENV+=		MOZ_APP_NAME=${MOZILLA}
+
+# Build outside ${WRKSRC}
+# Try to avoid conflict with config/makefiles/xpidl/Makefile.in
+.if ${MAINTAINER_INTERNAL:Uno} == "yes"
+OBJDIR=			../no-node-build
+.else
+OBJDIR=			../build
+.endif
+CONFIGURE_DIRS=		${OBJDIR}
+CONFIGURE_SCRIPT=	${WRKSRC}/configure
+
+PLIST_VARS+=	v4l2_decode ffvpx
+
+.if ${MACHINE_ARCH} == "aarch64" || \
+    ${MACHINE_ARCH:M*arm*} || \
+    ${MACHINE_ARCH} == riscv64
+PLIST.v4l2_decode=	yes	# see toolkit/moz.configure
+.endif
+
+.if ${MACHINE_ARCH} == "aarch64" || \
+    ${MACHINE_ARCH:M*arm*} || \
+    ${MACHINE_ARCH} == "i386" || \
+    ${MACHINE_ARCH} == "x86_64"
+PLIST.ffvpx=	yes	# see media/ffvpx/ffvpxcommon.mozbuild
+.endif
+
+# See ${WRKSRC}/security/sandbox/mac/Sandbox.mm: On Darwin, sandboxing
+# support is only available when the toolkit is cairo-cocoa.
+CONFIGURE_ARGS.Darwin+=	--disable-sandbox
+CONFIGURE_ARGS.NetBSD+=	--disable-sandbox
+
+PRINT_PLIST_AWK+=	/\/${MOZILLA}\// { gsub(/\/${MOZILLA}\//, "/$${MOZILLA}/") }
+PRINT_PLIST_AWK+=	/\/${MOZILLA}.png$$/ { gsub(/\/${MOZILLA}.png$$/, "/$${MOZILLA}.png") }
+PRINT_PLIST_AWK+=	/\/${MOZILLA}.desktop$$/ { gsub(/\/${MOZILLA}.desktop$$/, "/$${MOZILLA}.desktop") }
+PRINT_PLIST_AWK+=	/\/${MOZILLA}$$/ { gsub(/\/${MOZILLA}$$/, "/$${MOZILLA}") }
+PRINT_PLIST_AWK+=	/\/${MOZILLA}-bin$$/ { gsub(/\/${MOZILLA}-bin$$/, "/$${MOZILLA}-bin") }
+PLIST_SUBST+=		MOZILLA=${MOZILLA}
+
+# Makefiles sometimes call "rm -f" without more arguments. Kludge around ...
+.PHONY: create-rm-wrapper
+pre-configure: create-rm-wrapper
+create-rm-wrapper:
+	printf '#!/bin/sh\n[ "$$*" = "-f" ] && exit 0\nexec /bin/rm $$@\n' > \
+	  ${WRAPPER_DIR}/bin/rm
+	chmod +x ${WRAPPER_DIR}/bin/rm
+
+# The configure test for __thread succeeds, but later we end up with:
+# dist/bin/libxul.so: undefined reference to `__tls_get_addr'
+CONFIGURE_ENV.NetBSD+=	ac_cv_thread_keyword=no
+# In unspecified case, clock_gettime(CLOCK_MONOTONIC, ...) fails.
+CONFIGURE_ENV.NetBSD+=	ac_cv_clock_monotonic=
+
+.include "../../sysutils/pciutils/buildlink3.mk"
+.include "../../mk/atomic64.mk"
+BUILDLINK_API_DEPENDS.libevent+=	libevent>=1.1
+.include "../../devel/libevent/buildlink3.mk"
+.include "../../devel/libffi/buildlink3.mk"
+# See build/moz.configure/nspr.configure
+BUILDLINK_API_DEPENDS.nspr+=	nspr>=4.34
+.include "../../devel/nspr/buildlink3.mk"
+BUILDLINK_API_DEPENDS.icu+=	icu>=78.1
+.include "../../textproc/icu/buildlink3.mk"
+# See build/moz.configure/nss.configure
+BUILDLINK_API_DEPENDS.nss+=	nss>=3.126.1
+.include "../../devel/nss/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+#.include "../../mk/jpeg.buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+#BUILDLINK_API_DEPENDS.cairo+=	cairo>=1.10.2nb4
+#.include "../../graphics/cairo/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libwebp+=	libwebp>=1.0.2
+.include "../../graphics/libwebp/buildlink3.mk"
+BUILDLINK_DEPMETHOD.clang=	build
+.include "../../lang/clang/buildlink3.mk"
+RUST_REQ=	1.90.0
+.include "../../lang/rust/rust.mk"
+.include "../../multimedia/libvpx/buildlink3.mk"
+.include "../../net/libIDL/buildlink3.mk"
+.include "../../multimedia/ffmpeg9/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../x11/libXtst/buildlink3.mk"
+BUILDLINK_API_DEPENDS.pixman+= pixman>=0.40
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../x11/gtk3/buildlink3.mk"
+PLIST_VARS+=		wayland
+.if ${PKG_BUILD_OPTIONS.gtk3:Mwayland}
+CONFIGURE_ARGS+=	--enable-default-toolkit=cairo-gtk3-x11-wayland
+PLIST.wayland=		yes
+.else
+CONFIGURE_ARGS+=	--enable-default-toolkit=cairo-gtk3
+.endif
+.include "../../lang/python/batteries-included.mk"
+.include "../../lang/python/application.mk"
diff --git a/firefox/options.mk b/firefox/options.mk
new file mode 100644
index 0000000000..66ecb71c8b
--- /dev/null
+++ b/firefox/options.mk
@@ -0,0 +1,105 @@
+# $NetBSD: options.mk,v 1.77 2025/10/27 14:24:32 ryoon Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.firefox
+
+PKG_SUPPORTED_OPTIONS=	official-mozilla-branding
+PKG_SUPPORTED_OPTIONS+=	debug debug-info mozilla-jemalloc webrtc
+PKG_SUPPORTED_OPTIONS+=	dbus speechd
+PKG_SUPPORTED_OPTIONS+=	alsa pulseaudio sunaudio jack
+
+.if ${OPSYS} == "Linux"
+PKG_SUGGESTED_OPTIONS+=	dbus
+PKG_SUGGESTED_OPTIONS+=	alsa pulseaudio mozilla-jemalloc webrtc
+.endif
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "SunOS"
+PKG_SUGGESTED_OPTIONS+=	sunaudio
+.endif
+
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} >= 090000
+PKG_SUGGESTED_OPTIONS+=	webrtc
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Malsa)
+AUDIO_BACKENDS+=	alsa
+.include "../../audio/alsa-lib/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmozilla-jemalloc)
+CONFIGURE_ARGS+=	--enable-jemalloc
+CONFIGURE_ARGS+=	--enable-replace-malloc
+.else
+CONFIGURE_ARGS+=	--disable-jemalloc
+#.include "../../devel/jemalloc/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+=	--enable-debug="-g -Og"
+CONFIGURE_ARGS+=	--disable-optimize
+CONFIGURE_ARGS+=	--enable-debug-js-modules
+CONFIGURE_ARGS+=	--disable-install-strip
+CPPFLAGS+=		-DXXH_NO_INLINE_HINTS
+.else
+.  if !empty(PKG_OPTIONS:Mdebug-info)
+CONFIGURE_ARGS+=	--enable-debug-symbols
+CONFIGURE_ARGS+=	--enable-optimize=-O2
+CONFIGURE_ARGS+=	--disable-install-strip
+.  else
+CONFIGURE_ARGS+=	--disable-debug-symbols
+CONFIGURE_ARGS+=	--enable-optimize=-O2
+CONFIGURE_ARGS+=	--enable-install-strip
+.  endif
+CONFIGURE_ARGS+=	--disable-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+AUDIO_BACKENDS+=	pulseaudio
+.include "../../audio/pulseaudio/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mdbus)
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-dbus
+.else
+CONFIGURE_ARGS+=	--disable-dbus
+.  if ${OPSYS} == "Linux"
+CONFIGURE_ARGS+=	--disable-necko-wifi
+.  endif
+.endif
+
+.if !empty(PKG_OPTIONS:Mofficial-mozilla-branding)
+CONFIGURE_ARGS+=	--enable-official-branding
+LICENSE+=		AND mozilla-trademark-license
+RESTRICTED=		Trademark holder prohibits distribution of modified versions.
+NO_BIN_ON_CDROM=	${RESTRICTED}
+NO_BIN_ON_FTP=		${RESTRICTED}
+.else
+CONFIGURE_ARGS+=	--with-branding=browser/branding/unofficial
+.endif
+
+.if !empty(PKG_OPTIONS:Msunaudio)
+AUDIO_BACKENDS+=	sunaudio
+.endif
+
+.if !empty(PKG_OPTIONS:Mjack)
+AUDIO_BACKENDS+=	jack
+.include "../../audio/jack/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mwebrtc)
+.include "../../graphics/libv4l/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-webrtc
+.else
+CONFIGURE_ARGS+=	--disable-webrtc
+.endif
+
+.if !empty(PKG_OPTIONS:Mspeechd)
+.include "../../audio/speech-dispatcher/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-synth-speechd
+.else
+CONFIGURE_ARGS+=	--disable-synth-speechd
+.endif
+
+CONFIGURE_ARGS+=	--audio-backends=${AUDIO_BACKENDS:ts,}
diff --git a/firefox/patches/patch-browser_app_profile_firefox.js b/firefox/patches/patch-browser_app_profile_firefox.js
new file mode 100644
index 0000000000..5468674e6c
--- /dev/null
+++ b/firefox/patches/patch-browser_app_profile_firefox.js
@@ -0,0 +1,44 @@
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.26 2026/08/14 12:26:11 ryoon Exp $
+
+This patch modifies default Firefox settings - see the comments above
+each one.
+
+--- browser/app/profile/firefox.js.orig	2026-08-10 18:46:16.000000000 +0000
++++ browser/app/profile/firefox.js
+@@ -2929,6 +2929,36 @@ pref("toolkit.coverage.endpoint.base", "https://covera
+ pref("toolkit.coverage.enabled", false);
+ pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org";);
+ 
++// Select UI locale from LANG/LC_MESSAGE environmental variables
++pref("intl.locale.requested", "");
++
++// Enable system addons, for example langpacks from www/firefox-l10n
++pref("extensions.autoDisableScopes", 11);
++
++// Firefox includes a complex mechanism for "blacklisting" GPUs that
++// appears to fail on a NetBSD system where the only available OpenGL
++// implementations are all from Mesa.  WebRender was supposed to be
++// enabled by default from Firefox 91 onwards and appears to greatly
++// improve performance even with acceleration disabled at the kernel
++// level.
++pref("gfx.webrender.all", true);
++
++// Disable Web MIDI support
++// NetBSD gets immediate SIGSEGV when Web MIDI is enabled.
++pref("midi.testing", true);
++pref("dom.webmidi.enabled", true);
++pref("midi.prompt.testing", true);
++pref("media.navigator.permission.disabled", true);
++
++// Avoid unfunctional video and audio codecs
++pref("media.allow-audio-non-utility", true);
++
++// On NetBSD, many web applications (e.g. Telegram, Mastodon, Twitter)
++// will freeze until the service worker is restarted in about:serviceworkers.
++// This is a workaround that makes most of these sites function.
++// The root cause of this should be investigated.
++pref("dom.serviceWorkers.enabled", false);
++
+ // Discovery prefs
+ pref("browser.discovery.enabled", true);
+ pref("browser.discovery.containers.enabled", true);
diff --git a/firefox/patches/patch-build_gn__processor.py b/firefox/patches/patch-build_gn__processor.py
new file mode 100644
index 0000000000..e9a290b367
--- /dev/null
+++ b/firefox/patches/patch-build_gn__processor.py
@@ -0,0 +1,46 @@
+$NetBSD: patch-build_gn__processor.py,v 1.1 2025/10/27 14:24:33 ryoon Exp $
+
+--- build/gn_processor.py.orig	2025-10-03 13:17:56.000000000 +0000
++++ build/gn_processor.py
+@@ -190,6 +190,8 @@ def filter_gn_config(path, gn_result, sa
+         "mac": "Darwin",
+         "openbsd": "OpenBSD",
+         "win": "WINNT",
++        "freebsd": "FreeBSD",
++        "netbsd": "NetBSD",
+     }
+ 
+     mozbuild_args = {
+@@ -810,17 +812,17 @@ def main():
+ 
+     vars_set = []
+     for is_debug in (True, False):
+-        for target_os in ("android", "linux", "mac", "openbsd", "win"):
++        for target_os in ("android", "linux", "mac", "openbsd", "win", "freebsd", "netbsd"):
+             target_cpus = ["x64"]
+-            if target_os in ("android", "linux", "mac", "win", "openbsd"):
++            if target_os in ("android", "linux", "mac", "win", "openbsd", "freebsd", "netbsd"):
+                 target_cpus.append("arm64")
+-            if target_os in ("android", "linux"):
++            if target_os in ("android", "linux", "freebsd", "netbsd"):
+                 target_cpus.append("arm")
+-            if target_os in ("android", "linux", "win"):
++            if target_os in ("android", "linux", "win", "freebsd", "netbsd"):
+                 target_cpus.append("x86")
+-            if target_os in ("linux", "openbsd"):
++            if target_os in ("linux", "openbsd", "freebsd", "netbsd"):
+                 target_cpus.append("riscv64")
+-            if target_os == "linux":
++            if target_os in ("linux", "openbsd", "freebsd", "netbsd"):
+                 target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"])
+             for target_cpu in target_cpus:
+                 vars = {
+@@ -834,7 +836,7 @@ def main():
+                         vars["ozone_platform_x11"] = enable_x11
+                         vars_set.append(vars.copy())
+                 else:
+-                    if target_os == "openbsd":
++                    if target_os in ("openbsd", "freebsd", "netbsd"):
+                         vars["ozone_platform_x11"] = True
+                     vars_set.append(vars)
+ 
diff --git a/firefox/patches/patch-build_moz.configure_init.configure b/firefox/patches/patch-build_moz.configure_init.configure
new file mode 100644
index 0000000000..93c053da51
--- /dev/null
+++ b/firefox/patches/patch-build_moz.configure_init.configure
@@ -0,0 +1,15 @@
+$NetBSD: patch-build_moz.configure_init.configure,v 1.5 2024/05/10 09:14:07 jperkin Exp $
+
+Support illumos triple.
+
+--- build/moz.configure/init.configure.orig	2024-05-09 17:11:33.720650056 +0000
++++ build/moz.configure/init.configure
+@@ -535,6 +535,8 @@ def split_triplet(triplet, allow_wasi=Fa
+         canonical_os = canonical_kernel = "OpenBSD"
+     elif os.startswith("solaris"):
+         canonical_os = canonical_kernel = "SunOS"
++    elif os.startswith("illumos"):
++        canonical_os = canonical_kernel = "SunOS"
+     elif os.startswith("wasi") and allow_wasi:
+         canonical_os = canonical_kernel = "WASI"
+     else:
diff --git a/firefox/patches/patch-build_moz.configure_rust.configure b/firefox/patches/patch-build_moz.configure_rust.configure
new file mode 100644
index 0000000000..413b542641
--- /dev/null
+++ b/firefox/patches/patch-build_moz.configure_rust.configure
@@ -0,0 +1,15 @@
+$NetBSD: patch-build_moz.configure_rust.configure,v 1.8 2020/12/17 09:53:15 ryoon Exp $
+
+* Do not match rumprun toolchain for NetBSD,
+  narrowed should be one not two.
+
+--- build/moz.configure/rust.configure.orig	2020-12-03 23:12:39.000000000 +0000
++++ build/moz.configure/rust.configure
+@@ -371,6 +371,7 @@ def detect_rustc_target(
+             for c in candidates
+             if c.target.raw_os == host_or_target.raw_os
+             and c.target.raw_cpu == host_or_target.raw_cpu
++            and not c.rust_target.endswith("-rumprun-netbsd")
+         ]
+         if len(narrowed) == 1:
+             return narrowed[0].rust_target
diff --git a/firefox/patches/patch-config_gcc-stl-wrapper.template.h b/firefox/patches/patch-config_gcc-stl-wrapper.template.h
new file mode 100644
index 0000000000..49ab340e07
--- /dev/null
+++ b/firefox/patches/patch-config_gcc-stl-wrapper.template.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-config_gcc-stl-wrapper.template.h,v 1.7 2026/08/24 12:51:47 ryoon Exp $
+
+--- config/gcc-stl-wrapper.template.h.orig	2026-04-15 13:12:19.000000000 +0000
++++ config/gcc-stl-wrapper.template.h
+@@ -27,8 +27,8 @@
+ // limits) and bug 1694575 (iosfwd).
+ // Please be careful when adding more exceptions, especially regarding
+ // the header not directly or indirectly including <new>.
+-#ifndef moz_dont_include_mozalloc_for_cstdlib
+-#  define moz_dont_include_mozalloc_for_cstdlib
++#ifndef moz_dont_include_mozalloc_for_${HEADER}
++#  define moz_dont_include_mozalloc_for_${HEADER}
+ #endif
+ 
+ #ifndef moz_dont_include_mozalloc_for_cmath
+@@ -50,7 +50,7 @@
+ // Include mozalloc after the STL header and all other headers it includes
+ // have been preprocessed.
+ #if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
+-    !defined(moz_dont_include_mozalloc_for_${HEADER})
++    !defined(moz_dont_include_mozalloc_for_${HEADER})
+ #  define MOZ_INCLUDE_MOZALLOC_H
+ #  define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
+ #endif
+@@ -78,5 +78,7 @@
+ #ifndef mozilla_throw_gcc_h
+ #  include "mozilla/throw_gcc.h"
+ #endif
++
++#undef moz_dont_include_mzalloc_for_${HEADER}
+ 
+ #endif  // if mozilla_${HEADER}_h
diff --git a/firefox/patches/patch-config_makefiles_rust.mk b/firefox/patches/patch-config_makefiles_rust.mk
new file mode 100644
index 0000000000..774e0142d8
--- /dev/null
+++ b/firefox/patches/patch-config_makefiles_rust.mk
@@ -0,0 +1,30 @@
+$NetBSD: patch-config_makefiles_rust.mk,v 1.15 2025/10/27 14:24:33 ryoon Exp $
+
+NetBSD doesn't get along with parallel rust builds (it causes issues
+with ld.so) which are the default. Force -j1.
+
+Use less memory to fix build under NetBSD/i386.
+From: https://bugzilla.mozilla.org/show_bug.cgi?id=1644409
+
+--- config/makefiles/rust.mk.orig	2026-08-26 21:11:39.000000000 +0000
++++ config/makefiles/rust.mk
+@@ -65,6 +65,9 @@ endif
+ endif
+ endif
+ endif
++ifeq ($(OS_ARCH),NetBSD)
++cargo_build_flags += @RUST_MAKE_JOBS@
++endif
+ 
+ # Without -j > 1, make will not pass jobserver info down to cargo. Force
+ # one job when requested as a special case.
+@@ -91,7 +94,8 @@ ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE))
+ # Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045.
+ ifndef MOZ_CODE_COVERAGE
+ ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
++cargo_rustc_flags += -Clto=thin
++export CARGO_PROFILE_RELEASE_LTO=thin
+ endif
+ # We need -Cembed-bitcode=yes for all crates when using -Clto.
+ RUSTFLAGS += -Cembed-bitcode=yes
diff --git a/firefox/patches/patch-dom_base_nsAttrName.h b/firefox/patches/patch-dom_base_nsAttrName.h
new file mode 100644
index 0000000000..3eddb89fa0
--- /dev/null
+++ b/firefox/patches/patch-dom_base_nsAttrName.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-dom_base_nsAttrName.h,v 1.2 2019/01/29 16:28:22 ryoon Exp $
+
+cbindgen gets confused by NetBSD's types being macros too
+https://mail-index.netbsd.org/tech-pkg/2018/10/25/msg020395.html
+
+--- dom/base/nsAttrName.h.orig	2019-01-18 00:20:23.000000000 +0000
++++ dom/base/nsAttrName.h
+@@ -16,6 +16,10 @@
+ #include "mozilla/dom/NodeInfo.h"
+ #include "nsAtom.h"
+ #include "nsDOMString.h"
++#ifdef __NetBSD__
++/* This is also a macro which causes problems with cbindgen */
++#undef uintptr_t
++#endif
+ 
+ #define NS_ATTRNAME_NODEINFO_BIT 1
+ class nsAttrName {
diff --git a/firefox/patches/patch-dom_canvas_WebGLMethodDispatcher.h b/firefox/patches/patch-dom_canvas_WebGLMethodDispatcher.h
new file mode 100644
index 0000000000..09d8560653
--- /dev/null
+++ b/firefox/patches/patch-dom_canvas_WebGLMethodDispatcher.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-dom_canvas_WebGLMethodDispatcher.h,v 1.1 2026/08/14 12:26:11 ryoon Exp $
+
+- Work around broken WebGL method dispatch on NetBSD.
+  From PR pkg/60579: www/firefox: WebGL does not work on NetBSD
+
+--- dom/canvas/WebGLMethodDispatcher.h.orig	2026-07-27 13:13:11.000000000 +0000
++++ dom/canvas/WebGLMethodDispatcher.h
+@@ -31,7 +31,18 @@ class WebGLMethodDispatcher
+ 
+ // Defines each method the WebGLMethodDispatcher handles.  The COUNTER value
+ // is used as a cross-process ID for each of the methods.
++#ifdef __NetBSD__
++// XXX: NetBSD system headers use __COUNTER__ in __CTASSERT(), so
++//      __COUNTER__ may already have been incremented when this header is
++//      included.  Normalize the method IDs so that they start at zero.
++constexpr size_t kWebGLMethodDispatcherCounterBase = __COUNTER__ + 1;
++
++#define DEFINE_ASYNC(_METHOD)                                      \
++  DEFINE_METHOD_DISPATCHER(                                        \
++      __COUNTER__ - kWebGLMethodDispatcherCounterBase, _METHOD, 0)
++#else
+ #define DEFINE_ASYNC(_METHOD) DEFINE_METHOD_DISPATCHER(__COUNTER__, _METHOD, 0)
++#endif
+ 
+ DEFINE_ASYNC(HostWebGLContext::CreateBuffer)
+ DEFINE_ASYNC(HostWebGLContext::CreateFramebuffer)
diff --git a/firefox/patches/patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp b/firefox/patches/patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp
new file mode 100644
index 0000000000..e7c4ec93f5
--- /dev/null
+++ b/firefox/patches/patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-dom_media_mediacapabilities_MediaCapabilitiesValidation.cpp,v 1.2 2026/07/21 15:25:01 ryoon Exp $
+
+--- dom/media/mediacapabilities/MediaCapabilitiesValidation.cpp.orig	2026-07-13 13:09:12.000000000 +0000
++++ dom/media/mediacapabilities/MediaCapabilitiesValidation.cpp
+@@ -263,7 +263,7 @@ ValidationResult IsValidVideoConfiguration(const Video
+ 
+   // Step 1: If framerate is not finite or is not greater than 0,
+   // return false and abort these steps.
+-  if (!isfinite(aConfig.mFramerate) || !(aConfig.mFramerate > 0)) {
++  if (!std::isfinite(aConfig.mFramerate) || !(aConfig.mFramerate > 0)) {
+     ValidationResult err = Err(ValidationError::FramerateInvalid);
+     LOG(("[Invalid VideoConfiguration (Framerate, {}) #1] Rejecting '{}'\n",
+          EnumValueToString(err.unwrapErr()),
diff --git a/firefox/patches/patch-dom_media_webrtc_libwebrtc__overrides_moz.build b/firefox/patches/patch-dom_media_webrtc_libwebrtc__overrides_moz.build
new file mode 100644
index 0000000000..c48bfca7ea
--- /dev/null
+++ b/firefox/patches/patch-dom_media_webrtc_libwebrtc__overrides_moz.build
@@ -0,0 +1,13 @@
+$NetBSD: patch-dom_media_webrtc_libwebrtc__overrides_moz.build,v 1.1 2025/09/26 23:15:49 ryoon Exp $
+
+--- dom/media/webrtc/libwebrtc_overrides/moz.build.orig	2025-09-10 13:58:16.516218833 +0000
++++ dom/media/webrtc/libwebrtc_overrides/moz.build
+@@ -52,7 +52,7 @@ if CONFIG["OS_TARGET"] == "Linux" and CO
+ 
+ if (
+     CONFIG["MOZ_X11"] == "1"
+-    and CONFIG["OS_TARGET"] == "Linux"
++    and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD")
+     and CONFIG["TARGET_CPU"] in ("aarch64", "arm", "mips32", "mips64", "x86", "x86_64")
+ ):
+     UNIFIED_SOURCES += [
diff --git a/firefox/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp b/firefox/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp
new file mode 100644
index 0000000000..947c3f8e23
--- /dev/null
+++ b/firefox/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp
@@ -0,0 +1,40 @@
+$NetBSD: patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp,v 1.1 2023/06/04 09:26:35 ryoon Exp $
+
+--- dom/webtransport/api/WebTransportDatagramDuplexStream.cpp.orig	2023-04-23 21:17:18.000000000 +0000
++++ dom/webtransport/api/WebTransportDatagramDuplexStream.cpp
+@@ -62,7 +62,7 @@ void WebTransportDatagramDuplexStream::S
+                                                          ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-incomingmaxage
+   // Step 1
+-  if (isnan(aMaxAge) || aMaxAge < 0.) {
++  if (std::isnan(aMaxAge) || aMaxAge < 0.) {
+     aRv.ThrowRangeError("Invalid IncomingMaxAge");
+     return;
+   }
+@@ -78,7 +78,7 @@ void WebTransportDatagramDuplexStream::S
+                                                          ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-outgoingmaxage
+   // Step 1
+-  if (isnan(aMaxAge) || aMaxAge < 0.) {
++  if (std::isnan(aMaxAge) || aMaxAge < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingMaxAge");
+     return;
+   }
+@@ -94,7 +94,7 @@ void WebTransportDatagramDuplexStream::S
+     double aWaterMark, ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-incominghighwatermark
+   // Step 1
+-  if (isnan(aWaterMark) || aWaterMark < 0.) {
++  if (std::isnan(aWaterMark) || aWaterMark < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingMaxAge");
+     return;
+   }
+@@ -110,7 +110,7 @@ void WebTransportDatagramDuplexStream::S
+     double aWaterMark, ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-outgoinghighwatermark
+   // Step 1
+-  if (isnan(aWaterMark) || aWaterMark < 0.) {
++  if (std::isnan(aWaterMark) || aWaterMark < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingHighWaterMark");
+     return;
+   }
diff --git a/firefox/patches/patch-gfx_ots_src_name.cc b/firefox/patches/patch-gfx_ots_src_name.cc
new file mode 100644
index 0000000000..4c4f650798
--- /dev/null
+++ b/firefox/patches/patch-gfx_ots_src_name.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-gfx_ots_src_name.cc,v 1.1 2025/07/26 14:12:54 ryoon Exp $
+
+--- gfx/ots/src/name.cc.orig	2025-07-26 13:25:22.747360576 +0000
++++ gfx/ots/src/name.cc
+@@ -16,7 +16,7 @@ namespace {
+ // We disallow characters outside the URI spec "unreserved characters"
+ // set; any chars outside this set will be replaced by underscore.
+ bool AllowedInPsName(char c) {
+-  return isalnum(c) || std::strchr("-._~", c);
++  return isalnum((unsigned char)c) || std::strchr("-._~", c);
+ }
+ 
+ bool SanitizePsNameAscii(std::string& name) {
diff --git a/firefox/patches/patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp b/firefox/patches/patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp
new file mode 100644
index 0000000000..a48e5579ef
--- /dev/null
+++ b/firefox/patches/patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-gfx_skia_skia_src_sksl_codegen_SkSLSPIRVCodeGenerator.cpp,v 1.1 2025/07/26 14:12:54 ryoon Exp $
+
+--- gfx/skia/skia/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp.orig	2025-07-26 13:25:51.000473818 +0000
++++ gfx/skia/skia/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp
+@@ -4405,7 +4405,7 @@ void SPIRVCodeGenerator::writeFunctionSt
+             f, fSpecializationInfo, fActiveSpecializationIndex,
+             [&](int, const Variable*, const Expression* expr) {
+                 std::string name = expr->description();
+-                std::replace_if(name.begin(), name.end(), [](char c) { return !isalnum(c); }, '_');
++                std::replace_if(name.begin(), name.end(), [](char c) { return !isalnum(i(unsigned char)c); }, '_');
+ 
+                 mangledName += "_" + name;
+             });
diff --git a/firefox/patches/patch-gfx_wr_swgl_src_gl.cc b/firefox/patches/patch-gfx_wr_swgl_src_gl.cc
new file mode 100644
index 0000000000..03fa6b2634
--- /dev/null
+++ b/firefox/patches/patch-gfx_wr_swgl_src_gl.cc
@@ -0,0 +1,15 @@
+$NetBSD: patch-gfx_wr_swgl_src_gl.cc,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+* Use cmath for C++ to avoid errors under NetBSD.
+
+--- gfx/wr/swgl/src/gl.cc.orig	2026-08-14 14:46:45.531876235 +0000
++++ gfx/wr/swgl/src/gl.cc
+@@ -7,7 +7,7 @@
+ #include <string.h>
+ #include <assert.h>
+ #include <stdio.h>
+-#include <math.h>
++#include <cmath>
+ 
+ #ifdef __MACH__
+ #  include <mach/mach.h>
diff --git a/firefox/patches/patch-gfx_wr_swgl_src_glsl.h b/firefox/patches/patch-gfx_wr_swgl_src_glsl.h
new file mode 100644
index 0000000000..24e6ded905
--- /dev/null
+++ b/firefox/patches/patch-gfx_wr_swgl_src_glsl.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-gfx_wr_swgl_src_glsl.h,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+--- gfx/wr/swgl/src/glsl.h.orig	2026-08-12 13:09:03.000000000 +0000
++++ gfx/wr/swgl/src/glsl.h
+@@ -2,6 +2,9 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
++#include <cmath>
++using std::fpclassify;
++
+ #define SI ALWAYS_INLINE static
+ 
+ #include "vector_type.h"
diff --git a/firefox/patches/patch-gfx_wr_swgl_src_rasterize.h b/firefox/patches/patch-gfx_wr_swgl_src_rasterize.h
new file mode 100644
index 0000000000..a85399af26
--- /dev/null
+++ b/firefox/patches/patch-gfx_wr_swgl_src_rasterize.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-gfx_wr_swgl_src_rasterize.h,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+--- gfx/wr/swgl/src/rasterize.h.orig	2026-08-12 13:09:04.000000000 +0000
++++ gfx/wr/swgl/src/rasterize.h
+@@ -32,6 +32,8 @@
+ // a given row, the row will be converted to the flattened representation to
+ // support it, after which it will only ever revert back to runs if the depth
+ // buffer is cleared.
++#include <cmath>
++using std::isfinite;
+ 
+ // The largest 24-bit depth value supported.
+ constexpr uint32_t MAX_DEPTH_VALUE = 0xFFFFFF;
diff --git a/firefox/patches/patch-gfx_wr_swgl_src_swgl__ext.h b/firefox/patches/patch-gfx_wr_swgl_src_swgl__ext.h
new file mode 100644
index 0000000000..c2e168b2ef
--- /dev/null
+++ b/firefox/patches/patch-gfx_wr_swgl_src_swgl__ext.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-gfx_wr_swgl_src_swgl__ext.h,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+--- gfx/wr/swgl/src/swgl_ext.h.orig	2026-08-12 13:09:04.000000000 +0000
++++ gfx/wr/swgl/src/swgl_ext.h
+@@ -8,6 +8,8 @@
+ // efficiently process it and modulate it with color without incurring blend
+ // stage overheads.
+ #include <cstdint>
++#include <cmath>
++using std::isfinite;
+ 
+ template <typename P, typename C>
+ static void commit_masked_solid_span(P* buf, C color, int len) {
diff --git a/firefox/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc b/firefox/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
new file mode 100644
index 0000000000..44121f6b76
--- /dev/null
+++ b/firefox/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_chromium_src_base_message__pump__libevent.cc,v 1.12 2022/07/04 14:34:08 ryoon Exp $
+
+Allow older libevent
+
+--- ipc/chromium/src/base/message_pump_libevent.cc.orig	2022-06-16 21:32:07.000000000 +0000
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -24,6 +24,7 @@
+ 
+ // This macro checks that the _EVENT_SIZEOF_* constants defined in
+ // ipc/chromiume/src/third_party/<platform>/event2/event-config.h are correct.
++#if 0
+ #if defined(_EVENT_SIZEOF_SHORT)
+ #  define CHECK_EVENT_SIZEOF(TYPE, type)                \
+     static_assert(_EVENT_SIZEOF_##TYPE == sizeof(type), \
+@@ -44,6 +45,7 @@ CHECK_EVENT_SIZEOF(SHORT, short);
+ CHECK_EVENT_SIZEOF(SIZE_T, size_t);
+ CHECK_EVENT_SIZEOF(TIME_T, time_t);
+ CHECK_EVENT_SIZEOF(VOID_P, void*);
++#endif
+ 
+ // Lifecycle of struct event
+ // Libevent uses two main data structures:
diff --git a/firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc b/firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
new file mode 100644
index 0000000000..22ff5ef33c
--- /dev/null
+++ b/firefox/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
@@ -0,0 +1,16 @@
+$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.14 2025/10/27 14:24:33 ryoon Exp $
+
+* Support NetBSD
+
+--- ipc/chromium/src/base/platform_thread_posix.cc.orig	2023-07-20 18:06:23.000000000 +0000
++++ ipc/chromium/src/base/platform_thread_posix.cc
+@@ -12,7 +12,9 @@
+ #if defined(XP_DARWIN)
+ #  include <mach/mach.h>
+ #elif defined(XP_NETBSD)
++_Pragma("GCC visibility push(default)")
+ #  include <lwp.h>
++_Pragma("GCC visibility pop")
+ #elif defined(XP_LINUX)
+ #  include <sys/syscall.h>
+ #  include <sys/prctl.h>
diff --git a/firefox/patches/patch-ipc_glue_ForkServer.cpp b/firefox/patches/patch-ipc_glue_ForkServer.cpp
new file mode 100644
index 0000000000..1834d17df8
--- /dev/null
+++ b/firefox/patches/patch-ipc_glue_ForkServer.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-ipc_glue_ForkServer.cpp,v 1.2 2026/05/30 17:06:09 ryoon Exp $
+
+* Fix build for signal(3).
+
+--- ipc/glue/ForkServer.cpp.orig	2026-04-20 09:24:23.315338652 +0000
++++ ipc/glue/ForkServer.cpp
+@@ -19,6 +19,7 @@
+ #include "nsTraceRefcnt.h"
+ 
+ #include <fcntl.h>
++#include <signal.h>
+ #include <string.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
diff --git a/firefox/patches/patch-ipc_glue_GeckoChildProcessHost.cpp b/firefox/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
new file mode 100644
index 0000000000..255d3a131f
--- /dev/null
+++ b/firefox/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
@@ -0,0 +1,20 @@
+$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.16 2025/10/27 14:24:33 ryoon Exp $
+
+* Fix NetBSD linking
+
+--- ipc/glue/GeckoChildProcessHost.cpp.orig	2023-08-17 21:21:29.000000000 +0000
++++ ipc/glue/GeckoChildProcessHost.cpp
+@@ -4,7 +4,13 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
++#if defined(__NetBSD__)
++_Pragma("GCC visibility push(default)")
++#endif
+ #include "GeckoChildProcessHost.h"
++#if defined(__NetBSD__)
++_Pragma("GCC visibility pop")
++#endif
+ 
+ #include "base/command_line.h"
+ #include "base/process.h"
diff --git a/firefox/patches/patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp b/firefox/patches/patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp
new file mode 100644
index 0000000000..58f337b4e0
--- /dev/null
+++ b/firefox/patches/patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-js-src-jit-arm64-vixl-MozCpu-vixl.cpp,v 1.2 2024/02/22 15:12:50 ryoon Exp $
+
+Add NetBSD support.
+
+--- js/src/jit/arm64/vixl/MozCpu-vixl.cpp.orig	2024-02-13 14:50:57.324257195 +0000
++++ js/src/jit/arm64/vixl/MozCpu-vixl.cpp
+@@ -110,7 +110,7 @@ void CPU::EnsureIAndDCacheCoherency(void
+   FlushInstructionCache(GetCurrentProcess(), address, length);
+ #elif defined(XP_DARWIN)
+   sys_icache_invalidate(address, length);
+-#elif defined(__aarch64__) && (defined(__linux__) || defined(__android__) || defined(__FreeBSD__))
++#elif defined(__aarch64__) && (defined(__linux__) || defined(__android__) || defined(__FreeBSD__) || defined(__NetBSD__))
+   // Implement the cache synchronisation for all targets where AArch64 is the
+   // host, even if we're building the simulator for an AAarch64 host. This
+   // allows for cases where the user wants to simulate code as well as run it
diff --git a/firefox/patches/patch-js_public_Utility.h b/firefox/patches/patch-js_public_Utility.h
new file mode 100644
index 0000000000..4d6e780aed
--- /dev/null
+++ b/firefox/patches/patch-js_public_Utility.h
@@ -0,0 +1,27 @@
+$NetBSD: patch-js_public_Utility.h,v 1.2 2024/08/03 02:06:31 tsutsui Exp $
+
+- kludge to build on NetBSD/i386 10.0
+  https://mail-index.netbsd.org/pkgsrc-users/2024/07/16/msg039900.html
+
+--- js/public/Utility.h.orig	2024-07-04 17:04:15.000000000 +0000
++++ js/public/Utility.h
+@@ -482,9 +482,6 @@ static inline void js_free(void* p) {
+ #define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)              \
+   template <class T, typename... Args>                                      \
+   QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) {                \
+-    static_assert(                                                          \
+-        alignof(T) <= alignof(max_align_t),                                 \
+-        "over-aligned type is not supported by JS_DECLARE_NEW_METHODS");    \
+     void* memory = ALLOCATOR(sizeof(T));                                    \
+     return MOZ_LIKELY(memory) ? new (memory) T(std::forward<Args>(args)...) \
+                               : nullptr;                                    \
+@@ -501,9 +498,6 @@ static inline void js_free(void* p) {
+ #define JS_DECLARE_NEW_ARENA_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)           \
+   template <class T, typename... Args>                                         \
+   QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(arena_id_t arena, Args&&... args) { \
+-    static_assert(                                                             \
+-        alignof(T) <= alignof(max_align_t),                                    \
+-        "over-aligned type is not supported by JS_DECLARE_NEW_ARENA_METHODS"); \
+     void* memory = ALLOCATOR(arena, sizeof(T));                                \
+     return MOZ_LIKELY(memory) ? new (memory) T(std::forward<Args>(args)...)    \
+                               : nullptr;                                       \
diff --git a/firefox/patches/patch-js_src_editline_editline.c b/firefox/patches/patch-js_src_editline_editline.c
new file mode 100644
index 0000000000..091cc2e901
--- /dev/null
+++ b/firefox/patches/patch-js_src_editline_editline.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-js_src_editline_editline.c,v 1.1 2025/07/26 14:12:54 ryoon Exp $
+
+--- js/src/editline/editline.c.orig	2025-07-26 13:19:29.740302059 +0000
++++ js/src/editline/editline.c
+@@ -337,11 +337,11 @@ do_forward(STATUS move)
+     i = 0;
+     do {
+ 	p = &Line[Point];
+-	for ( ; Point < End && (*p == ' ' || !isalnum(*p)); Point++, p++)
++	for ( ; Point < End && (*p == ' ' || !isalnum((unsigned char)(*p))); Point++, p++)
+ 	    if (move == CSmove)
+ 		right(CSstay);
+ 
+-	for (; Point < End && isalnum(*p); Point++, p++)
++	for (; Point < End && isalnum((unsigned char)(*p)); Point++, p++)
+ 	    if (move == CSmove)
+ 		right(CSstay);
+ 
+@@ -1166,10 +1166,10 @@ bk_word()
+ 
+     i = 0;
+     do {
+-	for (p = &Line[Point]; p > Line && !isalnum(p[-1]); p--)
++	for (p = &Line[Point]; p > Line && !isalnum((unsigned char)(p[-1])); p--)
+ 	    left(CSmove);
+ 
+-	for (; p > Line && p[-1] != ' ' && isalnum(p[-1]); p--)
++	for (; p > Line && p[-1] != ' ' && isalnum((unsigned char)(p[-1])); p--)
+ 	    left(CSmove);
+ 
+ 	if (Point == 0)
diff --git a/firefox/patches/patch-js_src_intgemm_moz.build b/firefox/patches/patch-js_src_intgemm_moz.build
new file mode 100644
index 0000000000..9a80e48ad3
--- /dev/null
+++ b/firefox/patches/patch-js_src_intgemm_moz.build
@@ -0,0 +1,49 @@
+$NetBSD: patch-js_src_intgemm_moz.build,v 1.2 2026/05/30 17:06:09 ryoon Exp $
+
+* Disable AVX512.
+
+--- js/src/intgemm/moz.build.orig	2025-11-12 23:22:51.000000000 +0000
++++ js/src/intgemm/moz.build
+@@ -37,24 +37,24 @@ if CONFIG["INTEL_ARCHITECTURE"]:
+         SOURCES[
+             "/third_party/gemmology/kernels/GemmologyEngineAVX2.cpp"
+         ].flags += CONFIG["AVX2_FLAGS"]
+-    if CONFIG["AVXVNNI_FLAGS"]:
+-        DEFINES["USE_AVXVNNI"] = True
+-        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVXVNNI.cpp"]
+-        SOURCES[
+-            "/third_party/gemmology/kernels/GemmologyEngineAVXVNNI.cpp"
+-        ].flags += CONFIG["AVXVNNI_FLAGS"]
+-    if CONFIG["AVX512BW_FLAGS"]:
+-        DEFINES["USE_AVX512BW"] = True
+-        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVX512BW.cpp"]
+-        SOURCES[
+-            "/third_party/gemmology/kernels/GemmologyEngineAVX512BW.cpp"
+-        ].flags += CONFIG["AVX512BW_FLAGS"]
+-    if CONFIG["AVX512VNNI_FLAGS"]:
+-        DEFINES["USE_AVX512VNNI"] = True
+-        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVX512VNNI.cpp"]
+-        SOURCES[
+-            "/third_party/gemmology/kernels/GemmologyEngineAVX512VNNI.cpp"
+-        ].flags += CONFIG["AVX512VNNI_FLAGS"]
++#    if CONFIG["AVXVNNI_FLAGS"]:
++#        DEFINES["USE_AVXVNNI"] = True
++#        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVXVNNI.cpp"]
++#        SOURCES[
++#            "/third_party/gemmology/kernels/GemmologyEngineAVXVNNI.cpp"
++#        ].flags += CONFIG["AVXVNNI_FLAGS"]
++#    if CONFIG["AVX512BW_FLAGS"]:
++#        DEFINES["USE_AVX512BW"] = True
++#        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVX512BW.cpp"]
++#        SOURCES[
++#            "/third_party/gemmology/kernels/GemmologyEngineAVX512BW.cpp"
++#        ].flags += CONFIG["AVX512BW_FLAGS"]
++#    if CONFIG["AVX512VNNI_FLAGS"]:
++#        DEFINES["USE_AVX512VNNI"] = True
++#        SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineAVX512VNNI.cpp"]
++#        SOURCES[
++#            "/third_party/gemmology/kernels/GemmologyEngineAVX512VNNI.cpp"
++#        ].flags += CONFIG["AVX512VNNI_FLAGS"]
+ 
+ 
+ if CONFIG["TARGET_CPU"] == "aarch64":
diff --git a/firefox/patches/patch-js_src_jit_FlushICache.cpp b/firefox/patches/patch-js_src_jit_FlushICache.cpp
new file mode 100644
index 0000000000..4d166e09cb
--- /dev/null
+++ b/firefox/patches/patch-js_src_jit_FlushICache.cpp
@@ -0,0 +1,34 @@
+$NetBSD: patch-js_src_jit_FlushICache.cpp,v 1.4 2025/07/26 14:12:54 ryoon Exp $
+
+NetBSD does not have the Linux-specific membarrier(2) syscall.
+
+--- js/src/jit/FlushICache.cpp.orig	2025-06-13 17:08:49.000000000 +0000
++++ js/src/jit/FlushICache.cpp
+@@ -31,12 +31,18 @@
+ #    elif defined(__android__)
+ #      include <sys/syscall.h>
+ #      include <unistd.h>
++#    elif defined(__NetBSD__)
++       // nothing
+ #    else
+ #      error "Missing platform-specific declarations for membarrier syscall!"
+ #    endif  // __linux__ / ANDROID
+ 
+ static int membarrier(int cmd, int flags) {
++#if defined(__NetBSD__)
++  return ENOSYS;
++#else
+   return syscall(__NR_membarrier, cmd, flags);
++#endif
+ }
+ 
+ // These definitions come from the Linux kernel source, for kernels before 4.16
+@@ -112,6 +118,8 @@ bool CanFlushExecutionContextForAllThrea
+   MOZ_ASSERT(state != MemBarrierAvailable::Unset);
+   return state == MemBarrierAvailable::Yes;
+ 
++#  elif defined(__NetBSD__)
++  return false;
+ #  else
+   // On other platforms, we assume that the syscall for flushing the icache
+   // will flush the execution context for other cores.
diff --git a/firefox/patches/patch-js_src_jit_arm64_vixl_Registers-vixl.h b/firefox/patches/patch-js_src_jit_arm64_vixl_Registers-vixl.h
new file mode 100644
index 0000000000..e648c792e3
--- /dev/null
+++ b/firefox/patches/patch-js_src_jit_arm64_vixl_Registers-vixl.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-js_src_jit_arm64_vixl_Registers-vixl.h,v 1.1 2026/07/09 20:07:10 jklos Exp $
+
+--- js/src/jit/arm64/vixl/Registers-vixl.h.orig	2026-07-09 17:58:16.713975290 +0000
++++ js/src/jit/arm64/vixl/Registers-vixl.h
+@@ -188,13 +188,13 @@ class CPURegister {
+   bool IsRegister() const { return GetType() == kRegister; }
+   bool IsVRegister() const { return GetType() == kVRegister; }
+   bool IsZRegister() const { return GetType() == kZRegister; }
+-  bool IsPRegister() const { return GetType() == kPRegister; }
++  constexpr bool IsPRegister() const { return GetType() == kPRegister; }
+ 
+   bool IsNone() const { return GetType() == kNoRegister; }
+ 
+   // `GetType() == kNoRegister` implies IsNone(), and vice-versa.
+   // `GetType() == k<Foo>Register` implies Is<Foo>Register(), and vice-versa.
+-  RegisterType GetType() const {
++  constexpr RegisterType GetType() const {
+     switch (bank_) {
+       case kNoRegisterBank:
+         return kNoRegister;
diff --git a/firefox/patches/patch-js_src_util_NativeStack.cpp b/firefox/patches/patch-js_src_util_NativeStack.cpp
new file mode 100644
index 0000000000..b4d587e1a4
--- /dev/null
+++ b/firefox/patches/patch-js_src_util_NativeStack.cpp
@@ -0,0 +1,32 @@
+$NetBSD: patch-js_src_util_NativeStack.cpp,v 1.6 2020/04/09 14:01:26 ryoon Exp $
+
+Support SunOS.
+
+--- js/src/util/NativeStack.cpp.orig	2020-04-03 19:34:51.000000000 +0000
++++ js/src/util/NativeStack.cpp
+@@ -13,7 +13,7 @@
+ #  if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+ #    include <pthread_np.h>
+ #  endif
+-#  if defined(SOLARIS) || defined(AIX)
++#  if defined(__sun) || defined(AIX)
+ #    include <ucontext.h>
+ #  endif
+ #  if defined(ANDROID) && !defined(__aarch64__)
+@@ -40,7 +40,7 @@ void* js::GetNativeStackBaseImpl() {
+   return static_cast<void*>(pTib->StackBase);
+ }
+ 
+-#elif defined(SOLARIS)
++#elif defined(__sun)
+ 
+ static_assert(JS_STACK_GROWTH_DIRECTION < 0);
+ 
+@@ -128,6 +128,7 @@ void* js::GetNativeStackBaseImpl() {
+ #    elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
+   /* e.g. on FreeBSD 4.8 or newer, neundorf%kde.org@localhost */
+   pthread_attr_get_np(thread, &sattr);
++#    elif defined(__sun)
+ #    else
+   /*
+    * FIXME: this function is non-portable;
diff --git a/firefox/patches/patch-js_src_vm_TypedArrayObject-inl.h b/firefox/patches/patch-js_src_vm_TypedArrayObject-inl.h
new file mode 100644
index 0000000000..6e434b4ceb
--- /dev/null
+++ b/firefox/patches/patch-js_src_vm_TypedArrayObject-inl.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-js_src_vm_TypedArrayObject-inl.h,v 1.2 2024/10/01 12:47:19 ryoon Exp $
+
+- kludge to build on NetBSD/i386 10.0
+  https://mail-index.netbsd.org/pkgsrc-users/2024/07/16/msg039900.html
+
+--- js/src/vm/TypedArrayObject-inl.h.orig	2024-08-23 12:51:13.000000000 +0000
++++ js/src/vm/TypedArrayObject-inl.h
+@@ -435,7 +435,9 @@ class ElementSpecific {
+     // `malloc` returns memory at least as strictly aligned as for max_align_t
+     // and the alignment of max_align_t is a multiple of the size of `T`,
+     // so `SharedMem::cast` will be called with properly aligned memory.
++#if !defined(__i386__)
+     static_assert(alignof(std::max_align_t) % sizeof(T) == 0);
++#endif
+ 
+     SharedMem<T*> dest = Ops::extract(target).template cast<T*>() + offset;
+     SharedMem<void*> data = Ops::extract(source);
diff --git a/firefox/patches/patch-media_ffvpx_libavutil_arm_bswap.h b/firefox/patches/patch-media_ffvpx_libavutil_arm_bswap.h
new file mode 100644
index 0000000000..61ae28c608
--- /dev/null
+++ b/firefox/patches/patch-media_ffvpx_libavutil_arm_bswap.h
@@ -0,0 +1,36 @@
+$NetBSD: patch-media_ffvpx_libavutil_arm_bswap.h,v 1.4 2026/01/19 12:06:04 ryoon Exp $
+
+avutil/arm/bswap.h is preferred over the system's <arm/bswap.h> due to
+Firefox's include path order. This breaks <stdlib.h> and others, so
+make sure to pull in the system header when this happens.
+
+--- media/ffvpx/libavutil/arm/bswap.h.orig	2025-12-31 13:17:28.000000000 +0000
++++ media/ffvpx/libavutil/arm/bswap.h
+@@ -16,6 +16,10 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
++#if defined(__NetBSD__)
++#include "/usr/include/arm/bswap.h"
++#endif
++
+ #ifndef AVUTIL_ARM_BSWAP_H
+ #define AVUTIL_ARM_BSWAP_H
+ 
+@@ -23,6 +27,8 @@
+ #include "config.h"
+ #include "libavutil/attributes.h"
+ 
++#ifndef __aarch64__
++
+ #ifdef __ARMCC_VERSION
+ 
+ #if HAVE_ARMV6
+@@ -46,5 +52,7 @@ static av_always_inline av_const unsigned av_bswap16(u
+ }
+ #endif
+ #endif /* __ARMCC_VERSION */
++
++#endif /* __aarch64__ */
+ 
+ #endif /* AVUTIL_ARM_BSWAP_H */
diff --git a/firefox/patches/patch-media_libpng_pngpriv.h b/firefox/patches/patch-media_libpng_pngpriv.h
new file mode 100644
index 0000000000..fdb9ea8717
--- /dev/null
+++ b/firefox/patches/patch-media_libpng_pngpriv.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-media_libpng_pngpriv.h,v 1.8 2026/01/19 12:06:04 ryoon Exp $
+
+Fix _POSIX_SOURCE on SunOS.
+
+--- media/libpng/pngpriv.h.orig	2025-12-31 13:17:28.000000000 +0000
++++ media/libpng/pngpriv.h
+@@ -47,7 +47,9 @@
+  * still required (as of 2011-05-02.)
+  */
+ #ifndef _POSIX_SOURCE
++#if !defined(__sun) || (__STDC_VERSION__-0 < 199901L)
+ #  define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
++#endif
+ #endif
+ 
+ #ifndef PNG_VERSION_INFO_ONLY
diff --git a/firefox/patches/patch-memory_build_mozjemalloc__types.h b/firefox/patches/patch-memory_build_mozjemalloc__types.h
new file mode 100644
index 0000000000..ea79e7be1b
--- /dev/null
+++ b/firefox/patches/patch-memory_build_mozjemalloc__types.h
@@ -0,0 +1,23 @@
+$NetBSD: patch-memory_build_mozjemalloc__types.h,v 1.1 2025/10/27 14:24:33 ryoon Exp $
+
+* Try to fix build with mozilla-jemalloc option.
+
+--- memory/build/mozjemalloc_types.h.orig	2025-10-09 16:40:29.000000000 +0000
++++ memory/build/mozjemalloc_types.h
+@@ -50,11 +50,13 @@
+ extern "C" {
+ #endif
+ 
+-#ifndef MALLOC_USABLE_SIZE_CONST_PTR
+-#  define MALLOC_USABLE_SIZE_CONST_PTR const
++#ifdef MALLOC_USABLE_SIZE_CONST_PTR
++#  define MALLOC_USABLE_SIZE_CONST_PTR_CONST const
++#else
++#  define MALLOC_USABLE_SIZE_CONST_PTR_CONST
+ #endif
+ 
+-typedef MALLOC_USABLE_SIZE_CONST_PTR void* usable_ptr_t;
++typedef MALLOC_USABLE_SIZE_CONST_PTR_CONST void* usable_ptr_t;
+ 
+ typedef size_t arena_id_t;
+ 
diff --git a/firefox/patches/patch-mozglue_misc_Now.cpp b/firefox/patches/patch-mozglue_misc_Now.cpp
new file mode 100644
index 0000000000..9ad3d3a6f9
--- /dev/null
+++ b/firefox/patches/patch-mozglue_misc_Now.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-mozglue_misc_Now.cpp,v 1.1 2026/07/23 13:33:41 ryoon Exp $
+
+* If CLOCK_BOOTTIME is not available, return 0 instead of Nothing().
+  This fixes incorrect assert at AudioSessionManager.cpp:57 introduced
+  in 153.0.
+
+--- mozglue/misc/Now.cpp.orig	2026-07-23 01:36:06.678846874 +0000
++++ mozglue/misc/Now.cpp
+@@ -89,16 +89,13 @@ Maybe<uint64_t> NowIncludingSuspendMs() {
+ }
+ 
+ Maybe<uint64_t> NowIncludingSuspendMs() {
+-#  ifndef CLOCK_BOOTTIME
+-  return Nothing();
+-#  else
+   struct timespec ts = {0};
+-
++#  ifdef CLOCK_BOOTTIME
+   if (clock_gettime(CLOCK_BOOTTIME, &ts)) {
+     return Nothing();
+   }
+-  return Some(TimespecToMilliseconds(ts));
+ #  endif
++  return Some(TimespecToMilliseconds(ts));
+ }
+ 
+ #else  // catch all
diff --git a/firefox/patches/patch-netwerk_protocol_http_nsHttpHandler.cpp b/firefox/patches/patch-netwerk_protocol_http_nsHttpHandler.cpp
new file mode 100644
index 0000000000..b7c452a7b5
--- /dev/null
+++ b/firefox/patches/patch-netwerk_protocol_http_nsHttpHandler.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-netwerk_protocol_http_nsHttpHandler.cpp,v 1.5 2025/01/14 13:36:15 ryoon Exp $
+
+* Do not freeze user-agent string as Linux under NetBSD.
+
+--- netwerk/protocol/http/nsHttpHandler.cpp.orig	2024-12-26 14:27:48.719857849 +0000
++++ netwerk/protocol/http/nsHttpHandler.cpp
+@@ -1063,6 +1063,8 @@ void nsHttpHandler::InitUserAgentCompone
+   mOscpu.AssignLiteral("Linux armv81");
+ #elif defined(XP_IOS)
+   mOscpu.AssignLiteral("iPhone");
++#elif defined(__NetBSD__)
++  mOscpu.AssignLiteral("NetBSD x86_64");
+ #else
+   mOscpu.AssignLiteral("Linux x86_64");
+ #endif
diff --git a/firefox/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c b/firefox/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
new file mode 100644
index 0000000000..c0baf72cf3
--- /dev/null
+++ b/firefox/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
@@ -0,0 +1,112 @@
+$NetBSD: patch-nsprpub_pr_src_pthreads_ptsynch.c,v 1.3 2024/12/25 13:30:11 ryoon Exp $
+
+firefox: Workaround broken pthread_equal() usage
+
+Switch to an internal version of pthread_equal() without sanity checks.
+
+Problems detected on NetBSD 9.99.46.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1718838
+
+--- nsprpub/pr/src/pthreads/ptsynch.c.orig	2026-08-26 21:11:48.000000000 +0000
++++ nsprpub/pr/src/pthreads/ptsynch.c
+@@ -24,6 +24,13 @@ extern PTDebug pt_debug; /* this is shared between sev
+ extern PTDebug pt_debug; /* this is shared between several modules */
+ #endif                   /* defined(DEBUG) */
+ 
++/* XXX, pt_pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++	return t1 == t2;
++}
++
+ #if defined(FREEBSD)
+ /*
+  * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
+@@ -194,9 +201,9 @@ PR_Unlock(PRLock* lock)
+     PR_ASSERT(lock != NULL);
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(lock->mutex));
+     PR_ASSERT(PR_TRUE == lock->locked);
+-    PR_ASSERT(pthread_equal(lock->owner, self));
++    PR_ASSERT(pt_pthread_equal(lock->owner, self));
+ 
+-    if (!lock->locked || !pthread_equal(lock->owner, self)) {
++    if (!lock->locked || !pt_pthread_equal(lock->owner, self)) {
+         return PR_FAILURE;
+     }
+ 
+@@ -222,7 +229,7 @@ PR_AssertCurrentThreadOwnsLock(PRLock* lock)
+      * to the correctness of PR_AssertCurrentThreadOwnsLock(), but
+      * this particular order makes the assertion more likely to
+      * catch errors. */
+-    PR_ASSERT(lock->locked && pthread_equal(lock->owner, pthread_self()));
++    PR_ASSERT(lock->locked && pt_pthread_equal(lock->owner, pthread_self()));
+ }
+ 
+ /**************************************************************/
+@@ -279,7 +286,7 @@ pt_PostNotifyToCvar(PRCondVar* cvar, PRBool broadcast)
+     _PT_Notified* notified = &cvar->lock->notified;
+ 
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+ 
+     while (1) {
+@@ -361,7 +368,7 @@ PR_WaitCondVar(PRCondVar* cvar, PRIntervalTime timeout
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+     /* and it better be by us */
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+ 
+     if (_PT_THREAD_INTERRUPTED(thred)) {
+         goto aborted;
+@@ -576,7 +583,7 @@ PR_GetMonitorEntryCount(PRMonitor* mon)
+ 
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+-    if (pthread_equal(mon->owner, self)) {
++    if (pt_pthread_equal(mon->owner, self)) {
+         count = mon->entryCount;
+     }
+     rv = pthread_mutex_unlock(&mon->lock);
+@@ -592,7 +599,7 @@ PR_AssertCurrentThreadInMonitor(PRMonitor* mon)
+ 
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+-    PR_ASSERT(mon->entryCount != 0 && pthread_equal(mon->owner, pthread_self()));
++    PR_ASSERT(mon->entryCount != 0 && pt_pthread_equal(mon->owner, pthread_self()));
+     rv = pthread_mutex_unlock(&mon->lock);
+     PR_ASSERT(0 == rv);
+ #endif
+@@ -608,7 +615,7 @@ PR_EnterMonitor(PRMonitor* mon)
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+     if (mon->entryCount != 0) {
+-        if (pthread_equal(mon->owner, self)) {
++        if (pt_pthread_equal(mon->owner, self)) {
+             goto done;
+         }
+         while (mon->entryCount != 0) {
+@@ -640,8 +647,8 @@ PR_ExitMonitor(PRMonitor* mon)
+     PR_ASSERT(0 == rv);
+     /* the entries should be > 0 and we'd better be the owner */
+     PR_ASSERT(mon->entryCount > 0);
+-    PR_ASSERT(pthread_equal(mon->owner, self));
+-    if (mon->entryCount == 0 || !pthread_equal(mon->owner, self)) {
++    PR_ASSERT(pt_pthread_equal(mon->owner, self));
++    if (mon->entryCount == 0 || !pt_pthread_equal(mon->owner, self)) {
+         rv = pthread_mutex_unlock(&mon->lock);
+         PR_ASSERT(0 == rv);
+         return PR_FAILURE;
+@@ -687,7 +694,7 @@ PR_Wait(PRMonitor* mon, PRIntervalTime timeout)
+     /* the entries better be positive */
+     PR_ASSERT(mon->entryCount > 0);
+     /* and it better be owned by us */
+-    PR_ASSERT(pthread_equal(mon->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(mon->owner, pthread_self()));
+ 
+     /* tuck these away 'till later */
+     saved_entries = mon->entryCount;
diff --git a/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake.py b/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake.py
new file mode 100644
index 0000000000..62f7822f79
--- /dev/null
+++ b/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake.py
@@ -0,0 +1,27 @@
+$NetBSD: patch-python_mozbuild_mozbuild_backend_recursivemake.py,v 1.2 2024/10/01 12:47:19 ryoon Exp $
+
+* As of 129.0, libxul.so is built with -Wl,-z,defs (no undefined references).
+  Supply memalign() from fallback.cpp (Unified_cpp_memory_build0) for NetBSD.
+  This approach is completely incorrect, however I do not find the correct
+  way to include Unified_cpp_memory_build0.o to objs yet.
+
+--- python/mozbuild/mozbuild/backend/recursivemake.py.orig	2024-08-23 12:51:15.000000000 +0000
++++ python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -73,6 +73,8 @@ from ..util import FileAvoidWrite, ensur
+ from .common import CommonBackend
+ from .make import MakeBackend
+ 
++import buildconfig
++
+ # To protect against accidentally adding logic to Makefiles that belong in moz.build,
+ # we check if moz.build-like variables are defined in Makefiles. If they are, we throw
+ # an error to encourage the usage of moz.build instead.
+@@ -1426,6 +1428,8 @@ class RecursiveMakeBackend(MakeBackend):
+ 
+     def _process_linked_libraries(self, obj, backend_file):
+         objs, shared_libs, os_libs, static_libs = self._expand_libs(obj)
++        if buildconfig.substs["OS_ARCH"] == "NetBSD" and obj.name == "libxul.so":
++            objs.append("memory/build/Unified_cpp_memory_build0.o")
+ 
+         obj_target = obj.name
+         if isinstance(obj, (Program, SharedLibrary)):
diff --git a/firefox/patches/patch-python_sites_build.txt b/firefox/patches/patch-python_sites_build.txt
new file mode 100644
index 0000000000..f141b3786e
--- /dev/null
+++ b/firefox/patches/patch-python_sites_build.txt
@@ -0,0 +1,15 @@
+$NetBSD: patch-python_sites_build.txt,v 1.3 2026/07/21 15:25:01 ryoon Exp $
+
+* We are offline, so do not try to download from pypi.
+  No need to wait a timeout.
+
+--- python/sites/build.txt.orig	2026-07-13 13:09:21.000000000 +0000
++++ python/sites/build.txt
+@@ -1,6 +1,6 @@ pth:third_party/python/vsdownload
+ requires-python:>=3.9
+ pth:third_party/python/vsdownload
+-pypi-optional:taskcluster-taskgraph==24.1.1:toolchain artifacts will not be bootstrapped
++#pypi-optional:taskcluster-taskgraph==24.1.1:toolchain artifacts will not be bootstrapped
+ vendored:testing/web-platform/tests/tools/third_party/h2/src
+ vendored:testing/web-platform/tests/tools/third_party/hpack/src
+ vendored:testing/web-platform/tests/tools/third_party/html5lib
diff --git a/firefox/patches/patch-python_sites_mach.txt b/firefox/patches/patch-python_sites_mach.txt
new file mode 100644
index 0000000000..a61b835add
--- /dev/null
+++ b/firefox/patches/patch-python_sites_mach.txt
@@ -0,0 +1,31 @@
+$NetBSD: patch-python_sites_mach.txt,v 1.4 2026/08/24 12:51:47 ryoon Exp $
+
+* We are offline, so do not try to download from pypi.
+  No need to wait a timeout.
+* Use pyyaml from vendored unconditionally.
+
+--- python/sites/mach.txt.orig	2026-08-14 13:12:29.655766457 +0000
++++ python/sites/mach.txt
+@@ -58,15 +58,16 @@ pth:xpcom/idl-parser
+ pth:xpcom/idl-parser
+ # glean-sdk may not be installable if a wheel isn't available
+ # and it has to be built from source.
+-pypi-optional:glean-sdk==68.0.1:telemetry will not be collected
+-pypi-optional:orjson>=3.10:json operations will be slower in various tools
++#pypi-optional:glean-sdk==68.0.1:telemetry will not be collected
++#pypi-optional:orjson>=3.10:json operations will be slower in various tools
+ # Mach gracefully handles the case where `psutil` is unavailable.
+ # We aren't (yet) able to pin packages in automation, so we have to
+ # support down to the oldest locally-installed version (5.4.2).
+-pypi-optional:psutil>=5.4.2:telemetry will be missing some data
+-pypi-optional:rtoml>=0.11.0:toml operations will be slower in various tools
+-pypi-optional:zstandard>=0.11.1,<=0.25.0:zstd archives will not be possible to extract
+-vendored-fallback:pyyaml:third_party/python/pyyaml/lib/:faster native loading is disabled
++#pypi-optional:psutil>=5.4.2:telemetry will be missing some data
++#pypi-optional:rtoml>=0.11.0:toml operations will be slower in various tools
++#pypi-optional:zstandard>=0.11.1,<=0.25.0:zstd archives will not be possible to extract
++#vendored-fallback:pyyaml:third_party/python/pyyaml/lib/:faster native loading is disabled
++vendored:third_party/python/pyyaml/lib/
+ vendored:third_party/python/ansicon
+ vendored:third_party/python/appdirs
+ vendored:third_party/python/async_timeout
diff --git a/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc b/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc
new file mode 100644
index 0000000000..1f8a4c03b9
--- /dev/null
+++ b/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc
@@ -0,0 +1,27 @@
+$NetBSD: patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc,v 1.4 2025/12/15 21:09:16 gutteridge Exp $
+
+* NetBSD has no DT_GNU_HASH definition.
+* Fix builds with NetBSD >= 11.99.4, where ELF definitions were changed.
+
+--- third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc.orig	2025-11-06 22:07:37.000000000 +0000
++++ third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc
+@@ -221,6 +225,10 @@ void ElfMemImage::Init(const void *base)
+   for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) {
+     const auto value =
+         static_cast<intptr_t>(dynamic_entry->d_un.d_val) + relocation;
++/* For NetBSD 9 */
++#if !defined(DT_GNU_HASH)
++#define DT_GNU_HASH 0x6ffffef5
++#endif
+     switch (dynamic_entry->d_tag) {
+       case DT_HASH:
+         sysv_hash = reinterpret_cast<uint32_t *>(value);
+@@ -377,7 +385,7 @@ void ElfMemImage::SymbolIterator::Update
+   const ElfW(Versym) *version_symbol = image->GetVersym(index_);
+   ABSL_RAW_CHECK(symbol && version_symbol, "");
+   const char *const symbol_name = image->GetDynstr(symbol->st_name);
+-#if defined(__NetBSD__)
++#if defined(__NetBSD__) && ((_SYS_EXEC_ELF_H_ + 0) < 2)
+   const int version_index = version_symbol->vs_vers & VERSYM_VERSION;
+ #else
+   const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION;
diff --git a/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc b/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc
new file mode 100644
index 0000000000..5ec542894a
--- /dev/null
+++ b/firefox/patches/patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc
@@ -0,0 +1,18 @@
+$NetBSD: patch-third__party_abseil-cpp_absl_debugging_internal_vdso__support.cc,v 1.1 2025/04/30 03:10:40 ryoon Exp $
+
+* Do not find system_wrappers/syscall.h generated by Firefox.
+
+--- third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc.orig	2025-03-01 04:07:45.625009806 +0000
++++ third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc
+@@ -26,9 +26,9 @@
+ 
+ #include <errno.h>
+ #include <fcntl.h>
+-#if __has_include(<syscall.h>)
++#if defined(__linux__)
+ #include <syscall.h>
+-#elif __has_include(<sys/syscall.h>)
++#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ #include <sys/syscall.h>
+ #endif
+ #include <unistd.h>
diff --git a/firefox/patches/patch-third__party_angle_angle__common__gn_moz.build b/firefox/patches/patch-third__party_angle_angle__common__gn_moz.build
new file mode 100644
index 0000000000..c25ecd6f9d
--- /dev/null
+++ b/firefox/patches/patch-third__party_angle_angle__common__gn_moz.build
@@ -0,0 +1,40 @@
+$NetBSD: patch-third__party_angle_angle__common__gn_moz.build,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+--- third_party/angle/angle_common_gn/moz.build.orig	2026-08-12 13:09:20.000000000 +0000
++++ third_party/angle/angle_common_gn/moz.build
+@@ -134,7 +134,7 @@ if CONFIG["OS_TARGET"] == "Linux":
+         "/third_party/angle/src/common/system_utils_posix.cpp"
+     ]
+ 
+-if CONFIG["OS_TARGET"] == "OpenBSD":
++if CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "NetBSD":
+ 
+     DEFINES["USE_GLIB"] = "1"
+     DEFINES["USE_OZONE"] = "1"
+@@ -144,6 +144,17 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
+     DEFINES["__STDC_CONSTANT_MACROS"] = True
+     DEFINES["__STDC_FORMAT_MACROS"] = True
+ 
++    if CONFIG["OS_TARGET"] == "FreeBSD":
++        OS_LIBS += {
++            "dl"
++        }
++
++    UNIFIED_SOURCES += [
++        "/third_party/angle/src/common/system_utils_linux.cpp",
++        "/third_party/angle/src/common/system_utils_posix.cpp"
++    ]
++
++
+ if CONFIG["OS_TARGET"] == "WINNT":
+ 
+     DEFINES["ANGLE_IS_WIN"] = True
+@@ -208,7 +219,7 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] 
+ 
+     DEFINES["_DEBUG"] = True
+ 
+-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
++if CONFIG["MOZ_DEBUG"] == "1" and (CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "NetBSD"):
+ 
+     DEFINES["_DEBUG"] = True
+ 
diff --git a/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in b/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in
new file mode 100644
index 0000000000..e8d1350838
--- /dev/null
+++ b/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in
@@ -0,0 +1,873 @@
+$NetBSD: patch-third__party_angle_angle__program__version__id__gn_ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+For FreeBSD and NetBSD.
+
+--- third_party/angle/angle_program_version_id_gn/ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in.orig	2026-08-14 14:16:40.408891583 +0000
++++ third_party/angle/angle_program_version_id_gn/ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in
+@@ -0,0 +1,866 @@
++/third_party/angle/src/common/BinaryStream.h
++/third_party/angle/src/common/CircularBuffer.h
++/third_party/angle/src/common/Color.h
++/third_party/angle/src/common/Color.inc
++/third_party/angle/src/common/CompiledShaderState.h
++/third_party/angle/src/common/FastVector.h
++/third_party/angle/src/common/FixedQueue.h
++/third_party/angle/src/common/FixedVector.h
++/third_party/angle/src/common/MemoryBuffer.h
++/third_party/angle/src/common/Optional.h
++/third_party/angle/src/common/PackedEGLEnums_autogen.h
++/third_party/angle/src/common/PackedEnums.h
++/third_party/angle/src/common/PackedGLEnums_autogen.h
++/third_party/angle/src/common/PackedCLEnums_autogen.h
++/third_party/angle/src/common/PoolAlloc.h
++/third_party/angle/src/common/SimpleMutex.h
++/third_party/angle/src/common/SynchronizedValue.h
++/third_party/angle/src/common/WorkerThread.h
++/third_party/angle/src/common/aligned_memory.h
++/third_party/angle/src/common/android_util.h
++/third_party/angle/src/common/angleutils.h
++/third_party/angle/src/common/apple_platform_utils.h
++/third_party/angle/src/common/backtrace_utils.h
++/third_party/angle/src/common/base/anglebase/base_export.h
++/third_party/angle/src/common/base/anglebase/containers/mru_cache.h
++/third_party/angle/src/common/base/anglebase/logging.h
++/third_party/angle/src/common/base/anglebase/macros.h
++/third_party/angle/src/common/base/anglebase/no_destructor.h
++/third_party/angle/src/common/base/anglebase/numerics/checked_math.h
++/third_party/angle/src/common/base/anglebase/numerics/checked_math_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/clamped_math.h
++/third_party/angle/src/common/base/anglebase/numerics/clamped_math_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/math_constants.h
++/third_party/angle/src/common/base/anglebase/numerics/ranges.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_conversions.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_conversions_arm_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_conversions_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_math.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_math_arm_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_math_clang_gcc_impl.h
++/third_party/angle/src/common/base/anglebase/numerics/safe_math_shared_impl.h
++/third_party/angle/src/common/base/anglebase/sha1.h
++/third_party/angle/src/common/base/anglebase/sys_byteorder.h
++/third_party/angle/src/common/bitset_utils.h
++/third_party/angle/src/common/debug.h
++/third_party/angle/src/common/entry_points_enum_autogen.h
++/third_party/angle/src/common/event_tracer.h
++/third_party/angle/src/common/hash_containers.h
++/third_party/angle/src/common/hash_utils.h
++/third_party/angle/src/common/log_utils.h
++/third_party/angle/src/common/mathutil.h
++/third_party/angle/src/common/matrix_utils.h
++/third_party/angle/src/common/platform.h
++/third_party/angle/src/common/platform_helpers.h
++/third_party/angle/src/common/span.h
++/third_party/angle/src/common/span_util.h
++/third_party/angle/src/common/string_utils.h
++/third_party/angle/src/common/system_utils.h
++/third_party/angle/src/common/tls.h
++/third_party/angle/src/common/uniform_type_info_autogen.h
++/third_party/angle/src/common/unsafe_buffers.h
++/third_party/angle/src/common/utilities.h
++/third_party/angle/src/common/vector_utils.h
++/third_party/angle/src/libANGLE/CLBitField.h
++/third_party/angle/src/common/Float16ToFloat32.cpp
++/third_party/angle/src/common/MemoryBuffer.cpp
++/third_party/angle/src/common/PackedEGLEnums_autogen.cpp
++/third_party/angle/src/common/PackedEnums.cpp
++/third_party/angle/src/common/PackedGLEnums_autogen.cpp
++/third_party/angle/src/common/PoolAlloc.cpp
++/third_party/angle/src/common/SimpleMutex.cpp
++/third_party/angle/src/common/WorkerThread.cpp
++/third_party/angle/src/common/aligned_memory.cpp
++/third_party/angle/src/common/android_util.cpp
++/third_party/angle/src/common/angleutils.cpp
++/third_party/angle/src/common/base/anglebase/sha1.cc
++/third_party/angle/src/common/debug.cpp
++/third_party/angle/src/common/entry_points_enum_autogen.cpp
++/third_party/angle/src/common/event_tracer.cpp
++/third_party/angle/src/common/mathutil.cpp
++/third_party/angle/src/common/matrix_utils.cpp
++/third_party/angle/src/common/platform_helpers.cpp
++/third_party/angle/src/common/string_utils.cpp
++/third_party/angle/src/common/system_utils.cpp
++/third_party/angle/src/common/tls.cpp
++/third_party/angle/src/common/uniform_type_info_autogen.cpp
++/third_party/angle/src/common/utilities.cpp
++/third_party/angle/src/common/backtrace_utils_noop.cpp
++/third_party/angle/src/common/system_utils_posix.cpp
++/third_party/angle/src/libANGLE/AttributeMap.h
++/third_party/angle/src/libANGLE/BlobCache.h
++/third_party/angle/src/libANGLE/Buffer.h
++/third_party/angle/src/libANGLE/Caps.h
++/third_party/angle/src/libANGLE/CLBitField.h
++/third_party/angle/src/libANGLE/CLRefPointer.h
++/third_party/angle/src/libANGLE/Compiler.h
++/third_party/angle/src/libANGLE/Config.h
++/third_party/angle/src/libANGLE/Constants.h
++/third_party/angle/src/libANGLE/Context.h
++/third_party/angle/src/libANGLE/Context.inl.h
++/third_party/angle/src/libANGLE/Context_gles_1_0_autogen.h
++/third_party/angle/src/libANGLE/Context_gles_2_0_autogen.h
++/third_party/angle/src/libANGLE/Context_gles_3_0_autogen.h
++/third_party/angle/src/libANGLE/Context_gles_3_1_autogen.h
++/third_party/angle/src/libANGLE/Context_gles_3_2_autogen.h
++/third_party/angle/src/libANGLE/Context_gles_ext_autogen.h
++/third_party/angle/src/libANGLE/Debug.h
++/third_party/angle/src/libANGLE/Device.h
++/third_party/angle/src/libANGLE/Display.h
++/third_party/angle/src/libANGLE/EGLSync.h
++/third_party/angle/src/libANGLE/Error.h
++/third_party/angle/src/libANGLE/Error.inc
++/third_party/angle/src/libANGLE/ErrorStrings.h
++/third_party/angle/src/libANGLE/Fence.h
++/third_party/angle/src/libANGLE/Framebuffer.h
++/third_party/angle/src/libANGLE/FramebufferAttachment.h
++/third_party/angle/src/libANGLE/GLES1Renderer.h
++/third_party/angle/src/libANGLE/GLES1Shaders.inc
++/third_party/angle/src/libANGLE/GLES1State.h
++/third_party/angle/src/libANGLE/GlobalMutex.h
++/third_party/angle/src/libANGLE/HandleAllocator.h
++/third_party/angle/src/libANGLE/Image.h
++/third_party/angle/src/libANGLE/ImageIndex.h
++/third_party/angle/src/libANGLE/IndexRangeCache.h
++/third_party/angle/src/libANGLE/InfoLog.h
++/third_party/angle/src/libANGLE/LoggingAnnotator.h
++/third_party/angle/src/libANGLE/MemoryObject.h
++/third_party/angle/src/libANGLE/MemoryProgramCache.h
++/third_party/angle/src/libANGLE/MemoryShaderCache.h
++/third_party/angle/src/libANGLE/Observer.h
++/third_party/angle/src/libANGLE/Overlay.h
++/third_party/angle/src/libANGLE/OverlayWidgets.h
++/third_party/angle/src/libANGLE/Overlay_autogen.h
++/third_party/angle/src/libANGLE/Overlay_font_autogen.h
++/third_party/angle/src/libANGLE/PixelLocalStorage.h
++/third_party/angle/src/libANGLE/Program.h
++/third_party/angle/src/libANGLE/ProgramExecutable.h
++/third_party/angle/src/libANGLE/ProgramLinkedResources.h
++/third_party/angle/src/libANGLE/ProgramPipeline.h
++/third_party/angle/src/libANGLE/Query.h
++/third_party/angle/src/libANGLE/RefCountObject.h
++/third_party/angle/src/libANGLE/Renderbuffer.h
++/third_party/angle/src/libANGLE/ResourceManager.h
++/third_party/angle/src/libANGLE/ResourceMap.h
++/third_party/angle/src/libANGLE/Sampler.h
++/third_party/angle/src/libANGLE/Semaphore.h
++/third_party/angle/src/libANGLE/Shader.h
++/third_party/angle/src/libANGLE/ShareGroup.h
++/third_party/angle/src/libANGLE/ContextMutex.h
++/third_party/angle/src/libANGLE/SizedMRUCache.h
++/third_party/angle/src/libANGLE/State.h
++/third_party/angle/src/libANGLE/Stream.h
++/third_party/angle/src/libANGLE/Surface.h
++/third_party/angle/src/libANGLE/Texture.h
++/third_party/angle/src/libANGLE/Thread.h
++/third_party/angle/src/libANGLE/TransformFeedback.h
++/third_party/angle/src/libANGLE/Uniform.h
++/third_party/angle/src/libANGLE/VaryingPacking.h
++/third_party/angle/src/libANGLE/Version.h
++/third_party/angle/src/libANGLE/VertexArray.h
++/third_party/angle/src/libANGLE/VertexAttribute.h
++/third_party/angle/src/libANGLE/VertexAttribute.inc
++/third_party/angle/src/libANGLE/angletypes.h
++/third_party/angle/src/libANGLE/angletypes.inc
++/third_party/angle/src/libANGLE/cl_types.h
++/third_party/angle/src/libANGLE/context_private_call.inl.h
++/third_party/angle/src/libANGLE/context_private_call_autogen.h
++/third_party/angle/src/libANGLE/entry_points_utils.h
++/third_party/angle/src/libANGLE/features.h
++/third_party/angle/src/libANGLE/formatutils.h
++/third_party/angle/src/libANGLE/gles_extensions_autogen.h
++/third_party/angle/src/libANGLE/histogram_macros.h
++/third_party/angle/src/libANGLE/queryconversions.h
++/third_party/angle/src/libANGLE/queryutils.h
++/third_party/angle/src/libANGLE/trace.h
++/third_party/angle/src/libANGLE/renderer/BufferImpl.h
++/third_party/angle/src/libANGLE/renderer/CompilerImpl.h
++/third_party/angle/src/libANGLE/renderer/ContextImpl.h
++/third_party/angle/src/libANGLE/renderer/driver_utils.h
++/third_party/angle/src/libANGLE/renderer/DeviceImpl.h
++/third_party/angle/src/libANGLE/renderer/DisplayImpl.h
++/third_party/angle/src/libANGLE/renderer/EGLImplFactory.h
++/third_party/angle/src/libANGLE/renderer/EGLReusableSync.h
++/third_party/angle/src/libANGLE/renderer/EGLSyncImpl.h
++/third_party/angle/src/libANGLE/renderer/FenceNVImpl.h
++/third_party/angle/src/libANGLE/renderer/FormatID_autogen.h
++/third_party/angle/src/libANGLE/renderer/Format.h
++/third_party/angle/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h
++/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h
++/third_party/angle/src/libANGLE/renderer/GLImplFactory.h
++/third_party/angle/src/libANGLE/renderer/gl/functionsgl_enums.h
++/third_party/angle/src/libANGLE/renderer/ImageImpl.h
++/third_party/angle/src/libANGLE/renderer/MemoryObjectImpl.h
++/third_party/angle/src/libANGLE/renderer/OverlayImpl.h
++/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
++/third_party/angle/src/libANGLE/renderer/ProgramExecutableImpl.h
++/third_party/angle/src/libANGLE/renderer/ProgramPipelineImpl.h
++/third_party/angle/src/libANGLE/renderer/QueryImpl.h
++/third_party/angle/src/libANGLE/renderer/RenderbufferImpl.h
++/third_party/angle/src/libANGLE/renderer/RenderTargetCache.h
++/third_party/angle/src/libANGLE/renderer/SamplerImpl.h
++/third_party/angle/src/libANGLE/renderer/SemaphoreImpl.h
++/third_party/angle/src/libANGLE/renderer/ShaderImpl.h
++/third_party/angle/src/libANGLE/renderer/ShareGroupImpl.h
++/third_party/angle/src/libANGLE/renderer/StreamProducerImpl.h
++/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h
++/third_party/angle/src/libANGLE/renderer/SyncImpl.h
++/third_party/angle/src/libANGLE/renderer/TextureImpl.h
++/third_party/angle/src/libANGLE/renderer/TransformFeedbackImpl.h
++/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h
++/third_party/angle/src/libANGLE/renderer/vulkan/DisplayVk_api.h
++/third_party/angle/src/libANGLE/renderer/copyvertex.h
++/third_party/angle/src/libANGLE/renderer/copyvertex.inc.h
++/third_party/angle/src/libANGLE/renderer/load_functions_table.h
++/third_party/angle/src/libANGLE/renderer/renderer_utils.h
++/third_party/angle/src/libANGLE/renderer/serial_utils.h
++/third_party/angle/src/libANGLE/validationEGL.h
++/third_party/angle/src/libANGLE/validationEGL_autogen.h
++/third_party/angle/src/libANGLE/validationES.h
++/third_party/angle/src/libANGLE/validationES1.h
++/third_party/angle/src/libANGLE/validationES1_autogen.h
++/third_party/angle/src/libANGLE/validationES2.h
++/third_party/angle/src/libANGLE/validationES2_autogen.h
++/third_party/angle/src/libANGLE/validationES3.h
++/third_party/angle/src/libANGLE/validationES31.h
++/third_party/angle/src/libANGLE/validationES31_autogen.h
++/third_party/angle/src/libANGLE/validationES32.h
++/third_party/angle/src/libANGLE/validationES32_autogen.h
++/third_party/angle/src/libANGLE/validationES3_autogen.h
++/third_party/angle/src/libANGLE/validationESEXT.h
++/third_party/angle/src/libANGLE/validationESEXT_autogen.h
++/third_party/angle/src/common/base/anglebase/trace_event/trace_event.h
++/third_party/angle/src/libANGLE/CLPlatform.h
++/third_party/angle/src/libANGLE/renderer/CLPlatformImpl.h
++/third_party/angle/src/libANGLE/CLObject.h
++/third_party/angle/src/libANGLE/renderer/CLContextImpl.h
++/third_party/angle/src/libANGLE/renderer/CLDeviceImpl.h
++/third_party/angle/src/libANGLE/renderer/CLExtensions.h
++/third_party/angle/src/libANGLE/renderer/CLCommandQueueImpl.h
++/third_party/angle/src/libANGLE/renderer/CLEventImpl.h
++/third_party/angle/src/libANGLE/renderer/CLMemoryImpl.h
++/third_party/angle/src/libANGLE/renderer/CLProgramImpl.h
++/third_party/angle/src/libANGLE/renderer/CLSamplerImpl.h
++/third_party/angle/src/libANGLE/renderer/CLKernelImpl.h
++/third_party/angle/src/libANGLE/AttributeMap.cpp
++/third_party/angle/src/libANGLE/BlobCache.cpp
++/third_party/angle/src/libANGLE/Buffer.cpp
++/third_party/angle/src/libANGLE/Caps.cpp
++/third_party/angle/src/libANGLE/Compiler.cpp
++/third_party/angle/src/libANGLE/Config.cpp
++/third_party/angle/src/libANGLE/Context.cpp
++/third_party/angle/src/libANGLE/ContextMutex.cpp
++/third_party/angle/src/libANGLE/Context_gles_1_0.cpp
++/third_party/angle/src/libANGLE/Debug.cpp
++/third_party/angle/src/libANGLE/Device.cpp
++/third_party/angle/src/libANGLE/Display.cpp
++/third_party/angle/src/libANGLE/EGLSync.cpp
++/third_party/angle/src/libANGLE/Error.cpp
++/third_party/angle/src/libANGLE/Fence.cpp
++/third_party/angle/src/libANGLE/Framebuffer.cpp
++/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
++/third_party/angle/src/libANGLE/GLES1Renderer.cpp
++/third_party/angle/src/libANGLE/GLES1State.cpp
++/third_party/angle/src/libANGLE/GlobalMutex.cpp
++/third_party/angle/src/libANGLE/HandleAllocator.cpp
++/third_party/angle/src/libANGLE/Image.cpp
++/third_party/angle/src/libANGLE/ImageIndex.cpp
++/third_party/angle/src/libANGLE/IndexRangeCache.cpp
++/third_party/angle/src/libANGLE/LoggingAnnotator.cpp
++/third_party/angle/src/libANGLE/MemoryObject.cpp
++/third_party/angle/src/libANGLE/MemoryProgramCache.cpp
++/third_party/angle/src/libANGLE/MemoryShaderCache.cpp
++/third_party/angle/src/libANGLE/Observer.cpp
++/third_party/angle/src/libANGLE/Overlay.cpp
++/third_party/angle/src/libANGLE/OverlayWidgets.cpp
++/third_party/angle/src/libANGLE/Overlay_autogen.cpp
++/third_party/angle/src/libANGLE/Overlay_font_autogen.cpp
++/third_party/angle/src/libANGLE/PixelLocalStorage.cpp
++/third_party/angle/src/libANGLE/Platform.cpp
++/third_party/angle/src/libANGLE/Program.cpp
++/third_party/angle/src/libANGLE/ProgramExecutable.cpp
++/third_party/angle/src/libANGLE/ProgramLinkedResources.cpp
++/third_party/angle/src/libANGLE/ProgramPipeline.cpp
++/third_party/angle/src/libANGLE/Query.cpp
++/third_party/angle/src/libANGLE/Renderbuffer.cpp
++/third_party/angle/src/libANGLE/ResourceManager.cpp
++/third_party/angle/src/libANGLE/Sampler.cpp
++/third_party/angle/src/libANGLE/Semaphore.cpp
++/third_party/angle/src/libANGLE/Shader.cpp
++/third_party/angle/src/libANGLE/ShareGroup.cpp
++/third_party/angle/src/libANGLE/State.cpp
++/third_party/angle/src/libANGLE/Stream.cpp
++/third_party/angle/src/libANGLE/Surface.cpp
++/third_party/angle/src/libANGLE/Texture.cpp
++/third_party/angle/src/libANGLE/Thread.cpp
++/third_party/angle/src/libANGLE/TransformFeedback.cpp
++/third_party/angle/src/libANGLE/Uniform.cpp
++/third_party/angle/src/libANGLE/VaryingPacking.cpp
++/third_party/angle/src/libANGLE/VertexArray.cpp
++/third_party/angle/src/libANGLE/VertexAttribute.cpp
++/third_party/angle/src/libANGLE/angletypes.cpp
++/third_party/angle/src/libANGLE/es3_copy_conversion_table_autogen.cpp
++/third_party/angle/src/libANGLE/format_map_autogen.cpp
++/third_party/angle/src/libANGLE/formatutils.cpp
++/third_party/angle/src/libANGLE/gles_extensions_autogen.cpp
++/third_party/angle/src/libANGLE/queryconversions.cpp
++/third_party/angle/src/libANGLE/queryutils.cpp
++/third_party/angle/src/libANGLE/renderer/BufferImpl.cpp
++/third_party/angle/src/libANGLE/renderer/ContextImpl.cpp
++/third_party/angle/src/libANGLE/renderer/DeviceImpl.cpp
++/third_party/angle/src/libANGLE/renderer/DisplayImpl.cpp
++/third_party/angle/src/libANGLE/renderer/EGLReusableSync.cpp
++/third_party/angle/src/libANGLE/renderer/EGLSyncImpl.cpp
++/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp
++/third_party/angle/src/libANGLE/renderer/FramebufferImpl.cpp
++/third_party/angle/src/libANGLE/renderer/ImageImpl.cpp
++/third_party/angle/src/libANGLE/renderer/ProgramImpl.cpp
++/third_party/angle/src/libANGLE/renderer/ProgramPipelineImpl.cpp
++/third_party/angle/src/libANGLE/renderer/QueryImpl.cpp
++/third_party/angle/src/libANGLE/renderer/RenderbufferImpl.cpp
++/third_party/angle/src/libANGLE/renderer/ShaderImpl.cpp
++/third_party/angle/src/libANGLE/renderer/SurfaceImpl.cpp
++/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp
++/third_party/angle/src/libANGLE/renderer/TransformFeedbackImpl.cpp
++/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.cpp
++/third_party/angle/src/libANGLE/renderer/driver_utils.cpp
++/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp
++/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp
++/third_party/angle/src/libANGLE/validationEGL.cpp
++/third_party/angle/src/libANGLE/validationES.cpp
++/third_party/angle/src/libANGLE/validationES1.cpp
++/third_party/angle/src/libANGLE/validationES2.cpp
++/third_party/angle/src/libANGLE/validationES3.cpp
++/third_party/angle/src/libANGLE/validationES31.cpp
++/third_party/angle/src/libANGLE/validationES32.cpp
++/third_party/angle/src/libANGLE/validationESEXT.cpp
++/third_party/angle/src/common/frame_capture_binary_data.h
++/third_party/angle/src/common/frame_capture_utils.h
++/third_party/angle/src/common/frame_capture_utils_autogen.h
++/third_party/angle/src/common/gl_enum_utils.h
++/third_party/angle/src/common/gl_enum_utils_autogen.h
++/third_party/angle/src/libANGLE/capture/FrameCapture.h
++/third_party/angle/src/libANGLE/capture/capture_cl_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_egl_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_1_0_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_2_0_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_3_0_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_3_1_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_3_2_autogen.h
++/third_party/angle/src/libANGLE/capture/capture_gles_ext_autogen.h
++/third_party/angle/src/libANGLE/capture/serialize.h
++/third_party/angle/include/angle_gl.h
++/third_party/angle/include/export.h
++/third_party/angle/include/EGL/egl.h
++/third_party/angle/include/EGL/eglext.h
++/third_party/angle/include/EGL/eglext_angle.h
++/third_party/angle/include/EGL/eglplatform.h
++/third_party/angle/include/GLES/gl.h
++/third_party/angle/include/GLES/glplatform.h
++/third_party/angle/include/GLES/glext.h
++/third_party/angle/include/GLES2/gl2.h
++/third_party/angle/include/GLES2/gl2ext.h
++/third_party/angle/include/GLES2/gl2ext_angle.h
++/third_party/angle/include/GLES2/gl2platform.h
++/third_party/angle/include/GLES3/gl3.h
++/third_party/angle/include/GLES3/gl3platform.h
++/third_party/angle/include/GLES3/gl31.h
++/third_party/angle/include/GLES3/gl32.h
++/third_party/angle/include/GLX/glxext.h
++/third_party/angle/include/KHR/khrplatform.h
++/third_party/angle/include/WGL/wgl.h
++/third_party/angle/include/platform/Feature.h
++/third_party/angle/include/platform/autogen/FeaturesD3D_autogen.h
++/third_party/angle/include/platform/autogen/FeaturesGL_autogen.h
++/third_party/angle/include/platform/autogen/FeaturesMtl_autogen.h
++/third_party/angle/include/platform/autogen/FeaturesVk_autogen.h
++/third_party/angle/include/platform/autogen/FeaturesWgpu_autogen.h
++/third_party/angle/include/platform/autogen/FrontendFeatures_autogen.h
++/third_party/angle/include/platform/PlatformMethods.h
++/third_party/angle/include/vulkan/vulkan_fuchsia_ext.h
++/third_party/angle/include/GLSLANG/ShaderLang.h
++/third_party/angle/include/GLSLANG/ShaderVars.h
++/third_party/angle/src/compiler/translator/blocklayout.h
++/third_party/angle/src/compiler/translator/hlsl/blocklayoutHLSL.h
++/third_party/angle/include/EGL/egl.h
++/third_party/angle/include/EGL/eglext.h
++/third_party/angle/include/EGL/eglplatform.h
++/third_party/angle/include/GLES2/gl2.h
++/third_party/angle/include/GLES2/gl2ext.h
++/third_party/angle/include/GLES2/gl2platform.h
++/third_party/angle/include/GLES3/gl3.h
++/third_party/angle/include/GLES3/gl31.h
++/third_party/angle/include/GLES3/gl32.h
++/third_party/angle/include/GLES3/gl3platform.h
++/third_party/angle/include/KHR/khrplatform.h
++/third_party/angle/include/angle_gl.h
++/third_party/angle/src/compiler/translator/AsNode.h
++/third_party/angle/src/compiler/translator/BaseTypes.cpp
++/third_party/angle/src/compiler/translator/BaseTypes.h
++/third_party/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
++/third_party/angle/src/compiler/translator/BuiltInFunctionEmulator.h
++/third_party/angle/src/compiler/translator/CallDAG.cpp
++/third_party/angle/src/compiler/translator/CallDAG.h
++/third_party/angle/src/compiler/translator/CodeGen.cpp
++/third_party/angle/src/compiler/translator/CollectVariables.cpp
++/third_party/angle/src/compiler/translator/CollectVariables.h
++/third_party/angle/src/compiler/translator/Common.h
++/third_party/angle/src/compiler/translator/Compiler.cpp
++/third_party/angle/src/compiler/translator/Compiler.h
++/third_party/angle/src/compiler/translator/ConstantUnion.cpp
++/third_party/angle/src/compiler/translator/ConstantUnion.h
++/third_party/angle/src/compiler/translator/Declarator.cpp
++/third_party/angle/src/compiler/translator/Declarator.h
++/third_party/angle/src/compiler/translator/Diagnostics.cpp
++/third_party/angle/src/compiler/translator/Diagnostics.h
++/third_party/angle/src/compiler/translator/DirectiveHandler.cpp
++/third_party/angle/src/compiler/translator/DirectiveHandler.h
++/third_party/angle/src/compiler/translator/ExtensionBehavior.cpp
++/third_party/angle/src/compiler/translator/ExtensionBehavior.h
++/third_party/angle/src/compiler/translator/FlagStd140Structs.cpp
++/third_party/angle/src/compiler/translator/FlagStd140Structs.h
++/third_party/angle/src/compiler/translator/FunctionLookup.cpp
++/third_party/angle/src/compiler/translator/FunctionLookup.h
++/third_party/angle/src/compiler/translator/HashNames.cpp
++/third_party/angle/src/compiler/translator/HashNames.h
++/third_party/angle/src/compiler/translator/ImmutableString.h
++/third_party/angle/src/compiler/translator/ImmutableStringBuilder.cpp
++/third_party/angle/src/compiler/translator/ImmutableStringBuilder.h
++/third_party/angle/src/compiler/translator/InfoSink.cpp
++/third_party/angle/src/compiler/translator/InfoSink.h
++/third_party/angle/src/compiler/translator/Initialize.cpp
++/third_party/angle/src/compiler/translator/Initialize.h
++/third_party/angle/src/compiler/translator/InitializeGlobals.h
++/third_party/angle/src/compiler/translator/IntermNode.cpp
++/third_party/angle/src/compiler/translator/IntermNode.h
++/third_party/angle/src/compiler/translator/IntermRebuild.cpp
++/third_party/angle/src/compiler/translator/IntermRebuild.h
++/third_party/angle/src/compiler/translator/IsASTDepthBelowLimit.cpp
++/third_party/angle/src/compiler/translator/IsASTDepthBelowLimit.h
++/third_party/angle/src/compiler/translator/Name.cpp
++/third_party/angle/src/compiler/translator/Name.h
++/third_party/angle/src/compiler/translator/NodeType.h
++/third_party/angle/src/compiler/translator/Operator.cpp
++/third_party/angle/src/compiler/translator/Operator_autogen.h
++/third_party/angle/src/compiler/translator/OutputTree.cpp
++/third_party/angle/src/compiler/translator/OutputTree.h
++/third_party/angle/src/compiler/translator/ParseContext.cpp
++/third_party/angle/src/compiler/translator/ParseContext.h
++/third_party/angle/src/compiler/translator/PoolAlloc.cpp
++/third_party/angle/src/compiler/translator/PoolAlloc.h
++/third_party/angle/src/compiler/translator/Pragma.h
++/third_party/angle/src/compiler/translator/QualifierTypes.cpp
++/third_party/angle/src/compiler/translator/QualifierTypes.h
++/third_party/angle/src/compiler/translator/Severity.h
++/third_party/angle/src/compiler/translator/ShaderLang.cpp
++/third_party/angle/src/compiler/translator/ShaderVars.cpp
++/third_party/angle/src/compiler/translator/SizeClipCullDistance.cpp
++/third_party/angle/src/compiler/translator/SizeClipCullDistance.h
++/third_party/angle/src/compiler/translator/StaticType.h
++/third_party/angle/src/compiler/translator/Symbol.cpp
++/third_party/angle/src/compiler/translator/Symbol.h
++/third_party/angle/src/compiler/translator/SymbolTable.cpp
++/third_party/angle/src/compiler/translator/SymbolTable.h
++/third_party/angle/src/compiler/translator/SymbolTable_autogen.h
++/third_party/angle/src/compiler/translator/SymbolUniqueId.cpp
++/third_party/angle/src/compiler/translator/SymbolUniqueId.h
++/third_party/angle/src/compiler/translator/Types.cpp
++/third_party/angle/src/compiler/translator/Types.h
++/third_party/angle/src/compiler/translator/ValidateAST.cpp
++/third_party/angle/src/compiler/translator/ValidateAST.h
++/third_party/angle/src/compiler/translator/ValidateGlobalInitializer.cpp
++/third_party/angle/src/compiler/translator/ValidateGlobalInitializer.h
++/third_party/angle/src/compiler/translator/ValidateVaryingLocations.cpp
++/third_party/angle/src/compiler/translator/ValidateVaryingLocations.h
++/third_party/angle/src/compiler/translator/VariablePacker.cpp
++/third_party/angle/src/compiler/translator/VariablePacker.h
++/third_party/angle/src/compiler/translator/blocklayout.cpp
++/third_party/angle/src/compiler/translator/glsl/TranslatorESSL.h
++/third_party/angle/src/compiler/translator/glsl/TranslatorGLSL.h
++/third_party/angle/src/compiler/translator/glsl/VersionGLSL.h
++/third_party/angle/src/compiler/translator/glslang.h
++/third_party/angle/src/compiler/translator/glslang_lex_autogen.cpp
++/third_party/angle/src/compiler/translator/glslang_tab_autogen.cpp
++/third_party/angle/src/compiler/translator/glslang_tab_autogen.h
++/third_party/angle/src/compiler/translator/hlsl/TranslatorHLSL.h
++/third_party/angle/src/compiler/translator/ir/src/builder.h
++/third_party/angle/src/compiler/translator/ir/src/compile.h
++/third_party/angle/src/compiler/translator/ir/src/output/ir_to_legacy.h
++/third_party/angle/src/compiler/translator/ir/src/output/legacy.h
++/third_party/angle/src/compiler/translator/ir/src/pool_alloc.h
++/third_party/angle/src/compiler/translator/length_limits.h
++/third_party/angle/src/compiler/translator/msl/DriverUniformMetal.h
++/third_party/angle/src/compiler/translator/msl/TranslatorMSL.h
++/third_party/angle/src/compiler/translator/null/TranslatorNULL.h
++/third_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.h
++/third_party/angle/src/compiler/translator/tree_ops/AddDefaultReturnStatements.cpp
++/third_party/angle/src/compiler/translator/tree_ops/AddDefaultReturnStatements.h
++/third_party/angle/src/compiler/translator/tree_ops/ClampFragDepth.cpp
++/third_party/angle/src/compiler/translator/tree_ops/ClampFragDepth.h
++/third_party/angle/src/compiler/translator/tree_ops/ClampIndirectIndices.cpp
++/third_party/angle/src/compiler/translator/tree_ops/ClampIndirectIndices.h
++/third_party/angle/src/compiler/translator/tree_ops/ClampPointSize.cpp
++/third_party/angle/src/compiler/translator/tree_ops/ClampPointSize.h
++/third_party/angle/src/compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.cpp
++/third_party/angle/src/compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.h
++/third_party/angle/src/compiler/translator/tree_ops/DeclarePerVertexBlocks.cpp
++/third_party/angle/src/compiler/translator/tree_ops/DeclarePerVertexBlocks.h
++/third_party/angle/src/compiler/translator/tree_ops/DeferGlobalInitializers.cpp
++/third_party/angle/src/compiler/translator/tree_ops/DeferGlobalInitializers.h
++/third_party/angle/src/compiler/translator/tree_ops/EmulateGLFragColorBroadcast.cpp
++/third_party/angle/src/compiler/translator/tree_ops/EmulateGLFragColorBroadcast.h
++/third_party/angle/src/compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.cpp
++/third_party/angle/src/compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.h
++/third_party/angle/src/compiler/translator/tree_ops/FoldExpressions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/FoldExpressions.h
++/third_party/angle/src/compiler/translator/tree_ops/GatherDefaultUniforms.cpp
++/third_party/angle/src/compiler/translator/tree_ops/GatherDefaultUniforms.h
++/third_party/angle/src/compiler/translator/tree_ops/InitializeVariables.cpp
++/third_party/angle/src/compiler/translator/tree_ops/InitializeVariables.h
++/third_party/angle/src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.h
++/third_party/angle/src/compiler/translator/tree_ops/PreTransformTextureCubeGradDerivatives.cpp
++/third_party/angle/src/compiler/translator/tree_ops/PreTransformTextureCubeGradDerivatives.h
++/third_party/angle/src/compiler/translator/tree_ops/PruneEmptyCases.cpp
++/third_party/angle/src/compiler/translator/tree_ops/PruneEmptyCases.h
++/third_party/angle/src/compiler/translator/tree_ops/PruneNoOps.cpp
++/third_party/angle/src/compiler/translator/tree_ops/PruneNoOps.h
++/third_party/angle/src/compiler/translator/tree_ops/RecordConstantPrecision.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RecordConstantPrecision.h
++/third_party/angle/src/compiler/translator/tree_ops/ReduceInterfaceBlocks.cpp
++/third_party/angle/src/compiler/translator/tree_ops/ReduceInterfaceBlocks.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveArrayLengthMethod.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveArrayLengthMethod.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveDynamicIndexing.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveDynamicIndexing.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveInvariantDeclaration.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveInvariantDeclaration.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveUnreferencedVariables.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveUnreferencedVariables.h
++/third_party/angle/src/compiler/translator/tree_ops/RemoveUnusedFramebufferFetch.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RemoveUnusedFramebufferFetch.h
++/third_party/angle/src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.h
++/third_party/angle/src/compiler/translator/tree_ops/RewriteAtomicCounters.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewriteAtomicCounters.h
++/third_party/angle/src/compiler/translator/tree_ops/RewriteDfdy.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewriteDfdy.h
++/third_party/angle/src/compiler/translator/tree_ops/RewritePixelLocalStorage.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewritePixelLocalStorage.h
++/third_party/angle/src/compiler/translator/tree_ops/RewriteStructSamplers.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewriteStructSamplers.h
++/third_party/angle/src/compiler/translator/tree_ops/RewriteTexelFetchOffset.cpp
++/third_party/angle/src/compiler/translator/tree_ops/RewriteTexelFetchOffset.h
++/third_party/angle/src/compiler/translator/tree_ops/ScalarizeVecAndMatConstructorArgs.cpp
++/third_party/angle/src/compiler/translator/tree_ops/ScalarizeVecAndMatConstructorArgs.h
++/third_party/angle/src/compiler/translator/tree_ops/SeparateDeclarations.cpp
++/third_party/angle/src/compiler/translator/tree_ops/SeparateDeclarations.h
++/third_party/angle/src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.cpp
++/third_party/angle/src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.h
++/third_party/angle/src/compiler/translator/tree_ops/SimplifyLoopConditions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/SimplifyLoopConditions.h
++/third_party/angle/src/compiler/translator/tree_ops/SplitSequenceOperator.cpp
++/third_party/angle/src/compiler/translator/tree_ops/SplitSequenceOperator.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/RegenerateStructNames.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/RewriteRepeatedAssignToSwizzled.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/UseInterfaceBlockFields.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/AddAndTrueToLoopCondition.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/RewriteRowMajorMatrices.h
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/UnfoldShortCircuitAST.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/EnsureLoopForwardProgress.h
++/third_party/angle/src/compiler/translator/tree_util/BuiltIn.h
++/third_party/angle/src/compiler/translator/tree_util/BuiltIn_autogen.h
++/third_party/angle/src/compiler/translator/tree_util/DriverUniform.cpp
++/third_party/angle/src/compiler/translator/tree_util/DriverUniform.h
++/third_party/angle/src/compiler/translator/tree_util/FindFunction.cpp
++/third_party/angle/src/compiler/translator/tree_util/FindFunction.h
++/third_party/angle/src/compiler/translator/tree_util/FindMain.cpp
++/third_party/angle/src/compiler/translator/tree_util/FindMain.h
++/third_party/angle/src/compiler/translator/tree_util/FindPreciseNodes.cpp
++/third_party/angle/src/compiler/translator/tree_util/FindPreciseNodes.h
++/third_party/angle/src/compiler/translator/tree_util/FindSymbolNode.cpp
++/third_party/angle/src/compiler/translator/tree_util/FindSymbolNode.h
++/third_party/angle/src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp
++/third_party/angle/src/compiler/translator/tree_util/IntermNodePatternMatcher.h
++/third_party/angle/src/compiler/translator/tree_util/IntermNode_util.cpp
++/third_party/angle/src/compiler/translator/tree_util/IntermNode_util.h
++/third_party/angle/src/compiler/translator/tree_util/IntermTraverse.cpp
++/third_party/angle/src/compiler/translator/tree_util/IntermTraverse.h
++/third_party/angle/src/compiler/translator/tree_util/NodeSearch.h
++/third_party/angle/src/compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.cpp
++/third_party/angle/src/compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.h
++/third_party/angle/src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.cpp
++/third_party/angle/src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.h
++/third_party/angle/src/compiler/translator/tree_util/ReplaceShadowingVariables.cpp
++/third_party/angle/src/compiler/translator/tree_util/ReplaceShadowingVariables.h
++/third_party/angle/src/compiler/translator/tree_util/ReplaceVariable.cpp
++/third_party/angle/src/compiler/translator/tree_util/ReplaceVariable.h
++/third_party/angle/src/compiler/translator/tree_util/RewriteSampleMaskVariable.cpp
++/third_party/angle/src/compiler/translator/tree_util/RewriteSampleMaskVariable.h
++/third_party/angle/src/compiler/translator/tree_util/RunAtTheBeginningOfShader.cpp
++/third_party/angle/src/compiler/translator/tree_util/RunAtTheBeginningOfShader.h
++/third_party/angle/src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp
++/third_party/angle/src/compiler/translator/tree_util/RunAtTheEndOfShader.h
++/third_party/angle/src/compiler/translator/tree_util/SpecializationConstant.cpp
++/third_party/angle/src/compiler/translator/tree_util/SpecializationConstant.h
++/third_party/angle/src/compiler/translator/tree_util/Visit.h
++/third_party/angle/src/compiler/translator/util.cpp
++/third_party/angle/src/compiler/translator/util.h
++/third_party/angle/src/compiler/translator/wgsl/TranslatorWGSL.h
++/third_party/angle/src/compiler/translator/glsl/OutputGLSLBase.cpp
++/third_party/angle/src/compiler/translator/glsl/OutputGLSLBase.h
++/third_party/angle/src/compiler/translator/glsl/OutputGLSL.cpp
++/third_party/angle/src/compiler/translator/glsl/OutputGLSL.h
++/third_party/angle/src/compiler/translator/glsl/OutputESSL.cpp
++/third_party/angle/src/compiler/translator/glsl/OutputESSL.h
++/third_party/angle/src/compiler/translator/glsl/TranslatorESSL.cpp
++/third_party/angle/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp
++/third_party/angle/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.h
++/third_party/angle/src/compiler/translator/glsl/ExtensionGLSL.cpp
++/third_party/angle/src/compiler/translator/glsl/ExtensionGLSL.h
++/third_party/angle/src/compiler/translator/glsl/TranslatorGLSL.cpp
++/third_party/angle/src/compiler/translator/glsl/VersionGLSL.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/RegenerateStructNames.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/RewriteRepeatedAssignToSwizzled.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/UseInterfaceBlockFields.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/AddAndTrueToLoopCondition.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/RewriteRowMajorMatrices.cpp
++/third_party/angle/src/compiler/translator/tree_ops/glsl/apple/UnfoldShortCircuitAST.cpp
++/third_party/angle/src/compiler/translator/hlsl/ASTMetadataHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/ASTMetadataHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/BuiltInFunctionEmulatorHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/BuiltInFunctionEmulatorHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/ImageFunctionHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/ImageFunctionHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/OutputHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/OutputHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/ResourcesHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/ResourcesHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/StructureHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/StructureHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/TextureFunctionHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/TextureFunctionHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/TranslatorHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/UtilsHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/UtilsHLSL.h
++/third_party/angle/src/compiler/translator/hlsl/blocklayoutHLSL.cpp
++/third_party/angle/src/compiler/translator/hlsl/emulated_builtin_functions_hlsl_autogen.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/ArrayReturnValueToOutParameter.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/ArrayReturnValueToOutParameter.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/BreakVariableAliasingInInnerLoops.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/BreakVariableAliasingInInnerLoops.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/ExpandIntegerPowExpressions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/ExpandIntegerPowExpressions.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RecordUniformBlocksWithLargeArrayMember.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RecordUniformBlocksWithLargeArrayMember.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RemoveSwitchFallThrough.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RemoveSwitchFallThrough.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RewriteElseBlocks.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RewriteElseBlocks.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RewriteUnaryMinusOperatorInt.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/RewriteUnaryMinusOperatorInt.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateArrayConstructorStatements.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateArrayConstructorStatements.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateArrayInitialization.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateArrayInitialization.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateExpressionsReturningArrays.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/SeparateExpressionsReturningArrays.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/UnfoldShortCircuitToIf.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/UnfoldShortCircuitToIf.h
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/WrapSwitchStatementsInBlocks.cpp
++/third_party/angle/src/compiler/translator/tree_ops/hlsl/WrapSwitchStatementsInBlocks.h
++/third_party/angle/src/compiler/translator/spirv/BuildSPIRV.cpp
++/third_party/angle/src/compiler/translator/spirv/BuildSPIRV.h
++/third_party/angle/src/compiler/translator/spirv/BuiltinsWorkaround.cpp
++/third_party/angle/src/compiler/translator/spirv/BuiltinsWorkaround.h
++/third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cpp
++/third_party/angle/src/compiler/translator/spirv/OutputSPIRV.h
++/third_party/angle/src/compiler/translator/spirv/TranslatorSPIRV.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/ClampGLLayer.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/ClampGLLayer.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateDithering.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateDithering.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFragColorData.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFragColorData.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateYUVBuiltIns.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateYUVBuiltIns.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/FlagSamplersWithTexelFetch.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/FlagSamplersWithTexelFetch.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/ReswizzleYUVOps.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/ReswizzleYUVOps.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteInterpolateAtOffset.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteInterpolateAtOffset.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteR32fImages.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteR32fImages.h
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteSamplerExternalTexelFetch.cpp
++/third_party/angle/src/compiler/translator/tree_ops/spirv/RewriteSamplerExternalTexelFetch.h
++/third_party/angle/src/compiler/translator/ImmutableString_autogen.cpp
++/third_party/angle/src/compiler/translator/SymbolTable_autogen.cpp
++/third_party/angle/src/compiler/translator/msl/AstHelpers.cpp
++/third_party/angle/src/compiler/translator/msl/AstHelpers.h
++/third_party/angle/src/compiler/translator/msl/ConstantNames.cpp
++/third_party/angle/src/compiler/translator/msl/DebugSink.h
++/third_party/angle/src/compiler/translator/msl/DiscoverDependentFunctions.cpp
++/third_party/angle/src/compiler/translator/msl/DiscoverDependentFunctions.h
++/third_party/angle/src/compiler/translator/msl/DiscoverEnclosingFunctionTraverser.cpp
++/third_party/angle/src/compiler/translator/msl/DiscoverEnclosingFunctionTraverser.h
++/third_party/angle/src/compiler/translator/msl/DriverUniformMetal.cpp
++/third_party/angle/src/compiler/translator/msl/EmitMetal.cpp
++/third_party/angle/src/compiler/translator/msl/EmitMetal.h
++/third_party/angle/src/compiler/translator/msl/IdGen.cpp
++/third_party/angle/src/compiler/translator/msl/IdGen.h
++/third_party/angle/src/compiler/translator/msl/Layout.cpp
++/third_party/angle/src/compiler/translator/msl/Layout.h
++/third_party/angle/src/compiler/translator/msl/MapFunctionsToDefinitions.cpp
++/third_party/angle/src/compiler/translator/msl/MapFunctionsToDefinitions.h
++/third_party/angle/src/compiler/translator/msl/MapSymbols.cpp
++/third_party/angle/src/compiler/translator/msl/MapSymbols.h
++/third_party/angle/src/compiler/translator/msl/ModifyStruct.cpp
++/third_party/angle/src/compiler/translator/msl/ModifyStruct.h
++/third_party/angle/src/compiler/translator/msl/Pipeline.cpp
++/third_party/angle/src/compiler/translator/msl/Pipeline.h
++/third_party/angle/src/compiler/translator/msl/ProgramPrelude.cpp
++/third_party/angle/src/compiler/translator/msl/ProgramPrelude.h
++/third_party/angle/src/compiler/translator/msl/Reference.h
++/third_party/angle/src/compiler/translator/msl/RewritePipelines.cpp
++/third_party/angle/src/compiler/translator/msl/RewritePipelines.h
++/third_party/angle/src/compiler/translator/msl/SkippingTraverser.h
++/third_party/angle/src/compiler/translator/msl/SymbolEnv.cpp
++/third_party/angle/src/compiler/translator/msl/SymbolEnv.h
++/third_party/angle/src/compiler/translator/msl/ToposortStructs.cpp
++/third_party/angle/src/compiler/translator/msl/ToposortStructs.h
++/third_party/angle/src/compiler/translator/msl/TranslatorMSL.cpp
++/third_party/angle/src/compiler/translator/msl/UtilsMSL.cpp
++/third_party/angle/src/compiler/translator/msl/UtilsMSL.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/AddExplicitTypeCasts.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/AddExplicitTypeCasts.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/ConvertUnsupportedConstructorsToFunctionCalls.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/ConvertUnsupportedConstructorsToFunctionCalls.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/EnsureLoopForwardProgress.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/FixTypeConstructors.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/FixTypeConstructors.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/GuardFragDepthWrite.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/GuardFragDepthWrite.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/HoistConstants.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/HoistConstants.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/IntroduceVertexIndexID.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/IntroduceVertexIndexID.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/RescopeGlobalVariables.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/RescopeGlobalVariables.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteCaseDeclarations.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteCaseDeclarations.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteInterpolants.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteInterpolants.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteOutArgs.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteOutArgs.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteUnaddressableReferences.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/RewriteUnaddressableReferences.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/SeparateCompoundExpressions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/SeparateCompoundExpressions.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/TransposeRowMajorMatrices.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/TransposeRowMajorMatrices.h
++/third_party/angle/src/compiler/translator/tree_ops/msl/WrapMain.cpp
++/third_party/angle/src/compiler/translator/tree_ops/msl/WrapMain.h
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/EmulateMutableFunctionParams.cpp
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/EmulateMutableFunctionParams.h
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/PullExpressionsIntoFunctions.cpp
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/PullExpressionsIntoFunctions.h
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/RewriteMixedTypeMathExprs.cpp
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/RewriteMixedTypeMathExprs.h
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/RewriteMultielementSwizzleAssignment.cpp
++/third_party/angle/src/compiler/translator/tree_ops/wgsl/RewriteMultielementSwizzleAssignment.h
++/third_party/angle/src/compiler/translator/wgsl/OutputUniformBlocks.cpp
++/third_party/angle/src/compiler/translator/wgsl/OutputUniformBlocks.h
++/third_party/angle/src/compiler/translator/wgsl/RewritePipelineVariables.cpp
++/third_party/angle/src/compiler/translator/wgsl/RewritePipelineVariables.h
++/third_party/angle/src/compiler/translator/wgsl/TranslatorWGSL.cpp
++/third_party/angle/src/compiler/translator/wgsl/Utils.cpp
++/third_party/angle/src/compiler/translator/wgsl/Utils.h
++/third_party/angle/src/compiler/translator/wgsl/WGSLProgramPrelude.cpp
++/third_party/angle/src/compiler/translator/wgsl/WGSLProgramPrelude.h
++/third_party/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
++/third_party/angle/src/compiler/preprocessor/DiagnosticsBase.h
++/third_party/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
++/third_party/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
++/third_party/angle/src/compiler/preprocessor/DirectiveParser.cpp
++/third_party/angle/src/compiler/preprocessor/DirectiveParser.h
++/third_party/angle/src/compiler/preprocessor/ExpressionParser.h
++/third_party/angle/src/compiler/preprocessor/Input.cpp
++/third_party/angle/src/compiler/preprocessor/Input.h
++/third_party/angle/src/compiler/preprocessor/Lexer.cpp
++/third_party/angle/src/compiler/preprocessor/Lexer.h
++/third_party/angle/src/compiler/preprocessor/Macro.cpp
++/third_party/angle/src/compiler/preprocessor/Macro.h
++/third_party/angle/src/compiler/preprocessor/MacroExpander.cpp
++/third_party/angle/src/compiler/preprocessor/MacroExpander.h
++/third_party/angle/src/compiler/preprocessor/Preprocessor.cpp
++/third_party/angle/src/compiler/preprocessor/Preprocessor.h
++/third_party/angle/src/compiler/preprocessor/SourceLocation.h
++/third_party/angle/src/compiler/preprocessor/Token.cpp
++/third_party/angle/src/compiler/preprocessor/Token.h
++/third_party/angle/src/compiler/preprocessor/Tokenizer.h
++/third_party/angle/src/compiler/preprocessor/numeric_lex.h
++/third_party/angle/src/compiler/preprocessor/preprocessor_lex_autogen.cpp
++/third_party/angle/src/compiler/preprocessor/preprocessor_tab_autogen.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/BufferD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/BufferD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/CompilerD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/CompilerD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/ContextD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/DisplayD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/DisplayD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h
++/third_party/angle/src/libANGLE/renderer/d3d/DynamicImage2DHLSL.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/DynamicImage2DHLSL.h
++/third_party/angle/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/EGLImageD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.h
++/third_party/angle/src/libANGLE/renderer/d3d/ImageD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/ImageD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/IndexBuffer.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/IndexBuffer.h
++/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
++/third_party/angle/src/libANGLE/renderer/d3d/NativeWindowD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/NativeWindowD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/ProgramExecutableD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/ProgramExecutableD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/RenderbufferD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/SamplerD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/ShaderExecutableD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/ShaderExecutableD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
++/third_party/angle/src/libANGLE/renderer/d3d/TextureStorage.h
++/third_party/angle/src/libANGLE/renderer/d3d/VertexBuffer.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/VertexBuffer.h
++/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h
++/third_party/angle/src/libANGLE/renderer/d3d/driver_utils_d3d.cpp
++/third_party/angle/src/libANGLE/renderer/d3d/driver_utils_d3d.h
++/third_party/angle/src/libANGLE/renderer/d3d/formatutilsD3D.h
diff --git a/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_moz.build b/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_moz.build
new file mode 100644
index 0000000000..5bda19d515
--- /dev/null
+++ b/firefox/patches/patch-third__party_angle_angle__program__version__id__gn_moz.build
@@ -0,0 +1,31 @@
+$NetBSD: patch-third__party_angle_angle__program__version__id__gn_moz.build,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+* Add FreeBSD and NetBSD file with SHA256 hash.
+
+--- third_party/angle/angle_program_version_id_gn/moz.build.orig	2026-08-14 14:09:56.486273570 +0000
++++ third_party/angle/angle_program_version_id_gn/moz.build
+@@ -69,6 +69,24 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
+         script="/python/mozbuild/mozbuild/action/write_path_list.py",
+     )
+ 
++if CONFIG["OS_TARGET"] == "FreeBSD":
++
++    GeneratedFile(
++        "/third_party/angle/gen/ANGLEShaderProgramVersion.h.rsp",
++        entry_point="write_paths",
++        inputs=['ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in'],
++        script="/python/mozbuild/mozbuild/action/write_path_list.py",
++    )
++
++if CONFIG["OS_TARGET"] == "NetBSD":
++
++    GeneratedFile(
++        "/third_party/angle/gen/ANGLEShaderProgramVersion.h.rsp",
++        entry_point="write_paths",
++        inputs=['ANGLEShaderProgramVersion.h-22c710649c380411.rsp.in'],
++        script="/python/mozbuild/mozbuild/action/write_path_list.py",
++    )
++
+ if CONFIG["OS_TARGET"] == "WINNT":
+ 
+     DEFINES["UNICODE"] = True
diff --git a/firefox/patches/patch-third__party_angle_src_common_system__utils__linux.cpp b/firefox/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
new file mode 100644
index 0000000000..177ea2f77d
--- /dev/null
+++ b/firefox/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-third__party_angle_src_common_system__utils__linux.cpp,v 1.1 2026/08/24 12:51:47 ryoon Exp $
+
+--- third_party/angle/src/common/system_utils_linux.cpp.orig	2026-08-14 22:53:43.182273820 +0000
++++ third_party/angle/src/common/system_utils_linux.cpp
+@@ -63,6 +63,10 @@ void SetCurrentThreadName(const char *name)
+     // There's a 15-character (16 including '\0') limit.  If the name is too big (and ERANGE is
+     // returned), name will be ignored.
+     ASSERT(strlen(name) < 16);
++#if defined(__NetBSD__)
++    pthread_setname_np(pthread_self(), "%s", (void *)name);
++#else
+     pthread_setname_np(pthread_self(), name);
++#endif
+ }
+ }  // namespace angle
diff --git a/firefox/patches/patch-third__party_js_cfworker_build.sh b/firefox/patches/patch-third__party_js_cfworker_build.sh
new file mode 100644
index 0000000000..98e308661a
--- /dev/null
+++ b/firefox/patches/patch-third__party_js_cfworker_build.sh
@@ -0,0 +1,20 @@
+$NetBSD: patch-third__party_js_cfworker_build.sh,v 1.1 2022/05/14 10:30:26 tnn Exp $
+
+shell portability
+
+--- third_party/js/cfworker/build.sh.orig	2022-04-28 22:03:47.000000000 +0000
++++ third_party/js/cfworker/build.sh
+@@ -4,9 +4,10 @@ set -euo pipefail
+ # Path to mach relative to /third_party/js/cfworker
+ MACH=$(realpath "../../../mach")
+ 
+-if [[ $(uname -a) == *MSYS* ]]; then
+-  MACH="python ${MACH}"
+-fi
++# uname -a is not a good idea here. Someone could have MSYS in the hostname.
++#if uname -a | grep MSYS > /dev/null; then
++#  MACH="python ${MACH}"
++#fi
+ 
+ NODE="${MACH} node"
+ NPM="${MACH} npm"
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc b/firefox/patches/patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc
new file mode 100644
index 0000000000..59b65bdf53
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc
@@ -0,0 +1,34 @@
+$NetBSD: patch-third__party_libwebrtc_modules_audio__device_audio__device__impl.cc,v 1.5 2025/12/24 15:26:41 ryoon Exp $
+
+--- third_party/libwebrtc/modules/audio_device/audio_device_impl.cc.orig	2025-11-28 13:14:41.000000000 +0000
++++ third_party/libwebrtc/modules/audio_device/audio_device_impl.cc
+@@ -28,7 +28,7 @@
+ 
+ #if defined(WEBRTC_WIN)
+ #include "modules/audio_device/win/audio_device_core_win.h"
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ #if defined(WEBRTC_ENABLE_LINUX_ALSA)
+ #include "modules/audio_device/linux/audio_device_alsa_linux.h"
+ #endif
+@@ -146,6 +146,11 @@ int32_t AudioDeviceModuleImpl::CheckPlat
+ #elif defined(WEBRTC_FUCHSIA)
+   platform = kPlatformFuchsia;
+   RTC_LOG(LS_INFO) << "current platform is Fuchsia";
++#elif defined(WEBRTC_BSD)
++#  if defined(__NetBSD__)
++  platform = kPlatformNetBSD;
++  RTC_LOG(LS_INFO) << "current platform is NetBSD";
++#  endif
+ #endif
+   if (platform == kPlatformNotSupported) {
+     RTC_LOG(LS_ERROR)
+@@ -199,7 +204,7 @@ int32_t AudioDeviceModuleImpl::CreatePla
+ // 'rtc_include_pulse_audio' build flag.
+ // TODO(bugs.webrtc.org/9127): improve support and make it more clear that
+ // PulseAudio is the default selection.
+-#if !defined(WEBRTC_ANDROID) && defined(WEBRTC_LINUX)
++#if !defined(WEBRTC_ANDROID) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD))
+ #if !defined(WEBRTC_ENABLE_LINUX_PULSE)
+   // Build flag 'rtc_include_pulse_audio' is set to false. In this mode:
+   // - kPlatformDefaultAudio => ALSA, and
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build b/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build
new file mode 100644
index 0000000000..b1f7242b6e
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build
@@ -0,0 +1,45 @@
+$NetBSD: patch-third__party_libwebrtc_modules_desktop__capture_desktop__capture__gn_moz.build,v 1.7 2026/01/19 12:06:04 ryoon Exp $
+
+* Disable Wayland desktop capture for non-Linux platforms.
+  Fix segfault under X11.
+
+--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build.orig	2026-01-03 09:47:00.641014045 +0000
++++ third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
+@@ -408,7 +408,7 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] 
+ 
+     DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
+ 
+-if CONFIG["TARGET_CPU"] == "aarch64" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+     DEFINES["_GNU_SOURCE"] = True
+@@ -458,7 +458,7 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_C
+         "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "x86" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     CXXFLAGS += [
+         "-msse2"
+@@ -486,7 +486,7 @@ if CONFIG["TARGET_CPU"] == "x86" and (CONFIG["OS_TARGE
+         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "x86_64" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+     DEFINES["_GNU_SOURCE"] = True
+@@ -643,6 +643,10 @@ if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["MOZ_X1
+ if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["MOZ_X11"] == "1" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
+ 
+     DEFINES["WEBRTC_USE_X11"] = True
++
++    CXXFLAGS += [
++        "-msse2"
++    ]
+ 
+     OS_LIBS += [
+         "X11",
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc b/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
new file mode 100644
index 0000000000..6c9f7c86ed
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
@@ -0,0 +1,14 @@
+$NetBSD: patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc,v 1.4 2025/11/14 17:17:18 ryoon Exp $
+
+--- third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig	2025-10-31 13:10:50.000000000 +0000
++++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+@@ -15,7 +15,9 @@
+ #include <EGL/eglplatform.h>
+ #include <GL/gl.h>
+ #include <GL/glext.h>
++#if defined(__linux__)
+ #include <asm/ioctl.h>
++#endif
+ #include <dlfcn.h>
+ #include <fcntl.h>
+ #include <gbm.h>
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build b/firefox/patches/patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build
new file mode 100644
index 0000000000..9e2af92ce6
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build
@@ -0,0 +1,29 @@
+$NetBSD: patch-third__party_libwebrtc_modules_portal_portal__gn_moz.build,v 1.2 2026/01/19 12:06:04 ryoon Exp $
+
+--- third_party/libwebrtc/modules/portal/portal_gn/moz.build.orig	2026-01-02 07:16:24.028920365 +0000
++++ third_party/libwebrtc/modules/portal/portal_gn/moz.build
+@@ -38,7 +38,8 @@ DEFINES["WEBRTC_MOZILLA_BUILD"] = True
+ DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+ DEFINES["WEBRTC_POSIX"] = True
+ DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+-DEFINES["WEBRTC_USE_PIPEWIRE"] = True
++if CONFIG["OS_TARGET"] == "Linux":
++    DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+ DEFINES["_FILE_OFFSET_BITS"] = "64"
+ DEFINES["_GNU_SOURCE"] = True
+ DEFINES["_LARGEFILE64_SOURCE"] = True
+@@ -62,10 +63,13 @@ LOCAL_INCLUDES += [
+ ]
+ 
+ UNIFIED_SOURCES += [
+-    "/third_party/libwebrtc/modules/portal/pipewire_utils.cc",
+     "/third_party/libwebrtc/modules/portal/scoped_glib.cc",
+     "/third_party/libwebrtc/modules/portal/xdg_desktop_portal_utils.cc"
+ ]
++if CONFIG["OS_TARGET"] == "Linux":
++    UNIFIED_SOURCES += [
++        "/third_party/libwebrtc/modules/portal/pipewire_utils.cc"
++    ]
+ 
+ if not CONFIG["MOZ_DEBUG"]:
+ 
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc
new file mode 100644
index 0000000000..c7329886cd
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc
@@ -0,0 +1,37 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc,v 1.5 2025/12/24 15:26:41 ryoon Exp $
+
+* Fix build under NetBSD 9 and older.
+  The older NetBSD's sys/videoio.h does not have v4l2_capability.device_caps.
+
+--- third_party/libwebrtc/modules/video_capture/linux/device_info_v4l2.cc.orig	2025-12-11 01:10:40.995051175 +0000
++++ third_party/libwebrtc/modules/video_capture/linux/device_info_v4l2.cc
+@@ -211,11 +211,13 @@ uint32_t DeviceInfoV4l2::NumberOfDevices
+   for (int n = 0; n < 64; n++) {
+     snprintf(device, sizeof(device), "/dev/video%d", n);
+     if ((fd = open(device, O_RDONLY)) != -1) {
++#if defined(VIDIOC_QUERYCAP)
+       // query device capabilities and make sure this is a video capture device
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+ 
+       close(fd);
+       count++;
+@@ -387,11 +389,15 @@ bool DeviceInfoV4l2::IsDeviceNameMatches
+ 
+ bool DeviceInfoV4l2::IsVideoCaptureDevice(struct v4l2_capability* cap)
+ {
++#if defined(V4L2_CAP_DEVICE_CAPS)
+   if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
+     return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE;
+   } else {
+     return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
+   }
++#else
++    return true;
++#endif
+ }
+ 
+ int32_t DeviceInfoV4l2::FillCapabilities(int fd) {
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc
new file mode 100644
index 0000000000..4d761150fc
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc
@@ -0,0 +1,42 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc,v 1.3 2025/12/24 15:26:41 ryoon Exp $
+
+* Fix build under NetBSD 9 and older.
+  The older NetBSD's sys/videoio.h does not have v4l2_capability.device_caps.
+* On NetBSD, some uvideo(4) devices are not usable. They returns
+  fmt.pixelformat as zero from VIDIOC_ENUM_FMT. Exclude unsupported devices
+  in early stage.
+
+--- third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc.orig	2025-12-05 17:43:20.000000000 +0000
++++ third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc
+@@ -90,18 +90,28 @@ int32_t VideoCaptureModuleV4L2::Init(con
+     if ((fd = open(device, O_RDONLY)) != -1) {
+       // query device capabilities
+       struct v4l2_capability cap;
++#if defined(VIDIOC_QUERYCAP)
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) {
+         if (cap.bus_info[0] != 0) {
+           if (strncmp((const char*)cap.bus_info,
+                       (const char*)deviceUniqueIdUTF8,
+                       strlen((const char*)deviceUniqueIdUTF8)) ==
+               0) {  // match with device id
+-            close(fd);
+-            found = true;
+-            break;  // fd matches with device unique id supplied
++            struct v4l2_fmtdesc fmt;
++            memset(&fmt, 0, sizeof(fmt));
++            fmt.index = 0;
++            fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++            if (ioctl(fd, VIDIOC_ENUM_FMT, &fmt) == 0) {
++              if (fmt.pixelformat != 0) {
++                close(fd);
++                found = true;
++                break;  // fd matches with device unique id supplied
++              }
++            }
+           }
+         }
+       }
++#endif
+       close(fd);  // close since this is not the matching device
+     }
+   }
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build
new file mode 100644
index 0000000000..4c3a8bcb4a
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build
@@ -0,0 +1,40 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_video__capture__internal__impl__gn_moz.build,v 1.1 2025/12/24 15:26:41 ryoon Exp $
+
+--- third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build.orig	2025-12-02 15:13:29.385557469 +0000
++++ third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build
+@@ -282,7 +282,7 @@ if CONFIG["OS_TARGET"] == "Android" and 
+         "-msse2"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "aarch64" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+     DEFINES["_GNU_SOURCE"] = True
+@@ -299,7 +299,7 @@ if CONFIG["TARGET_CPU"] == "aarch64" and
+         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "arm" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "arm" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+     DEFINES["_GNU_SOURCE"] = True
+@@ -316,7 +316,7 @@ if CONFIG["TARGET_CPU"] == "arm" and (CO
+         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "x86" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     CXXFLAGS += [
+         "-msse2"
+@@ -337,7 +337,7 @@ if CONFIG["TARGET_CPU"] == "x86" and (CO
+         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
+     ]
+ 
+-if CONFIG["TARGET_CPU"] == "x86_64" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
++if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux":
+ 
+     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+     DEFINES["_GNU_SOURCE"] = True
diff --git a/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc
new file mode 100644
index 0000000000..3ff9837871
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_video__capture__options.cc,v 1.3 2025/07/26 14:12:54 ryoon Exp $
+
+--- third_party/libwebrtc/modules/video_capture/video_capture_options.cc.orig	2025-05-21 12:41:53.782245708 +0000
++++ third_party/libwebrtc/modules/video_capture/video_capture_options.cc
+@@ -37,7 +37,7 @@ void VideoCaptureOptions::Init(Callback*
+     return;
+   }
+ #endif
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+   if (!allow_v4l2_)
+     callback->OnInitialized(Status::UNAVAILABLE);
+   else
diff --git a/firefox/patches/patch-third__party_libwebrtc_rtc__base_memory__usage.cc b/firefox/patches/patch-third__party_libwebrtc_rtc__base_memory__usage.cc
new file mode 100644
index 0000000000..2ea867ac93
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_rtc__base_memory__usage.cc
@@ -0,0 +1,23 @@
+$NetBSD: patch-third__party_libwebrtc_rtc__base_memory__usage.cc,v 1.4 2025/09/26 23:15:49 ryoon Exp $
+
+--- third_party/libwebrtc/rtc_base/memory_usage.cc.orig	2025-09-10 12:13:46.353394466 +0000
++++ third_party/libwebrtc/rtc_base/memory_usage.cc
+@@ -12,7 +12,7 @@
+ 
+ #include <cstdint>
+ 
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ #include <unistd.h>
+ 
+ #include <cstdio>
+@@ -34,7 +34,8 @@
+ namespace webrtc {
+ 
+ int64_t GetProcessResidentSizeBytes() {
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
++ #include <unistd.h>
+   FILE* file = fopen("/proc/self/statm", "r");
+   if (file == nullptr) {
+     RTC_LOG(LS_ERROR) << "Failed to open /proc/self/statm";
diff --git a/firefox/patches/patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc b/firefox/patches/patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc
new file mode 100644
index 0000000000..bb0f288ce6
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_libwebrtc_rtc__base_physical__socket__server.cc,v 1.1 2024/07/13 22:10:30 ryoon Exp $
+
+--- third_party/libwebrtc/rtc_base/physical_socket_server.cc.orig	2024-07-03 20:25:45.412396416 +0000
++++ third_party/libwebrtc/rtc_base/physical_socket_server.cc
+@@ -770,7 +770,7 @@ int PhysicalSocket::TranslateOption(Opti
+       return -1;
+ #endif
+     case OPT_RECV_ECN:
+-#if defined(WEBRTC_POSIX)
++#if defined(WEBRTC_POSIX) && defined(IP_RECVTOS)
+       if (family_ == AF_INET6) {
+         *slevel = IPPROTO_IPV6;
+         *sopt = IPV6_RECVTCLASS;
diff --git a/firefox/patches/patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc b/firefox/patches/patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc
new file mode 100644
index 0000000000..69ef8b0d7a
--- /dev/null
+++ b/firefox/patches/patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc
@@ -0,0 +1,29 @@
+$NetBSD: patch-third__party_libwebrtc_rtc__base_platform__thread__types.cc,v 1.3 2025/07/26 14:12:54 ryoon Exp $
+
+--- third_party/libwebrtc/rtc_base/platform_thread_types.cc.orig	2025-05-21 12:30:11.564823191 +0000
++++ third_party/libwebrtc/rtc_base/platform_thread_types.cc
+@@ -71,7 +71,11 @@ bool IsThreadRefEqual(const PlatformThre
+ #if defined(WEBRTC_WIN) || defined(WEBRTC_FUCHSIA)
+   return a == b;
+ #elif defined(WEBRTC_POSIX)
++#  if defined(__NetBSD__)
++  return a == b;
++#  else
+   return pthread_equal(a, b);
++#  endif
+ #endif
+ }
+ 
+@@ -118,6 +122,12 @@ void SetCurrentThreadName(const char* na
+   prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name));  // NOLINT
+ #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
+   pthread_setname_np(name);
++#elif defined(WEBRTC_BSD)
++#  if defined(__NetBSD__)
++  pthread_setname_np(pthread_self(), "%s", const_cast<char *>(name));
++#  else
++  pthread_setname_np(pthread_self(), name);
++#  endif
+ #elif defined(WEBRTC_FUCHSIA)
+   zx_status_t status = zx_object_set_property(zx_thread_self(), ZX_PROP_NAME,
+                                               name, strlen(name));
diff --git a/firefox/patches/patch-third__party_python_dlmanager_check.py b/firefox/patches/patch-third__party_python_dlmanager_check.py
new file mode 100644
index 0000000000..bcbfcc8abc
--- /dev/null
+++ b/firefox/patches/patch-third__party_python_dlmanager_check.py
@@ -0,0 +1,24 @@
+$NetBSD: patch-third__party_python_dlmanager_check.py,v 1.1 2024/10/11 13:55:48 wiz Exp $
+
+Fix build with Python 3.13.
+
+--- third_party/python/dlmanager/check.py.orig	2024-10-11 13:43:43.746252969 +0000
++++ third_party/python/dlmanager/check.py
+@@ -5,7 +5,7 @@ Run flake8 checks and tests.
+ 
+ import os
+ import argparse
+-import pipes
++import shlex
+ import shutil
+ import tempfile
+ 
+@@ -23,7 +23,7 @@ def parse_args():
+ 
+ 
+ def run(cmd, **kwargs):
+-    msg = 'Running: |%s|' % ' '.join(pipes.quote(c) for c in cmd)
++    msg = 'Running: |%s|' % ' '.join(shlex.quote(c) for c in cmd)
+     if kwargs.get('cwd'):
+         msg += ' in %s' % kwargs['cwd']
+     print(msg)
diff --git a/firefox/patches/patch-third__party_rust_mtu_src_bindings_netbsd.rs b/firefox/patches/patch-third__party_rust_mtu_src_bindings_netbsd.rs
new file mode 100644
index 0000000000..92f717c38b
--- /dev/null
+++ b/firefox/patches/patch-third__party_rust_mtu_src_bindings_netbsd.rs
@@ -0,0 +1,69 @@
+$NetBSD: patch-third__party_rust_mtu_src_bindings_netbsd.rs,v 1.3 2026/08/06 18:17:21 tnn Exp $
+
+* Fix build under NetBSD/i386 10.
+
+--- third_party/rust/mtu/src/bindings/netbsd.rs.orig	2026-07-27 13:13:31.000000000 +0000
++++ third_party/rust/mtu/src/bindings/netbsd.rs
+@@ -5,8 +5,8 @@ pub const RTAX_MAX: u32 = 9;
+ pub const RTA_DST: u32 = 1;
+ pub const RTA_IFP: u32 = 16;
+ pub const RTAX_MAX: u32 = 9;
+-pub type __int32_t = ::std::os::raw::c_int;
+-pub type __int64_t = ::std::os::raw::c_long;
++pub type __int32_t = i32;
++pub type __int64_t = i64;
+ pub type __pid_t = __int32_t;
+ pub type u_char = ::std::os::raw::c_uchar;
+ pub type u_short = ::std::os::raw::c_ushort;
+@@ -19,8 +19,14 @@ const _: () = {
+ }
+ #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+ const _: () = {
++    #[cfg(target_pointer_width = "64")]
+     ["Size of timespec"][::std::mem::size_of::<timespec>() - 16usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Size of timespec"][::std::mem::size_of::<timespec>() - 12usize];
++    #[cfg(target_pointer_width = "64")]
+     ["Alignment of timespec"][::std::mem::align_of::<timespec>() - 8usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Alignment of timespec"][::std::mem::align_of::<timespec>() - 4usize];
+     ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize];
+     ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize];
+ };
+@@ -50,8 +56,14 @@ const _: () = {
+ }
+ #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+ const _: () = {
++    #[cfg(target_pointer_width = "64")]
+     ["Size of if_data"][::std::mem::size_of::<if_data>() - 136usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Size of if_data"][::std::mem::size_of::<if_data>() - 132usize];
++    #[cfg(target_pointer_width = "64")]
+     ["Alignment of if_data"][::std::mem::align_of::<if_data>() - 8usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Alignment of if_data"][::std::mem::align_of::<if_data>() - 4usize];
+     ["Offset of field: if_data::ifi_type"][::std::mem::offset_of!(if_data, ifi_type) - 0usize];
+     ["Offset of field: if_data::ifi_addrlen"]
+         [::std::mem::offset_of!(if_data, ifi_addrlen) - 1usize];
+@@ -102,7 +114,10 @@ const _: () = {
+ #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+ const _: () = {
+     ["Size of rt_metrics"][::std::mem::size_of::<rt_metrics>() - 80usize];
++    #[cfg(target_pointer_width = "64")]
+     ["Alignment of rt_metrics"][::std::mem::align_of::<rt_metrics>() - 8usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Alignment of rt_metrics"][::std::mem::align_of::<rt_metrics>() - 4usize];
+     ["Offset of field: rt_metrics::rmx_locks"]
+         [::std::mem::offset_of!(rt_metrics, rmx_locks) - 0usize];
+     ["Offset of field: rt_metrics::rmx_mtu"][::std::mem::offset_of!(rt_metrics, rmx_mtu) - 8usize];
+@@ -143,7 +158,10 @@ const _: () = {
+ #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+ const _: () = {
+     ["Size of rt_msghdr"][::std::mem::size_of::<rt_msghdr>() - 120usize];
++    #[cfg(target_pointer_width = "64")]
+     ["Alignment of rt_msghdr"][::std::mem::align_of::<rt_msghdr>() - 8usize];
++    #[cfg(not(target_pointer_width = "64"))]
++    ["Alignment of rt_msghdr"][::std::mem::align_of::<rt_msghdr>() - 4usize];
+     ["Offset of field: rt_msghdr::rtm_msglen"]
+         [::std::mem::offset_of!(rt_msghdr, rtm_msglen) - 0usize];
+     ["Offset of field: rt_msghdr::rtm_version"]
diff --git a/firefox/patches/patch-third__party_sqlite3_ext_moz.build b/firefox/patches/patch-third__party_sqlite3_ext_moz.build
new file mode 100644
index 0000000000..ebba227e55
--- /dev/null
+++ b/firefox/patches/patch-third__party_sqlite3_ext_moz.build
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_sqlite3_ext_moz.build,v 1.3 2026/07/21 15:25:01 ryoon Exp $
+
+--- third_party/sqlite3/ext/moz.build.orig	2026-07-13 13:09:31.000000000 +0000
++++ third_party/sqlite3/ext/moz.build
+@@ -30,7 +30,7 @@ DEFINES["SQLITE_VEC_ENABLE_DISKANN"] = 0
+ # In this release we're not using DISKANN so remove to save space
+ DEFINES["SQLITE_VEC_ENABLE_DISKANN"] = 0
+ 
+-if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android":
++if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android" or CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD":
+     OS_LIBS += [
+         "m",
+     ]
diff --git a/firefox/patches/patch-third__party_sqlite3_src_moz.build b/firefox/patches/patch-third__party_sqlite3_src_moz.build
new file mode 100644
index 0000000000..695047fc60
--- /dev/null
+++ b/firefox/patches/patch-third__party_sqlite3_src_moz.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-third__party_sqlite3_src_moz.build,v 1.2 2023/07/07 13:47:10 ryoon Exp $
+
+* Fix segfault under NetBSD/i386 9 and pkgsrc/lang/gcc8-8.5.0
+  For NetBSD/i386 9, @SQLITE3OPTFLAG@ will be replaced with "'-O0',".
+
+--- third_party/sqlite3/src/moz.build.orig	2023-06-22 21:19:22.000000000 +0000
++++ third_party/sqlite3/src/moz.build
+@@ -108,6 +108,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
+     CFLAGS += [
+         '-Wno-sign-compare',
+         '-Wno-type-limits',
++        @SQLITE3OPTFLAG@
+     ]
+ 
+ # Set a default journal size limit. Note an hot journal can grow over this
diff --git a/firefox/patches/patch-third__party_wasm2c_src_c-writer.cc b/firefox/patches/patch-third__party_wasm2c_src_c-writer.cc
new file mode 100644
index 0000000000..55ccbf010f
--- /dev/null
+++ b/firefox/patches/patch-third__party_wasm2c_src_c-writer.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_wasm2c_src_c-writer.cc,v 1.1 2025/07/26 14:12:54 ryoon Exp $
+
+--- third_party/wasm2c/src/c-writer.cc.orig	2025-07-26 13:24:19.226278807 +0000
++++ third_party/wasm2c/src/c-writer.cc
+@@ -1490,7 +1490,7 @@ void CWriter::WriteInitExprTerminal(cons
+ std::string CWriter::GenerateHeaderGuard() const {
+   std::string result;
+   for (char c : header_name_) {
+-    if (isalnum(c) || c == '_') {
++    if (isalnum((unsigned char)c) || c == '_') {
+       result += toupper(c);
+     } else {
+       result += '_';
diff --git a/firefox/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc b/firefox/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc
new file mode 100644
index 0000000000..bfaa06a031
--- /dev/null
+++ b/firefox/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc,v 1.1 2023/06/14 16:22:18 ryoon Exp $
+
+--- third_party/wasm2c/src/prebuilt/wasm2c_source_includes.cc.orig	2023-05-25 21:19:41.000000000 +0000
++++ third_party/wasm2c/src/prebuilt/wasm2c_source_includes.cc
+@@ -20,7 +20,7 @@ R"w2c_template(#include <malloc.h>
+ )w2c_template"
+ R"w2c_template(#define alloca _alloca
+ )w2c_template"
+-R"w2c_template(#elif defined(__FreeBSD__) || defined(__OpenBSD__)
++R"w2c_template(#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ )w2c_template"
+ R"w2c_template(#include <stdlib.h>
+ )w2c_template"
diff --git a/firefox/patches/patch-toolkit_components_terminator_nsTerminator.cpp b/firefox/patches/patch-toolkit_components_terminator_nsTerminator.cpp
new file mode 100644
index 0000000000..6eb631a296
--- /dev/null
+++ b/firefox/patches/patch-toolkit_components_terminator_nsTerminator.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-toolkit_components_terminator_nsTerminator.cpp,v 1.8 2023/01/07 23:36:39 ryoon Exp $
+
+* Fix segfault on exit under NetBSD
+
+--- toolkit/components/terminator/nsTerminator.cpp.orig	2022-06-16 21:35:58.000000000 +0000
++++ toolkit/components/terminator/nsTerminator.cpp
+@@ -34,7 +34,7 @@
+ #if defined(XP_WIN)
+ #  include <windows.h>
+ #else
+-#  include <unistd.h>
++#  include <time.h>
+ #endif
+ 
+ #include "mozilla/AppShutdown.h"
+@@ -184,7 +184,10 @@ void RunWatchdog(void* arg) {
+ #if defined(XP_WIN)
+     Sleep(HEARTBEAT_INTERVAL_MS /* ms */);
+ #else
+-    usleep(HEARTBEAT_INTERVAL_MS * 1000 /* usec */);
++    struct timespec tickd;
++    tickd.tv_sec = 0;
++    tickd.tv_nsec = HEARTBEAT_INTERVAL_MS * 1000 * 1000;
++    nanosleep(&tickd, NULL);
+ #endif
+ 
+     if (gHeartbeat++ < timeToLive) {
diff --git a/firefox/patches/patch-toolkit_moz.configure b/firefox/patches/patch-toolkit_moz.configure
new file mode 100644
index 0000000000..7bafdf5614
--- /dev/null
+++ b/firefox/patches/patch-toolkit_moz.configure
@@ -0,0 +1,31 @@
+$NetBSD: patch-toolkit_moz.configure,v 1.17 2023/08/22 13:48:17 tnn Exp $
+
+* Enable ALSA for NetBSD too.
+* Support --enable-forkserver on NetBSD.
+
+--- toolkit/moz.configure.orig	2023-08-15 21:10:03.000000000 +0000
++++ toolkit/moz.configure
+@@ -242,6 +242,7 @@ def imply_alsa(values, target):
+         any("alsa" in value for value in values)
+         and target.kernel != "Linux"
+         and target.os != "FreeBSD"
++        and target.os != "NetBSD"
+     ):
+         die("Cannot enable ALSA on %s", target.os)
+     return any("alsa" in value for value in values) or None
+@@ -2816,6 +2817,7 @@ def forkserver_default(target, build_pro
+         (target.os == "GNU" and target.kernel == "Linux")
+         or target.os == "FreeBSD"
+         or target.os == "OpenBSD"
++        or target.os == "NetBSD"
+     )
+ 
+ 
+@@ -2834,6 +2836,7 @@ def forkserver_flag(value, target):
+         or (target.os == "GNU" and target.kernel == "Linux")
+         or target.os == "FreeBSD"
+         or target.os == "OpenBSD"
++        or target.os == "NetBSD"
+     ):
+         return bool(value)
+     pass
diff --git a/firefox/patches/patch-toolkit_mozapps_installer_packager.mk b/firefox/patches/patch-toolkit_mozapps_installer_packager.mk
new file mode 100644
index 0000000000..90f1b0221e
--- /dev/null
+++ b/firefox/patches/patch-toolkit_mozapps_installer_packager.mk
@@ -0,0 +1,15 @@
+$NetBSD: patch-toolkit_mozapps_installer_packager.mk,v 1.4 2025/07/26 14:12:54 ryoon Exp $
+
+* Symbolic link to lib/firefox/firefox causes 'Couldn't load XPCOM.' error.
+
+--- toolkit/mozapps/installer/packager.mk.orig	2025-07-17 18:03:38.000000000 +0000
++++ toolkit/mozapps/installer/packager.mk
+@@ -169,7 +169,7 @@ endif
+ 	  (cd $(DESTDIR)$(installdir) && tar -xf -)
+ 	$(NSINSTALL) -D $(DESTDIR)$(bindir)
+ 	$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
+-	ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
++	#ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
+ 
+ upload:
+ 	$(PYTHON3) -u $(MOZILLA_DIR)/build/upload.py --base-path $(ABS_DIST) $(UPLOAD_FILES)
diff --git a/firefox/patches/patch-xpcom_base_nscore.h b/firefox/patches/patch-xpcom_base_nscore.h
new file mode 100644
index 0000000000..da83809add
--- /dev/null
+++ b/firefox/patches/patch-xpcom_base_nscore.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-xpcom_base_nscore.h,v 1.5 2019/03/19 16:11:28 ryoon Exp $
+
+* Support llvm/clang
+
+--- xpcom/base/nscore.h.orig	2019-03-07 16:53:44.000000000 +0000
++++ xpcom/base/nscore.h
+@@ -76,7 +76,7 @@
+  *           NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
+  */
+ 
+-#if defined(__i386__) && defined(__GNUC__)
++#if defined(__i386__) && defined(__GNUC__) && !(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ == 0)
+ #  define NS_FASTCALL __attribute__((regparm(3), stdcall))
+ #  define NS_CONSTRUCTOR_FASTCALL __attribute__((regparm(3), stdcall))
+ #elif defined(XP_WIN) && !defined(_WIN64)
diff --git a/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build b/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
new file mode 100644
index 0000000000..c90a2d181f
--- /dev/null
+++ b/firefox/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
@@ -0,0 +1,17 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_moz.build,v 1.15 2024/01/31 15:54:52 ryoon Exp $
+
+Make NetBSD/sparc64 use the same xptcall bindings as all other sparc64 ports
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1505360
+
+--- xpcom/reflect/xptcall/md/unix/moz.build.orig	2024-01-12 13:20:20.000000000 +0000
++++ xpcom/reflect/xptcall/md/unix/moz.build
+@@ -221,7 +221,7 @@ if CONFIG["OS_ARCH"] == "OpenBSD" and CO
+     ]
+ 
+ if (
+-    CONFIG["OS_ARCH"] in ("OpenBSD", "FreeBSD", "Linux", "SunOS")
++    CONFIG["OS_ARCH"] in ("OpenBSD", "FreeBSD", "Linux", "SunOS", "NetBSD")
+     and CONFIG["TARGET_CPU"] == "sparc64"
+ ):
+     SOURCES += [


Home | Main Index | Thread Index | Old Index