New commits:
commit cd83f7a98d81a31086a9ddde77dc4b4782ad391a
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
b/http/firefox/patches/0028-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
new file mode 100644
index 0000000..4d5edb4
--- /dev/null
+++
b/http/firefox/patches/0028-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
@@ -0,0 +1,150 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla AT glandium.org>
+# Date 1690956771 0
+# Node ID b3c797d9f72325bd693c43ff9a1b110e6af964b2
+# Parent 7ee1dad073d03db2f730fd5c2baf77f37e458feb
+Bug 1844484 - Override the symbol used by compilers in vtables for pure
virtual methods. r=firefox-build-system-reviewers,ahochheiden
+
+In bug 1839743, we made the build system prefer packed relative
+relocations to elfhack when both the system libc and linker support
+them. Unfortunately, while that covers most of the benefits from
+elfhack, it doesn't cover bug 651892.
+
+To cover it, we make every C++ executable contain its own copy of
+the symbol, so that all relocations related to it become relative.
+
+And because this is actually (slightly) beneficial on macos, and because
+it's also an advantage to have our own abort called rather than the
+system's, we apply the same to all platforms.
+
+Differential Revision: https://phabricator.services.mozilla.com/D184068
+
+diff --git a/build/pure_virtual/moz.build b/build/pure_virtual/moz.build
+new file mode 100644
+--- /dev/null
++++ b/build/pure_virtual/moz.build
+@@ -0,0 +1,23 @@
++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
++# vim: set filetype=python:
++# 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/.
++
++Library("pure_virtual")
++
++SOURCES += ["pure_virtual.c"]
++
++FORCE_STATIC_LIB = True
++
++USE_STATIC_LIBS = True
++
++# Build a real library so that the linker can remove it if the symbol
++# is never used.
++NO_EXPAND_LIBS = True
++
++# LTO can mess things up.
++if CONFIG["CC_TYPE"] == "clang-cl":
++ CFLAGS += ["-clang:-fno-lto"]
++else:
++ CFLAGS += ["-fno-lto"]
+diff --git a/build/pure_virtual/pure_virtual.c
b/build/pure_virtual/pure_virtual.c
+new file mode 100644
+--- /dev/null
++++ b/build/pure_virtual/pure_virtual.c
+@@ -0,0 +1,27 @@
++/* 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 <mozilla/Assertions.h>
++
++// This function is used in vtables to point at pure virtual methods.
++// The implementation in the standard library usually aborts, but
++// the function is normally never called (a call would be a bug).
++// Each of these entries in vtables, however, require an unnecessary
++// dynamic relocation. Defining our own function makes the linker
++// point the vtables here instead of the standard library, replacing
++// the dynamic relocations with relative relocations.
++//
++// On Windows, it doesn't really make a difference, but on macOS it
++// can be packed better, saving about 10KB in libxul, and on 64-bits
++// ELF systems, with packed relative relocations, it saves 140KB.
++//
++// Another advantage of having our own is that we can use MOZ_CRASH
++// instead of the system's abort.
++#ifdef _MSC_VER
++int __cdecl _purecall() { MOZ_CRASH("pure virtual call"); }
++#else
++__attribute__((visibility("hidden"))) void __cxa_pure_virtual() {
++ MOZ_CRASH("pure virtual call");
++}
++#endif
+diff --git a/mfbt/moz.build b/mfbt/moz.build
+--- a/mfbt/moz.build
++++ b/mfbt/moz.build
+@@ -200,8 +200,13 @@ SOURCES += [
+ SOURCES["lz4/xxhash.c"].flags += ["-Wno-unused-function"]
+
+ DisableStlWrapping()
+
+ if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
+ OS_LIBS += ["atomic"]
+
+ DEFINES["LZ4LIB_VISIBILITY"] = ""
++
++# This is kind of gross because this is not a subdirectory,
++# but pure_virtual requires mfbt to build and some projects
++# don't use mfbt.
++DIRS += ["../build/pure_virtual"]
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py
b/python/mozbuild/mozbuild/frontend/emitter.py
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -383,16 +383,18 @@ class TreeMetadataEmitter(LoggingMixin):
+ if (
+ context.config.substs.get("MOZ_STDCXX_COMPAT")
+ and context.config.substs.get(self.ARCH_VAR.get(obj.KIND))
== "Linux"
+ ):
+ self._link_library(
+ context, obj, variable, self.STDCXXCOMPAT_NAME[obj.KIND]
+ )
+ if obj.KIND == "target":
++ if "pure_virtual" in self._libs:
++ self._link_library(context, obj, variable,
"pure_virtual")
+ for lib in context.config.substs.get("STLPORT_LIBS", []):
+ obj.link_system_library(lib)
+
+ def _link_library(self, context, obj, variable, path):
+ force_static = path.startswith("static:") and obj.KIND == "target"
+ if force_static:
+ path = path[7:]
+ name = mozpath.basename(path)
+diff --git a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
+--- a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
++++ b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
+@@ -1,24 +1,16 @@
+ add_task(async function run_test() {
+ if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
+ dump(
+ "INFO | test_crash_purevirtual.js | Can't test crashreporter in a
non-libxul build.\n"
+ );
+ return;
+ }
+
+- var isOSX = "nsILocalFileMac" in Ci;
+- if (isOSX) {
+- dump(
+- "INFO | test_crash_purevirtual.js | TODO: purecalls not caught on OS
X\n"
+- );
+- return;
+- }
+-
+ // Try crashing with a pure virtual call
+ await do_crash(
+ function () {
+ crashType = CrashTestUtils.CRASH_PURE_VIRTUAL_CALL;
+ crashReporter.annotateCrashReport("TestKey", "TestValue");
+ },
+ function (mdump, extra) {
+ Assert.equal(extra.TestKey, "TestValue");
+
diff --git a/http/firefox/patches/0029-bgo-911679-gcc-binutils-2.41.patch
b/http/firefox/patches/0029-bgo-911679-gcc-binutils-2.41.patch
new file mode 100644
index 0000000..9f8ce30
--- /dev/null
+++ b/http/firefox/patches/0029-bgo-911679-gcc-binutils-2.41.patch
@@ -0,0 +1,60 @@
+--- a/media/ffvpx/libavcodec/x86/mathops.h
++++ b/media/ffvpx/libavcodec/x86/mathops.h
+@@ -35,12 +35,20 @@
+ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
+ {
+ int rt, dummy;
++ if (__builtin_constant_p(shift))
+ __asm__ (
+ "imull %3 \n\t"
+ "shrdl %4, %%edx, %%eax \n\t"
+ :"=a"(rt), "=d"(dummy)
+- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
++ :"a"(a), "rm"(b), "i"(shift & 0x1F)
+ );
++ else
++ __asm__ (
++ "imull %3 \n\t"
++ "shrdl %4, %%edx, %%eax \n\t"
++ :"=a"(rt), "=d"(dummy)
++ :"a"(a), "rm"(b), "c"((uint8_t)shift)
++ );
+ return rt;
+ }
+
+@@ -113,19 +121,31 @@ __asm__ volatile(\
+ // avoid +32 for shift optimization (gcc should do that ...)
+ #define NEG_SSR32 NEG_SSR32
+ static inline int32_t NEG_SSR32( int32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("sarl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("sarl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+ #define NEG_USR32 NEG_USR32
+ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("shrl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("shrl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+--
+2.30.2
diff --git
a/http/firefox/patches/0029-bmo-1841377-musl-libc-overalignment.patch
b/http/firefox/patches/0029-bmo-1841377-musl-libc-overalignment.patch
deleted file mode 100644
index 8711d32..0000000
--- a/http/firefox/patches/0029-bmo-1841377-musl-libc-overalignment.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-
-# HG changeset patch
-# User Xi Ruoyao <xry111 AT xry111.site>
-# Date 1689069778 0
-# Node ID f6a610679661486ccd236a445cfb9862e21a36dd
-# Parent e4dbb1e6c72201d69477e5686de0cead6e063ca1
-Bug 1841040 - Remove over-alignment from GCMarker and Nursery,
r=spidermonkey-reviewers,jonco
-
-js_new<T> cannot guarantee the alignment if T is over-aligned, and this
-issue is not trivial to fix (blocked by Bug 1842582).
-
-Add a static assert to detect the attempt using js_new<T> for
-over-aligned T, and remove the problematic alignas() attributes as a
-short-term fix.
-
-Differential Revision: https://phabricator.services.mozilla.com/D182546
-
-diff --git a/js/public/Utility.h b/js/public/Utility.h
---- a/js/public/Utility.h
-+++ b/js/public/Utility.h
-@@ -473,32 +473,38 @@ static inline void js_free(void* p) {
- * JS_DECLARE_NEW_METHODS (see js::MallocProvider for an example).
- *
- * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,
- * or the build will break.
- */
- #define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)
\
- template <class T, typename... Args>
\
- QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) {
\
-+ static_assert(
\
-+ alignof(T) <= alignof(max_align_t),
\
-+ "over-aligned type is not supported by JS_DECLARE_NEW_METHODS");
\
- void* memory = ALLOCATOR(sizeof(T));
\
- return MOZ_LIKELY(memory) ? new (memory) T(std::forward<Args>(args)...)
\
- : nullptr;
\
- }
-
- /*
- * Given a class which should provide a 'new' method that takes an arena as
- * its first argument, add JS_DECLARE_NEW_ARENA_METHODS
- * (see js::MallocProvider for an example).
- *
- * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_ARENA_METHODS,
- * or the build will break.
- */
- #define JS_DECLARE_NEW_ARENA_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)
\
- template <class T, typename... Args>
\
- QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(arena_id_t arena, Args&&...
args) { \
-+ static_assert(
\
-+ alignof(T) <= alignof(max_align_t),
\
-+ "over-aligned type is not supported by
JS_DECLARE_NEW_ARENA_METHODS"); \
- void* memory = ALLOCATOR(arena, sizeof(T));
\
- return MOZ_LIKELY(memory) ? new (memory) T(std::forward<Args>(args)...)
\
- : nullptr;
\
- }
-
- /*
- * Given a class which should provide 'make' methods, add
- * JS_DECLARE_MAKE_METHODS (see js::MallocProvider for an example). This
-diff --git a/js/src/gc/GCMarker.h b/js/src/gc/GCMarker.h
---- a/js/src/gc/GCMarker.h
-+++ b/js/src/gc/GCMarker.h
-@@ -269,17 +269,17 @@ using ParallelMarkingTracer = MarkingTra
-
- enum ShouldReportMarkTime : bool {
- ReportMarkTime = true,
- DontReportMarkTime = false
- };
-
- } /* namespace gc */
-
--class alignas(TypicalCacheLineSize) GCMarker {
-+class GCMarker {
- enum MarkingState : uint8_t {
- // Have not yet started marking.
- NotActive,
-
- // Root marking mode. This sets the hasMarkedCells flag on compartments
- // containing objects and scripts, which is used to make sure we clean
up
- // dead compartments.
- RootMarking,
-diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h
---- a/js/src/gc/Nursery.h
-+++ b/js/src/gc/Nursery.h
-@@ -63,17 +63,17 @@ class JS_PUBLIC_API Sprinter;
-
- namespace gc {
- class AutoGCSession;
- struct Cell;
- class GCSchedulingTunables;
- class TenuringTracer;
- } // namespace gc
-
--class alignas(TypicalCacheLineSize) Nursery {
-+class Nursery {
- public:
- explicit Nursery(gc::GCRuntime* gc);
- ~Nursery();
-
- [[nodiscard]] bool init(AutoLockGCBgAlloc& lock);
-
- // Number of allocated (ready to use) chunks.
- unsigned allocatedChunkCount() const { return chunks_.length(); }
-
diff --git
a/http/firefox/patches/0030-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
b/http/firefox/patches/0030-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
new file mode 100644
index 0000000..4a61c39
--- /dev/null
+++
b/http/firefox/patches/0030-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
@@ -0,0 +1,105 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1690834111 0
+# Node ID dd8ef46f522442182dcefcf0b8e1baa1a56d2cd0
+# Parent ed02af11f3cf62eb5935caa7bc132274c8a2cb5e
+Bug 1839615 [Linux] Configure libva logging according to platform decoder
log r=alwu
+
+Differential Revision: https://phabricator.services.mozilla.com/D184948
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+@@ -264,16 +264,27 @@ bool FFmpegVideoDecoder<LIBAV_VER>::Crea
+ return false;
+ }
+
+ mCodecContext->hw_device_ctx = mLib->av_buffer_ref(mVAAPIDeviceContext);
+ releaseVAAPIcontext.release();
+ return true;
+ }
+
++void FFmpegVideoDecoder<LIBAV_VER>::AdjustHWDecodeLogging() {
++ if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
++ mLib->av_log_set_level(AV_LOG_DEBUG);
++ setenv("LIBVA_MESSAGING_LEVEL", "1", false);
++ } else if (MOZ_LOG_TEST(sPDMLog, LogLevel::Info)) {
++ setenv("LIBVA_MESSAGING_LEVEL", "2", false);
++ } else {
++ setenv("LIBVA_MESSAGING_LEVEL", "0", false);
++ }
++}
++
+ MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitVAAPIDecoder() {
+ FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
+
+ StaticMutexAutoLock mon(sMutex);
+
+ // mAcceleratedFormats is already configured so check supported
+ // formats before we do anything.
+ if (mAcceleratedFormats.Length()) {
+@@ -340,19 +351,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ mAcceleratedFormats = GetAcceleratedFormats();
+ if (!IsFormatAccelerated(mCodecID)) {
+ FFMPEG_LOG(" Format %s is not accelerated",
+ mLib->avcodec_get_name(mCodecID));
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+ }
+
+- if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
+- mLib->av_log_set_level(AV_LOG_DEBUG);
+- }
++ AdjustHWDecodeLogging();
+
+ FFMPEG_LOG(" VA-API FFmpeg init successful");
+ releaseVAAPIdecoder.release();
+ return NS_OK;
+ }
+
+ MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitV4L2Decoder() {
+ FFMPEG_LOG("Initialising V4L2-DRM FFmpeg decoder");
+@@ -420,19 +429,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ if (mAcceleratedFormats.IsEmpty()) {
+ // FFmpeg does not correctly report that the V4L2 wrapper decoders are
+ // hardware accelerated, but we know they always are. If we've gotten
+ // this far then we know this codec has a V4L2 wrapper decoder and so is
+ // accelerateed.
+ mAcceleratedFormats.AppendElement(mCodecID);
+ }
+
+- if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
+- mLib->av_log_set_level(AV_LOG_DEBUG);
+- }
++ AdjustHWDecodeLogging();
+
+ FFMPEG_LOG(" V4L2 FFmpeg init successful");
+ mUsingV4L2 = true;
+ releaseDecoder.release();
+ return NS_OK;
+ }
+ #endif
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+@@ -135,16 +135,17 @@ class FFmpegVideoDecoder<LIBAV_VER>
+ AVCodecID aCodecID, AVVAAPIHWConfig* hwconfig);
+ nsTArray<AVCodecID> GetAcceleratedFormats();
+ bool IsFormatAccelerated(AVCodecID aCodecID) const;
+
+ MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
+ MediaResult CreateImageV4L2(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
++ void AdjustHWDecodeLogging();
+ #endif
+
+ #ifdef MOZ_WAYLAND_USE_HWDECODE
+ AVBufferRef* mVAAPIDeviceContext;
+ bool mUsingV4L2;
+ bool mEnableHardwareDecoding;
+ VADisplay mDisplay;
+ UniquePtr<VideoFramePool<LIBAV_VER>> mVideoFramePool;
+
diff --git
a/http/firefox/patches/0030-bmo-1847190-dont-use-configure_cache-for-relative-relocations.patch
b/http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
deleted file mode 100644
index 0c6c69a..0000000
---
a/http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
+++ /dev/null
@@ -1,431 +0,0 @@
-
-# HG changeset patch
-# User Mike Hommey <mh+mozilla AT glandium.org>
-# Date 1688543450 0
-# Node ID aec57c7faed9d7639d7e1fbd936a8b38bc747e63
-# Parent 38b13df05dd40dab0cd1eaba4f7248de589d99e8
-Bug 1841567 - Stop running check_binary on host binaries.
r=firefox-build-system-reviewers,sergesanspaille
-
-Back when this was added, we weren't using sysroots, and we did end up
-with host binaries that couldn't run on the host because libstdc++ came
-along the host compiler, and was newer than the system libstdc++. These
-concerns are long gone (libstdc++ in the sysroots is older than any
-supported linux host build system), so we don't need to run those checks
-anymore.
-
-Differential Revision: https://phabricator.services.mozilla.com/D182691
-
-diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
---- a/config/makefiles/rust.mk
-+++ b/config/makefiles/rust.mk
-@@ -442,17 +442,17 @@ RUST_LIBRARY_DEPS := $(wordlist 2, 10000
- # the chance of proxy bypasses originating from rust code.
- # The check only works when rust code is built with -Clto but without
MOZ_LTO_RUST_CROSS.
- # Sanitizers and sancov also fail because compiler-rt hooks network
functions.
- ifndef MOZ_PROFILE_GENERATE
- ifeq ($(OS_ARCH), Linux)
- ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
- ifndef MOZ_LTO_RUST_CROSS
- ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
-- $(call py_action,check_binary,--target --networking $@)
-+ $(call py_action,check_binary,--networking $@)
- endif
- endif
- endif
- endif
- endif
-
- define make_default_rule
- $(1):
-diff --git a/config/rules.mk b/config/rules.mk
---- a/config/rules.mk
-+++ b/config/rules.mk
-@@ -417,17 +417,17 @@ endef
- # creates OBJS, links with LIBS to create Foo
- #
- $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(call
resfile,$(PROGRAM)) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
- $(REPORT_BUILD)
- ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
- $(LINKER) -OUT:$@ -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib
$(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS)
$(filter %.res,$^) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
- else # !WINNT || GNU_CC
- $(call EXPAND_CC_OR_CXX,$@) -o $@ $(COMPUTED_CXX_LDFLAGS)
$(PGO_CFLAGS) $($(notdir $@)_OBJS) $(filter %.res,$^) $(WIN32_EXE_LDFLAGS)
$(LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS)
-- $(call py_action,check_binary,--target $@)
-+ $(call py_action,check_binary,$@)
- endif # WINNT && !GNU_CC
-
- ifdef ENABLE_STRIP
- $(STRIP) $(STRIP_FLAGS) $@
- endif
- ifdef MOZ_POST_PROGRAM_COMMAND
- $(MOZ_POST_PROGRAM_COMMAND) $@
- endif
-@@ -438,19 +438,16 @@ ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
- $(HOST_LINKER) -OUT:$@ -PDB:$(HOST_PDBFILE) $($(notdir $@)_OBJS)
$(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS)
$(HOST_EXTRA_LIBS)
- else
- ifeq ($(HOST_CPP_PROG_LINK),1)
- $(HOST_CXX) -o $@ $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $($(notdir
$@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
- else
- $(HOST_CC) -o $@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS) $($(notdir
$@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
- endif # HOST_CPP_PROG_LINK
- endif
--ifndef CROSS_COMPILE
-- $(call py_action,check_binary,--host $@)
--endif
-
- #
- # This is an attempt to support generation of multiple binaries
- # in one directory, it assumes everything to compile Foo is in
- # Foo.o (from either Foo.c or Foo.cpp).
- #
- # SIMPLE_PROGRAMS = Foo Bar
- # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
-@@ -461,17 +458,17 @@ endef
- $(foreach p,$(SIMPLE_PROGRAMS),$(eval $(call simple_program_deps,$(p))))
-
- $(SIMPLE_PROGRAMS):
- $(REPORT_BUILD)
- ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
- $(LINKER) -out:$@ -pdb:$(LINK_PDBFILE) $($@_OBJS) $(filter %.res,$^)
$(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(STATIC_LIBS)
$(SHARED_LIBS) $(OS_LIBS)
- else
- $(call EXPAND_CC_OR_CXX,$@) $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) -o
$@ $($@_OBJS) $(filter %.res,$^) $(WIN32_EXE_LDFLAGS) $(LDFLAGS)
$(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS)
-- $(call py_action,check_binary,--target $@)
-+ $(call py_action,check_binary,$@)
- endif # WINNT && !GNU_CC
-
- ifdef ENABLE_STRIP
- $(STRIP) $(STRIP_FLAGS) $@
- endif
- ifdef MOZ_POST_PROGRAM_COMMAND
- $(MOZ_POST_PROGRAM_COMMAND) $@
- endif
-@@ -482,19 +479,16 @@ ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
- $(HOST_LINKER) -OUT:$@ -PDB:$(HOST_PDBFILE) $($(notdir $@)_OBJS)
$(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS)
$(HOST_EXTRA_LIBS)
- else
- ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
- $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS)
$($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
- else
- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS)
$($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
- endif
- endif
--ifndef CROSS_COMPILE
-- $(call py_action,check_binary,--host $@)
--endif
-
- $(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
- $(REPORT_BUILD)
- $(RM) $(REAL_LIBRARY)
- $(AR) $(AR_FLAGS) $($@_OBJS)
-
- $(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS)
$(GLOBAL_DEPS)
- $(REPORT_BUILD_VERBOSE)
-@@ -525,17 +519,17 @@ endif
- # so instead of deleting .o files after repacking them into a dylib, we make
- # symlinks back to the originals. The symlinks are a no-op for stabs
debugging,
- # so no need to conditionalize on OS version or debugging format.
-
- $(SHARED_LIBRARY): $(OBJS) $(call resfile,$(SHARED_LIBRARY)) $(STATIC_LIBS)
$(EXTRA_DEPS) $(GLOBAL_DEPS)
- $(REPORT_BUILD)
- $(RM) $@
- $(MKSHLIB) $($@_OBJS) $(filter %.res,$^) $(LDFLAGS) $(STATIC_LIBS)
$(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS)
-- $(call py_action,check_binary,--target $@)
-+ $(call py_action,check_binary,$@)
-
- ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
- endif # WINNT && !GCC
- chmod +x $@
- ifdef ENABLE_STRIP
- $(STRIP) $(STRIP_FLAGS) $@
- endif
-
-diff --git a/python/mozbuild/mozbuild/action/check_binary.py
b/python/mozbuild/mozbuild/action/check_binary.py
---- a/python/mozbuild/mozbuild/action/check_binary.py
-+++ b/python/mozbuild/mozbuild/action/check_binary.py
-@@ -15,22 +15,18 @@ from packaging.version import Version
- from mozbuild.action.util import log_build_task
- from mozbuild.util import memoize
-
- STDCXX_MAX_VERSION = Version("3.4.19")
- CXXABI_MAX_VERSION = Version("1.3.7")
- GLIBC_MAX_VERSION = Version("2.17")
- LIBGCC_MAX_VERSION = Version("4.8")
-
--HOST = {"platform": buildconfig.substs["HOST_OS_ARCH"], "readelf":
"readelf"}
--
--TARGET = {
-- "platform": buildconfig.substs["OS_TARGET"],
-- "readelf": buildconfig.substs.get("READELF", "readelf"),
--}
-+PLATFORM = buildconfig.substs["OS_TARGET"]
-+READELF = buildconfig.substs.get("READELF", "readelf")
-
- ADDR_RE = re.compile(r"[0-9a-f]{8,16}")
-
- if buildconfig.substs.get("HAVE_64BIT_BUILD"):
- GUESSED_NSMODULE_SIZE = 8
- else:
- GUESSED_NSMODULE_SIZE = 4
-
-@@ -58,24 +54,24 @@ def at_least_one(iter):
- for item in iter:
- saw_one = True
- yield item
- if not saw_one:
- raise Empty()
-
-
- # Iterates the symbol table on ELF binaries.
--def iter_elf_symbols(target, binary, all=False):
-+def iter_elf_symbols(binary, all=False):
- ty = get_type(binary)
- # Static libraries are ar archives. Assume they are ELF.
- if ty == UNKNOWN and open(binary, "rb").read(8) == b"!<arch>\n":
- ty = ELF
- assert ty == ELF
- for line in get_output(
-- target["readelf"], "--wide", "--syms" if all else "--dyn-syms",
binary
-+ READELF, "--wide", "--syms" if all else "--dyn-syms", binary
- ):
- data = line.split()
- if not (len(data) >= 8 and data[0].endswith(":") and
data[0][:-1].isdigit()):
- continue
- n, addr, size, type, bind, vis, index, name = data[:8]
-
- if "@" in name:
- name, ver = name.rsplit("@", 1)
-@@ -88,36 +84,36 @@ def iter_elf_symbols(target, binary, all
- # readelf output may contain decimal values or hexadecimal
- # values prefixed with 0x for the size. Let python autodetect.
- "size": int(size, 0),
- "name": name,
- "version": ver,
- }
-
-
--def iter_readelf_dynamic(target, binary):
-- for line in get_output(target["readelf"], "-d", binary):
-+def iter_readelf_dynamic(binary):
-+ for line in get_output(READELF, "-d", binary):
- data = line.split(None, 2)
- if data and len(data) == 3 and data[0].startswith("0x"):
- yield data[1].rstrip(")").lstrip("("), data[2]
-
-
--def check_binary_compat(target, binary):
-+def check_binary_compat(binary):
- if get_type(binary) != ELF:
- raise Skip()
- checks = (
- ("libstdc++", "GLIBCXX_", STDCXX_MAX_VERSION),
- ("libstdc++", "CXXABI_", CXXABI_MAX_VERSION),
- ("libgcc", "GCC_", LIBGCC_MAX_VERSION),
- ("libc", "GLIBC_", GLIBC_MAX_VERSION),
- )
-
- unwanted = {}
- try:
-- for sym in at_least_one(iter_elf_symbols(target, binary)):
-+ for sym in at_least_one(iter_elf_symbols(binary)):
- # Only check versions on undefined symbols
- if sym["addr"] != 0:
- continue
-
- # No version to check
- if not sym["version"]:
- continue
-
-@@ -136,21 +132,21 @@ def check_binary_compat(target, binary):
- "We do not want these {} symbol versions to be
used:".format(lib)
- )
- error.extend(
- " {} ({})".format(s["name"], s["version"]) for s in
unwanted[prefix]
- )
- raise RuntimeError("\n".join(error))
-
-
--def check_textrel(target, binary):
-- if target is HOST or get_type(binary) != ELF:
-+def check_textrel(binary):
-+ if get_type(binary) != ELF:
- raise Skip()
- try:
-- for tag, value in at_least_one(iter_readelf_dynamic(target,
binary)):
-+ for tag, value in at_least_one(iter_readelf_dynamic(binary)):
- if tag == "TEXTREL" or (tag == "FLAGS" and "TEXTREL" in value):
- raise RuntimeError(
- "We do not want text relocations in libraries and
programs"
- )
- except Empty:
- raise RuntimeError("Could not parse readelf output?")
-
-
-@@ -162,54 +158,52 @@ def ishex(s):
- return False
-
-
- def is_libxul(binary):
- basename = os.path.basename(binary).lower()
- return "xul" in basename
-
-
--def check_pt_load(target, binary):
-- if target is HOST or get_type(binary) != ELF or not is_libxul(binary):
-+def check_pt_load(binary):
-+ if get_type(binary) != ELF or not is_libxul(binary):
- raise Skip()
- count = 0
-- for line in get_output(target["readelf"], "-l", binary):
-+ for line in get_output(READELF, "-l", binary):
- data = line.split()
- if data and data[0] == "LOAD":
- count += 1
- if count <= 1:
- raise RuntimeError("Expected more than one PT_LOAD segment")
-
-
--def check_mozglue_order(target, binary):
-- if target is HOST or target["platform"] != "Android":
-+def check_mozglue_order(binary):
-+ if PLATFORM != "Android":
- raise Skip()
- # While this is very unlikely (libc being added by the compiler at the
end
- # of the linker command line), if libmozglue.so ends up after libc.so,
all
- # hell breaks loose, so better safe than sorry, and check it's actually
the
- # case.
- try:
- mozglue = libc = None
-- for n, (tag, value) in enumerate(
-- at_least_one(iter_readelf_dynamic(target, binary))
-- ):
-+ for n, (tag, value) in
enumerate(at_least_one(iter_readelf_dynamic(binary))):
- if tag == "NEEDED":
- if "[libmozglue.so]" in value:
- mozglue = n
- elif "[libc.so]" in value:
- libc = n
- if libc is None:
- raise RuntimeError("libc.so is not linked?")
- if mozglue is not None and libc < mozglue:
- raise RuntimeError("libmozglue.so must be linked before
libc.so")
- except Empty:
- raise RuntimeError("Could not parse readelf output?")
-
-
--def check_networking(target, binary):
-+def check_networking(binary):
- retcode = 0
- networking_functions = set(
- [
- # socketpair is not concerning; it is restricted to AF_UNIX
- "connect",
- "accept",
- "listen",
- "getsockname",
-@@ -237,17 +231,17 @@ def check_networking(target, binary):
- "getprotobynumber",
- "setprotoent",
- "endprotoent",
- ]
- )
- bad_occurences_names = set()
-
- try:
-- for sym in at_least_one(iter_elf_symbols(target, binary, all=True)):
-+ for sym in at_least_one(iter_elf_symbols(binary, all=True)):
- if sym["addr"] == 0 and sym["name"] in networking_functions:
- bad_occurences_names.add(sym["name"])
- except Empty:
- raise RuntimeError("Could not parse llvm-objdump output?")
-
- basename = os.path.basename(binary)
- if bad_occurences_names:
- s = (
-@@ -263,37 +257,37 @@ def check_networking(target, binary):
- file=sys.stderr,
- )
- retcode = 1
- elif buildconfig.substs.get("MOZ_AUTOMATION"):
- print("TEST-PASS | check_networking | {}".format(basename))
- return retcode
-
-
--def checks(target, binary):
-+def checks(binary):
- # The clang-plugin is built as target but is really a host binary.
-- # Cheat and pretend we were passed the right argument.
-+ # Cheat and pretend we weren't called.
- if "clang-plugin" in binary:
-- target = HOST
-+ return 0
- checks = []
-- if buildconfig.substs.get("MOZ_STDCXX_COMPAT") and target["platform"]
== "Linux":
-+ if buildconfig.substs.get("MOZ_STDCXX_COMPAT") and PLATFORM == "Linux":
- checks.append(check_binary_compat)
-
- # Disabled for local builds because of readelf performance: See bug
1472496
- if not buildconfig.substs.get("DEVELOPER_OPTIONS"):
- checks.append(check_textrel)
- checks.append(check_pt_load)
- checks.append(check_mozglue_order)
-
- retcode = 0
- basename = os.path.basename(binary)
- for c in checks:
- try:
- name = c.__name__
-- c(target, binary)
-+ c(binary)
- if buildconfig.substs.get("MOZ_AUTOMATION"):
- print("TEST-PASS | {} | {}".format(name, basename))
- except Skip:
- pass
- except RuntimeError as e:
- print(
- "TEST-UNEXPECTED-FAIL | {} | {} | {}".format(name,
basename, str(e)),
- file=sys.stderr,
-@@ -301,43 +295,26 @@ def checks(target, binary):
- retcode = 1
- return retcode
-
-
- def main(args):
- parser = argparse.ArgumentParser(description="Check built binaries")
-
- parser.add_argument(
-- "--host", action="store_true", help="Perform checks for a host
binary"
-- )
-- parser.add_argument(
-- "--target", action="store_true", help="Perform checks for a target
binary"
-- )
-- parser.add_argument(
- "--networking",
- action="store_true",
- help="Perform checks for networking functions",
- )
-
- parser.add_argument(
- "binary", metavar="PATH", help="Location of the binary to check"
- )
-
- options = parser.parse_args(args)
-
-- if options.host == options.target:
-- print("Exactly one of --host or --target must be given",
file=sys.stderr)
-- return 1
--
-- if options.networking and options.host:
-- print("--networking is only valid with --target", file=sys.stderr)
-- return 1
--
- if options.networking:
-- return check_networking(TARGET, options.binary)
-- elif options.host:
-- return checks(HOST, options.binary)
-- elif options.target:
-- return checks(TARGET, options.binary)
-+ return check_networking(options.binary)
-+ return checks(options.binary)
-
-
- if __name__ == "__main__":
- sys.exit(log_build_task(main, sys.argv[1:]))
-
diff --git
a/http/firefox/patches/0031-bmo-1846701-Rename-MOZ_WAYLAND_USE_HWDECODE-to-MOZ_USE_HWDECODE.patch
b/http/firefox/patches/0031-bmo-1846701-Rename-MOZ_WAYLAND_USE_HWDECODE-to-MOZ_USE_HWDECODE.patch
new file mode 100644
index 0000000..49bd785
--- /dev/null
+++
b/http/firefox/patches/0031-bmo-1846701-Rename-MOZ_WAYLAND_USE_HWDECODE-to-MOZ_USE_HWDECODE.patch
@@ -0,0 +1,451 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1691134608 0
+# Node ID 4fb5d7fb05768e517a9de0310aad97dc60eb9142
+# Parent a0da46a5cddd1f88b3f35948704fe311a910d44e
+Bug 1846701 [Linux] Rename MOZ_WAYLAND_USE_HWDECODE to MOZ_USE_HWDECODE as
we build HW decode on X11 too r=alwu
+
+Differential Revision: https://phabricator.services.mozilla.com/D185140
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegLibs.h
b/dom/media/platforms/ffmpeg/FFmpegLibs.h
+--- a/dom/media/platforms/ffmpeg/FFmpegLibs.h
++++ b/dom/media/platforms/ffmpeg/FFmpegLibs.h
+@@ -9,17 +9,17 @@
+
+ extern "C" {
+ #ifdef __GNUC__
+ # pragma GCC visibility push(default)
+ #endif
+ #include "libavcodec/avcodec.h"
+ #include "libavutil/avutil.h"
+ #include "libavutil/mem.h"
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ # include "libavutil/hwcontext_vaapi.h"
+ # include "libavutil/hwcontext_drm.h"
+ #endif
+ #ifdef __GNUC__
+ # pragma GCC visibility pop
+ #endif
+ }
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+@@ -14,17 +14,17 @@
+ #include "VPXDecoder.h"
+ #include "mozilla/layers/KnowsCompositor.h"
+ #if LIBAVCODEC_VERSION_MAJOR >= 57
+ # include "mozilla/layers/TextureClient.h"
+ #endif
+ #if LIBAVCODEC_VERSION_MAJOR >= 58
+ # include "mozilla/ProfilerMarkers.h"
+ #endif
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ # include "H264.h"
+ # include "mozilla/gfx/gfxVars.h"
+ # include "mozilla/layers/DMABUFSurfaceImage.h"
+ # include "mozilla/widget/DMABufLibWrapper.h"
+ # include "FFmpegVideoFramePool.h"
+ # include "va/va.h"
+ #endif
+
+@@ -58,17 +58,17 @@
+ #include "prsystem.h"
+
+ #ifdef XP_WIN
+ # include "mozilla/gfx/DeviceManagerDx.h"
+ # include "mozilla/gfx/gfxVars.h"
+ #endif
+
+ // Forward declare from va.h
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ typedef int VAStatus;
+ # define VA_EXPORT_SURFACE_READ_ONLY 0x0001
+ # define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
+ # define VA_STATUS_SUCCESS 0x00000000
+ #endif
+ // Use some extra HW frames for potential rendering lags.
+ #define EXTRA_HW_FRAMES 6
+ // Defines number of delayed frames until we switch back to SW decode.
+@@ -80,17 +80,17 @@ typedef int VAStatus;
+
+ #define AV_LOG_DEBUG 48
+
+ typedef mozilla::layers::Image Image;
+ typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage;
+
+ namespace mozilla {
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ nsTArray<AVCodecID> FFmpegVideoDecoder<LIBAV_VER>::mAcceleratedFormats;
+ #endif
+
+ using media::TimeUnit;
+
+ /**
+ * FFmpeg calls back to this function with a list of pixel formats it
supports.
+ * We choose a pixel format that we support and return it.
+@@ -141,17 +141,17 @@ static AVPixelFormat ChoosePixelFormat(A
+ break;
+ }
+ }
+
+ NS_WARNING("FFmpeg does not share any supported pixel formats.");
+ return AV_PIX_FMT_NONE;
+ }
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ static AVPixelFormat ChooseVAAPIPixelFormat(AVCodecContext* aCodecContext,
+ const AVPixelFormat* aFormats) {
+ FFMPEG_LOG("Choosing FFmpeg pixel format for VA-API video decoding.");
+ for (; *aFormats > -1; aFormats++) {
+ switch (*aFormats) {
+ case AV_PIX_FMT_VAAPI_VLD:
+ FFMPEG_LOG("Requesting pixel format VAAPI_VLD");
+ return AV_PIX_FMT_VAAPI_VLD;
+@@ -472,17 +472,17 @@ int64_t FFmpegVideoDecoder<LIBAV_VER>::P
+
+ void FFmpegVideoDecoder<LIBAV_VER>::PtsCorrectionContext::Reset() {
+ mNumFaultyPts = 0;
+ mNumFaultyDts = 0;
+ mLastPts = INT64_MIN;
+ mLastDts = INT64_MIN;
+ }
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ void FFmpegVideoDecoder<LIBAV_VER>::InitHWDecodingPrefs() {
+ if (!mEnableHardwareDecoding) {
+ FFMPEG_LOG("VAAPI is disabled by parent decoder module.");
+ return;
+ }
+
+ bool supported = false;
+ switch (mCodecID) {
+@@ -524,17 +524,17 @@ void FFmpegVideoDecoder<LIBAV_VER>::Init
+ #endif
+
+ FFmpegVideoDecoder<LIBAV_VER>::FFmpegVideoDecoder(
+ FFmpegLibWrapper* aLib, const VideoInfo& aConfig,
+ KnowsCompositor* aAllocator, ImageContainer* aImageContainer,
+ bool aLowLatency, bool aDisableHardwareDecoding,
+ Maybe<TrackingId> aTrackingId)
+ : FFmpegDataDecoder(aLib, GetCodecId(aConfig.mMimeType)),
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ mVAAPIDeviceContext(nullptr),
+ mUsingV4L2(false),
+ mEnableHardwareDecoding(!aDisableHardwareDecoding),
+ mDisplay(nullptr),
+ #endif
+ mImageAllocator(aAllocator),
+ mImageContainer(aImageContainer),
+ mInfo(aConfig),
+@@ -547,32 +547,32 @@ FFmpegVideoDecoder<LIBAV_VER>::FFmpegVid
+ mLowLatency(aLowLatency),
+ mTrackingId(std::move(aTrackingId)) {
+ FFMPEG_LOG("FFmpegVideoDecoder::FFmpegVideoDecoder MIME %s Codec ID %d",
+ aConfig.mMimeType.get(), mCodecID);
+ // Use a new MediaByteBuffer as the object will be modified during
+ // initialization.
+ mExtraData = new MediaByteBuffer;
+ mExtraData->AppendElements(*aConfig.mExtraData);
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ InitHWDecodingPrefs();
+ #endif
+ }
+
+ FFmpegVideoDecoder<LIBAV_VER>::~FFmpegVideoDecoder() {
+ #ifdef CUSTOMIZED_BUFFER_ALLOCATION
+ MOZ_DIAGNOSTIC_ASSERT(mAllocatedImages.IsEmpty(),
+ "Should release all shmem buffers before destroy!");
+ #endif
+ }
+
+ RefPtr<MediaDataDecoder::InitPromise> FFmpegVideoDecoder<LIBAV_VER>::Init()
{
+ MediaResult rv;
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ if (mEnableHardwareDecoding) {
+ # ifdef MOZ_ENABLE_VAAPI
+ rv = InitVAAPIDecoder();
+ if (NS_SUCCEEDED(rv)) {
+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack,
__func__);
+ }
+ # endif // MOZ_ENABLE_VAAPI
+
+@@ -581,17 +581,17 @@ RefPtr<MediaDataDecoder::InitPromise> FF
+ rv = InitV4L2Decoder();
+ if (NS_SUCCEEDED(rv)) {
+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack,
__func__);
+ }
+ # endif // MOZ_ENABLE_V4L2
+
+ mEnableHardwareDecoding = false;
+ }
+-#endif // MOZ_WAYLAND_USE_HWDECODE
++#endif // MOZ_USE_HWDECODE
+
+ rv = InitDecoder();
+ if (NS_SUCCEEDED(rv)) {
+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
+ }
+
+ return InitPromise::CreateAndReject(rv, __func__);
+ }
+@@ -946,17 +946,17 @@ void FFmpegVideoDecoder<LIBAV_VER>::Init
+ nsCString FFmpegVideoDecoder<LIBAV_VER>::GetCodecName() const {
+ #if LIBAVCODEC_VERSION_MAJOR > 53
+ return nsCString(mLib->avcodec_descriptor_get(mCodecID)->name);
+ #else
+ return nsLiteralCString("FFmpegAudioDecoder");
+ #endif
+ }
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ void FFmpegVideoDecoder<LIBAV_VER>::InitHWCodecContext(bool aUsingV4L2) {
+ mCodecContext->width = mInfo.mImage.width;
+ mCodecContext->height = mInfo.mImage.height;
+ mCodecContext->thread_count = 1;
+
+ if (aUsingV4L2) {
+ mCodecContext->get_format = ChooseV4L2PixelFormat;
+ } else {
+@@ -1083,17 +1083,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ *aGotFrame = false;
+ }
+ do {
+ if (!PrepareFrame()) {
+ NS_WARNING("FFmpeg decoder failed to allocate frame.");
+ return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
+ }
+
+-# ifdef MOZ_WAYLAND_USE_HWDECODE
++# ifdef MOZ_USE_HWDECODE
+ // Release unused VA-API surfaces before avcodec_receive_frame() as
+ // ffmpeg recycles VASurface for HW decoding.
+ if (mVideoFramePool) {
+ mVideoFramePool->ReleaseUnusedVAAPIFrames();
+ }
+ # endif
+
+ res = mLib->avcodec_receive_frame(mCodecContext, mFrame);
+@@ -1112,17 +1112,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ NS_ERROR_DOM_MEDIA_DECODE_ERR,
+ RESULT_DETAIL("avcodec_receive_frame error: %s", errStr));
+ }
+
+ UpdateDecodeTimes(decodeStart);
+ decodeStart = TimeStamp::Now();
+
+ MediaResult rv;
+-# ifdef MOZ_WAYLAND_USE_HWDECODE
++# ifdef MOZ_USE_HWDECODE
+ if (IsHardwareAccelerated()) {
+ if (mMissedDecodeInAverangeTime > HW_DECODE_LATE_FRAMES) {
+ PROFILER_MARKER_TEXT("FFmpegVideoDecoder::DoDecode",
MEDIA_PLAYBACK, {},
+ "Fallback to SW decode");
+ FFMPEG_LOG(" HW decoding is slow, switch back to SW decode");
+ return MediaResult(
+ NS_ERROR_DOM_MEDIA_DECODE_ERR,
+ RESULT_DETAIL("HW decoding is slow, switch back to SW decode"));
+@@ -1448,17 +1448,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ if (!v) {
+ return MediaResult(NS_ERROR_OUT_OF_MEMORY,
+ RESULT_DETAIL("image allocation error"));
+ }
+ aResults.AppendElement(std::move(v));
+ return NS_OK;
+ }
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ bool FFmpegVideoDecoder<LIBAV_VER>::GetVAAPISurfaceDescriptor(
+ VADRMPRIMESurfaceDescriptor* aVaDesc) {
+ VASurfaceID surface_id = (VASurfaceID)(uintptr_t)mFrame->data[3];
+ VAStatus vas = mLib->vaExportSurfaceHandle(
+ mDisplay, surface_id, VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
+ VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
aVaDesc);
+ if (vas != VA_STATUS_SUCCESS) {
+ return false;
+@@ -1604,35 +1604,35 @@ AVCodecID FFmpegVideoDecoder<LIBAV_VER>:
+ }
+ #endif
+
+ return AV_CODEC_ID_NONE;
+ }
+
+ void FFmpegVideoDecoder<LIBAV_VER>::ProcessShutdown() {
+ MOZ_ASSERT(mTaskQueue->IsOnCurrentThread());
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ mVideoFramePool = nullptr;
+ if (IsHardwareAccelerated()) {
+ mLib->av_buffer_unref(&mVAAPIDeviceContext);
+ }
+ #endif
+ FFmpegDataDecoder<LIBAV_VER>::ProcessShutdown();
+ }
+
+ bool FFmpegVideoDecoder<LIBAV_VER>::IsHardwareAccelerated(
+ nsACString& aFailureReason) const {
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ return mUsingV4L2 || !!mVAAPIDeviceContext;
+ #else
+ return false;
+ #endif
+ }
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ bool FFmpegVideoDecoder<LIBAV_VER>::IsFormatAccelerated(
+ AVCodecID aCodecID) const {
+ for (const auto& format : mAcceleratedFormats) {
+ if (format == aCodecID) {
+ return true;
+ }
+ }
+ return false;
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+@@ -12,17 +12,17 @@
+ #include "FFmpegLibWrapper.h"
+ #include "PerformanceRecorder.h"
+ #include "SimpleMap.h"
+ #include "mozilla/ScopeExit.h"
+ #include "nsTHashSet.h"
+ #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56
+ # include "mozilla/layers/TextureClient.h"
+ #endif
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ # include "FFmpegVideoFramePool.h"
+ #endif
+
+ struct _VADRMPRIMESurfaceDescriptor;
+ typedef struct _VADRMPRIMESurfaceDescriptor VADRMPRIMESurfaceDescriptor;
+
+ namespace mozilla {
+
+@@ -118,17 +118,17 @@ class FFmpegVideoDecoder<LIBAV_VER>
+ layers::TextureClient* AllocateTextureClientForImage(
+ struct AVCodecContext* aCodecContext, layers::PlanarYCbCrImage*
aImage);
+
+ gfx::IntSize GetAlignmentVideoFrameSize(struct AVCodecContext*
aCodecContext,
+ int32_t aWidth,
+ int32_t aHeight) const;
+ #endif
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ void InitHWDecodingPrefs();
+ MediaResult InitVAAPIDecoder();
+ MediaResult InitV4L2Decoder();
+ bool CreateVAAPIDeviceContext();
+ void InitHWCodecContext(bool aUsingV4L2);
+ AVCodec* FindVAAPICodec();
+ bool GetVAAPISurfaceDescriptor(VADRMPRIMESurfaceDescriptor* aVaDesc);
+ void AddAcceleratedFormats(nsTArray<AVCodecID>& aCodecList,
+@@ -138,17 +138,17 @@ class FFmpegVideoDecoder<LIBAV_VER>
+
+ MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
+ MediaResult CreateImageV4L2(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
+ void AdjustHWDecodeLogging();
+ #endif
+
+-#ifdef MOZ_WAYLAND_USE_HWDECODE
++#ifdef MOZ_USE_HWDECODE
+ AVBufferRef* mVAAPIDeviceContext;
+ bool mUsingV4L2;
+ bool mEnableHardwareDecoding;
+ VADisplay mDisplay;
+ UniquePtr<VideoFramePool<LIBAV_VER>> mVideoFramePool;
+ static nsTArray<AVCodecID> mAcceleratedFormats;
+ #endif
+ RefPtr<KnowsCompositor> mImageAllocator;
+diff --git a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
+--- a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
++++ b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
+@@ -27,13 +27,13 @@ if CONFIG['CC_TYPE'] == 'gcc':
+ '-Wno-attributes',
+ ]
+ if CONFIG['MOZ_WIDGET_GTK']:
+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS']
+ if CONFIG['MOZ_ENABLE_VAAPI'] or CONFIG['MOZ_ENABLE_V4L2']:
+ UNIFIED_SOURCES += ['../FFmpegVideoFramePool.cpp']
+ LOCAL_INCLUDES += ['/third_party/drm/drm/include/libdrm/']
+ USE_LIBS += ['mozva']
+- DEFINES['MOZ_WAYLAND_USE_HWDECODE'] = 1
++ DEFINES['MOZ_USE_HWDECODE'] = 1
+
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ FINAL_LIBRARY = 'xul'
+diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/moz.build
b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build
+--- a/dom/media/platforms/ffmpeg/ffmpeg59/moz.build
++++ b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build
+@@ -27,13 +27,13 @@ if CONFIG["CC_TYPE"] == "gcc":
+ "-Wno-attributes",
+ ]
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
+ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
+ UNIFIED_SOURCES += ["../FFmpegVideoFramePool.cpp"]
+ LOCAL_INCLUDES += ["/third_party/drm/drm/include/libdrm/"]
+ USE_LIBS += ["mozva"]
+- DEFINES["MOZ_WAYLAND_USE_HWDECODE"] = 1
++ DEFINES["MOZ_USE_HWDECODE"] = 1
+
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ FINAL_LIBRARY = "xul"
+diff --git a/dom/media/platforms/ffmpeg/ffmpeg60/moz.build
b/dom/media/platforms/ffmpeg/ffmpeg60/moz.build
+--- a/dom/media/platforms/ffmpeg/ffmpeg60/moz.build
++++ b/dom/media/platforms/ffmpeg/ffmpeg60/moz.build
+@@ -27,13 +27,13 @@ if CONFIG["CC_TYPE"] == "gcc":
+ "-Wno-attributes",
+ ]
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
+ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
+ UNIFIED_SOURCES += ["../FFmpegVideoFramePool.cpp"]
+ LOCAL_INCLUDES += ["/third_party/drm/drm/include/libdrm/"]
+ USE_LIBS += ["mozva"]
+- DEFINES["MOZ_WAYLAND_USE_HWDECODE"] = 1
++ DEFINES["MOZ_USE_HWDECODE"] = 1
+
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ FINAL_LIBRARY = "xul"
+diff --git a/dom/media/platforms/ffmpeg/ffvpx/moz.build
b/dom/media/platforms/ffmpeg/ffvpx/moz.build
+--- a/dom/media/platforms/ffmpeg/ffvpx/moz.build
++++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build
+@@ -38,13 +38,13 @@ DEFINES["FFVPX_VERSION"] = 46465650
+ DEFINES["USING_MOZFFVPX"] = True
+
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
+ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
+ UNIFIED_SOURCES += ["../FFmpegVideoFramePool.cpp"]
+ LOCAL_INCLUDES += ["/third_party/drm/drm/include/libdrm/"]
+ USE_LIBS += ["mozva"]
+- DEFINES["MOZ_WAYLAND_USE_HWDECODE"] = 1
++ DEFINES["MOZ_USE_HWDECODE"] = 1
+
+ include("/ipc/chromium/chromium-config.mozbuild")
+
+ FINAL_LIBRARY = "xul"
+
diff --git
a/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
b/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
deleted file mode 100644
index 00cadde..0000000
---
a/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-
-# HG changeset patch
-# User Mike Hommey <mh+mozilla AT glandium.org>
-# Date 1688455805 0
-# Node ID 8f3c18688bf43961a61f78f11f8aaef5e5de5fec
-# Parent 25c1a2b1eff10640f2c23261214875b0c13c9037
-Bug 1841571 - Treat rust libraries as objects in the build graph.
r=firefox-build-system-reviewers,sergesanspaille
-
-The build graph has dependencies like:
- some/dir/target: some/dir/target-objects
-
-where some/dir/target-objects will build the objects in the directory,
-and some/dir/target will link some binary (executable or shared library)
-using those objects (and/or objects in other directories).
-
-From that perspective, the rust (static) libraries are more similar to
-objects, and we should treat them as such.
-
-This will allow to add the right dependencies to use a in-tree-built tool
-to link shared libraries without having building the rust libraries
-depend on it just because they are treated as other binaries in the
-build graph.
-
-Differential Revision: https://phabricator.services.mozilla.com/D182694
-
-diff --git a/config/recurse.mk b/config/recurse.mk
---- a/config/recurse.mk
-+++ b/config/recurse.mk
-@@ -230,12 +230,12 @@ ifndef TEST_MOZBUILD
- pre-export:: $(DEPTH)/.cargo/config
- endif
-
- # When building gtest as part of the build (LINK_GTEST_DURING_COMPILE),
- # force the build system to get to it first, so that it can be linked
- # quickly without LTO, allowing the build system to go ahead with
- # plain gkrust and libxul while libxul-gtest is being linked and
- # dump-sym'ed.
--ifneq (,$(filter toolkit/library/gtest/rust/target,$(compile_targets)))
--toolkit/library/rust/target: toolkit/library/gtest/rust/target
-+ifneq (,$(filter
toolkit/library/gtest/rust/target-objects,$(compile_targets)))
-+toolkit/library/rust/target-objects:
toolkit/library/gtest/rust/target-objects
- endif
- endif
-diff --git a/config/rules.mk b/config/rules.mk
---- a/config/rules.mk
-+++ b/config/rules.mk
-@@ -381,28 +381,28 @@ else
- resfile =
- resfile_for_manifest =
- endif
-
- ##############################################
- ifdef COMPILE_ENVIRONMENT
- compile:: host target
-
--host:: $(HOST_OBJS) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
$(HOST_RUST_PROGRAMS) $(HOST_RUST_LIBRARY_FILE) $(HOST_SHARED_LIBRARY)
-+host:: $(HOST_OBJS) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
$(HOST_RUST_PROGRAMS) $(HOST_SHARED_LIBRARY)
-
--target:: $(filter-out $(MOZBUILD_NON_DEFAULT_TARGETS),$(LIBRARY)
$(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(RUST_LIBRARY_FILE)
$(RUST_PROGRAMS))
-+target:: $(filter-out $(MOZBUILD_NON_DEFAULT_TARGETS),$(LIBRARY)
$(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(RUST_PROGRAMS))
-
- ifndef LIBRARY
- ifdef OBJS
- target:: $(OBJS)
- endif
- endif
-
--target-objects: $(OBJS) $(PROGOBJS)
--host-objects: $(HOST_OBJS) $(HOST_PROGOBJS)
-+target-objects: $(OBJS) $(PROGOBJS) $(filter-out
$(MOZBUILD_NON_DEFAULT_TARGETS),$(RUST_LIBRARY_FILE))
-+host-objects: $(HOST_OBJS) $(HOST_PROGOBJS) $(HOST_RUST_LIBRARY_FILE)
-
- syms::
-
- include $(MOZILLA_DIR)/config/makefiles/target_binaries.mk
- endif
-
- alltags:
- $(RM) TAGS
-diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py
b/python/mozbuild/mozbuild/backend/recursivemake.py
---- a/python/mozbuild/mozbuild/backend/recursivemake.py
-+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
-@@ -1379,16 +1379,18 @@ class RecursiveMakeBackend(MakeBackend):
- self._process_non_default_target(libdef, libdef.import_name,
backend_file)
-
- def _process_host_shared_library(self, libdef, backend_file):
- backend_file.write("HOST_SHARED_LIBRARY = %s\n" % libdef.lib_name)
-
- def _build_target_for_obj(self, obj):
- if hasattr(obj, "output_category") and obj.output_category:
- target_name = obj.output_category
-+ elif isinstance(obj, BaseRustLibrary):
-+ target_name = f"{obj.KIND}-objects"
- else:
- target_name = obj.KIND
- if target_name == "wasm":
- target_name = "target"
- return "%s/%s" % (
- mozpath.relpath(obj.objdir, self.environment.topobjdir),
- target_name,
- )
-
diff --git
a/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
b/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
deleted file mode 100644
index 4d5edb4..0000000
---
a/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-
-# HG changeset patch
-# User Mike Hommey <mh+mozilla AT glandium.org>
-# Date 1690956771 0
-# Node ID b3c797d9f72325bd693c43ff9a1b110e6af964b2
-# Parent 7ee1dad073d03db2f730fd5c2baf77f37e458feb
-Bug 1844484 - Override the symbol used by compilers in vtables for pure
virtual methods. r=firefox-build-system-reviewers,ahochheiden
-
-In bug 1839743, we made the build system prefer packed relative
-relocations to elfhack when both the system libc and linker support
-them. Unfortunately, while that covers most of the benefits from
-elfhack, it doesn't cover bug 651892.
-
-To cover it, we make every C++ executable contain its own copy of
-the symbol, so that all relocations related to it become relative.
-
-And because this is actually (slightly) beneficial on macos, and because
-it's also an advantage to have our own abort called rather than the
-system's, we apply the same to all platforms.
-
-Differential Revision: https://phabricator.services.mozilla.com/D184068
-
-diff --git a/build/pure_virtual/moz.build b/build/pure_virtual/moz.build
-new file mode 100644
---- /dev/null
-+++ b/build/pure_virtual/moz.build
-@@ -0,0 +1,23 @@
-+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-+# vim: set filetype=python:
-+# 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/.
-+
-+Library("pure_virtual")
-+
-+SOURCES += ["pure_virtual.c"]
-+
-+FORCE_STATIC_LIB = True
-+
-+USE_STATIC_LIBS = True
-+
-+# Build a real library so that the linker can remove it if the symbol
-+# is never used.
-+NO_EXPAND_LIBS = True
-+
-+# LTO can mess things up.
-+if CONFIG["CC_TYPE"] == "clang-cl":
-+ CFLAGS += ["-clang:-fno-lto"]
-+else:
-+ CFLAGS += ["-fno-lto"]
-diff --git a/build/pure_virtual/pure_virtual.c
b/build/pure_virtual/pure_virtual.c
-new file mode 100644
---- /dev/null
-+++ b/build/pure_virtual/pure_virtual.c
-@@ -0,0 +1,27 @@
-+/* 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 <mozilla/Assertions.h>
-+
-+// This function is used in vtables to point at pure virtual methods.
-+// The implementation in the standard library usually aborts, but
-+// the function is normally never called (a call would be a bug).
-+// Each of these entries in vtables, however, require an unnecessary
-+// dynamic relocation. Defining our own function makes the linker
-+// point the vtables here instead of the standard library, replacing
-+// the dynamic relocations with relative relocations.
-+//
-+// On Windows, it doesn't really make a difference, but on macOS it
-+// can be packed better, saving about 10KB in libxul, and on 64-bits
-+// ELF systems, with packed relative relocations, it saves 140KB.
-+//
-+// Another advantage of having our own is that we can use MOZ_CRASH
-+// instead of the system's abort.
-+#ifdef _MSC_VER
-+int __cdecl _purecall() { MOZ_CRASH("pure virtual call"); }
-+#else
-+__attribute__((visibility("hidden"))) void __cxa_pure_virtual() {
-+ MOZ_CRASH("pure virtual call");
-+}
-+#endif
-diff --git a/mfbt/moz.build b/mfbt/moz.build
---- a/mfbt/moz.build
-+++ b/mfbt/moz.build
-@@ -200,8 +200,13 @@ SOURCES += [
- SOURCES["lz4/xxhash.c"].flags += ["-Wno-unused-function"]
-
- DisableStlWrapping()
-
- if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
- OS_LIBS += ["atomic"]
-
- DEFINES["LZ4LIB_VISIBILITY"] = ""
-+
-+# This is kind of gross because this is not a subdirectory,
-+# but pure_virtual requires mfbt to build and some projects
-+# don't use mfbt.
-+DIRS += ["../build/pure_virtual"]
-diff --git a/python/mozbuild/mozbuild/frontend/emitter.py
b/python/mozbuild/mozbuild/frontend/emitter.py
---- a/python/mozbuild/mozbuild/frontend/emitter.py
-+++ b/python/mozbuild/mozbuild/frontend/emitter.py
-@@ -383,16 +383,18 @@ class TreeMetadataEmitter(LoggingMixin):
- if (
- context.config.substs.get("MOZ_STDCXX_COMPAT")
- and context.config.substs.get(self.ARCH_VAR.get(obj.KIND))
== "Linux"
- ):
- self._link_library(
- context, obj, variable, self.STDCXXCOMPAT_NAME[obj.KIND]
- )
- if obj.KIND == "target":
-+ if "pure_virtual" in self._libs:
-+ self._link_library(context, obj, variable,
"pure_virtual")
- for lib in context.config.substs.get("STLPORT_LIBS", []):
- obj.link_system_library(lib)
-
- def _link_library(self, context, obj, variable, path):
- force_static = path.startswith("static:") and obj.KIND == "target"
- if force_static:
- path = path[7:]
- name = mozpath.basename(path)
-diff --git a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
---- a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
-+++ b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
-@@ -1,24 +1,16 @@
- add_task(async function run_test() {
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
- dump(
- "INFO | test_crash_purevirtual.js | Can't test crashreporter in a
non-libxul build.\n"
- );
- return;
- }
-
-- var isOSX = "nsILocalFileMac" in Ci;
-- if (isOSX) {
-- dump(
-- "INFO | test_crash_purevirtual.js | TODO: purecalls not caught on OS
X\n"
-- );
-- return;
-- }
--
- // Try crashing with a pure virtual call
- await do_crash(
- function () {
- crashType = CrashTestUtils.CRASH_PURE_VIRTUAL_CALL;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- },
- function (mdump, extra) {
- Assert.equal(extra.TestKey, "TestValue");
-
diff --git a/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
b/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
deleted file mode 100644
index 9f8ce30..0000000
--- a/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- a/media/ffvpx/libavcodec/x86/mathops.h
-+++ b/media/ffvpx/libavcodec/x86/mathops.h
-@@ -35,12 +35,20 @@
- static av_always_inline av_const int MULL(int a, int b, unsigned shift)
- {
- int rt, dummy;
-+ if (__builtin_constant_p(shift))
- __asm__ (
- "imull %3 \n\t"
- "shrdl %4, %%edx, %%eax \n\t"
- :"=a"(rt), "=d"(dummy)
-- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
-+ :"a"(a), "rm"(b), "i"(shift & 0x1F)
- );
-+ else
-+ __asm__ (
-+ "imull %3 \n\t"
-+ "shrdl %4, %%edx, %%eax \n\t"
-+ :"=a"(rt), "=d"(dummy)
-+ :"a"(a), "rm"(b), "c"((uint8_t)shift)
-+ );
- return rt;
- }
-
-@@ -113,19 +121,31 @@ __asm__ volatile(\
- // avoid +32 for shift optimization (gcc should do that ...)
- #define NEG_SSR32 NEG_SSR32
- static inline int32_t NEG_SSR32( int32_t a, int8_t s){
-+ if (__builtin_constant_p(s))
- __asm__ ("sarl %1, %0\n\t"
- : "+r" (a)
-- : "ic" ((uint8_t)(-s))
-+ : "i" (-s & 0x1F)
- );
-+ else
-+ __asm__ ("sarl %1, %0\n\t"
-+ : "+r" (a)
-+ : "c" ((uint8_t)(-s))
-+ );
- return a;
- }
-
- #define NEG_USR32 NEG_USR32
- static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
-+ if (__builtin_constant_p(s))
- __asm__ ("shrl %1, %0\n\t"
- : "+r" (a)
-- : "ic" ((uint8_t)(-s))
-+ : "i" (-s & 0x1F)
- );
-+ else
-+ __asm__ ("shrl %1, %0\n\t"
-+ : "+r" (a)
-+ : "c" ((uint8_t)(-s))
-+ );
- return a;
- }
-
---
-2.30.2
diff --git
a/http/firefox/patches/0035-bmo-1847697-dont-use-pack-relative-relocs-when-it-leads-to-ld-error.patch
b/http/firefox/patches/0035-bmo-1847697-dont-use-pack-relative-relocs-when-it-leads-to-ld-error.patch
deleted file mode 100644
index 6d16524..0000000
---
a/http/firefox/patches/0035-bmo-1847697-dont-use-pack-relative-relocs-when-it-leads-to-ld-error.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/toolkit/moz.configure b/toolkit/moz.configure
---- a/toolkit/moz.configure
-+++ b/toolkit/moz.configure
-@@ -1619,19 +1619,28 @@
- # BFD ld ignores options it doesn't understand. So check
- # that we did get packed relative relocations (DT_RELR).
- env = os.environ.copy()
- env["LANG"] = "C"
- dyn = check_cmd_output(readelf, "-d", path, env=env)
-+ dyn = dyn.splitlines()
- tags = [
-- int(l.split()[0], 16)
-- for l in dyn.splitlines()
-- if l.strip().startswith("0x")
-+ int(l.split()[0], 16) for l in dyn if
l.strip().startswith("0x")
- ]
- # Older versions of readelf don't know about DT_RELR but
will
- # still display the tag number.
- if 0x23 in tags:
-- return pack_rel_relocs
-+ needed = [l for l in dyn if l.split()[1] == "(NEEDED)"]
-+ is_glibc = any(l.endswith("[libc.so.6]") for l in
needed)
-+ # The mold linker doesn't add a GLIBC_ABI_DT_RELR
version
-+ # dependency, which ld.so doesn't like.
-+ # https://github.com/rui314/mold/issues/653#issuecomment-1670274638
-+ if is_glibc:
-+ versions = check_cmd_output(readelf, "-V", path,
env=env)
-+ if "GLIBC_ABI_DT_RELR" in versions.split():
-+ return pack_rel_relocs
-+ else:
-+ return pack_rel_relocs
- finally:
- try:
- os.remove(path)
- except FileNotFoundError:
- pass
-
diff --git
a/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
b/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
deleted file mode 100644
index 8e18e04..0000000
---
a/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-
-# HG changeset patch
-# User stransky <stransky AT redhat.com>
-# Date 1690447248 0
-# Node ID 0963f5b18821bbcac2c9799552a6d60fc31ae7ae
-# Parent f3abc129a8e8c6554481b7a7c3e63c34df3c9ee3
-Bug 1837627 Don't use YUVColorSpace::Identity for YUV pixel formats r=alwu
-
-Check color space of video frames and use YUVColorSpace::Identity for RGB
frames only. This patch also unifies color space setup for shm and non-shm
video decoding paths.
-
-- Implement TransferAVColorSpaceToColorSpace() to convert color space from
AVColorSpace to gfx::YUVColorSpace.
- It also check color format and doesn't allow to mix YUV color space and
RGB formats.
-- Use TransferAVColorSpaceToColorSpace() in both shm and non-shm decoding
paths.
-
-Differential Revision: https://phabricator.services.mozilla.com/D184469
-
-diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-@@ -607,16 +607,42 @@ static gfx::ColorDepth GetColorDepth(con
- return gfx::ColorDepth::COLOR_12;
- #endif
- default:
- MOZ_ASSERT_UNREACHABLE("Not supported format?");
- return gfx::ColorDepth::COLOR_8;
- }
- }
-
-+static bool IsYUVFormat(const AVPixelFormat& aFormat) {
-+ return aFormat != AV_PIX_FMT_GBRP;
-+}
-+
-+static gfx::YUVColorSpace TransferAVColorSpaceToColorSpace(
-+ const AVColorSpace aSpace, const AVPixelFormat aFormat,
-+ const gfx::IntSize& aSize) {
-+ if (!IsYUVFormat(aFormat)) {
-+ return gfx::YUVColorSpace::Identity;
-+ }
-+ switch (aSpace) {
-+#if LIBAVCODEC_VERSION_MAJOR >= 55
-+ case AVCOL_SPC_BT2020_NCL:
-+ case AVCOL_SPC_BT2020_CL:
-+ return gfx::YUVColorSpace::BT2020;
-+#endif
-+ case AVCOL_SPC_BT709:
-+ return gfx::YUVColorSpace::BT709;
-+ case AVCOL_SPC_SMPTE170M:
-+ case AVCOL_SPC_BT470BG:
-+ return gfx::YUVColorSpace::BT601;
-+ default:
-+ return DefaultColorSpace(aSize);
-+ }
-+}
-+
- #ifdef CUSTOMIZED_BUFFER_ALLOCATION
- static int GetVideoBufferWrapper(struct AVCodecContext* aCodecContext,
- AVFrame* aFrame, int aFlags) {
- auto* decoder =
- static_cast<FFmpegVideoDecoder<LIBAV_VER>*>(aCodecContext->opaque);
- int rv = decoder->GetVideoBuffer(aCodecContext, aFrame, aFlags);
- return rv < 0 ? decoder->GetVideoBufferDefault(aCodecContext, aFrame,
aFlags)
- : rv;
-@@ -625,32 +651,16 @@ static int GetVideoBufferWrapper(struct
- static void ReleaseVideoBufferWrapper(void* opaque, uint8_t* data) {
- if (opaque) {
- FFMPEG_LOGV("ReleaseVideoBufferWrapper: PlanarYCbCrImage=%p", opaque);
- RefPtr<ImageBufferWrapper> image =
static_cast<ImageBufferWrapper*>(opaque);
- image->ReleaseBuffer();
- }
- }
-
--static gfx::YUVColorSpace TransferAVColorSpaceToYUVColorSpace(
-- AVColorSpace aSpace) {
-- switch (aSpace) {
-- case AVCOL_SPC_BT2020_NCL:
-- case AVCOL_SPC_BT2020_CL:
-- return gfx::YUVColorSpace::BT2020;
-- case AVCOL_SPC_BT709:
-- return gfx::YUVColorSpace::BT709;
-- case AVCOL_SPC_SMPTE170M:
-- case AVCOL_SPC_BT470BG:
-- return gfx::YUVColorSpace::BT601;
-- default:
-- return gfx::YUVColorSpace::Default;
-- }
--}
--
- static bool IsColorFormatSupportedForUsingCustomizedBuffer(
- const AVPixelFormat& aFormat) {
- # if XP_WIN
- // Currently the web render doesn't support uploading R16 surface, so we
can't
- // use the shmem texture for 10 bit+ videos which would be uploaded by the
- // web render. See Bug 1751498.
- return aFormat == AV_PIX_FMT_YUV420P || aFormat == AV_PIX_FMT_YUVJ420P ||
- aFormat == AV_PIX_FMT_YUV444P;
-@@ -723,18 +733,19 @@ FFmpegVideoDecoder<LIBAV_VER>::AllocateT
-
- // Setting other attributes
- data.mPictureRect = gfx::IntRect(
- mInfo.ScaledImageRect(aCodecContext->width, aCodecContext->height)
- .TopLeft(),
- gfx::IntSize(aCodecContext->width, aCodecContext->height));
- data.mStereoMode = mInfo.mStereoMode;
- if (aCodecContext->colorspace != AVCOL_SPC_UNSPECIFIED) {
-- data.mYUVColorSpace =
-- TransferAVColorSpaceToYUVColorSpace(aCodecContext->colorspace);
-+ data.mYUVColorSpace = TransferAVColorSpaceToColorSpace(
-+ aCodecContext->colorspace, aCodecContext->pix_fmt,
-+ data.mPictureRect.Size());
- } else {
- data.mYUVColorSpace = mInfo.mColorSpace
- ? *mInfo.mColorSpace
- : DefaultColorSpace(data.mPictureRect.Size());
- }
- data.mColorDepth = GetColorDepth(aCodecContext->pix_fmt);
- data.mColorRange = aCodecContext->color_range == AVCOL_RANGE_JPEG
- ? gfx::ColorRange::FULL
-@@ -1275,40 +1286,27 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
- if (aGotFrame) {
- *aGotFrame = true;
- }
- return rv;
- #endif
- }
-
- gfx::YUVColorSpace FFmpegVideoDecoder<LIBAV_VER>::GetFrameColorSpace()
const {
-+ AVColorSpace colorSpace = AVCOL_SPC_UNSPECIFIED;
- #if LIBAVCODEC_VERSION_MAJOR > 58
-- switch (mFrame->colorspace) {
-+ colorSpace = mFrame->colorspace;
- #else
-- AVColorSpace colorSpace = AVCOL_SPC_UNSPECIFIED;
- if (mLib->av_frame_get_colorspace) {
- colorSpace = (AVColorSpace)mLib->av_frame_get_colorspace(mFrame);
- }
-- switch (colorSpace) {
- #endif
--#if LIBAVCODEC_VERSION_MAJOR >= 55
-- case AVCOL_SPC_BT2020_NCL:
-- case AVCOL_SPC_BT2020_CL:
-- return gfx::YUVColorSpace::BT2020;
--#endif
-- case AVCOL_SPC_BT709:
-- return gfx::YUVColorSpace::BT709;
-- case AVCOL_SPC_SMPTE170M:
-- case AVCOL_SPC_BT470BG:
-- return gfx::YUVColorSpace::BT601;
-- case AVCOL_SPC_RGB:
-- return gfx::YUVColorSpace::Identity;
-- default:
-- return DefaultColorSpace({mFrame->width, mFrame->height});
-- }
-+ return TransferAVColorSpaceToColorSpace(
-+ colorSpace, (AVPixelFormat)mFrame->format,
-+ gfx::IntSize{mFrame->width, mFrame->height});
- }
-
- gfx::ColorSpace2 FFmpegVideoDecoder<LIBAV_VER>::GetFrameColorPrimaries()
const {
- AVColorPrimaries colorPrimaries = AVCOL_PRI_UNSPECIFIED;
- #if LIBAVCODEC_VERSION_MAJOR > 57
- colorPrimaries = mFrame->color_primaries;
- #endif
- switch (colorPrimaries) {
-@@ -1632,17 +1630,18 @@ bool FFmpegVideoDecoder<LIBAV_VER>::IsFo
- }
-
- // See ffmpeg / vaapi_decode.c how CodecID is mapped to VAProfile.
- static const struct {
- enum AVCodecID codec_id;
- VAProfile va_profile;
- char name[100];
- } vaapi_profile_map[] = {
--# define MAP(c, v, n) {AV_CODEC_ID_##c, VAProfile##v, n}
-+# define MAP(c, v, n) \
-+ { AV_CODEC_ID_##c, VAProfile##v, n }
- MAP(H264, H264ConstrainedBaseline, "H264ConstrainedBaseline"),
- MAP(H264, H264Main, "H264Main"),
- MAP(H264, H264High, "H264High"),
- MAP(VP8, VP8Version0_3, "VP8Version0_3"),
- MAP(VP9, VP9Profile0, "VP9Profile0"),
- MAP(VP9, VP9Profile2, "VP9Profile2"),
- MAP(AV1, AV1Profile0, "AV1Profile0"),
- MAP(AV1, AV1Profile1, "AV1Profile1"),
-
diff --git
a/http/firefox/patches/0037-bmo-1837627-convert-AVColorRange-to-GetColorRange.patch