diff options
Diffstat (limited to 'www/tor-browser/files')
8 files changed, 115 insertions, 86 deletions
diff --git a/www/tor-browser/files/patch-bug1876632 b/www/tor-browser/files/patch-bug1876632 deleted file mode 100644 index 3932b1deccc9..000000000000 --- a/www/tor-browser/files/patch-bug1876632 +++ /dev/null @@ -1,35 +0,0 @@ -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-build_gn__processor.py b/www/tor-browser/files/patch-build_gn__processor.py index be5e10347483..08e7f1211613 100644 --- a/www/tor-browser/files/patch-build_gn__processor.py +++ b/www/tor-browser/files/patch-build_gn__processor.py @@ -1,10 +1,10 @@ -commit 0e5bcbefae64b35a5c8df360e3980258a565fa72 -Author: Christoph Moench-Tegeder <cmt@burggraben.net> +commit bcf74d8c7a315c4f8ef70f1a60d4ce957cebac1d +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> - chase gn_processor.py move + FreeBSD workings for webrtc configure (gn_processor.py) diff --git build/gn_processor.py build/gn_processor.py -index 2ba8b92c2751..91170efb9a5d 100644 +index 36cc6bdfe492..ed0fb2b7aa45 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): @@ -15,7 +15,7 @@ index 2ba8b92c2751..91170efb9a5d 100644 "linux": "Linux", "mac": "Darwin", "openbsd": "OpenBSD", -@@ -780,17 +781,17 @@ def main(): +@@ -801,17 +802,17 @@ def main(): vars_set = [] for is_debug in (True, False): @@ -38,12 +38,12 @@ index 2ba8b92c2751..91170efb9a5d 100644 target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"]) for target_cpu in target_cpus: vars = { -@@ -799,7 +800,7 @@ def main(): +@@ -820,7 +821,7 @@ def main(): "target_cpu": target_cpu, "target_os": target_os, } - if target_os == "linux": + if target_os in ("freebsd", "linux"): - for use_x11 in (True, False): - vars["use_x11"] = use_x11 + for enable_x11 in (True, False): + vars["ozone_platform_x11"] = enable_x11 vars_set.append(vars.copy()) diff --git a/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build b/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build new file mode 100644 index 000000000000..ac01cff0e211 --- /dev/null +++ b/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build @@ -0,0 +1,25 @@ +commit 18ea032974539d7f4db64d21a87fd174333b9e2c +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> + + build XErrorTrap for FreeBSD, too + +diff --git dom/media/webrtc/libwebrtc_overrides/moz.build dom/media/webrtc/libwebrtc_overrides/moz.build +index ed9c450e5649..1ac213e48b28 100644 +--- dom/media/webrtc/libwebrtc_overrides/moz.build ++++ dom/media/webrtc/libwebrtc_overrides/moz.build +@@ -49,13 +49,13 @@ + "call/call_basic_stats.cc", + ] + +-if CONFIG["OS_TARGET"] == "OpenBSD": ++if CONFIG["OS_TARGET"] in ("FreeBSD", "OpenBSD"): + CXXFLAGS += CONFIG["MOZ_X11_CFLAGS"] + UNIFIED_SOURCES += [ + "modules/desktop_capture/linux/x11/x_error_trap.cc", + ] + +-if CONFIG["TARGET_CPU"] in ("loongarch64", "ppc64"): ++if CONFIG["TARGET_CPU"] in ("loongarch64"): + UNIFIED_SOURCES += [ + "modules/desktop_capture/linux/x11/x_error_trap.cc", + ] diff --git a/www/tor-browser/files/patch-python_sites_mach.txt b/www/tor-browser/files/patch-python_sites_mach.txt index dc2caf9bdfc6..706f285b0731 100644 --- a/www/tor-browser/files/patch-python_sites_mach.txt +++ b/www/tor-browser/files/patch-python_sites_mach.txt @@ -15,4 +15,4 @@ index 6e3db1c848f7..10ba12c2f13b 100644 # 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 + pypi-optional:zstandard>=0.11.1,<=0.24.0:zstd archives will not be possible to extract diff --git a/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni b/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni new file mode 100644 index 000000000000..7cfd8c79d2da --- /dev/null +++ b/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni @@ -0,0 +1,18 @@ +commit 66fb0f122ef1ddf961b333c8377b84b603d75b27 +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> + + support FreeBSD as a host platform + +diff --git third_party/chromium/build/toolchain/toolchain.gni third_party/chromium/build/toolchain/toolchain.gni +index 754f0e3bbd7e..238d79631ba8 100644 +--- third_party/chromium/build/toolchain/toolchain.gni ++++ third_party/chromium/build/toolchain/toolchain.gni +@@ -75,7 +75,7 @@ if (host_os == "mac") { + host_shlib_extension = ".dylib" + } else if (host_os == "win") { + host_shlib_extension = ".dll" +-} else if (host_os == "linux" || host_os == "aix" || host_os == "zos") { ++} else if (host_os == "linux" || host_os == "aix" || host_os == "freebsd" || host_os == "zos") { + host_shlib_extension = ".so" + } else { + assert(false, "Host platform not supported") 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 e4607283ebcf..7774855c7941 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,13 +1,13 @@ -commit da40b474fba2247ffc07696a2c565d830e900c9c +commit e8a3b91abdc00edd7633aabbe5e63bfc0d0825e4 Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> enable pipewire on bsd diff --git third_party/chromium/build/config/BUILDCONFIG.gn third_party/chromium/build/config/BUILDCONFIG.gn -index 889bdb92354c..ccda96d998c5 100644 +index 4bb38fe31ff2..b10eb19f521a 100644 --- third_party/chromium/build/config/BUILDCONFIG.gn +++ third_party/chromium/build/config/BUILDCONFIG.gn -@@ -132,6 +132,7 @@ declare_args() { +@@ -137,6 +137,7 @@ declare_args() { # Set to true when compiling with the Clang compiler. is_clang = current_os != "linux" || current_os == "openbsd" || @@ -15,7 +15,7 @@ index 889bdb92354c..ccda96d998c5 100644 (current_cpu != "s390x" && current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64" && -@@ -184,7 +185,7 @@ if (host_toolchain == "") { +@@ -206,7 +207,7 @@ if (host_toolchain == "") { # TODO(dpranke): Add some sort of assert here that verifies that # no toolchain omitted host_toolchain from its toolchain_args(). @@ -24,16 +24,16 @@ index 889bdb92354c..ccda96d998c5 100644 if (target_os != "linux") { 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.") +@@ -246,7 +247,7 @@ if (target_os == "android") { + # Targeting android on Mac is best-effort and not guaranteed to work. + #assert(host_os == "linux", "Android builds are only supported on Linux.") _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 = "//chromium/build/toolchain/linux:clang_$target_cpu" -@@ -288,7 +289,7 @@ is_chromeos = current_os == "chromeos" +@@ -314,7 +315,7 @@ is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" is_linux = current_os == "linux" @@ -41,12 +41,12 @@ index 889bdb92354c..ccda96d998c5 100644 +is_bsd = current_os == "openbsd" || current_os == "freebsd" is_mac = current_os == "mac" is_nacl = current_os == "nacl" - is_win = current_os == "win" || current_os == "winuwp" + is_wasm = current_os == "emscripten" diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn -index 397df7b27b24..8a587feed6b9 100644 +index ac8569efaa40..5d6c5953491c 100644 --- third_party/libwebrtc/BUILD.gn +++ third_party/libwebrtc/BUILD.gn -@@ -107,7 +107,7 @@ if (!build_with_chromium && !build_with_mozilla) { +@@ -111,7 +111,7 @@ if (!build_with_chromium && !build_with_mozilla) { "tools_webrtc/perf:webrtc_dashboard_upload", ] } @@ -56,10 +56,10 @@ index 397df7b27b24..8a587feed6b9 100644 } } diff --git third_party/libwebrtc/modules/desktop_capture/BUILD.gn third_party/libwebrtc/modules/desktop_capture/BUILD.gn -index de00f688871c..e32c19d38c8d 100644 +index 5c843cfc2b6a..0ed9f98a964f 100644 --- third_party/libwebrtc/modules/desktop_capture/BUILD.gn +++ third_party/libwebrtc/modules/desktop_capture/BUILD.gn -@@ -74,7 +74,7 @@ if (rtc_include_tests) { +@@ -76,7 +76,7 @@ if (rtc_include_tests) { "window_finder_unittest.cc", ] @@ -68,7 +68,7 @@ index de00f688871c..e32c19d38c8d 100644 configs += [ "../portal:gio" ] } -@@ -86,7 +86,7 @@ if (rtc_include_tests) { +@@ -88,7 +88,7 @@ if (rtc_include_tests) { } } @@ -77,7 +77,7 @@ index de00f688871c..e32c19d38c8d 100644 rtc_test("shared_screencast_stream_test") { testonly = true -@@ -145,7 +145,7 @@ if (rtc_include_tests) { +@@ -148,7 +148,7 @@ if (rtc_include_tests) { "test_utils_unittest.cc", ] @@ -86,6 +86,24 @@ index de00f688871c..e32c19d38c8d 100644 configs += [ "../portal:gio" ] } +@@ -215,7 +215,7 @@ if (rtc_include_tests) { + "screen_drawer.h", + ] + +- if (is_linux || is_chromeos) { ++ if (is_linux || is_chromeos || is_bsd) { + sources += [ "screen_drawer_linux.cc" ] + libs = [ "X11" ] + } +@@ -254,7 +254,7 @@ if (rtc_include_tests) { + "mock_desktop_capturer_callback.h", + ] + +- if ((is_linux || is_chromeos) && rtc_use_pipewire) { ++ if ((is_linux || is_chromeos || us_bsd) && rtc_use_pipewire) { + configs += [ "../portal:gio" ] + } + @@ -267,7 +267,7 @@ if (rtc_include_tests) { } @@ -95,17 +113,8 @@ index de00f688871c..e32c19d38c8d 100644 config("pipewire_config") { configs = [ "../portal:pipewire_config" ] } -@@ -330,7 +330,7 @@ rtc_library("desktop_capture") { - "window_finder.cc", - "window_finder.h", - ] -- if (is_linux && !is_castos && rtc_use_pipewire) { -+ if ((is_linux || is_bsd) && !is_castos && rtc_use_pipewire) { - sources += [ "desktop_capture_metadata.h" ] - } - if (is_mac) { diff --git third_party/libwebrtc/modules/portal/BUILD.gn third_party/libwebrtc/modules/portal/BUILD.gn -index 6828388b31af..7e1857d861c5 100644 +index 70b4739ad0c4..99ab95d441f3 100644 --- third_party/libwebrtc/modules/portal/BUILD.gn +++ third_party/libwebrtc/modules/portal/BUILD.gn @@ -10,7 +10,7 @@ import("//chromium/build/config/linux/pkg_config.gni") @@ -118,10 +127,10 @@ index 6828388b31af..7e1857d861c5 100644 pkg_config("gio") { packages = [ diff --git third_party/libwebrtc/webrtc.gni third_party/libwebrtc/webrtc.gni -index 58b450cbb16e..00b9ca49c71f 100644 +index 1e87de20e545..77a8a55d8659 100644 --- third_party/libwebrtc/webrtc.gni +++ third_party/libwebrtc/webrtc.gni -@@ -154,7 +154,7 @@ declare_args() { +@@ -151,7 +151,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_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc b/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc index e83c56760a7c..13a23c835960 100644 --- a/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc +++ b/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc @@ -1,26 +1,19 @@ -commit 3524023ca1d2184ab9a5a7cc61695923e6834cc1 -Author: Christoph Moench-Tegeder <cmt@burggraben.net> +commit f53507857647459d4a48935901f80f27a5ae58a9 +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> avoid linux-only includes diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index 6a019c64b4b3..18bb43d797dd 100644 +index 821fdfb487b7..e000c1c104fe 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -@@ -10,12 +10,16 @@ - - #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" - +@@ -15,7 +15,9 @@ + #include <EGL/eglplatform.h> + #include <GL/gl.h> + #include <GL/glext.h> +#if !defined(__FreeBSD__) #include <asm/ioctl.h> +#endif #include <dlfcn.h> #include <fcntl.h> - #include <gdk/gdk.h> - #include <libdrm/drm_fourcc.h> -+#if !defined(__FreeBSD__) - #include <linux/types.h> -+#endif - #include <spa/param/video/format-utils.h> - #include <unistd.h> - #include <xf86drm.h> + #include <gbm.h> diff --git a/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h b/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h new file mode 100644 index 000000000000..14ed30920d6a --- /dev/null +++ b/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h @@ -0,0 +1,19 @@ +commit 9f34111f6f4e2ebefd878a3c256fc012826e6936 +Author: Christoph Moench-Tegeder <cmt@FreeBSD.org> + + FreeBSD does not know asm-generic/ioctl.h + +diff --git third_party/libwebrtc/modules/portal/pipewire_utils.h third_party/libwebrtc/modules/portal/pipewire_utils.h +index c3d4f347a8cd..14a36260c292 100644 +--- third_party/libwebrtc/modules/portal/pipewire_utils.h ++++ third_party/libwebrtc/modules/portal/pipewire_utils.h +@@ -11,7 +11,9 @@ + #ifndef MODULES_PORTAL_PIPEWIRE_UTILS_H_ + #define MODULES_PORTAL_PIPEWIRE_UTILS_H_ + ++#if !defined(__FreeBSD__) + #include <asm-generic/ioctl.h> ++#endif + #include <sys/ioctl.h> + #include <sys/mman.h> + |
