New commits:
commit 654f8ec33b378bdc364bd27f56dc9dbc54c97f79
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index 7865256..ec3ef5e 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2023-09-27 Pavel Vinogradov <public AT sorcemage.org>
+ * DETAILS: version 118.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.93
+ * patches/*: updated
+
2023-09-12 Pavel Vinogradov <public AT sorcemage.org>
* DETAILS: version 117.0.1, SECURITY_PATCH++, (CVE-2023-4863)
diff --git a/http/firefox/patches/0020-bgo-908297-ppc64-webrtc.patch
b/http/firefox/patches/0020-bgo-908297-ppc64-webrtc.patch
new file mode 100644
index 0000000..e4f12bc
--- /dev/null
+++ b/http/firefox/patches/0020-bgo-908297-ppc64-webrtc.patch
@@ -0,0 +1,30 @@
+diff -r 4cb22dd449d6 third_party/libwebrtc/moz.build
+--- a/third_party/libwebrtc/moz.build Mon Aug 07 08:16:50 2023 +0000
++++ b/third_party/libwebrtc/moz.build Tue Aug 08 13:57:02 2023 -0700
+@@ -603,16 +603,26 @@
+ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
+ "/third_party/libwebrtc/modules/portal/portal_gn",
+ "/third_party/libwebrtc/third_party/drm/drm_gn",
+ "/third_party/libwebrtc/third_party/gbm/gbm_gn",
+ "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
+ "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
+ ]
+
++if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
++
++ DIRS += [
++ "/third_party/libwebrtc/modules/portal/portal_gn",
++ "/third_party/libwebrtc/third_party/drm/drm_gn",
++ "/third_party/libwebrtc/third_party/gbm/gbm_gn",
++ "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
++ "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
++ ]
++
+ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "OpenBSD":
+
+ DIRS += [
+ "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
+ "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
+ ]
+
+ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "OpenBSD":
\ No newline at end of file
diff --git
a/http/firefox/patches/0020-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
b/http/firefox/patches/0020-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
deleted file mode 100644
index 51f7faa..0000000
--- a/http/firefox/patches/0020-qm-qm-fix-sqlite3-on-ppc-with-clang.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel AT octaforge.org>
-Date: Fri, 23 Sep 2022 02:38:29 +0200
-Subject: [PATCH] fix sqlite3 on ppc with clang
-
-The __ppc__ macro is always defined on clang but not gcc, which
-results in sqlite mistakenly thinking that ppc64le with clang
-is big endian.
-
-Also disable some inline assembly stuff on ppc that is never used
-with gcc and probably was never tested with modern machines.
----
- third_party/sqlite3/src/sqlite3.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/third_party/sqlite3/src/sqlite3.c
b/third_party/sqlite3/src/sqlite3.c
-index 4f3dc68..9017062 100644
---- a/third_party/sqlite3/src/sqlite3.c
-+++ b/third_party/sqlite3/src/sqlite3.c
-@@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
- # if defined(i386) || defined(__i386__) || defined(_M_IX86) ||
\
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) ||
\
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) ||
\
-- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
-+ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||
defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--# elif defined(sparc) || defined(__ppc__) || \
-+# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
- defined(__ARMEB__) || defined(__AARCH64EB__)
- # define SQLITE_BYTEORDER 4321
- # else
-@@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char
**sqlite3CompileOptions(int *pnOpt);
- return val;
- }
-
--#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
-+#elif 0
-
- __inline__ sqlite_uint64 sqlite3Hwtime(void){
- unsigned long long retval;
-@@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
- #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
- defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
- defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
-- defined(__arm__)
-+ defined(__arm__) || defined(__LITTLE_ENDIAN__)
- # define SQLITE_BYTEORDER 1234
--#elif defined(sparc) || defined(__ppc__)
-+#elif defined(sparc) || defined(__BIG_ENDIAN__)
- # define SQLITE_BYTEORDER 4321
- #else
- # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
---
-2.37.3
-
diff --git a/http/firefox/patches/0021-bgo-908297-ppc64-webrtc.patch
b/http/firefox/patches/0021-bgo-908297-ppc64-webrtc.patch
deleted file mode 100644
index e4f12bc..0000000
--- a/http/firefox/patches/0021-bgo-908297-ppc64-webrtc.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -r 4cb22dd449d6 third_party/libwebrtc/moz.build
---- a/third_party/libwebrtc/moz.build Mon Aug 07 08:16:50 2023 +0000
-+++ b/third_party/libwebrtc/moz.build Tue Aug 08 13:57:02 2023 -0700
-@@ -603,16 +603,26 @@
- "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
- "/third_party/libwebrtc/modules/portal/portal_gn",
- "/third_party/libwebrtc/third_party/drm/drm_gn",
- "/third_party/libwebrtc/third_party/gbm/gbm_gn",
- "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
- "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
- ]
-
-+if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
-+
-+ DIRS += [
-+ "/third_party/libwebrtc/modules/portal/portal_gn",
-+ "/third_party/libwebrtc/third_party/drm/drm_gn",
-+ "/third_party/libwebrtc/third_party/gbm/gbm_gn",
-+ "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
-+ "/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
-+ ]
-+
- if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "OpenBSD":
-
- DIRS += [
- "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
- "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
- ]
-
- if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "OpenBSD":
\ No newline at end of file
diff --git a/http/firefox/patches/0021-bmo-1516803-gcc-lto-sandbox.patch
b/http/firefox/patches/0021-bmo-1516803-gcc-lto-sandbox.patch
new file mode 100644
index 0000000..eff08f6
--- /dev/null
+++ b/http/firefox/patches/0021-bmo-1516803-gcc-lto-sandbox.patch
@@ -0,0 +1,16 @@
+diff -Naur a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+--- a/security/sandbox/linux/moz.build 2023-07-04 13:57:56.029462755 +0300
++++ b/security/sandbox/linux/moz.build 2023-07-04 14:05:08.607221195 +0300
+@@ -114,9 +114,9 @@
+ # gcc lto likes to put the top level asm in syscall.cc in a different
partition
+ # from the function using it which breaks the build. Work around that by
+ # forcing there to be only one partition.
+-for f in CONFIG["OS_CXXFLAGS"]:
+- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
+- LDFLAGS += ["--param lto-partitions=1"]
++if CONFIG['CC_TYPE'] != 'clang':
++ LDFLAGS += ['--param', 'lto-partitions=1']
++
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
diff --git a/http/firefox/patches/0022-bmo-1516803-gcc-lto-sandbox.patch
b/http/firefox/patches/0022-bmo-1516803-gcc-lto-sandbox.patch
deleted file mode 100644
index eff08f6..0000000
--- a/http/firefox/patches/0022-bmo-1516803-gcc-lto-sandbox.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Naur a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
---- a/security/sandbox/linux/moz.build 2023-07-04 13:57:56.029462755 +0300
-+++ b/security/sandbox/linux/moz.build 2023-07-04 14:05:08.607221195 +0300
-@@ -114,9 +114,9 @@
- # gcc lto likes to put the top level asm in syscall.cc in a different
partition
- # from the function using it which breaks the build. Work around that by
- # forcing there to be only one partition.
--for f in CONFIG["OS_CXXFLAGS"]:
-- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-- LDFLAGS += ["--param lto-partitions=1"]
-+if CONFIG['CC_TYPE'] != 'clang':
-+ LDFLAGS += ['--param', 'lto-partitions=1']
-+
-
- DEFINES["NS_NO_XPCOM"] = True
- DisableStlWrapping()
diff --git a/http/firefox/patches/0022-enable-vaapi-on-all-amd-cards.patch
b/http/firefox/patches/0022-enable-vaapi-on-all-amd-cards.patch
new file mode 100644
index 0000000..112cd42
--- /dev/null
+++ b/http/firefox/patches/0022-enable-vaapi-on-all-amd-cards.patch
@@ -0,0 +1,19 @@
+diff -up firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi
firefox-115.0/widget/gtk/GfxInfo.cpp
+--- firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-06-29
12:18:53.179833765 +0200
++++ firefox-115.0/widget/gtk/GfxInfo.cpp 2023-06-29 12:19:33.256212776
+0200
+@@ -970,14 +970,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
+ V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", "");
+
+- // Disable on Release/late Beta on AMD
+-#if !defined(EARLY_BETA_OR_EARLIER)
+- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll,
+- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
+- nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
+- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
+- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE",
"");
+-#endif
+ ////////////////////////////////////
+ // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST
+ APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All,
+
diff --git
a/http/firefox/patches/0023-bgo-907963-rustflags-single-string.patch
b/http/firefox/patches/0023-bgo-907963-rustflags-single-string.patch
new file mode 100644
index 0000000..a56aec4
--- /dev/null
+++ b/http/firefox/patches/0023-bgo-907963-rustflags-single-string.patch
@@ -0,0 +1,76 @@
+--- 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/0023-enable-vaapi-on-all-amd-cards.patch
b/http/firefox/patches/0023-enable-vaapi-on-all-amd-cards.patch
deleted file mode 100644
index 112cd42..0000000
--- a/http/firefox/patches/0023-enable-vaapi-on-all-amd-cards.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi
firefox-115.0/widget/gtk/GfxInfo.cpp
---- firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-06-29
12:18:53.179833765 +0200
-+++ firefox-115.0/widget/gtk/GfxInfo.cpp 2023-06-29 12:19:33.256212776
+0200
-@@ -970,14 +970,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
- V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", "");
-
-- // Disable on Release/late Beta on AMD
--#if !defined(EARLY_BETA_OR_EARLIER)
-- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll,
-- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
-- nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
-- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
-- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE",
"");
--#endif
- ////////////////////////////////////
- // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST
- APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All,
-
diff --git
a/http/firefox/patches/0024-bgo-907963-rustflags-single-string.patch
b/http/firefox/patches/0024-bgo-907963-rustflags-single-string.patch
deleted file mode 100644
index a56aec4..0000000
--- a/http/firefox/patches/0024-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/0024-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
b/http/firefox/patches/0024-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
new file mode 100644
index 0000000..bb0621a
--- /dev/null
+++
b/http/firefox/patches/0024-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/0025-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
b/http/firefox/patches/0025-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch
deleted file mode 100644
index bb0621a..0000000
---
a/http/firefox/patches/0025-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/0025-gcc-lto-patch-from-opensuse.patch
b/http/firefox/patches/0025-gcc-lto-patch-from-opensuse.patch
new file mode 100644
index 0000000..24e4ba3
--- /dev/null
+++ b/http/firefox/patches/0025-gcc-lto-patch-from-opensuse.patch
@@ -0,0 +1,97 @@
+Index: firefox-115.0/build/pgo/profileserver.py
+===================================================================
+--- firefox-115.0.orig/build/pgo/profileserver.py
++++ firefox-115.0/build/pgo/profileserver.py
+@@ -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
+@@ -87,9 +87,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
+@@ -213,6 +226,10 @@ if __name__ == "__main__":
+ print("Firefox exited successfully, but produced a crashreport")
+ sys.exit(1)
+
++ print('Copying profile data....')
++ os.system('pwd');
++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..;
tar xf instrumented/profdata.tar.gz;');
++
+ llvm_profdata = env.get("LLVM_PROFDATA")
+ if llvm_profdata:
+ profraw_files = glob.glob("*.profraw")
+Index: firefox-115.0/build/unix/mozconfig.unix
+===================================================================
+--- firefox-115.0.orig/build/unix/mozconfig.unix
++++ firefox-115.0/build/unix/mozconfig.unix
+@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
+ CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
+ CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+
++ if [ -n "$MOZ_PGO" ]; then
++ if [ -z "$USE_ARTIFACT" ]; then
++ ac_add_options --enable-lto
++ fi
++ export AR="$topsrcdir/gcc/bin/gcc-ar"
++ export NM="$topsrcdir/gcc/bin/gcc-nm"
++ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
++ fi
++
+ # We want to make sure we use binutils and other binaries in the
tooltool
+ # package.
+ mk_add_options "export
PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH"
+Index: firefox-115.0/extensions/spellcheck/src/moz.build
+===================================================================
+--- firefox-115.0.orig/extensions/spellcheck/src/moz.build
++++ firefox-115.0/extensions/spellcheck/src/moz.build
+@@ -28,3 +28,5 @@ EXPORTS.mozilla += [
+ "mozInlineSpellChecker.h",
+ "mozSpellChecker.h",
+ ]
++
++CXXFLAGS += ['-fno-devirtualize']
+Index: firefox-115.0/toolkit/components/terminator/nsTerminator.cpp
+===================================================================
+--- firefox-115.0.orig/toolkit/components/terminator/nsTerminator.cpp
++++ firefox-115.0/toolkit/components/terminator/nsTerminator.cpp
+@@ -460,6 +460,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/0026-bgo-914738-nodbus-fix2.patch
b/http/firefox/patches/0026-bgo-914738-nodbus-fix2.patch
new file mode 100644
index 0000000..5b1a2ff
--- /dev/null
+++ b/http/firefox/patches/0026-bgo-914738-nodbus-fix2.patch
@@ -0,0 +1,13 @@
+--- a/widget/gtk/nsAppShell.cpp
++++ b/widget/gtk/nsAppShell.cpp
+@@ -296,8 +296,10 @@
+ do_GetService(POWERMANAGERSERVICE_CONTRACTID);
+
+ if (powerManagerService) {
++#ifdef MOZ_ENABLE_DBUS
+ powerManagerService->AddWakeLockListener(
+ WakeLockListener::GetSingleton());
++#endif
+ } else {
+ NS_WARNING(
+ "Failed to retrieve PowerManagerService, wakelocks will be
broken!");
diff --git
a/http/firefox/patches/0026-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
b/http/firefox/patches/0026-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
deleted file mode 100644
index 4d5edb4..0000000
---
a/http/firefox/patches/0026-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/0027-bgo-911679-gcc-binutils-2.41.patch
b/http/firefox/patches/0027-bgo-911679-gcc-binutils-2.41.patch
deleted file mode 100644
index 9f8ce30..0000000
--- a/http/firefox/patches/0027-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/0028-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
b/http/firefox/patches/0028-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
deleted file mode 100644
index 4a61c39..0000000
---
a/http/firefox/patches/0028-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-
-# 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/0029-bmo-1846701-Rename-MOZ_WAYLAND_USE_HWDECODE-to-MOZ_USE_HWDECODE.patch