diff options
Diffstat (limited to 'www/tor-browser')
15 files changed, 204 insertions, 420 deletions
diff --git a/www/tor-browser/Makefile b/www/tor-browser/Makefile index 76548cb2b9cc..f99e3cb04891 100644 --- a/www/tor-browser/Makefile +++ b/www/tor-browser/Makefile @@ -1,9 +1,8 @@ PORTNAME= tor-browser -DISTVERSION= 14.5.4 -PORTREVISION= 1 +DISTVERSION= 15.0a1 CATEGORIES= www net security wayland -TAG_BASE= 90dbac96420394aa35ce29385814742ac4942b26 -TAG_TOR= 9cbc3b3d25d2c5c77f1b6b3172ba6bcad2563939 +TAG_BASE= 96a559c7c1f7b9231db2b5cece7ecae980ae835d +TAG_TOR= 3becb908fbf68aa77accc1f2e03e2c29f4fe40e2 MASTER_SITES= TOR \ LOCAL/vvd \ https://build-sources.tbb.torproject.org/:source1 \ @@ -18,7 +17,7 @@ MASTER_SITES= TOR \ LOCAL/vvd:source5 MASTER_SITE_SUBDIR= torbrowser/${DISTVERSION}/:DEFAULT \ download/releases/:source3 -DISTNAME= src-firefox-tor-browser-128.12.0esr-14.5-1-build1 +DISTNAME= src-firefox-tor-browser-140.1.0esr-15.0-1-build3 MANUAL= manual_215922.zip NOSCRIPT= noscript-13.0.8.xpi DISTFILES= ${DISTNAME}.tar.xz \ @@ -36,12 +35,12 @@ LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= nspr>=4.32:devel/nspr \ - nss>=3.101:security/nss \ - icu>=73.1,1:devel/icu \ + nss>=3.112:security/nss \ + icu>=76.1:devel/icu \ libevent>=2.1.8:devel/libevent \ - harfbuzz>=8.5.0:print/harfbuzz \ + harfbuzz>=10.1.0:print/harfbuzz \ graphite2>=1.3.14:graphics/graphite2 \ - png>=1.6.43:graphics/png \ + png>=1.6.45:graphics/png \ dav1d>=1.0.0:multimedia/dav1d \ libvpx>=1.14:multimedia/libvpx \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ @@ -66,8 +65,8 @@ LOCALES= af ar az be bg bs ca cs da de el es-ES et fa fi fr ga-IE gu-IN \ nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru sk sl sq sr sv-SE ta \ te th tl tr uk ur vi zh-CN zh-TW -CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" \ - MOZ_CHROME_MULTILOCALE="${LOCALES}" +CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" +CONFIGURE_ENV+= MOZ_CHROME_MULTILOCALE="${LOCALES}" MAKE_ENV+= LOCALES="${LOCALES}" @@ -79,7 +78,7 @@ SUB_FILES= fonts.conf tor-browser.desktop torrc-defaults WRKSRC= ${WRKDIR}/${DISTNAME:S/src-//} -MOZ_EXPORT+= MOZ_TELEMETRY_REPORTING="" \ +MOZ_EXPORT= MOZ_TELEMETRY_REPORTING="" \ MOZILLA_OFFICIAL="1" \ MOZ_OFFICIAL_BRANDING="1" \ MOZ_APP_DISPLAYNAME="Tor Browser" \ @@ -105,6 +104,12 @@ MOZ_OPTIONS= --with-base-browser-version=${DISTVERSION} \ .include <bsd.port.options.mk> +.if ${ARCH} == i386 && ${MACHINE_CPU:Msse2} +# is not enabled on i386 by default +# Fix for error: always_inline function '_mm_setzero_si64' requires target feature 'sse2' +CFLAGS_i386+= -msse2 +.endif + .if ${ARCH} == amd64 MOZ_OPTIONS+= --enable-rust-simd .endif @@ -141,11 +146,11 @@ post-configure: ${WRKDIR}/.mozbuild/l10n-central/${i}/toolkit/toolkit/global/ ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/tor-browser.ftl \ ${WRKDIR}/.mozbuild/l10n-central/${i}/toolkit/toolkit/global/ - ${MKDIR} ${WRKDIR}/.mozbuild/l10n-central/${i}/browser/branding/tb-release + ${MKDIR} ${WRKDIR}/.mozbuild/l10n-central/${i}/browser/branding/tb-release \ + ${WRKSRC}/toolkit/torbutton/chrome/locale/${i} ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/brand.properties \ ${WRKDIR}/translation-${TAG_TOR}/${i}/branding/brand.ftl \ ${WRKDIR}/.mozbuild/l10n-central/${i}/browser/branding/tb-release - ${MKDIR} ${WRKSRC}/toolkit/torbutton/chrome/locale/${i}/ . for j in onionLocation.properties settings.properties torConnect.properties \ torlauncher.properties ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/${j} \ @@ -161,18 +166,17 @@ post-build: ${WRKSRC}/mach package-multi-locale --locales ${LOCALES} post-install: - @${MKDIR} ${STAGEDIR}${DATADIR} + ${MKDIR} ${STAGEDIR}${DATADIR} \ + ${STAGEDIR}${PREFIX}/lib/tor-browser/fontconfig \ + ${STAGEDIR}${PREFIX}/lib/tor-browser/fonts \ + ${STAGEDIR}${PREFIX}/lib/tor-browser/distribution/extensions ${INSTALL_DATA} ${WRKDIR}/torrc-defaults \ ${STAGEDIR}${DATADIR}/torrc-defaults - ${INSTALL_DATA} ${WRKDIR}/tor-browser.desktop \ - ${STAGEDIR}${PREFIX}/share/applications/tor-browser.desktop - ${MKDIR} ${STAGEDIR}${PREFIX}/lib/tor-browser/fontconfig - ${MKDIR} ${STAGEDIR}${PREFIX}/lib/tor-browser/fonts + ${INSTALL_DATA} ${WRKDIR}/tor-browser.desktop ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/fonts.conf \ ${STAGEDIR}${PREFIX}/lib/tor-browser/fontconfig/fonts.conf (cd ${WRKDIR}/fonts && \ ${COPYTREE_SHARE} "*.otf *.ttf" ${STAGEDIR}${PREFIX}/lib/tor-browser/fonts) - ${MKDIR} ${STAGEDIR}${PREFIX}/lib/tor-browser/distribution/extensions ${INSTALL_DATA} ${DISTDIR}/${NOSCRIPT} \ "${STAGEDIR}${PREFIX}/lib/tor-browser/distribution/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi" diff --git a/www/tor-browser/distinfo b/www/tor-browser/distinfo index 17b1427f4f3d..a23a19b33259 100644 --- a/www/tor-browser/distinfo +++ b/www/tor-browser/distinfo @@ -1,15 +1,15 @@ -TIMESTAMP = 1750789506 -SHA256 (src-firefox-tor-browser-128.12.0esr-14.5-1-build1.tar.xz) = d79e2760287bb86cddf99da0e73e0dd2fe54eb301958f58404deb475e61a47f8 -SIZE (src-firefox-tor-browser-128.12.0esr-14.5-1-build1.tar.xz) = 611154864 +TIMESTAMP = 1753901678 +SHA256 (src-firefox-tor-browser-140.1.0esr-15.0-1-build3.tar.xz) = cb3621465038e833c69e783f6725b1cd5e81ec8b15dcfcf2ad8607bf67a6c259 +SIZE (src-firefox-tor-browser-140.1.0esr-15.0-1-build3.tar.xz) = 691078808 SHA256 (manual_215922.zip) = b5ed703f54d52e9f197320f3698e936d585a3fed23cc4f9fbf59edce2869f885 SIZE (manual_215922.zip) = 28305786 SHA256 (fonts-3--4348e1.tar.zst) = 7fbbecece6de777f196982f6eb567970a6d8e7ac2bf5b1ad6b90e1ea36374032 SIZE (fonts-3--4348e1.tar.zst) = 27441580 SHA256 (noscript-13.0.8.xpi) = 9d978cfe083cb9cce120b5ee41e8933d752d7ab4680bf517c5ec4b29c4cfd2dc SIZE (noscript-13.0.8.xpi) = 993143 -SHA256 (tpo-translation-90dbac96420394aa35ce29385814742ac4942b26_GL0.tar.gz) = dd720795ebd4a335e522fc48956e81b1ba62580aae33d99997ecdaf6866a3537 -SIZE (tpo-translation-90dbac96420394aa35ce29385814742ac4942b26_GL0.tar.gz) = 793166 -SHA256 (tpo-translation-9cbc3b3d25d2c5c77f1b6b3172ba6bcad2563939_GL0.tar.gz) = 033bd5bb2e4e2f852d3a711c4e652a389f32974fe0304a969f518680d849a32c -SIZE (tpo-translation-9cbc3b3d25d2c5c77f1b6b3172ba6bcad2563939_GL0.tar.gz) = 2834090 +SHA256 (tpo-translation-96a559c7c1f7b9231db2b5cece7ecae980ae835d_GL0.tar.gz) = c58379e5f2db0275e470bfaaa07ddb4b4fcf5567e8e7a345a6c8ca04eba5d509 +SIZE (tpo-translation-96a559c7c1f7b9231db2b5cece7ecae980ae835d_GL0.tar.gz) = 912336 +SHA256 (tpo-translation-3becb908fbf68aa77accc1f2e03e2c29f4fe40e2_GL0.tar.gz) = 9424f0fd015cbecf21525b55ef1a9ae35564c235ea3fcf333f339632e2daa7ca +SIZE (tpo-translation-3becb908fbf68aa77accc1f2e03e2c29f4fe40e2_GL0.tar.gz) = 2837662 SHA256 (mozilla-l10n-firefox-l10n-fcd0300e8478d1ec4d1c097a073ddb8e1e0351e3_GH0.tar.gz) = d07ecc7fe021998b523357849f71d52c9cb5248cb79bba29793e1ba353bae5bb SIZE (mozilla-l10n-firefox-l10n-fcd0300e8478d1ec4d1c097a073ddb8e1e0351e3_GH0.tar.gz) = 68409826 diff --git a/www/tor-browser/files/patch-bug1559213 b/www/tor-browser/files/patch-bug1559213 deleted file mode 100644 index ead3425fa70b..000000000000 --- a/www/tor-browser/files/patch-bug1559213 +++ /dev/null @@ -1,131 +0,0 @@ -commit 25a5572d5cd137aa6d893e09a00bd39908a59a18 -Author: Christoph Moench-Tegeder <cmt@burggraben.net> -Date: Tue Sep 10 22:23:32 2024 +0200 - - based on: - commit 717bba28411c - Author: Jory A. Pratt <anarchy@gentoo.org> - Date: Thu Jun 13 11:53:00 2019 -0700 - - Bug 1559213 - Allow to use system av1 libs instead of bundled. - -diff --git config/external/moz.build config/external/moz.build -index a24b470396cf..547f5f5c9e04 100644 ---- config/external/moz.build -+++ config/external/moz.build -@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: - external_dirs += ["media/libvpx"] - - if CONFIG["MOZ_AV1"]: -- external_dirs += ["media/libaom"] -- external_dirs += ["media/libdav1d"] -+ if not CONFIG["MOZ_SYSTEM_AV1"]: -+ external_dirs += ["media/libaom"] -+ external_dirs += ["media/libdav1d"] - - if not CONFIG["MOZ_SYSTEM_PNG"]: - external_dirs += ["media/libpng"] -diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build -index 61536cc6e225..29cf635bbb44 100644 ---- dom/media/platforms/moz.build -+++ dom/media/platforms/moz.build -@@ -71,6 +71,11 @@ if CONFIG["MOZ_AV1"]: - "agnostic/AOMDecoder.cpp", - "agnostic/DAV1DDecoder.cpp", - ] -+ if CONFIG['MOZ_SYSTEM_AV1']: -+ CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS'] -+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS'] -+ CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] -+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] - - if CONFIG["MOZ_OMX"]: - EXPORTS += [ -diff --git media/ffvpx/libavcodec/moz.build media/ffvpx/libavcodec/moz.build -index 6f09049a6068..90a82a19a9d1 100644 ---- media/ffvpx/libavcodec/moz.build -+++ media/ffvpx/libavcodec/moz.build -@@ -119,10 +119,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: - 'vp9recon.c', - 'vpx_rac.c', - ] -- USE_LIBS += [ -- 'dav1d', -- 'media_libdav1d_asm', -- ] -+ if CONFIG["MOZ_SYSTEM_AV1"]: -+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] -+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] -+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS'] -+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS'] -+ else: -+ USE_LIBS += [ -+ 'dav1d', -+ 'media_libdav1d_asm', -+ ] - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - LOCAL_INCLUDES += ['/media/mozva'] - SOURCES += [ -diff --git media/libopus/moz.build media/libopus/moz.build -index 943aee79ee99..4ad07e3e98af 100644 ---- media/libopus/moz.build -+++ media/libopus/moz.build -@@ -58,7 +58,7 @@ if not CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]: - DEFINES["FIXED_POINT"] = 1 - DEFINES["DISABLE_FLOAT_API"] = True - --if CONFIG["OS_ARCH"] == "Linux": -+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"): - OS_LIBS += [ - "m", - ] -diff --git media/libvorbis/moz.build media/libvorbis/moz.build -index cd17d4f89759..816edd72a000 100644 ---- media/libvorbis/moz.build -+++ media/libvorbis/moz.build -@@ -45,7 +45,7 @@ LOCAL_INCLUDES += ['lib'] - if CONFIG['OS_ARCH'] == 'SunOS': - DEFINES['HAVE_ALLOCA_H'] = True - --if CONFIG["OS_ARCH"] == "Linux": -+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"): - OS_LIBS += [ - "m", - ] -diff --git toolkit/moz.configure toolkit/moz.configure -index 1f85d2831f2f..07294b93f850 100644 ---- toolkit/moz.configure -+++ toolkit/moz.configure -@@ -883,7 +883,23 @@ def av1(value): - return True - - --@depends(target, when=av1 & compile_environment) -+option("--with-system-av1", -+ help="Use system av1 (located with pkgconfig)") -+ -+system_libaom_info = pkg_check_modules("MOZ_SYSTEM_LIBAOM", "aom >= 1.0.0", -+ when="--with-system-av1") -+ -+system_libdav1d_info = pkg_check_modules("MOZ_SYSTEM_LIBDAV1D", "dav1d >= 0.1.1", -+ when="--with-system-av1") -+ -+@depends(system_libaom_info, system_libdav1d_info) -+def system_av1(system_libaom_info, system_libdav1d_info): -+ has_av1_libs = False -+ if system_libaom_info and system_libdav1d_info: -+ has_av1_libs = True -+ return has_av1_libs -+ -+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) - def dav1d_asm(target): - if target.cpu in ("aarch64", "x86", "x86_64"): - return True -@@ -899,6 +915,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) - set_define("MOZ_DAV1D_ASM", dav1d_asm) - set_config("MOZ_AV1", av1) - set_define("MOZ_AV1", av1) -+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True)) - - # JXL Image Codec Support - # ============================================================== diff --git a/www/tor-browser/files/patch-bug1859752 b/www/tor-browser/files/patch-bug1859752 deleted file mode 100644 index 3050a31cf0cf..000000000000 --- a/www/tor-browser/files/patch-bug1859752 +++ /dev/null @@ -1,42 +0,0 @@ -# HG changeset patch -# User André Bargull <andre.bargull@gmail.com> -# Date 1699346749 0 -# Node ID 0e7eefda24250041d7f008cc77dfa79045afa791 -# Parent 1e39572cb1c784039a9e14b8c36396c66cf58a5d -Bug 1859752 - Part 9: Add new line break classes. r=platform-i18n-reviewers,dminor - -Use `CLASS_CHARACTER` because that matches the previous character class for most -characters which are now part of the new character classes. - -Depends on D192733 - -Differential Revision: https://phabricator.services.mozilla.com/D192734 - -diff --git intl/lwbrk/LineBreaker.cpp intl/lwbrk/LineBreaker.cpp ---- intl/lwbrk/LineBreaker.cpp -+++ intl/lwbrk/LineBreaker.cpp -@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB - /* JT = 34, [JT] */ CLASS_CHARACTER, - /* JV = 35, [JV] */ CLASS_CHARACTER, - /* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER, - /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE, - /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER, - /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER, - /* E_BASE = 40, [EB] */ CLASS_BREAKABLE, - /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER, -- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER}; -+ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER, -+ /* AKSARA = 43, [AK] */ CLASS_CHARACTER, -+ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER, -+ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER, -+ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER, -+ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER, -+ }; - - static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass), - "Gecko vs ICU LineBreak class mismatch"); - - auto cls = GetLineBreakClass(u); - MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass)); - - // Overrides based on rules for the different line-break values given in diff --git a/www/tor-browser/files/patch-bug1876632 b/www/tor-browser/files/patch-bug1876632 new file mode 100644 index 000000000000..3932b1deccc9 --- /dev/null +++ b/www/tor-browser/files/patch-bug1876632 @@ -0,0 +1,35 @@ +commit 4f531ca86d24be5d4de673f6e652ed899151d20c +Author: Jesper Schmitz Mouridsen <jesper@schmitz.computer> +Date: Wed Jul 23 22:01:31 2025 +0000 + + Bug 1876632 Fix aslr allocations on FreeBSD r=spidermonkey-reviewers,sfink + + Without the alignment flag the desired address + gets randomized by aslr in a way which causes it to not + be aligned. Furthermore the TryToAlignChunk almost always + fails. With this fix it never gets to TryToAlignChunk + because the flag guarantees upfront alignment. + + Differential Revision: https://phabricator.services.mozilla.com/D257824 + +diff --git js/src/gc/Memory.cpp js/src/gc/Memory.cpp +index e790f1784ede..13639c9a6eb4 100644 +--- js/src/gc/Memory.cpp ++++ js/src/gc/Memory.cpp +@@ -608,7 +608,16 @@ static void* MapAlignedPagesRandom(size_t length, size_t alignment) { + for (size_t i = 1; i <= 1024; ++i) { + if (i & 0xf) { + uint64_t desired = alignment * GetNumberInRange(minNum, maxNum); ++# if defined(__FreeBSD__) && defined(__aarch64__) ++ int flags = MAP_PRIVATE | MAP_ANON | ++ MAP_ALIGNED(mozilla::CeilingLog2Size(alignment)); ++ region = MozTaggedAnonymousMmap((void*)(uintptr_t)desired, length, ++ int(PageAccess::ReadWrite), flags, -1, 0, ++ "js-gc-heap"); ++# else + region = MapMemoryAtFuzzy(reinterpret_cast<void*>(desired), length); ++ ++# endif + if (!region) { + continue; + } diff --git a/www/tor-browser/files/patch-bug847568 b/www/tor-browser/files/patch-bug847568 index 2ee46579d43d..5b557e0e5a86 100644 --- a/www/tor-browser/files/patch-bug847568 +++ b/www/tor-browser/files/patch-bug847568 @@ -1,10 +1,10 @@ -# Allow building against system-wide graphite2/harfbuzz. +Allow building against system-wide graphite2/harfbuzz diff --git config/system-headers.mozbuild config/system-headers.mozbuild -index 0c06f581b33b..10f125be25ab 100644 +index af44c89057fc..c0ac271917fb 100644 --- config/system-headers.mozbuild +++ config/system-headers.mozbuild -@@ -1307,6 +1307,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: +@@ -1304,6 +1304,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: "proxy.h", ] @@ -25,10 +25,10 @@ index 0c06f581b33b..10f125be25ab 100644 system_headers += [ "unicode/calendar.h", diff --git dom/base/moz.build dom/base/moz.build -index 14c9f9dd96fb..bd1c8f241e9b 100644 +index 170d19f09aa9..a47fc8b1193c 100644 --- dom/base/moz.build +++ dom/base/moz.build -@@ -606,6 +606,9 @@ FINAL_LIBRARY = "xul" +@@ -620,6 +620,9 @@ FINAL_LIBRARY = "xul" if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] @@ -40,7 +40,7 @@ index 14c9f9dd96fb..bd1c8f241e9b 100644 script="gen-usecounters.py", diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build new file mode 100644 -index 000000000000..24e8d7a03274 +index 000000000000..ed0323eba9d5 --- /dev/null +++ gfx/graphite2/geckoextra/moz.build @@ -0,0 +1,21 @@ @@ -104,10 +104,10 @@ index 56ea317bedfc..07dd7f66f1bc 100644 "thebes", "ipc", diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py -index c161d24df853..8c7dd395b371 100755 +index b589efde1c5c..47f49e10df70 100755 --- gfx/skia/generate_mozbuild.py +++ gfx/skia/generate_mozbuild.py -@@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): +@@ -95,6 +95,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] @@ -118,10 +118,10 @@ index c161d24df853..8c7dd395b371 100755 LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/skia/moz.build gfx/skia/moz.build -index 83aa2957a938..0859316a1f09 100644 +index 7fee54534878..ba1a4038e4a0 100644 --- gfx/skia/moz.build +++ gfx/skia/moz.build -@@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): +@@ -623,6 +623,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] @@ -132,10 +132,10 @@ index 83aa2957a938..0859316a1f09 100644 LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/thebes/moz.build gfx/thebes/moz.build -index fd1fcf236d81..958d3f699ffd 100644 +index 48f2849e2025..7d0a161a91b4 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build -@@ -293,7 +293,13 @@ if CONFIG["MOZ_WAYLAND"]: +@@ -295,7 +295,13 @@ if CONFIG["MOZ_WAYLAND"]: LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] @@ -151,7 +151,7 @@ index fd1fcf236d81..958d3f699ffd 100644 CXXFLAGS += ["-Werror=switch"] diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build -index 2bbd00415cae..f66bd37695d4 100644 +index 2396210428ee..092baac6f79c 100644 --- intl/unicharutil/util/moz.build +++ intl/unicharutil/util/moz.build @@ -24,6 +24,9 @@ UNIFIED_SOURCES += [ @@ -165,10 +165,10 @@ index 2bbd00415cae..f66bd37695d4 100644 GeneratedFile( diff --git netwerk/dns/moz.build netwerk/dns/moz.build -index c926d14707d1..35a3f33e2885 100644 +index 1bb0430f01aa..0360e0f468c0 100644 --- netwerk/dns/moz.build +++ netwerk/dns/moz.build -@@ -112,6 +112,9 @@ GeneratedFile( +@@ -111,6 +111,9 @@ GeneratedFile( "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"] ) @@ -178,43 +178,24 @@ index c926d14707d1..35a3f33e2885 100644 # need to include etld_data.inc LOCAL_INCLUDES += [ "/netwerk/base", -diff --git old-configure.in old-configure.in -index 2ca88a20a4b3..88bc9b873eff 100644 ---- old-configure.in -+++ old-configure.in -@@ -1067,6 +1067,27 @@ fi - AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID) - AC_SUBST(MOZ_MACBUNDLE_ID) - -+dnl ======================================================== -+dnl Check for graphite2 -+dnl ======================================================== -+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then -+ dnl graphite2.pc has bogus version, check manually -+ _SAVE_CFLAGS=$CFLAGS -+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" -+ AC_TRY_COMPILE([ #include <graphite2/Font.h> -+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ -+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ -+ * 100 + GR2_VERSION_BUGFIX >= \ -+ (major) * 10000 + (minor) * 100 + (bugfix) ) -+ ], [ -+ #if !GR2_VERSION_REQUIRE(1,3,14) -+ #error "Insufficient graphite2 version." -+ #endif -+ ], [], -+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) -+ CFLAGS=$_SAVE_CFLAGS -+fi -+ - dnl ======================================================== - dnl = Child Process Name for IPC - dnl ======================================================== +diff --git security/rlbox/moz.build security/rlbox/moz.build +index 7ad8d076f0f1..835b9d905e03 100644 +--- security/rlbox/moz.build ++++ security/rlbox/moz.build +@@ -47,6 +47,8 @@ if CONFIG["MOZ_WASM_SANDBOXING_GRAPHITE"]: + for k, v in graphite_defines: + WASM_DEFINES[k] = v + LOCAL_INCLUDES += ["/gfx/graphite2/src"] ++ if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: ++ WASM_CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"] + + if CONFIG["MOZ_WASM_SANDBOXING_OGG"]: + include("/media/libogg/sources.mozbuild") diff --git toolkit/library/moz.build toolkit/library/moz.build -index 76746f308011..f6844f4c400b 100644 +index ee6051567c8e..c24a5a513bbc 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build -@@ -292,6 +292,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]: +@@ -298,6 +298,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]: if CONFIG["MOZ_SYSTEM_WEBP"]: OS_LIBS += CONFIG["MOZ_WEBP_LIBS"] @@ -228,10 +209,10 @@ index 76746f308011..f6844f4c400b 100644 OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"] diff --git toolkit/moz.configure toolkit/moz.configure -index a060a59f728f..f0778d1ae2d6 100644 +index 1f85d2831f2f..04ce56e2cc0b 100644 --- toolkit/moz.configure +++ toolkit/moz.configure -@@ -1218,6 +1218,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info): +@@ -1397,6 +1397,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info): set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft) set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft) diff --git a/www/tor-browser/files/patch-python_mozbuild_mozbuild_gn__processor.py b/www/tor-browser/files/patch-build_gn__processor.py index 94584d8b160b..be5e10347483 100644 --- a/www/tor-browser/files/patch-python_mozbuild_mozbuild_gn__processor.py +++ b/www/tor-browser/files/patch-build_gn__processor.py @@ -1,13 +1,13 @@ -commit 6bfdff4afcc9e3843b9c3a5d7e884e281a305398 +commit 0e5bcbefae64b35a5c8df360e3980258a565fa72 Author: Christoph Moench-Tegeder <cmt@burggraben.net> - chase gn_processor.py changes + chase gn_processor.py move -diff --git python/mozbuild/mozbuild/gn_processor.py python/mozbuild/mozbuild/gn_processor.py -index a77b6c7759f1..e5498ac5e9df 100644 ---- python/mozbuild/mozbuild/gn_processor.py -+++ python/mozbuild/mozbuild/gn_processor.py -@@ -185,6 +185,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target): +diff --git build/gn_processor.py build/gn_processor.py +index 2ba8b92c2751..91170efb9a5d 100644 +--- build/gn_processor.py ++++ build/gn_processor.py +@@ -186,6 +186,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target): } oses = { "android": "Android", @@ -15,7 +15,7 @@ index a77b6c7759f1..e5498ac5e9df 100644 "linux": "Linux", "mac": "Darwin", "openbsd": "OpenBSD", -@@ -742,17 +743,17 @@ def main(): +@@ -780,17 +781,17 @@ def main(): vars_set = [] for is_debug in (True, False): @@ -35,10 +35,10 @@ index a77b6c7759f1..e5498ac5e9df 100644 target_cpus.append("riscv64") - if target_os == "linux": + if target_os in ("freebsd", "linux"): - target_cpus.extend(["ppc64", "mipsel", "mips64el"]) + target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"]) for target_cpu in target_cpus: vars = { -@@ -761,7 +762,7 @@ def main(): +@@ -799,7 +800,7 @@ def main(): "target_cpu": target_cpu, "target_os": target_os, } diff --git a/www/tor-browser/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h b/www/tor-browser/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h deleted file mode 100644 index 05cf110b1192..000000000000 --- a/www/tor-browser/files/patch-gfx_skia_skia_src_core_SkRasterPipeline.h +++ /dev/null @@ -1,13 +0,0 @@ -diff --git gfx/skia/skia/src/core/SkRasterPipeline.h gfx/skia/skia/src/core/SkRasterPipeline.h -index 2475ea0d398d..67967483656d 100644 ---- gfx/skia/skia/src/core/SkRasterPipeline.h -+++ gfx/skia/skia/src/core/SkRasterPipeline.h -@@ -27,7 +27,7 @@ struct SkImageInfo; - struct skcms_TransferFunction; - - #if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && \ -- !defined(SK_CPU_LOONGARCH) -+ !defined(SK_CPU_LOONGARCH) && !defined(__powerpc__) - #define SK_HAS_MUSTTAIL 1 - #else - #define SK_HAS_MUSTTAIL 0 diff --git a/www/tor-browser/files/patch-ipc_glue_GeckoChildProcessHost.cpp b/www/tor-browser/files/patch-ipc_glue_GeckoChildProcessHost.cpp new file mode 100644 index 000000000000..42f5f25add33 --- /dev/null +++ b/www/tor-browser/files/patch-ipc_glue_GeckoChildProcessHost.cpp @@ -0,0 +1,13 @@ +diff --git ipc/glue/GeckoChildProcessHost.cpp ipc/glue/GeckoChildProcessHost.cpp +index 9bb8314bd98c..2bc0382a9385 100644 +--- ipc/glue/GeckoChildProcessHost.cpp ++++ ipc/glue/GeckoChildProcessHost.cpp +@@ -1121,7 +1121,7 @@ Result<Ok, LaunchError> BaseProcessLauncher::DoSetup() { + #if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN) + geckoargs::sCrashReporter.Put(CrashReporter::GetChildNotificationPipe(), + mChildArgs); +-#elif defined(XP_UNIX) && !defined(XP_IOS) ++#elif defined(XP_UNIX) && !defined(XP_IOS) && !defined(XP_FREEBSD) + UniqueFileHandle childCrashFd = CrashReporter::GetChildNotificationPipe(); + if (!childCrashFd) { + return Err(LaunchError("DuplicateFileHandle failed")); diff --git a/www/tor-browser/files/patch-memory_mozalloc_throw__gcc.h b/www/tor-browser/files/patch-memory_mozalloc_throw__gcc.h index 53db05bc0803..81a511179852 100644 --- a/www/tor-browser/files/patch-memory_mozalloc_throw__gcc.h +++ b/www/tor-browser/files/patch-memory_mozalloc_throw__gcc.h @@ -1,4 +1,4 @@ ---- memory/mozalloc/throw_gcc.h.orig 2022-03-05 00:14:41 UTC +--- memory/mozalloc/throw_gcc.h.orig 2022-02-02 17:33:38 UTC +++ memory/mozalloc/throw_gcc.h @@ -74,50 +74,66 @@ __throw_bad_function_call(void) { mozalloc_abort("fatal: STL threw bad_function_call"); diff --git a/www/tor-browser/files/patch-python_sites_mach.txt b/www/tor-browser/files/patch-python_sites_mach.txt new file mode 100644 index 000000000000..dc2caf9bdfc6 --- /dev/null +++ b/www/tor-browser/files/patch-python_sites_mach.txt @@ -0,0 +1,18 @@ +commit 10ee367cbe7ff5a19acfcfe3bfb75a49671e4132 +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> + + bump psutil (same as ports) + + 5.9.x breaks mach + +diff --git python/sites/mach.txt python/sites/mach.txt +index 6e3db1c848f7..10ba12c2f13b 100644 +--- python/sites/mach.txt ++++ python/sites/mach.txt +@@ -108,5 +108,5 @@ pypi-optional:glean-sdk==63.1.0:telemetry will not be collected + # 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,<=5.9.4:telemetry will be missing some data ++pypi-optional:psutil>=5.4.2,<=7.0.0:telemetry will be missing some data + pypi-optional:zstandard>=0.11.1,<=0.23.0:zstd archives will not be possible to extract diff --git a/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn b/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn index 331a94015301..e4607283ebcf 100644 --- a/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn +++ b/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn @@ -1,25 +1,12 @@ -commit 93615ae859d1d819b33bbe0e32c5260a467b3625 -Author: Christoph Moench-Tegeder <cmt@burggraben.net> +commit da40b474fba2247ffc07696a2c565d830e900c9c +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> enable pipewire on bsd -diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn -index 6eb14773b0a7..d63fd1d5529f 100644 ---- third_party/libwebrtc/BUILD.gn -+++ third_party/libwebrtc/BUILD.gn -@@ -106,7 +106,7 @@ if (!build_with_chromium && !build_with_mozilla) { - "tools_webrtc/perf:webrtc_dashboard_upload", - ] - } -- if ((is_linux || is_chromeos) && rtc_use_pipewire) { -+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { - deps += [ "modules/desktop_capture:shared_screencast_stream_test" ] - } - if (is_fuchsia) { -diff --git third_party/libwebrtc/build/config/BUILDCONFIG.gn third_party/libwebrtc/build/config/BUILDCONFIG.gn -index 571ae5f0d60d..863d428fc676 100644 ---- third_party/libwebrtc/build/config/BUILDCONFIG.gn -+++ third_party/libwebrtc/build/config/BUILDCONFIG.gn +diff --git third_party/chromium/build/config/BUILDCONFIG.gn third_party/chromium/build/config/BUILDCONFIG.gn +index 889bdb92354c..ccda96d998c5 100644 +--- third_party/chromium/build/config/BUILDCONFIG.gn ++++ third_party/chromium/build/config/BUILDCONFIG.gn @@ -132,6 +132,7 @@ declare_args() { # Set to true when compiling with the Clang compiler. @@ -35,17 +22,17 @@ index 571ae5f0d60d..863d428fc676 100644 - if (host_os == "linux" || host_os == "openbsd") { + if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd") { if (target_os != "linux") { - host_toolchain = "//build/toolchain/linux:clang_$host_cpu" + host_toolchain = "//chromium/build/toolchain/linux:clang_$host_cpu" } else if (is_clang) { @@ -222,7 +223,7 @@ if (target_os == "android") { assert(host_os == "linux" || host_os == "mac", "Android builds are only supported on Linux and Mac hosts.") - _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu" + _default_toolchain = "//chromium/build/toolchain/android:android_clang_$target_cpu" -} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") { +} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd" || target_os == "freebsd") { # See comments in build/toolchain/cros/BUILD.gn about board compiles. if (is_clang) { - _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" + _default_toolchain = "//chromium/build/toolchain/linux:clang_$target_cpu" @@ -288,7 +289,7 @@ is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" @@ -55,11 +42,24 @@ index 571ae5f0d60d..863d428fc676 100644 is_mac = current_os == "mac" is_nacl = current_os == "nacl" is_win = current_os == "win" || current_os == "winuwp" +diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn +index 397df7b27b24..8a587feed6b9 100644 +--- third_party/libwebrtc/BUILD.gn ++++ third_party/libwebrtc/BUILD.gn +@@ -107,7 +107,7 @@ if (!build_with_chromium && !build_with_mozilla) { + "tools_webrtc/perf:webrtc_dashboard_upload", + ] + } +- if ((is_linux || is_chromeos) && rtc_use_pipewire) { ++ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { + deps += [ "modules/desktop_capture:shared_screencast_stream_test" ] + } + } diff --git third_party/libwebrtc/modules/desktop_capture/BUILD.gn third_party/libwebrtc/modules/desktop_capture/BUILD.gn -index c184e2fbbcac..e1af29734d8b 100644 +index de00f688871c..e32c19d38c8d 100644 --- third_party/libwebrtc/modules/desktop_capture/BUILD.gn +++ third_party/libwebrtc/modules/desktop_capture/BUILD.gn -@@ -75,7 +75,7 @@ if (rtc_include_tests) { +@@ -74,7 +74,7 @@ if (rtc_include_tests) { "window_finder_unittest.cc", ] @@ -68,7 +68,7 @@ index c184e2fbbcac..e1af29734d8b 100644 configs += [ "../portal:gio" ] } -@@ -87,7 +87,7 @@ if (rtc_include_tests) { +@@ -86,7 +86,7 @@ if (rtc_include_tests) { } } @@ -77,7 +77,7 @@ index c184e2fbbcac..e1af29734d8b 100644 rtc_test("shared_screencast_stream_test") { testonly = true -@@ -146,7 +146,7 @@ if (rtc_include_tests) { +@@ -145,7 +145,7 @@ if (rtc_include_tests) { "test_utils_unittest.cc", ] @@ -86,16 +86,7 @@ index c184e2fbbcac..e1af29734d8b 100644 configs += [ "../portal:gio" ] } -@@ -255,7 +255,7 @@ if (rtc_include_tests) { - "mock_desktop_capturer_callback.h", - ] - -- if ((is_linux || is_chromeos) && rtc_use_pipewire) { -+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { - configs += [ "../portal:gio" ] - } - -@@ -268,7 +268,7 @@ if (rtc_include_tests) { +@@ -267,7 +267,7 @@ if (rtc_include_tests) { } # TODO(bugs.webrtc.org/14187): remove when all users are gone @@ -104,7 +95,7 @@ index c184e2fbbcac..e1af29734d8b 100644 config("pipewire_config") { configs = [ "../portal:pipewire_config" ] } -@@ -326,7 +326,7 @@ rtc_library("desktop_capture") { +@@ -330,7 +330,7 @@ rtc_library("desktop_capture") { "window_finder.cc", "window_finder.h", ] @@ -114,10 +105,10 @@ index c184e2fbbcac..e1af29734d8b 100644 } if (is_mac) { diff --git third_party/libwebrtc/modules/portal/BUILD.gn third_party/libwebrtc/modules/portal/BUILD.gn -index d7768b2323c9..3593a6959277 100644 +index 6828388b31af..7e1857d861c5 100644 --- third_party/libwebrtc/modules/portal/BUILD.gn +++ third_party/libwebrtc/modules/portal/BUILD.gn -@@ -10,7 +10,7 @@ import("//build/config/linux/pkg_config.gni") +@@ -10,7 +10,7 @@ import("//chromium/build/config/linux/pkg_config.gni") import("//tools/generate_stubs/rules.gni") import("../../webrtc.gni") @@ -127,10 +118,10 @@ index d7768b2323c9..3593a6959277 100644 pkg_config("gio") { packages = [ diff --git third_party/libwebrtc/webrtc.gni third_party/libwebrtc/webrtc.gni -index b1db8ff88415..64e0cb8f7c79 100644 +index 58b450cbb16e..00b9ca49c71f 100644 --- third_party/libwebrtc/webrtc.gni +++ third_party/libwebrtc/webrtc.gni -@@ -153,7 +153,7 @@ declare_args() { +@@ -154,7 +154,7 @@ declare_args() { # By default it's only enabled on desktop Linux (excludes ChromeOS) and # only when using the sysroot as PipeWire is not available in older and # supported Ubuntu and Debian distributions. diff --git a/www/tor-browser/files/patch-third__party_sqlite3_ext_sqlite-vec_sqlite-vec.c b/www/tor-browser/files/patch-third__party_sqlite3_ext_sqlite-vec_sqlite-vec.c new file mode 100644 index 000000000000..662857e65bc5 --- /dev/null +++ b/www/tor-browser/files/patch-third__party_sqlite3_ext_sqlite-vec_sqlite-vec.c @@ -0,0 +1,15 @@ +diff --git third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c +index 96612e26d385..c43c46136bef 100644 +--- third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c ++++ third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c +@@ -11,6 +11,10 @@ + #include <stdlib.h> + #include <string.h> + ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#endif ++ + #ifndef SQLITE_VEC_OMIT_FS + #include <stdio.h> + #endif diff --git a/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c b/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c deleted file mode 100644 index e2e9a3cc88f4..000000000000 --- a/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c +++ /dev/null @@ -1,104 +0,0 @@ -diff --git toolkit/components/processtools/ProcInfo_bsd.cpp toolkit/components/processtools/ProcInfo_bsd.cpp -index a6ff4881940c..f041ed5e50ce 100644 ---- toolkit/components/processtools/ProcInfo_bsd.cpp -+++ toolkit/components/processtools/ProcInfo_bsd.cpp -@@ -18,6 +18,9 @@ - #include <cstdio> - #include <cstring> - #include <unistd.h> -+#ifdef __FreeBSD__ -+#include <sys/user.h> -+#endif - - namespace mozilla { - -@@ -50,25 +53,39 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( - } - for (const auto& request : aRequests) { - size_t size; -+#ifdef __FreeBSD__ -+ int mib[4]; -+ int mibsize = 4; -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_PROC; -+ mib[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; -+ mib[3] = request.pid; -+#else - int mib[6]; -+ int mibsize = 6; - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PID | KERN_PROC_SHOW_THREADS; - mib[3] = request.pid; - mib[4] = sizeof(kinfo_proc); - mib[5] = 0; -- if (sysctl(mib, 6, nullptr, &size, nullptr, 0) == -1) { -+#endif -+ if (sysctl(mib, mibsize, nullptr, &size, nullptr, 0) == -1) { - // Can't get info for this process. Skip it. - continue; - } - -+#ifdef __FreeBSD__ -+ auto procs = MakeUniqueFallible<kinfo_proc[]>(size / sizeof(kinfo_proc)); -+#else - mib[5] = size / sizeof(kinfo_proc); - auto procs = MakeUniqueFallible<kinfo_proc[]>(mib[5]); -+#endif - if (!procs) { - result.SetReject(NS_ERROR_OUT_OF_MEMORY); - return result; - } -- if (sysctl(mib, 6, procs.get(), &size, nullptr, 0) == -1 && -+ if (sysctl(mib, mibsize, procs.get(), &size, nullptr, 0) == -1 && - errno != ENOMEM) { - continue; - } -@@ -84,19 +101,34 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( - bool found = false; - for (size_t i = 0; i < size / sizeof(kinfo_proc); i++) { - const auto& p = procs[i]; -+#ifdef __FreeBSD__ -+ if (i == 0) { -+#else - if (p.p_tid == -1) { -+#endif - // This is the process. - found = true; -+#ifdef __FreeBSD__ -+ info.cpuTime = uint64_t(p.ki_runtime) * 1'000u; -+ info.memory = (p.ki_tsize + p.ki_dsize + p.ki_ssize) * getpagesize(); -+#else - info.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + - uint64_t(p.p_rtime_usec) * 1'000u; - info.memory = - (p.p_vm_tsize + p.p_vm_dsize + p.p_vm_ssize) * getpagesize(); -+#endif -+ - } else { - // This is one of its threads. - ThreadInfo threadInfo; -+#ifdef __FreeBSD__ -+ threadInfo.tid = p.ki_tid; -+ threadInfo.cpuTime = uint64_t(p.ki_runtime) * 1'000u; -+#else - threadInfo.tid = p.p_tid; - threadInfo.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + - uint64_t(p.p_rtime_usec) * 1'000u; -+#endif - info.threads.AppendElement(threadInfo); - } - } -diff --git toolkit/components/processtools/moz.build toolkit/components/processtools/moz.build -index b7c164c1b0ac..a41dad52c343 100644 ---- toolkit/components/processtools/moz.build -+++ toolkit/components/processtools/moz.build -@@ -39,7 +39,7 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"] - # Platform-specific implementations of `ProcInfo`. - toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"] - if toolkit == "gtk" or toolkit == "android": -- if CONFIG["OS_TARGET"] == "OpenBSD": -+ if CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "OpenBSD": - UNIFIED_SOURCES += ["ProcInfo_bsd.cpp"] - else: - UNIFIED_SOURCES += ["ProcInfo_linux.cpp"] diff --git a/www/tor-browser/files/patch-toolkit_xre_nsEmbedFunctions.cpp b/www/tor-browser/files/patch-toolkit_xre_nsEmbedFunctions.cpp new file mode 100644 index 000000000000..caac874012c9 --- /dev/null +++ b/www/tor-browser/files/patch-toolkit_xre_nsEmbedFunctions.cpp @@ -0,0 +1,17 @@ +diff --git toolkit/xre/nsEmbedFunctions.cpp toolkit/xre/nsEmbedFunctions.cpp +index 9ce6af94637c..44165558f7ec 100644 +--- toolkit/xre/nsEmbedFunctions.cpp ++++ toolkit/xre/nsEmbedFunctions.cpp +@@ -360,10 +360,12 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[], + static_cast<CrashReporter::ProcessId>(*crashHelperPidArg); + #endif // defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID) + ++#if !defined(XP_FREEBSD) + exceptionHandlerIsSet = CrashReporter::SetRemoteExceptionHandler( + std::move(*crashReporterArg), crashHelperPid); + MOZ_ASSERT(exceptionHandlerIsSet, + "Should have been able to set remote exception handler"); ++#endif + + if (!exceptionHandlerIsSet) { + // Bug 684322 will add better visibility into this condition |