sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (384eafbcb5e0dd73e801af78358351127e6840e0)
- From: Pavel Vinogradov <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (384eafbcb5e0dd73e801af78358351127e6840e0)
- Date: Wed, 4 Sep 2024 15:43:11 +0000
GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:
http/firefox/DEPENDS
| 2
http/firefox/DETAILS
| 4
http/firefox/HISTORY
| 5
http/firefox/patches/0017-bgo-907963-rustflags-single-string.patch
| 76 --
http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
| 20
http/firefox/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
| 20
http/firefox/patches/0018-gcc-lto-pgo-from-fedora.patch
| 128 +++
http/firefox/patches/0019-bmo-1862601-system-icu-74.patch
| 41 +
http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
| 128 ---
http/firefox/patches/0020-bgo-748849-RUST_TARGET_override.patch
| 61 +
http/firefox/patches/0020-bmo-1862601-system-icu-74.patch
| 41 -
http/firefox/patches/0021-bgo-748849-RUST_TARGET_override.patch
| 61 -
http/firefox/patches/0021-bmo-1559213-Support-system-av1.patch
| 96 ++
http/firefox/patches/0022-bmo-1559213-Support-system-av1.patch
| 96 --
http/firefox/patches/0022-bmo-1874059-fix-libcxx-18.patch
| 16
http/firefox/patches/0023-bmo-1874059-fix-libcxx-18.patch
| 16
http/firefox/patches/0023-dont-use-build-id.patch
| 13
http/firefox/patches/0024-dont-use-build-id.patch
| 13
http/firefox/patches/0024-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
| 14
http/firefox/patches/0025-bgo-925101-force-software-rendering-during-pgo-build.patch
| 16
http/firefox/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
| 14
http/firefox/patches/0026-bgo-929967-fix-pgo-on-musl.patch
| 14
http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
| 368 ----------
http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
| 16
http/firefox/patches/0027-bmo-1913286-filter-out-unsupported-devices-for-pipewire-camera-screencasting.patch
| 330 ++++++++
http/firefox/patches/0028-bmo-1902227-backport-ffmpeg-av1-vaapi-fixes-for-mesa-24.0.7plus.patch
| 250 ------
http/firefox/patches/0029-bmo-1912663-cbindgen-0.27.0-fixes.patch
| 62 -
http/firefox/patches/0030-bgo-929967-fix-pgo-on-musl.patch
| 14
28 files changed, 757 insertions(+), 1178 deletions(-)
New commits:
commit 384eafbcb5e0dd73e801af78358351127e6840e0
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
http/firefox: version 130.0, SECURITY_PATCH++
diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index 826d792..0b87f65 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -51,7 +51,7 @@ depends libwebp "--with-system-webp"
&&
depends nspr "--with-system-nspr" &&
-local NSS_BRANCH="3.102" &&
+local NSS_BRANCH="3.103" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
diff --git a/http/firefox/DETAILS b/http/firefox/DETAILS
index cb0c5d6..c601327 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,6 +1,6 @@
SPELL=firefox
- VERSION=129.0.2
- SECURITY_PATCH=195
+ VERSION=130.0
+ SECURITY_PATCH=196
SOURCE="${SPELL}-${VERSION}.source.tar.xz"
# Watch: http://releases.mozilla.org/pub/firefox/releases/
/releases/([0-9.]+)/
SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index b55c4c6..625f8af 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2024-09-04 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 130.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.103
+ * patches/*: updated
+
2024-08-22 Pavel Vinogradov <public AT sourcemage.org>
* patches/*: updated
diff --git
a/http/firefox/patches/0017-bgo-907963-rustflags-single-string.patch
b/http/firefox/patches/0017-bgo-907963-rustflags-single-string.patch
deleted file mode 100644
index a56aec4..0000000
--- a/http/firefox/patches/0017-bgo-907963-rustflags-single-string.patch
+++ /dev/null
@@ -1,76 +0,0 @@
---- firefox-111.0.1/build/moz.configure/rust.configure 2023-03-21
06:16:03.000000000 -0700
-+++ firefox-111.0.1/build/moz.configure/rust.configure.new 2023-04-05
08:57:29.403219120 -0700
-@@ -593,7 +593,7 @@
-
- # ==============================================================
-
--option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags")
-+option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags",
comma_split=False)
- set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags))
-
-
---- firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py
2023-03-21 06:16:09.000000000 -0700
-+++ firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py.new
2023-04-05 08:57:31.270193468 -0700
-@@ -191,6 +191,10 @@
- to instantiate an option indirectly. Set this to a positive integer to
- force the script to look into a deeper stack frame when inferring the
- `category`.
-+ - `comma_split` specifies whether the value string should be split on
-+ commas. The default is True. Setting it False is necessary for things
-+ like compiler flags which should be a single string that may contain
-+ commas.
- """
-
- __slots__ = (
-@@ -205,6 +209,7 @@
- "possible_origins",
- "category",
- "define_depth",
-+ "comma_split",
- )
-
- def __init__(
-@@ -218,6 +223,7 @@
- category=None,
- help=None,
- define_depth=0,
-+ comma_split=True,
- ):
- if not name and not env:
- raise InvalidOptionError(
-@@ -335,9 +341,10 @@
- self.choices = choices
- self.help = help
- self.category = category or _infer_option_category(define_depth)
-+ self.comma_split = comma_split
-
- @staticmethod
-- def split_option(option):
-+ def split_option(option, comma_split=True):
- """Split a flag or variable into a prefix, a name and values
-
- Variables come in the form NAME=values (no prefix).
-@@ -350,7 +357,13 @@
-
- elements = option.split("=", 1)
- name = elements[0]
-- values = tuple(elements[1].split(",")) if len(elements) == 2 else ()
-+ if len(elements) == 2:
-+ if comma_split:
-+ values = tuple(elements[1].split(","))
-+ else:
-+ values = (elements[1],)
-+ else:
-+ values = ()
- if name.startswith("--"):
- name = name[2:]
- if not name.islower():
-@@ -426,7 +439,7 @@
- % (option, origin, ", ".join(self.possible_origins))
- )
-
-- prefix, name, values = self.split_option(option)
-+ prefix, name, values = self.split_option(option, self.comma_split)
- option = self._join_option(prefix, name)
-
- assert name in (self.name, self.env)
diff --git
a/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
b/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
new file mode 100644
index 0000000..bb0621a
--- /dev/null
+++
b/http/firefox/patches/0017-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
@@ -0,0 +1,20 @@
+--- a/security/sandbox/linux/Sandbox.cpp 2023-07-10 20:29:48.000000000 +0100
++++ b/security/sandbox/linux/Sandbox.cpp 2023-07-15 09:13:43.561724668
+0100
+@@ -18,6 +18,8 @@
+ #include <dirent.h>
+ #ifdef NIGHTLY_BUILD
+ # include "dlfcn.h"
++#else
++# include <dlfcn.h>
+ #endif
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -685,7 +687,7 @@
+ files->Add("/proc/stat", SandboxOpenedFile::Error{});
+ files->Add("/proc/net/unix", SandboxOpenedFile::Error{});
+ files->Add("/proc/self/maps", SandboxOpenedFile::Error{});
+-
++ Unused << dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY);
+ // Finally, start the sandbox.
+ SetCurrentProcessSandbox(GetMediaSandboxPolicy(files));
+ }
\ No newline at end of file
diff --git
a/http/firefox/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
b/http/firefox/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
deleted file mode 100644
index bb0621a..0000000
---
a/http/firefox/patches/0018-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/security/sandbox/linux/Sandbox.cpp 2023-07-10 20:29:48.000000000 +0100
-+++ b/security/sandbox/linux/Sandbox.cpp 2023-07-15 09:13:43.561724668
+0100
-@@ -18,6 +18,8 @@
- #include <dirent.h>
- #ifdef NIGHTLY_BUILD
- # include "dlfcn.h"
-+#else
-+# include <dlfcn.h>
- #endif
- #include <errno.h>
- #include <fcntl.h>
-@@ -685,7 +687,7 @@
- files->Add("/proc/stat", SandboxOpenedFile::Error{});
- files->Add("/proc/net/unix", SandboxOpenedFile::Error{});
- files->Add("/proc/self/maps", SandboxOpenedFile::Error{});
--
-+ Unused << dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY);
- // Finally, start the sandbox.
- SetCurrentProcessSandbox(GetMediaSandboxPolicy(files));
- }
\ No newline at end of file
diff --git a/http/firefox/patches/0018-gcc-lto-pgo-from-fedora.patch
b/http/firefox/patches/0018-gcc-lto-pgo-from-fedora.patch
new file mode 100644
index 0000000..3d8a0b1
--- /dev/null
+++ b/http/firefox/patches/0018-gcc-lto-pgo-from-fedora.patch
@@ -0,0 +1,128 @@
+diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo
firefox-128.0/build/moz.configure/lto-pgo.configure
+--- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02
00:34:14.000000000 +0200
++++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02
17:59:44.425650444 +0200
+@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi
+
+ @depends(
+ "--enable-profile-use",
++ c_compiler,
+ pgo_profile_path,
+ llvm_profdata,
+ llvm_profdata_order,
+ build_environment,
+ )
+-def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
++def orderfile_path(profile_use, compiler, path, profdata, profdata_order,
build_env):
++ if compiler.type == "gcc":
++ return None
++
+ if not profile_use:
+ return None
+
+@@ -133,7 +137,7 @@ def pgo_flags(
+ return namespace(
+ gen_cflags=["-fprofile-generate"],
+ gen_ldflags=["-fprofile-generate"],
+- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
++ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wno-coverage-mismatch"],
+ use_ldflags=["-fprofile-use"],
+ )
+
+diff -up firefox-128.0/build/pgo/profileserver.py.pgo
firefox-128.0/build/pgo/profileserver.py
+--- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02
00:34:15.000000000 +0200
++++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444
+0200
+@@ -11,7 +11,7 @@ import subprocess
+ import sys
+
+ import mozcrash
+-from mozbuild.base import BinaryNotFoundException, MozbuildObject
++from mozbuild.base import BinaryNotFoundException, MozbuildObject,
BuildEnvironmentNotFoundException
+ from mozfile import TemporaryDirectory
+ from mozhttpd import MozHttpd
+ from mozprofile import FirefoxProfile, Preferences
+@@ -97,9 +97,22 @@ if __name__ == "__main__":
+ locations = ServerLocations()
+ locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
+
+- old_profraw_files = glob.glob("*.profraw")
+- for f in old_profraw_files:
+- os.remove(f)
++ using_gcc = False
++ try:
++ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
++ using_gcc = True
++ except BuildEnvironmentNotFoundException:
++ pass
++
++ if using_gcc:
++ for dirpath, _, filenames in os.walk('.'):
++ for f in filenames:
++ if f.endswith('.gcda'):
++ os.remove(os.path.join(dirpath, f))
++ else:
++ old_profraw_files = glob.glob('*.profraw')
++ for f in old_profraw_files:
++ os.remove(f)
+
+ with TemporaryDirectory() as profilePath:
+ # TODO: refactor this into mozprofile
+diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build
+--- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200
++++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200
+@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
+ # The file uses SSE2 intrinsics, so it needs special compile flags on
some
+ # compilers.
+ SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
+ elif CONFIG["TARGET_CPU"].startswith("mips"):
+diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo
firefox-128.0/gfx/skia/generate_mozbuild.py
+--- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02
17:59:44.425650444 +0200
++++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02
18:17:40.973081400 +0200
+@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/gfx/skia/moz.build.pgo
firefox-128.0/gfx/skia/moz.build
+--- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444
+0200
++++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200
+@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
+--- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2024-07-02 00:34:32.000000000 +0200
++++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
2024-07-02 17:59:44.425650444 +0200
+@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() {
+ }
+ #endif
+
++ // Disable watchdog for PGO train builds - writting profile information at
++ // exit may take time and it is better to make build hang rather than
++ // silently produce poorly performing binary.
++ crashAfterMS = INT32_MAX;
++
+ UniquePtr<Options> options(new Options());
+ // crashAfterTicks is guaranteed to be > 0 as
+ // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >>
HEARTBEAT_INTERVAL_MS
diff --git a/http/firefox/patches/0019-bmo-1862601-system-icu-74.patch
b/http/firefox/patches/0019-bmo-1862601-system-icu-74.patch
new file mode 100644
index 0000000..617dd76
--- /dev/null
+++ b/http/firefox/patches/0019-bmo-1862601-system-icu-74.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/917599
+https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
+https://hg.mozilla.org/try/rev/d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+
+# HG changeset patch
+# User André Bargull <andre.bargull AT gmail.com>
+# Date 1697435923 -7200
+# Node ID d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+# Parent c63994f8259efdf6e745c960aa9e1409d5477049
+Bug xxx - Part 12: Add new line break classes. r?
+
+diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp
+--- a/intl/lwbrk/LineBreaker.cpp
++++ b/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/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
b/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
deleted file mode 100644
index 3d8a0b1..0000000
--- a/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo
firefox-128.0/build/moz.configure/lto-pgo.configure
---- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02
00:34:14.000000000 +0200
-+++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02
17:59:44.425650444 +0200
-@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi
-
- @depends(
- "--enable-profile-use",
-+ c_compiler,
- pgo_profile_path,
- llvm_profdata,
- llvm_profdata_order,
- build_environment,
- )
--def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
-+def orderfile_path(profile_use, compiler, path, profdata, profdata_order,
build_env):
-+ if compiler.type == "gcc":
-+ return None
-+
- if not profile_use:
- return None
-
-@@ -133,7 +137,7 @@ def pgo_flags(
- return namespace(
- gen_cflags=["-fprofile-generate"],
- gen_ldflags=["-fprofile-generate"],
-- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
-+ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wno-coverage-mismatch"],
- use_ldflags=["-fprofile-use"],
- )
-
-diff -up firefox-128.0/build/pgo/profileserver.py.pgo
firefox-128.0/build/pgo/profileserver.py
---- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02
00:34:15.000000000 +0200
-+++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444
+0200
-@@ -11,7 +11,7 @@ import subprocess
- import sys
-
- import mozcrash
--from mozbuild.base import BinaryNotFoundException, MozbuildObject
-+from mozbuild.base import BinaryNotFoundException, MozbuildObject,
BuildEnvironmentNotFoundException
- from mozfile import TemporaryDirectory
- from mozhttpd import MozHttpd
- from mozprofile import FirefoxProfile, Preferences
-@@ -97,9 +97,22 @@ if __name__ == "__main__":
- locations = ServerLocations()
- locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
-
-- old_profraw_files = glob.glob("*.profraw")
-- for f in old_profraw_files:
-- os.remove(f)
-+ using_gcc = False
-+ try:
-+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
-+ using_gcc = True
-+ except BuildEnvironmentNotFoundException:
-+ pass
-+
-+ if using_gcc:
-+ for dirpath, _, filenames in os.walk('.'):
-+ for f in filenames:
-+ if f.endswith('.gcda'):
-+ os.remove(os.path.join(dirpath, f))
-+ else:
-+ old_profraw_files = glob.glob('*.profraw')
-+ for f in old_profraw_files:
-+ os.remove(f)
-
- with TemporaryDirectory() as profilePath:
- # TODO: refactor this into mozprofile
-diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build
---- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200
-+++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200
-@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
- # The file uses SSE2 intrinsics, so it needs special compile flags on
some
- # compilers.
- SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
-- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
-+ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
- SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
- SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
- SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
-- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
-+ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
- SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
- SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
- elif CONFIG["TARGET_CPU"].startswith("mips"):
-diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo
firefox-128.0/gfx/skia/generate_mozbuild.py
---- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02
17:59:44.425650444 +0200
-+++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02
18:17:40.973081400 +0200
-@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
- if CONFIG['INTEL_ARCHITECTURE']:
- SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
- skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
-- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
-- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
-+ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
-+ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
- SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
- SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
- SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
-diff -up firefox-128.0/gfx/skia/moz.build.pgo
firefox-128.0/gfx/skia/moz.build
---- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444
+0200
-+++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200
-@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
- if CONFIG['INTEL_ARCHITECTURE']:
- SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
- skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
-- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
-- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
-+ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
-+ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
- SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
- SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
- SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
-diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
---- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2024-07-02 00:34:32.000000000 +0200
-+++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
2024-07-02 17:59:44.425650444 +0200
-@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() {
- }
- #endif
-
-+ // Disable watchdog for PGO train builds - writting profile information at
-+ // exit may take time and it is better to make build hang rather than
-+ // silently produce poorly performing binary.
-+ crashAfterMS = INT32_MAX;
-+
- UniquePtr<Options> options(new Options());
- // crashAfterTicks is guaranteed to be > 0 as
- // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >>
HEARTBEAT_INTERVAL_MS
diff --git a/http/firefox/patches/0020-bgo-748849-RUST_TARGET_override.patch
b/http/firefox/patches/0020-bgo-748849-RUST_TARGET_override.patch
new file mode 100644
index 0000000..f109538
--- /dev/null
+++ b/http/firefox/patches/0020-bgo-748849-RUST_TARGET_override.patch
@@ -0,0 +1,61 @@
+From: Sam James <sam AT gentoo.org>
+Subject: Allow RUST_TARGET override for detected Rust triplet (fixes musl
build)
+
+Respect RUST_TARGET from the environment to override Mozilla's
+own triplet detection.
+
+If the variable is unset, the old logic is used.
+
+The issue is that Gentoo supports both, say:
+- x86_64-unknown-linux-musl, and
+- x86-64-gentoo-linux-musl
+
+Our Rust is built to understand
+-gentoo- as a vendor target, but
+our Rust only actually includes
+-unknown-.
+
+Mozilla's configure sees -gentoo-
+in CHOST and that Rust _understands_
+-gentoo- and tries to use it, without
+verifying that we actually have
+-gentoo- installed as a Rust target.
+
+This requires exporting RUST_TARGET
+in the ebuild, possibly like:
+````
+inherit rust-toolchain
+
+src_configure() {
+ [...]
+ export RUST_TARGET=$(rust_abi)
+ [...]
+}
+````
+
+Inspired by Alpine's patch at
+https://git.alpinelinux.org/aports/tree/community/firefox/fix-rust-target.patch?id=740922900cf8042be6751fcfcccdd3fc11bd77d3.
+
+Bug: https://bugs.gentoo.org/748849
+Bug: https://bugs.gentoo.org/779178
+Bug: https://bugs.gentoo.org/836226
+Thanks-to: Georgy Yakovlev <gyakovlev AT gentoo.org>
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -275,6 +275,7 @@ def rust_supported_targets(rustc):
+ return data
+
+
++@imports('os')
+ def detect_rustc_target(
+ host_or_target, compiler_info, arm_target, rust_supported_targets
+ ):
+@@ -396,7 +397,7 @@ def detect_rustc_target(
+
+ return None
+
+- rustc_target = find_candidate(candidates)
++ rustc_target = os.environ.get('RUST_TARGET', find_candidate(candidates))
+
+ if rustc_target is None:
+ die("Don't know how to translate {} for
rustc".format(host_or_target.alias))
diff --git a/http/firefox/patches/0020-bmo-1862601-system-icu-74.patch
b/http/firefox/patches/0020-bmo-1862601-system-icu-74.patch
deleted file mode 100644
index 617dd76..0000000
--- a/http/firefox/patches/0020-bmo-1862601-system-icu-74.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-https://bugs.gentoo.org/917599
-https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
-https://hg.mozilla.org/try/rev/d5f3b0c4f08a426ce00a153c04e177eecb6820e2
-
-# HG changeset patch
-# User André Bargull <andre.bargull AT gmail.com>
-# Date 1697435923 -7200
-# Node ID d5f3b0c4f08a426ce00a153c04e177eecb6820e2
-# Parent c63994f8259efdf6e745c960aa9e1409d5477049
-Bug xxx - Part 12: Add new line break classes. r?
-
-diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp
---- a/intl/lwbrk/LineBreaker.cpp
-+++ b/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/http/firefox/patches/0021-bgo-748849-RUST_TARGET_override.patch
b/http/firefox/patches/0021-bgo-748849-RUST_TARGET_override.patch
deleted file mode 100644
index f109538..0000000
--- a/http/firefox/patches/0021-bgo-748849-RUST_TARGET_override.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Sam James <sam AT gentoo.org>
-Subject: Allow RUST_TARGET override for detected Rust triplet (fixes musl
build)
-
-Respect RUST_TARGET from the environment to override Mozilla's
-own triplet detection.
-
-If the variable is unset, the old logic is used.
-
-The issue is that Gentoo supports both, say:
-- x86_64-unknown-linux-musl, and
-- x86-64-gentoo-linux-musl
-
-Our Rust is built to understand
--gentoo- as a vendor target, but
-our Rust only actually includes
--unknown-.
-
-Mozilla's configure sees -gentoo-
-in CHOST and that Rust _understands_
--gentoo- and tries to use it, without
-verifying that we actually have
--gentoo- installed as a Rust target.
-
-This requires exporting RUST_TARGET
-in the ebuild, possibly like:
-````
-inherit rust-toolchain
-
-src_configure() {
- [...]
- export RUST_TARGET=$(rust_abi)
- [...]
-}
-````
-
-Inspired by Alpine's patch at
-https://git.alpinelinux.org/aports/tree/community/firefox/fix-rust-target.patch?id=740922900cf8042be6751fcfcccdd3fc11bd77d3.
-
-Bug: https://bugs.gentoo.org/748849
-Bug: https://bugs.gentoo.org/779178
-Bug: https://bugs.gentoo.org/836226
-Thanks-to: Georgy Yakovlev <gyakovlev AT gentoo.org>
---- a/build/moz.configure/rust.configure
-+++ b/build/moz.configure/rust.configure
-@@ -275,6 +275,7 @@ def rust_supported_targets(rustc):
- return data
-
-
-+@imports('os')
- def detect_rustc_target(
- host_or_target, compiler_info, arm_target, rust_supported_targets
- ):
-@@ -396,7 +397,7 @@ def detect_rustc_target(
-
- return None
-
-- rustc_target = find_candidate(candidates)
-+ rustc_target = os.environ.get('RUST_TARGET', find_candidate(candidates))
-
- if rustc_target is None:
- die("Don't know how to translate {} for
rustc".format(host_or_target.alias))
diff --git a/http/firefox/patches/0021-bmo-1559213-Support-system-av1.patch
b/http/firefox/patches/0021-bmo-1559213-Support-system-av1.patch
new file mode 100644
index 0000000..240ef56
--- /dev/null
+++ b/http/firefox/patches/0021-bmo-1559213-Support-system-av1.patch
@@ -0,0 +1,96 @@
+diff --git a/config/external/moz.build b/config/external/moz.build
+index 2fc8df57992e..63d18e50a961 100644
+--- a/config/external/moz.build
++++ b/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 a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+index 5c6e25b3980b..ce99ebfb6d3f 100644
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -81,6 +81,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 a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+index 761fc8cf4cd9..793a5b8697a8 100644
+--- a/media/ffvpx/libavcodec/moz.build
++++ b/media/ffvpx/libavcodec/moz.build
+@@ -120,10 +120,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 a/toolkit/moz.configure b/toolkit/moz.configure
+index f93a5d64fec8..814357f4e979 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -744,7 +744,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
+@@ -760,6 +776,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/http/firefox/patches/0022-bmo-1559213-Support-system-av1.patch
b/http/firefox/patches/0022-bmo-1559213-Support-system-av1.patch
deleted file mode 100644
index 240ef56..0000000
--- a/http/firefox/patches/0022-bmo-1559213-Support-system-av1.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-diff --git a/config/external/moz.build b/config/external/moz.build
-index 2fc8df57992e..63d18e50a961 100644
---- a/config/external/moz.build
-+++ b/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 a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
-index 5c6e25b3980b..ce99ebfb6d3f 100644
---- a/dom/media/platforms/moz.build
-+++ b/dom/media/platforms/moz.build
-@@ -81,6 +81,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 a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
-index 761fc8cf4cd9..793a5b8697a8 100644
---- a/media/ffvpx/libavcodec/moz.build
-+++ b/media/ffvpx/libavcodec/moz.build
-@@ -120,10 +120,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 a/toolkit/moz.configure b/toolkit/moz.configure
-index f93a5d64fec8..814357f4e979 100644
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -744,7 +744,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
-@@ -760,6 +776,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/http/firefox/patches/0022-bmo-1874059-fix-libcxx-18.patch
b/http/firefox/patches/0022-bmo-1874059-fix-libcxx-18.patch
new file mode 100644
index 0000000..b21a93c
--- /dev/null
+++ b/http/firefox/patches/0022-bmo-1874059-fix-libcxx-18.patch
@@ -0,0 +1,16 @@
+--- a/build/moz.configure/toolchain.configure 2024-03-16 22:53:15.409390707
+0000
++++ b/build/moz.configure/toolchain.configure 2024-03-16 22:57:02.661805132
+0000
+@@ -2183,10 +2183,10 @@
+ set_define("_LIBCPP_HIDE_FROM_ABI",
libcxx_override_visibility.hide_from_abi)
+
+
+-@depends(target, build_environment)
+-def visibility_flags(target, env):
++@depends(target, build_environment, c_compiler)
++def visibility_flags(target, env, c_compiler):
+ if target.os != "WINNT":
+- if target.kernel == "Darwin":
++ if target.kernel == "Darwin" or (c_compiler.type == "clang" and
c_compiler.version >= "17.0.0"):
+ return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
+ return (
+ "-I%s/system_wrappers" % os.path.join(env.dist),
\ No newline at end of file
diff --git a/http/firefox/patches/0023-bmo-1874059-fix-libcxx-18.patch
b/http/firefox/patches/0023-bmo-1874059-fix-libcxx-18.patch
deleted file mode 100644
index b21a93c..0000000
--- a/http/firefox/patches/0023-bmo-1874059-fix-libcxx-18.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/build/moz.configure/toolchain.configure 2024-03-16 22:53:15.409390707
+0000
-+++ b/build/moz.configure/toolchain.configure 2024-03-16 22:57:02.661805132
+0000
-@@ -2183,10 +2183,10 @@
- set_define("_LIBCPP_HIDE_FROM_ABI",
libcxx_override_visibility.hide_from_abi)
-
-
--@depends(target, build_environment)
--def visibility_flags(target, env):
-+@depends(target, build_environment, c_compiler)
-+def visibility_flags(target, env, c_compiler):
- if target.os != "WINNT":
-- if target.kernel == "Darwin":
-+ if target.kernel == "Darwin" or (c_compiler.type == "clang" and
c_compiler.version >= "17.0.0"):
- return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
- return (
- "-I%s/system_wrappers" % os.path.join(env.dist),
\ No newline at end of file
diff --git a/http/firefox/patches/0023-dont-use-build-id.patch
b/http/firefox/patches/0023-dont-use-build-id.patch
new file mode 100644
index 0000000..4ec8ac1
--- /dev/null
+++ b/http/firefox/patches/0023-dont-use-build-id.patch
@@ -0,0 +1,13 @@
+diff '--color=auto' -Naur a/build/moz.configure/flags.configure
b/build/moz.configure/flags.configure
+--- a/build/moz.configure/flags.configure 2024-07-08 20:04:44.944708403
+0300
++++ b/build/moz.configure/flags.configure 2024-07-08 20:13:30.867064722
+0300
+@@ -197,9 +197,6 @@
+
+ check_and_add_flag("-pipe", when=building_with_gcc)
+
+-check_and_add_linker_flag("-Wl,--build-id=uuid", when=check_build_id_uuid)
+-check_and_add_linker_flag("-Wl,--build-id=sha1", when=check_build_id_sha1)
+-
+ check_and_add_asm_flag("-Wa,--noexecstack",
when=building_with_gnu_compatible_cc)
+ check_and_add_linker_flag("-Wl,-z,noexecstack",
when=building_with_gnu_compatible_cc)
+ check_and_add_linker_flag("-Wl,-z,text",
when=building_with_gnu_compatible_cc)
diff --git a/http/firefox/patches/0024-dont-use-build-id.patch
b/http/firefox/patches/0024-dont-use-build-id.patch
deleted file mode 100644
index 4ec8ac1..0000000
--- a/http/firefox/patches/0024-dont-use-build-id.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff '--color=auto' -Naur a/build/moz.configure/flags.configure
b/build/moz.configure/flags.configure
---- a/build/moz.configure/flags.configure 2024-07-08 20:04:44.944708403
+0300
-+++ b/build/moz.configure/flags.configure 2024-07-08 20:13:30.867064722
+0300
-@@ -197,9 +197,6 @@
-
- check_and_add_flag("-pipe", when=building_with_gcc)
-
--check_and_add_linker_flag("-Wl,--build-id=uuid", when=check_build_id_uuid)
--check_and_add_linker_flag("-Wl,--build-id=sha1", when=check_build_id_sha1)
--
- check_and_add_asm_flag("-Wa,--noexecstack",
when=building_with_gnu_compatible_cc)
- check_and_add_linker_flag("-Wl,-z,noexecstack",
when=building_with_gnu_compatible_cc)
- check_and_add_linker_flag("-Wl,-z,text",
when=building_with_gnu_compatible_cc)
diff --git
a/http/firefox/patches/0024-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
b/http/firefox/patches/0024-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
new file mode 100644
index 0000000..1fca899
--- /dev/null
+++
b/http/firefox/patches/0024-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
@@ -0,0 +1,14 @@
+diff -Naur a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+--- a/media/ffvpx/libavcodec/moz.build 2024-06-07 00:33:58.000000000 +0300
++++ b/media/ffvpx/libavcodec/moz.build 2024-06-10 21:13:44.142620997 +0300
+@@ -143,6 +143,10 @@
+ c11_flags = ["-std=gnu11"]
+ if CONFIG["CC_TYPE"] == "clang-cl":
+ c11_flags.insert(0, "-Xclang")
++
++if CONFIG["CC_TYPE"] == "gcc" and int(CONFIG["CC_VERSION"].split(".")[0])
>= 14:
++ c11_flags.insert(0, "-Wno-error=incompatible-pointer-types")
++
+ CFLAGS += c11_flags
+
+ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
diff --git
a/http/firefox/patches/0025-bgo-925101-force-software-rendering-during-pgo-build.patch
b/http/firefox/patches/0025-bgo-925101-force-software-rendering-during-pgo-build.patch
new file mode 100644
index 0000000..7f4b987
--- /dev/null
+++
b/http/firefox/patches/0025-bgo-925101-force-software-rendering-during-pgo-build.patch
@@ -0,0 +1,16 @@
+
+bgo#925101 for some unknown reason some users are having issues with pgo
crashing. Forcing software
+rendering to be used while pgo'ing doesn't have an impact in performance, as
hwaccel isn't used
+during pgo even when it works. The issue could be caused by
wrongly/automatically
+configured/detected gpu access anyway. The issue seems related to mesa, but
hard to pinpoint.
+
+diff '--color=auto' -Naur a/testing/profiles/profileserver/user.js
b/testing/profiles/profileserver/user.js
+--- a/testing/profiles/profileserver/user.js 2024-07-11 10:37:53.889115118
+0300
++++ b/testing/profiles/profileserver/user.js 2024-07-11 10:40:23.086996283
+0300
+@@ -11,3 +11,6 @@
+ user_pref("extensions.webextensions.warnings-as-errors", false);
+ // Turn off update
+ user_pref("app.update.disabledForTesting", true);
++// bgo#925101 mesa issues with pgo, force software rendering during pgo
++user_pref("gfx.webrender.software", true);
++
diff --git
a/http/firefox/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
b/http/firefox/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
deleted file mode 100644
index 1fca899..0000000
---
a/http/firefox/patches/0025-mozilla-bundled-ffmpeg-7-gcc-14-incompatible-pointer-types.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -Naur a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
---- a/media/ffvpx/libavcodec/moz.build 2024-06-07 00:33:58.000000000 +0300
-+++ b/media/ffvpx/libavcodec/moz.build 2024-06-10 21:13:44.142620997 +0300
-@@ -143,6 +143,10 @@
- c11_flags = ["-std=gnu11"]
- if CONFIG["CC_TYPE"] == "clang-cl":
- c11_flags.insert(0, "-Xclang")
-+
-+if CONFIG["CC_TYPE"] == "gcc" and int(CONFIG["CC_VERSION"].split(".")[0])
>= 14:
-+ c11_flags.insert(0, "-Wno-error=incompatible-pointer-types")
-+
- CFLAGS += c11_flags
-
- if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
diff --git a/http/firefox/patches/0026-bgo-929967-fix-pgo-on-musl.patch
b/http/firefox/patches/0026-bgo-929967-fix-pgo-on-musl.patch
new file mode 100644
index 0000000..3c8457e
--- /dev/null
+++ b/http/firefox/patches/0026-bgo-929967-fix-pgo-on-musl.patch
@@ -0,0 +1,14 @@
+diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
+index 7354714..0385792 100755
+--- a/build/pgo/profileserver.py
++++ b/build/pgo/profileserver.py
+@@ -171,6 +171,9 @@ if __name__ == "__main__":
+ env["UPLOAD_PATH"], "profile-run-1.log"
+ )
+
++ # Workaround for https://bugs.gentoo.org/929967
++ env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin")
++
+ # Run Firefox a first time to initialize its profile
+ runner = FirefoxRunner(
+ profile=profile,
diff --git
a/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
b/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
deleted file mode 100644
index 8f8f9cb..0000000
--- a/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
+++ /dev/null
@@ -1,368 +0,0 @@
-diff --git a/widget/gtk/MozContainerSurfaceLock.cpp
b/widget/gtk/MozContainerSurfaceLock.cpp
-new file mode 100644
---- /dev/null
-+++ b/widget/gtk/MozContainerSurfaceLock.cpp
-@@ -0,0 +1,31 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2
-*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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 "MozContainerSurfaceLock.h"
-+#include "MozContainer.h"
-+#include "WidgetUtilsGtk.h"
-+
-+using namespace mozilla::widget;
-+
-+MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) {
-+#ifdef MOZ_WAYLAND
-+ mContainer = aContainer;
-+ if (GdkIsWaylandDisplay()) {
-+ // mSurface can be nullptr if we lock hidden MozContainer and
-+ // that's correct, MozContainer is still locked.
-+ mSurface = moz_container_wayland_surface_lock(aContainer);
-+ }
-+#endif
-+}
-+
-+MozContainerSurfaceLock::~MozContainerSurfaceLock() {
-+#ifdef MOZ_WAYLAND
-+ if (GdkIsWaylandDisplay()) {
-+ moz_container_wayland_surface_unlock(mContainer, &mSurface);
-+ }
-+#endif
-+}
-+
-+struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface;
}
-diff --git a/widget/gtk/MozContainerSurfaceLock.h
b/widget/gtk/MozContainerSurfaceLock.h
-new file mode 100644
---- /dev/null
-+++ b/widget/gtk/MozContainerSurfaceLock.h
-@@ -0,0 +1,28 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2
-*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+#ifndef widget_gtk_MozContainerSurfaceLock_h
-+#define widget_gtk_MozContainerSurfaceLock_h
-+
-+struct wl_surface;
-+struct _MozContainer;
-+typedef struct _MozContainer MozContainer;
-+
-+class MozContainerSurfaceLock {
-+ public:
-+ explicit MozContainerSurfaceLock(MozContainer* aContainer);
-+ ~MozContainerSurfaceLock();
-+
-+ // wl_surface can be nullptr if we lock hidden MozContainer.
-+ struct wl_surface* GetSurface();
-+
-+ private:
-+#ifdef MOZ_WAYLAND
-+ MozContainer* mContainer = nullptr;
-+#endif
-+ struct wl_surface* mSurface = nullptr;
-+};
-+
-+#endif // widget_gtk_MozContainerSurfaceLock_h
-diff --git a/widget/gtk/MozContainerWayland.cpp
b/widget/gtk/MozContainerWayland.cpp
---- a/widget/gtk/MozContainerWayland.cpp
-+++ b/widget/gtk/MozContainerWayland.cpp
-@@ -82,33 +82,16 @@ using namespace mozilla;
- using namespace mozilla::widget;
-
- static bool moz_container_wayland_surface_create_locked(
- const MutexAutoLock& aProofOfLock, MozContainer* container);
- static void moz_container_wayland_set_opaque_region_locked(
- const MutexAutoLock& aProofOfLock, MozContainer* container,
- const LayoutDeviceIntRegion&);
-
--// Lock mozcontainer and get wayland surface of it. You need to pair with
--// moz_container_wayland_surface_unlock() even
--// if moz_container_wayland_surface_lock() fails and returns nullptr.
--static struct wl_surface* moz_container_wayland_surface_lock(
-- MozContainer* container);
--static void moz_container_wayland_surface_unlock(MozContainer* container,
-- struct wl_surface**
surface);
--
--MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) {
-- mContainer = aContainer;
-- mSurface = moz_container_wayland_surface_lock(aContainer);
--}
--MozContainerSurfaceLock::~MozContainerSurfaceLock() {
-- moz_container_wayland_surface_unlock(mContainer, &mSurface);
--}
--struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface;
}
--
- // Invalidate gtk wl_surface to commit changes to wl_subsurface.
- // wl_subsurface changes are effective when parent surface is commited.
- static void moz_container_wayland_invalidate(MozContainer* container) {
- LOGWAYLAND("moz_container_wayland_invalidate [%p]\n",
- (void*)moz_container_get_nsWindow(container));
-
- GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container));
- if (!window) {
-diff --git a/widget/gtk/MozContainerWayland.h
b/widget/gtk/MozContainerWayland.h
---- a/widget/gtk/MozContainerWayland.h
-+++ b/widget/gtk/MozContainerWayland.h
-@@ -8,16 +8,17 @@
- #ifndef __MOZ_CONTAINER_WAYLAND_H__
- #define __MOZ_CONTAINER_WAYLAND_H__
-
- #include <gtk/gtk.h>
- #include <functional>
- #include <vector>
- #include "mozilla/Mutex.h"
- #include "WindowSurface.h"
-+#include "MozContainerSurfaceLock.h"
-
- /*
- * MozContainer
- *
- * This class serves three purposes in the nsIWidget implementation.
- *
- * - It provides objects to receive signals from GTK for events on native
- * windows.
-@@ -56,25 +57,22 @@ struct MozContainerWayland {
- mozilla::Mutex container_lock{"MozContainerWayland::container_lock"};
- };
-
- struct _MozContainer;
- struct _MozContainerClass;
- typedef struct _MozContainer MozContainer;
- typedef struct _MozContainerClass MozContainerClass;
-
--class MozContainerSurfaceLock {
-- MozContainer* mContainer;
-- struct wl_surface* mSurface;
--
-- public:
-- explicit MozContainerSurfaceLock(MozContainer* aContainer);
-- ~MozContainerSurfaceLock();
-- struct wl_surface* GetSurface();
--};
-+// Lock mozcontainer and get wayland surface of it. You need to pair with
-+// moz_container_wayland_surface_unlock() even
-+// if moz_container_wayland_surface_lock() fails and returns nullptr.
-+struct wl_surface* moz_container_wayland_surface_lock(MozContainer*
container);
-+void moz_container_wayland_surface_unlock(MozContainer* container,
-+ struct wl_surface** surface);
-
- void moz_container_wayland_map(GtkWidget*);
- gboolean moz_container_wayland_map_event(GtkWidget*, GdkEventAny*);
- void moz_container_wayland_size_allocate(GtkWidget*, GtkAllocation*);
- void moz_container_wayland_unmap(GtkWidget*);
-
- struct wl_egl_window* moz_container_wayland_get_egl_window(
- MozContainer* container, double scale);
-diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
---- a/widget/gtk/moz.build
-+++ b/widget/gtk/moz.build
-@@ -28,16 +28,17 @@ if CONFIG["MOZ_WAYLAND"]:
- if CONFIG["MOZ_ENABLE_VAAPI"]:
- DIRS += ["vaapitest"]
-
- if CONFIG["MOZ_ENABLE_V4L2"]:
- DIRS += ["v4l2test"]
-
- EXPORTS += [
- "MozContainer.h",
-+ "MozContainerSurfaceLock.h",
- "nsGTKToolkit.h",
- "nsGtkUtils.h",
- "nsImageToPixbuf.h",
- ]
-
- EXPORTS.mozilla += [
- "GfxInfo.h",
- "GfxInfoUtils.h",
-@@ -66,16 +67,17 @@ UNIFIED_SOURCES += [
- "DMABufLibWrapper.cpp",
- "DMABufSurface.cpp",
- "GfxInfo.cpp",
- "gtk3drawing.cpp",
- "GtkCompositorWidget.cpp",
- "IMContextWrapper.cpp",
- "InProcessGtkCompositorWidget.cpp",
- "MozContainer.cpp",
-+ "MozContainerSurfaceLock.cpp",
- "MPRISServiceHandler.cpp",
- "NativeKeyBindings.cpp",
- "NativeMenuGtk.cpp",
- "NativeMenuSupport.cpp",
- "nsApplicationChooser.cpp",
- "nsAppShell.cpp",
- "nsBidiKeyboard.cpp",
- "nsClipboard.cpp",
-@@ -109,16 +111,17 @@ if CONFIG["MOZ_WAYLAND"]:
- UNIFIED_SOURCES += [
- "MozContainerWayland.cpp",
- "nsClipboardWayland.cpp",
- "nsWaylandDisplay.cpp",
- "WaylandBuffer.cpp",
- "WindowSurfaceWaylandMultiBuffer.cpp",
- ]
- EXPORTS.mozilla.widget += [
-+ "MozContainerSurfaceLock.h",
- "MozContainerWayland.h",
- "nsWaylandDisplay.h",
- "WaylandBuffer.h",
- ]
-
- if CONFIG["MOZ_X11"]:
- UNIFIED_SOURCES += [
- "nsClipboardX11.cpp",
-
-diff --git a/widget/gtk/GtkCompositorWidget.cpp
b/widget/gtk/GtkCompositorWidget.cpp
---- a/widget/gtk/GtkCompositorWidget.cpp
-+++ b/widget/gtk/GtkCompositorWidget.cpp
-@@ -206,10 +206,14 @@ void GtkCompositorWidget::SetRenderingSu
- }
-
- #ifdef MOZ_LOGGING
- bool GtkCompositorWidget::IsPopup() {
- return mWidget ? mWidget->IsPopup() : false;
- }
- #endif
-
-+UniquePtr<MozContainerSurfaceLock> GtkCompositorWidget::LockSurface() {
-+ return mWidget ? mWidget->LockSurface() : nullptr;
-+}
-+
- } // namespace widget
- } // namespace mozilla
-diff --git a/widget/gtk/GtkCompositorWidget.h
b/widget/gtk/GtkCompositorWidget.h
---- a/widget/gtk/GtkCompositorWidget.h
-+++ b/widget/gtk/GtkCompositorWidget.h
-@@ -5,16 +5,18 @@
-
- #ifndef widget_gtk_GtkCompositorWidget_h
- #define widget_gtk_GtkCompositorWidget_h
-
- #include "GLDefs.h"
- #include "mozilla/DataMutex.h"
- #include "mozilla/widget/CompositorWidget.h"
- #include "WindowSurfaceProvider.h"
-+#include "mozilla/UniquePtr.h"
-+#include "MozContainerSurfaceLock.h"
-
- class nsIWidget;
- class nsWindow;
-
- namespace mozilla {
-
- namespace layers {
- class NativeLayerRootWayland;
-@@ -91,16 +93,18 @@ class GtkCompositorWidget : public Compo
- RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() override;
- #endif
-
- // PlatformCompositorWidgetDelegate Overrides
-
- void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize)
override;
- GtkCompositorWidget* AsGtkCompositorWidget() override { return this; }
-
-+ UniquePtr<MozContainerSurfaceLock> LockSurface();
-+
- private:
- #if defined(MOZ_WAYLAND)
- void ConfigureWaylandBackend();
- #endif
- #if defined(MOZ_X11)
- void ConfigureX11Backend(Window aXWindow, bool aShaped);
- #endif
- #ifdef MOZ_LOGGING
-diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
---- a/widget/gtk/nsWindow.cpp
-+++ b/widget/gtk/nsWindow.cpp
-@@ -10271,8 +10271,15 @@ void nsWindow::SetDragSource(GdkDragCont
- mSourceDragContext = aSourceDragContext;
- if (IsPopup() &&
- (widget::GdkIsWaylandDisplay() || widget::IsXWaylandProtocol())) {
- if (auto* menuPopupFrame = GetMenuPopupFrame(GetFrame())) {
- menuPopupFrame->SetIsDragSource(!!aSourceDragContext);
- }
- }
- }
-+
-+UniquePtr<MozContainerSurfaceLock> nsWindow::LockSurface() {
-+ if (mIsDestroyed) {
-+ return nullptr;
-+ }
-+ return MakeUnique<MozContainerSurfaceLock>(mContainer);
-+}
-diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
---- a/widget/gtk/nsWindow.h
-+++ b/widget/gtk/nsWindow.h
-@@ -8,16 +8,17 @@
- #ifndef __nsWindow_h__
- #define __nsWindow_h__
-
- #include <gdk/gdk.h>
- #include <gtk/gtk.h>
-
- #include "CompositorWidget.h"
- #include "MozContainer.h"
-+#include "MozContainerSurfaceLock.h"
- #include "VsyncSource.h"
- #include "mozilla/EventForwards.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/RefPtr.h"
- #include "mozilla/TouchEvents.h"
- #include "mozilla/UniquePtr.h"
- #include "mozilla/RWLock.h"
- #include "mozilla/widget/WindowSurface.h"
-@@ -416,16 +417,18 @@ class nsWindow final : public nsBaseWidg
- static bool TitlebarUseShapeMask();
- bool IsRemoteContent() { return HasRemoteContent(); }
- void NativeMoveResizeWaylandPopupCallback(const GdkRectangle* aFinalSize,
- bool aFlippedX, bool aFlippedY);
- static bool IsToplevelWindowTransparent();
-
- static nsWindow* GetFocusedWindow();
-
-+ mozilla::UniquePtr<MozContainerSurfaceLock> LockSurface();
-+
- #ifdef MOZ_WAYLAND
- // Use xdg-activation protocol to transfer focus from gFocusWindow to
aWindow.
- static void TransferFocusToWaylandWindow(nsWindow* aWindow);
- void FocusWaylandWindow(const char* aTokenID);
-
- bool GetCSDDecorationOffset(int* aDx, int* aDy);
- bool SetEGLNativeWindowSize(const LayoutDeviceIntSize& aEGLWindowSize);
- void WaylandDragWorkaround(GdkEventButton* aEvent);
-
-diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp
b/gfx/webrender_bindings/RenderCompositorEGL.cpp
---- a/gfx/webrender_bindings/RenderCompositorEGL.cpp
-+++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp
-@@ -149,16 +149,26 @@ RenderedFrameId RenderCompositorEGL::End
- const auto width = right - left;
- const auto height = bottom - top;
-
- bufferInvalid.OrWith(
- gfx::IntRect(left, (GetBufferSize().height - bottom), width,
height));
- }
- gl()->SetDamage(bufferInvalid);
- }
-+
-+#ifdef MOZ_WIDGET_GTK
-+ // Rendering on Wayland has to be atomic (buffer attach + commit) and
-+ // wayland surface is also used by main thread so lock it before
-+ // we paint at SwapBuffers().
-+ UniquePtr<MozContainerSurfaceLock> lock;
-+ if (auto* gtkWidget = mWidget->AsGTK()) {
-+ lock = gtkWidget->LockSurface();
-+ }
-+#endif
- gl()->SwapBuffers();
- return frameId;
- }
-
- void RenderCompositorEGL::Pause() { DestroyEGLSurface(); }
-
- bool RenderCompositorEGL::Resume() {
- if (kIsAndroid) {
-
-
diff --git
a/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
b/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
deleted file mode 100644
index 7f4b987..0000000
---
a/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-
-bgo#925101 for some unknown reason some users are having issues with pgo
crashing. Forcing software
-rendering to be used while pgo'ing doesn't have an impact in performance, as
hwaccel isn't used
-during pgo even when it works. The issue could be caused by
wrongly/automatically
-configured/detected gpu access anyway. The issue seems related to mesa, but
hard to pinpoint.
-
-diff '--color=auto' -Naur a/testing/profiles/profileserver/user.js
b/testing/profiles/profileserver/user.js
---- a/testing/profiles/profileserver/user.js 2024-07-11 10:37:53.889115118
+0300
-+++ b/testing/profiles/profileserver/user.js 2024-07-11 10:40:23.086996283
+0300
-@@ -11,3 +11,6 @@
- user_pref("extensions.webextensions.warnings-as-errors", false);
- // Turn off update
- user_pref("app.update.disabledForTesting", true);
-+// bgo#925101 mesa issues with pgo, force software rendering during pgo
-+user_pref("gfx.webrender.software", true);
-+
diff --git
a/http/firefox/patches/0027-bmo-1913286-filter-out-unsupported-devices-for-pipewire-camera-screencasting.patch
b/http/firefox/patches/0027-bmo-1913286-filter-out-unsupported-devices-for-pipewire-camera-screencasting.patch
new file mode 100644
index 0000000..7131aa0
--- /dev/null
+++
b/http/firefox/patches/0027-bmo-1913286-filter-out-unsupported-devices-for-pipewire-camera-screencasting.patch
@@ -0,0 +1,330 @@
+
+# HG changeset patch
+# User Jan Grulich <jgrulich AT redhat.com>
+# Date 1725275240 0
+# Node ID 25415f3c344023667c01089f74b9f0c6fc7b6a56
+# Parent 3071e3421b420019ce714503e0d96f68f0289268
+Bug 1913286 - WebRTC backport: PipeWire camera: filter out devices with no
capabilities r=pehrsons,webrtc-reviewers
+
+Filter out devices that do not support any format supported by WebRTC.
+This will for example be IR cameras that show as duplicated in the list
+of cameras, but support only GRAY8 format and for that reason do not
+work at all.
+
+This is a simple backport of an WebRTC upstream change.
+
+Upstream commit: b4aba7834e6c94adace1cb4c20e2e1ee70eb9cc5
+
+Differential Revision: https://phabricator.services.mozilla.com/D219224
+
+diff --git
a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc
b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc
+---
a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc
++++
b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc
+@@ -52,56 +52,56 @@ int32_t DeviceInfoPipeWire::GetDeviceNam
+ uint32_t
productUniqueIdUTF8Length,
+ pid_t* pid,
+ bool* deviceIsPlaceholder) {
+ RTC_CHECK(pipewire_session_);
+
+ if (deviceNumber >= NumberOfDevices())
+ return -1;
+
+- const PipeWireNode& node = pipewire_session_->nodes().at(deviceNumber);
++ const auto& node = pipewire_session_->nodes().at(deviceNumber);
+
+- if (deviceNameLength <= node.display_name().length()) {
++ if (deviceNameLength <= node->display_name().length()) {
+ RTC_LOG(LS_INFO) << "deviceNameUTF8 buffer passed is too small";
+ return -1;
+ }
+- if (deviceUniqueIdUTF8Length <= node.unique_id().length()) {
++ if (deviceUniqueIdUTF8Length <= node->unique_id().length()) {
+ RTC_LOG(LS_INFO) << "deviceUniqueIdUTF8 buffer passed is too small";
+ return -1;
+ }
+ if (productUniqueIdUTF8 &&
+- productUniqueIdUTF8Length <= node.model_id().length()) {
++ productUniqueIdUTF8Length <= node->model_id().length()) {
+ RTC_LOG(LS_INFO) << "productUniqueIdUTF8 buffer passed is too small";
+ return -1;
+ }
+
+ memset(deviceNameUTF8, 0, deviceNameLength);
+- node.display_name().copy(deviceNameUTF8, deviceNameLength);
++ node->display_name().copy(deviceNameUTF8, deviceNameLength);
+
+ memset(deviceUniqueIdUTF8, 0, deviceUniqueIdUTF8Length);
+- node.unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length);
++ node->unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length);
+
+ if (productUniqueIdUTF8) {
+ memset(productUniqueIdUTF8, 0, productUniqueIdUTF8Length);
+- node.model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length);
++ node->model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length);
+ }
+
+ return 0;
+ }
+
+ int32_t DeviceInfoPipeWire::CreateCapabilityMap(
+ const char* deviceUniqueIdUTF8) {
+ RTC_CHECK(pipewire_session_);
+
+ for (auto& node : pipewire_session_->nodes()) {
+- if (node.unique_id().compare(deviceUniqueIdUTF8) != 0)
++ if (node->unique_id().compare(deviceUniqueIdUTF8) != 0)
+ continue;
+
+- _captureCapabilities = node.capabilities();
+- _lastUsedDeviceNameLength = node.unique_id().length();
++ _captureCapabilities = node->capabilities();
++ _lastUsedDeviceNameLength = node->unique_id().length();
+ _lastUsedDeviceName = static_cast<char*>(
+ realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1));
+ memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8,
+ _lastUsedDeviceNameLength + 1);
+ return _captureCapabilities.size();
+ }
+ return -1;
+ }
+diff --git
a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
+--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
+@@ -47,16 +47,29 @@ VideoType PipeWireRawFormatToVideoType(u
+ return VideoType::kABGR;
+ case SPA_VIDEO_FORMAT_ARGB:
+ return VideoType::kBGRA;
+ default:
+ return VideoType::kUnknown;
+ }
+ }
+
++void PipeWireNode::PipeWireNodeDeleter::operator()(
++ PipeWireNode* node) const noexcept {
++ pw_proxy_destroy(node->proxy_);
++ spa_hook_remove(&node->node_listener_);
++}
++
++// static
++PipeWireNode::PipeWireNodePtr PipeWireNode::Create(PipeWireSession* session,
++ uint32_t id,
++ const spa_dict* props) {
++ return PipeWireNodePtr(new PipeWireNode(session, id, props));
++}
++
+ PipeWireNode::PipeWireNode(PipeWireSession* session,
+ uint32_t id,
+ const spa_dict* props)
+ : session_(session),
+ id_(id),
+ display_name_(spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)),
+ unique_id_(rtc::ToString(id)) {
+ RTC_LOG(LS_VERBOSE) << "Found Camera: " << display_name_;
+@@ -68,21 +81,16 @@ PipeWireNode::PipeWireNode(PipeWireSessi
+ .version = PW_VERSION_NODE_EVENTS,
+ .info = OnNodeInfo,
+ .param = OnNodeParam,
+ };
+
+ pw_node_add_listener(proxy_, &node_listener_, &node_events, this);
+ }
+
+-PipeWireNode::~PipeWireNode() {
+- pw_proxy_destroy(proxy_);
+- spa_hook_remove(&node_listener_);
+-}
+-
+ // static
+ void PipeWireNode::OnNodeInfo(void* data, const pw_node_info* info) {
+ PipeWireNode* that = static_cast<PipeWireNode*>(data);
+
+ if (info->change_mask & PW_NODE_CHANGE_MASK_PROPS) {
+ const char* vid_str;
+ const char* pid_str;
+ absl::optional<int> vid;
+@@ -94,17 +102,19 @@ void PipeWireNode::OnNodeInfo(void* data
+ pid = pid_str ? rtc::StringToNumber<int>(pid_str) : absl::nullopt;
+
+ if (vid && pid) {
+ char model_str[10];
+ snprintf(model_str, sizeof(model_str), "%04x:%04x", vid.value(),
+ pid.value());
+ that->model_id_ = model_str;
+ }
+- } else if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) {
++ }
++
++ if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) {
+ for (uint32_t i = 0; i < info->n_params; i++) {
+ uint32_t id = info->params[i].id;
+ if (id == SPA_PARAM_EnumFormat &&
+ info->params[i].flags & SPA_PARAM_INFO_READ) {
+ pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr);
+ break;
+ }
+ }
+@@ -345,58 +355,67 @@ void PipeWireSession::OnCoreError(void*
+
+ // static
+ void PipeWireSession::OnCoreDone(void* data, uint32_t id, int seq) {
+ PipeWireSession* that = static_cast<PipeWireSession*>(data);
+
+ if (id == PW_ID_CORE) {
+ if (seq == that->sync_seq_) {
+ RTC_LOG(LS_VERBOSE) << "Enumerating PipeWire camera devices
complete.";
++
++ // Remove camera devices with no capabilities
++ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(),
++ [](const PipeWireNode::PipeWireNodePtr&
node) {
++ return node->capabilities().empty();
++ });
++ that->nodes_.erase(it, that->nodes_.end());
++
+ that->Finish(VideoCaptureOptions::Status::SUCCESS);
+ }
+ }
+ }
+
+ // static
+ void PipeWireSession::OnRegistryGlobal(void* data,
+ uint32_t id,
+ uint32_t permissions,
+ const char* type,
+ uint32_t version,
+ const spa_dict* props) {
+ PipeWireSession* that = static_cast<PipeWireSession*>(data);
+
+ // Skip already added nodes to avoid duplicate camera entries
+ if (std::find_if(that->nodes_.begin(), that->nodes_.end(),
+- [id](const PipeWireNode& node) {
+- return node.id() == id;
++ [id](const PipeWireNode::PipeWireNodePtr& node) {
++ return node->id() == id;
+ }) != that->nodes_.end())
+ return;
+
+ if (type != absl::string_view(PW_TYPE_INTERFACE_Node))
+ return;
+
+ if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION))
+ return;
+
+ auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE);
+ if (!node_role || strcmp(node_role, "Camera"))
+ return;
+
+- that->nodes_.emplace_back(that, id, props);
++ that->nodes_.push_back(PipeWireNode::Create(that, id, props));
+ that->PipeWireSync();
+ }
+
+ // static
+ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) {
+ PipeWireSession* that = static_cast<PipeWireSession*>(data);
+
+- auto it = std::remove_if(
+- that->nodes_.begin(), that->nodes_.end(),
+- [id](const PipeWireNode& node) { return node.id() == id; });
++ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(),
++ [id](const PipeWireNode::PipeWireNodePtr& node) {
++ return node->id() == id;
++ });
+ that->nodes_.erase(it, that->nodes_.end());
+ }
+
+ void PipeWireSession::Finish(VideoCaptureOptions::Status status) {
+ webrtc::MutexLock lock(&callback_lock_);
+
+ if (callback_) {
+ callback_->OnInitialized(status);
+diff --git
a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h
b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h
+--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h
++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h
+@@ -32,27 +32,37 @@ namespace videocapturemodule {
+ class PipeWireSession;
+ class VideoCaptureModulePipeWire;
+
+ // PipeWireNode objects are the local representation of PipeWire node
objects.
+ // The portal API ensured that only camera nodes are visible to the client.
+ // So they all represent one camera that is available via PipeWire.
+ class PipeWireNode {
+ public:
+- PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict*
props);
+- ~PipeWireNode();
++ struct PipeWireNodeDeleter {
++ void operator()(PipeWireNode* node) const noexcept;
++ };
++
++ using PipeWireNodePtr =
++ std::unique_ptr<PipeWireNode, PipeWireNode::PipeWireNodeDeleter>;
++ static PipeWireNodePtr Create(PipeWireSession* session,
++ uint32_t id,
++ const spa_dict* props);
+
+ uint32_t id() const { return id_; }
+ std::string display_name() const { return display_name_; }
+ std::string unique_id() const { return unique_id_; }
+ std::string model_id() const { return model_id_; }
+ std::vector<VideoCaptureCapability> capabilities() const {
+ return capabilities_;
+ }
+
++ protected:
++ PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict*
props);
++
+ private:
+ static void OnNodeInfo(void* data, const pw_node_info* info);
+ static void OnNodeParam(void* data,
+ int seq,
+ uint32_t id,
+ uint32_t index,
+ uint32_t next,
+ const spa_pod* param);
+@@ -82,18 +92,19 @@ class CameraPortalNotifier : public Came
+
+ class PipeWireSession : public rtc::RefCountedNonVirtual<PipeWireSession> {
+ public:
+ PipeWireSession();
+ ~PipeWireSession();
+
+ void Init(VideoCaptureOptions::Callback* callback,
+ int fd = kInvalidPipeWireFd);
+-
+- const std::deque<PipeWireNode>& nodes() const { return nodes_; }
++ const std::deque<PipeWireNode::PipeWireNodePtr>& nodes() const {
++ return nodes_;
++ }
+
+ friend class CameraPortalNotifier;
+ friend class PipeWireNode;
+ friend class VideoCaptureModulePipeWire;
+
+ private:
+ void InitPipeWire(int fd);
+ bool StartPipeWire(int fd);
+@@ -129,17 +140,17 @@ class PipeWireSession : public rtc::RefC
+ struct pw_core* pw_core_ = nullptr;
+ struct spa_hook core_listener_;
+
+ struct pw_registry* pw_registry_ = nullptr;
+ struct spa_hook registry_listener_;
+
+ int sync_seq_ = 0;
+
+- std::deque<PipeWireNode> nodes_;
++ std::deque<PipeWireNode::PipeWireNodePtr> nodes_;
+ std::unique_ptr<CameraPortal> portal_;
+ std::unique_ptr<CameraPortalNotifier> portal_notifier_;
+ };
+
+ } // namespace videocapturemodule
+ } // namespace webrtc
+
+ #endif // MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_
+diff --git
a/third_party/libwebrtc/moz-patch-stack/b4aba7834e.no-op-cherry-pick-msg
b/third_party/libwebrtc/moz-patch-stack/b4aba7834e.no-op-cherry-pick-msg
+new file mode 100644
+--- /dev/null
++++ b/third_party/libwebrtc/moz-patch-stack/b4aba7834e.no-op-cherry-pick-msg
+@@ -0,0 +1,1 @@
++We cherry-picked this in bug 1913286.
+
diff --git
a/http/firefox/patches/0028-bmo-1902227-backport-ffmpeg-av1-vaapi-fixes-for-mesa-24.0.7plus.patch
b/http/firefox/patches/0028-bmo-1902227-backport-ffmpeg-av1-vaapi-fixes-for-mesa-24.0.7plus.patch
deleted file mode 100644
index 43107eb..0000000
---
a/http/firefox/patches/0028-bmo-1902227-backport-ffmpeg-av1-vaapi-fixes-for-mesa-24.0.7plus.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-
-# HG changeset patch
-# User stransky <stransky AT redhat.com>
-# Date 1721296887 0
-# Node ID a782319319be064da7dce5e0964a2954a2fef8ff
-# Parent 046f0f522ce779aa3c9e170f248780cf312103a6
-Bug 1902227 [Linux/VA-API] Backport AV1/VA-API playback fix for AMD/mesa >
24.0.7 r=padenot
-
-Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29400
-Allows to use multiple slices for AV1 VA-API decode.
-
-Differential Revision: https://phabricator.services.mozilla.com/D216919
-
-diff --git a/media/ffvpx/libavcodec/vaapi_av1.c
b/media/ffvpx/libavcodec/vaapi_av1.c
---- a/media/ffvpx/libavcodec/vaapi_av1.c
-+++ b/media/ffvpx/libavcodec/vaapi_av1.c
-@@ -14,16 +14,17 @@
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
- */
-
- #include "libavutil/frame.h"
-+#include "libavutil/mem.h"
- #include "hwaccel_internal.h"
- #include "vaapi_decode.h"
- #include "internal.h"
- #include "av1dec.h"
- #include "thread.h"
-
- typedef struct VAAPIAV1FrameRef {
- AVFrame *frame;
-@@ -37,16 +38,19 @@ typedef struct VAAPIAV1DecContext {
- * For film grain case, VAAPI generate 2 output for each frame,
- * current_frame will not apply film grain, and will be used for
- * references for next frames. Maintain the reference list without
- * applying film grain here. And current_display_picture will be
- * used to apply film grain and push to downstream.
- */
- VAAPIAV1FrameRef ref_tab[AV1_NUM_REF_FRAMES];
- AVFrame *tmp_frame;
-+
-+ int nb_slice_params;
-+ VASliceParameterBufferAV1 *slice_params;
- } VAAPIAV1DecContext;
-
- static VASurfaceID vaapi_av1_surface_id(AV1Frame *vf)
- {
- if (vf)
- return ff_vaapi_get_surface_id(vf->f);
- else
- return VA_INVALID_SURFACE;
-@@ -92,16 +96,18 @@ static int vaapi_av1_decode_uninit(AVCod
- {
- VAAPIAV1DecContext *ctx = avctx->internal->hwaccel_priv_data;
-
- av_frame_free(&ctx->tmp_frame);
-
- for (int i = 0; i < FF_ARRAY_ELEMS(ctx->ref_tab); i++)
- av_frame_free(&ctx->ref_tab[i].frame);
-
-+ av_freep(&ctx->slice_params);
-+
- return ff_vaapi_decode_uninit(avctx);
- }
-
-
- static int vaapi_av1_start_frame(AVCodecContext *avctx,
- av_unused const uint8_t *buffer,
- av_unused uint32_t size)
- {
-@@ -388,43 +394,56 @@ static int vaapi_av1_end_frame(AVCodecCo
- }
-
- static int vaapi_av1_decode_slice(AVCodecContext *avctx,
- const uint8_t *buffer,
- uint32_t size)
- {
- const AV1DecContext *s = avctx->priv_data;
- VAAPIDecodePicture *pic = s->cur_frame.hwaccel_picture_private;
-- VASliceParameterBufferAV1 slice_param;
-- int err = 0;
-+ VAAPIAV1DecContext *ctx = avctx->internal->hwaccel_priv_data;
-+ int err, nb_params;
-+
-+ nb_params = s->tg_end - s->tg_start + 1;
-+ if (ctx->nb_slice_params < nb_params) {
-+ ctx->slice_params = av_realloc_array(ctx->slice_params,
-+ nb_params,
-+ sizeof(*ctx->slice_params));
-+ if (!ctx->slice_params) {
-+ ctx->nb_slice_params = 0;
-+ err = AVERROR(ENOMEM);
-+ goto fail;
-+ }
-+ ctx->nb_slice_params = nb_params;
-+ }
-
- for (int i = s->tg_start; i <= s->tg_end; i++) {
-- memset(&slice_param, 0, sizeof(VASliceParameterBufferAV1));
--
-- slice_param = (VASliceParameterBufferAV1) {
-+ ctx->slice_params[i - s->tg_start] = (VASliceParameterBufferAV1) {
- .slice_data_size = s->tile_group_info[i].tile_size,
- .slice_data_offset = s->tile_group_info[i].tile_offset,
- .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
- .tile_row = s->tile_group_info[i].tile_row,
- .tile_column = s->tile_group_info[i].tile_column,
- .tg_start = s->tg_start,
- .tg_end = s->tg_end,
- };
--
-- err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &slice_param,
--
sizeof(VASliceParameterBufferAV1),
-- buffer,
-- size);
-- if (err) {
-- ff_vaapi_decode_cancel(avctx, pic);
-- return err;
-- }
- }
-
-+ err = ff_vaapi_decode_make_slice_buffer(avctx, pic, ctx->slice_params,
nb_params,
-+
sizeof(VASliceParameterBufferAV1),
-+ buffer,
-+ size);
-+ if (err)
-+ goto fail;
-+
- return 0;
-+
-+fail:
-+ ff_vaapi_decode_cancel(avctx, pic);
-+ return err;
- }
-
- const FFHWAccel ff_av1_vaapi_hwaccel = {
- .p.name = "av1_vaapi",
- .p.type = AVMEDIA_TYPE_VIDEO,
- .p.id = AV_CODEC_ID_AV1,
- .p.pix_fmt = AV_PIX_FMT_VAAPI,
- .start_frame = vaapi_av1_start_frame,
-diff --git a/media/ffvpx/libavcodec/vaapi_decode.c
b/media/ffvpx/libavcodec/vaapi_decode.c
---- a/media/ffvpx/libavcodec/vaapi_decode.c
-+++ b/media/ffvpx/libavcodec/vaapi_decode.c
-@@ -58,16 +58,17 @@ int ff_vaapi_decode_make_param_buffer(AV
- "is %#x.\n", type, size, buffer);
- return 0;
- }
-
-
- int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
- VAAPIDecodePicture *pic,
- const void *params_data,
-+ int nb_params,
- size_t params_size,
- const void *slice_data,
- size_t slice_size)
- {
- VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
- VAStatus vas;
- int index;
-
-@@ -83,17 +84,17 @@ int ff_vaapi_decode_make_slice_buffer(AV
- pic->slices_allocated = pic->slices_allocated ?
pic->slices_allocated * 2 : 64;
- }
- av_assert0(pic->nb_slices + 1 <= pic->slices_allocated);
-
- index = 2 * pic->nb_slices;
-
- vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
- VASliceParameterBufferType,
-- params_size, 1, (void*)params_data,
-+ params_size, nb_params, (void*)params_data,
- &pic->slice_buffers[index]);
- if (vas != VA_STATUS_SUCCESS) {
- av_log(avctx, AV_LOG_ERROR, "Failed to create slice "
- "parameter buffer: %d (%s).\n", vas, vaErrorStr(vas));
- return AVERROR(EIO);
- }
-
- av_log(avctx, AV_LOG_DEBUG, "Slice %d param buffer (%zu bytes) "
-diff --git a/media/ffvpx/libavcodec/vaapi_decode.h
b/media/ffvpx/libavcodec/vaapi_decode.h
---- a/media/ffvpx/libavcodec/vaapi_decode.h
-+++ b/media/ffvpx/libavcodec/vaapi_decode.h
-@@ -68,16 +68,17 @@ int ff_vaapi_decode_make_param_buffer(AV
- VAAPIDecodePicture *pic,
- int type,
- const void *data,
- size_t size);
-
- int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
- VAAPIDecodePicture *pic,
- const void *params_data,
-+ int nb_params,
- size_t params_size,
- const void *slice_data,
- size_t slice_size);
-
- int ff_vaapi_decode_issue(AVCodecContext *avctx,
- VAAPIDecodePicture *pic);
- int ff_vaapi_decode_cancel(AVCodecContext *avctx,
- VAAPIDecodePicture *pic);
-diff --git a/media/ffvpx/libavcodec/vaapi_vp8.c
b/media/ffvpx/libavcodec/vaapi_vp8.c
---- a/media/ffvpx/libavcodec/vaapi_vp8.c
-+++ b/media/ffvpx/libavcodec/vaapi_vp8.c
-@@ -204,17 +204,17 @@ static int vaapi_vp8_decode_slice(AVCode
- s->coder_state_at_header_end.bit_count - 8),
- .num_of_partitions = s->num_coeff_partitions + 1,
- };
-
- sp.partition_size[0] = s->header_partition_size -
((sp.macroblock_offset + 7) / 8);
- for (i = 0; i < 8; i++)
- sp.partition_size[i+1] = s->coeff_partition_size[i];
-
-- err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, sizeof(sp),
data, data_size);
-+ err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, 1, sizeof(sp),
data, data_size);
- if (err)
- goto fail;
-
- return 0;
-
- fail:
- ff_vaapi_decode_cancel(avctx, pic);
- return err;
-diff --git a/media/ffvpx/libavcodec/vaapi_vp9.c
b/media/ffvpx/libavcodec/vaapi_vp9.c
---- a/media/ffvpx/libavcodec/vaapi_vp9.c
-+++ b/media/ffvpx/libavcodec/vaapi_vp9.c
-@@ -153,17 +153,17 @@ static int vaapi_vp9_decode_slice(AVCode
- .chroma_dc_quant_scale =
h->h.segmentation.feat[i].qmul[1][0],
- .chroma_ac_quant_scale =
h->h.segmentation.feat[i].qmul[1][1],
- };
-
- memcpy(slice_param.seg_param[i].filter_level,
h->h.segmentation.feat[i].lflvl,
sizeof(slice_param.seg_param[i].filter_level));
- }
-
- err = ff_vaapi_decode_make_slice_buffer(avctx, pic,
-- &slice_param,
sizeof(slice_param),
-+ &slice_param, 1,
sizeof(slice_param),
- buffer, size);
- if (err) {
- ff_vaapi_decode_cancel(avctx, pic);
- return err;
- }
-
- return 0;
- }
-
diff --git
a/http/firefox/patches/0029-bmo-1912663-cbindgen-0.27.0-fixes.patch
b/http/firefox/patches/0029-bmo-1912663-cbindgen-0.27.0-fixes.patch
deleted file mode 100644
index 3904ac7..0000000
--- a/http/firefox/patches/0029-bmo-1912663-cbindgen-0.27.0-fixes.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-diff --git a/servo/components/style_traits/values.rs
b/servo/components/style_traits/values.rs
---- a/servo/components/style_traits/values.rs
-+++ b/servo/components/style_traits/values.rs
-@@ -387,15 +387,15 @@
- mut parse_one: F,
- ) -> Result<Vec<T>, ParseError<'i, E>>
- where
- F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i,
E>>,
- {
-- input.skip_whitespace(); // Unnecessary for correctness, but may
help try() rewind less.
-+ input.skip_whitespace(); // Unnecessary for correctness, but may
help try_parse() rewind less.
- let mut results = vec![parse_one(input)?];
- loop {
-- input.skip_whitespace(); // Unnecessary for correctness, but
may help try() rewind less.
-- if let Ok(item) = input.try(&mut parse_one) {
-+ input.skip_whitespace(); // Unnecessary for correctness, but
may help try_parse() rewind less.
-+ if let Ok(item) = input.try_parse(&mut parse_one) {
- results.push(item);
- } else {
- return Ok(results);
- }
- }
-@@ -412,18 +412,18 @@
- mut parse_one: F,
- ) -> Result<Vec<T>, ParseError<'i, E>>
- where
- F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i,
E>>,
- {
-- input.skip_whitespace(); // Unnecessary for correctness, but may
help try() rewind less.
-+ input.skip_whitespace(); // Unnecessary for correctness, but may
help try_parse() rewind less.
- let mut results = vec![parse_one(input)?];
- loop {
-- input.skip_whitespace(); // Unnecessary for correctness, but
may help try() rewind less.
-+ input.skip_whitespace(); // Unnecessary for correctness, but
may help try_parse() rewind less.
- let comma_location = input.current_source_location();
-- let comma = input.try(|i| i.expect_comma()).is_ok();
-- input.skip_whitespace(); // Unnecessary for correctness, but
may help try() rewind less.
-- if let Ok(item) = input.try(&mut parse_one) {
-+ let comma = input.try_parse(|i| i.expect_comma()).is_ok();
-+ input.skip_whitespace(); // Unnecessary for correctness, but
may help try_parse() rewind less.
-+ if let Ok(item) = input.try_parse(&mut parse_one) {
- results.push(item);
- } else if comma {
- return
Err(comma_location.new_unexpected_token_error(Token::Comma));
- } else {
- break;
-diff --git a/servo/ports/geckolib/cbindgen.toml
b/servo/ports/geckolib/cbindgen.toml
---- a/servo/ports/geckolib/cbindgen.toml
-+++ b/servo/ports/geckolib/cbindgen.toml
-@@ -360,11 +360,10 @@
- "gfxFontVariation" = "gfxFontVariation"
- "URLExtraData" = "URLExtraData"
- "Keyframe" = "Keyframe"
- "nsChangeHint" = "nsChangeHint"
- "ServoElementSnapshotTable" = "ServoElementSnapshotTable"
--"Keyframe" = "Keyframe"
- "ComputedKeyframeValues" = "ComputedKeyframeValues"
- "OriginFlags" = "OriginFlags"
- "ServoTraversalFlags" = "ServoTraversalFlags"
- "ServoStyleSetSizes" = "ServoStyleSetSizes"
- "BeforeFlag" = "StyleEasingBeforeFlag"
-
diff --git a/http/firefox/patches/0030-bgo-929967-fix-pgo-on-musl.patch
b/http/firefox/patches/0030-bgo-929967-fix-pgo-on-musl.patch
deleted file mode 100644
index 3c8457e..0000000
--- a/http/firefox/patches/0030-bgo-929967-fix-pgo-on-musl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
-index 7354714..0385792 100755
---- a/build/pgo/profileserver.py
-+++ b/build/pgo/profileserver.py
-@@ -171,6 +171,9 @@ if __name__ == "__main__":
- env["UPLOAD_PATH"], "profile-run-1.log"
- )
-
-+ # Workaround for https://bugs.gentoo.org/929967
-+ env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin")
-+
- # Run Firefox a first time to initialize its profile
- runner = FirefoxRunner(
- profile=profile,
- [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (384eafbcb5e0dd73e801af78358351127e6840e0), Pavel Vinogradov, 09/04/2024
Archive powered by MHonArc 2.6.24.