2020-12-16 23:40:17 +01:00
|
|
|
# HG changeset patch
|
|
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
2023-07-05 23:06:07 +02:00
|
|
|
# Parent 9959fe2a13a39cbeb98ca1bef2e21caba16717bd
|
2020-12-16 23:40:17 +01:00
|
|
|
|
2023-07-05 23:06:07 +02:00
|
|
|
Index: firefox-115.0/build/moz.configure/lto-pgo.configure
|
|
|
|
===================================================================
|
|
|
|
--- firefox-115.0.orig/build/moz.configure/lto-pgo.configure
|
|
|
|
+++ firefox-115.0/build/moz.configure/lto-pgo.configure
|
|
|
|
@@ -251,8 +251,8 @@ def lto(
|
2021-12-07 22:12:25 +01:00
|
|
|
cflags.append("-flto")
|
|
|
|
ldflags.append("-flto")
|
|
|
|
else:
|
|
|
|
- cflags.append("-flto=thin")
|
|
|
|
- ldflags.append("-flto=thin")
|
|
|
|
+ cflags.append("-flto")
|
|
|
|
+ ldflags.append("-flto")
|
|
|
|
|
2023-07-05 23:06:07 +02:00
|
|
|
if target.os == "Android" and "cross" in values:
|
2021-12-07 22:12:25 +01:00
|
|
|
# Work around https://github.com/rust-lang/rust/issues/90088
|
2023-07-05 23:06:07 +02:00
|
|
|
@@ -268,7 +268,7 @@ def lto(
|
|
|
|
if "full" in values:
|
2021-12-07 22:12:25 +01:00
|
|
|
cflags.append("-flto")
|
|
|
|
else:
|
|
|
|
- cflags.append("-flto=thin")
|
|
|
|
+ cflags.append("-flto")
|
|
|
|
# With clang-cl, -flto can only be used with -c or -fuse-ld=lld.
|
|
|
|
# AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld.
|
|
|
|
cflags.append("-fuse-ld=lld")
|
2023-07-05 23:06:07 +02:00
|
|
|
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
|
- Mozilla Firefox 109.0
MFSA 2023-01 (bsc#1207119)
* CVE-2023-23597 (bmo#1538028)
Logic bug in process allocation allowed to read arbitrary
files
* CVE-2023-23598 (bmo#1800425)
Arbitrary file read from GTK drag and drop on Linux
* CVE-2023-23599 (bmo#1777800)
Malicious command could be hidden in devtools output on
Windows
* CVE-2023-23600 (bmo#1787034)
Notification permissions persisted between Normal and Private
Browsing on Android
* CVE-2023-23601 (bmo#1794268)
URL being dragged from cross-origin iframe into same tab
triggers navigation
* CVE-2023-23602 (bmo#1800890)
Content Security Policy wasn't being correctly applied to
WebSockets in WebWorkers
* CVE-2023-23603 (bmo#1800832)
Calls to <code>console.log</code> allowed bypasing Content
Security Policy via format directive
* CVE-2023-23604 (bmo#1802346)
Creation of duplicate <code>SystemPrincipal</code> from less
secure contexts
* CVE-2023-23605 (bmo#1764921, bmo#1802690, bmo#1806974)
Memory safety bugs fixed in Firefox 109 and Firefox ESR 102.7
* CVE-2023-23606 (bmo#1764974, bmo#1798591, bmo#1799201,
bmo#1800446, bmo#1801248, bmo#1802100, bmo#1803393,
bmo#1804626, bmo#1804971, bmo#1807004)
OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=1033
2023-01-18 08:21:07 +01:00
|
|
|
import sys
|
2020-12-16 23:40:17 +01:00
|
|
|
|
|
|
|
import mozcrash
|
- Mozilla Firefox 109.0
MFSA 2023-01 (bsc#1207119)
* CVE-2023-23597 (bmo#1538028)
Logic bug in process allocation allowed to read arbitrary
files
* CVE-2023-23598 (bmo#1800425)
Arbitrary file read from GTK drag and drop on Linux
* CVE-2023-23599 (bmo#1777800)
Malicious command could be hidden in devtools output on
Windows
* CVE-2023-23600 (bmo#1787034)
Notification permissions persisted between Normal and Private
Browsing on Android
* CVE-2023-23601 (bmo#1794268)
URL being dragged from cross-origin iframe into same tab
triggers navigation
* CVE-2023-23602 (bmo#1800890)
Content Security Policy wasn't being correctly applied to
WebSockets in WebWorkers
* CVE-2023-23603 (bmo#1800832)
Calls to <code>console.log</code> allowed bypasing Content
Security Policy via format directive
* CVE-2023-23604 (bmo#1802346)
Creation of duplicate <code>SystemPrincipal</code> from less
secure contexts
* CVE-2023-23605 (bmo#1764921, bmo#1802690, bmo#1806974)
Memory safety bugs fixed in Firefox 109 and Firefox ESR 102.7
* CVE-2023-23606 (bmo#1764974, bmo#1798591, bmo#1799201,
bmo#1800446, bmo#1801248, bmo#1802100, bmo#1803393,
bmo#1804626, bmo#1804971, bmo#1807004)
OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=1033
2023-01-18 08:21:07 +01:00
|
|
|
-from mozbuild.base import BinaryNotFoundException, MozbuildObject
|
|
|
|
+from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException
|
2020-12-16 23:40:17 +01:00
|
|
|
from mozfile import TemporaryDirectory
|
|
|
|
from mozhttpd import MozHttpd
|
|
|
|
from mozprofile import FirefoxProfile, Preferences
|
2023-07-05 23:06:07 +02:00
|
|
|
@@ -87,9 +87,22 @@ if __name__ == "__main__":
|
2020-12-16 23:40:17 +01:00
|
|
|
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
|
2023-07-05 23:06:07 +02:00
|
|
|
@@ -213,6 +226,10 @@ if __name__ == "__main__":
|
2020-12-16 23:40:17 +01:00
|
|
|
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")
|
2023-07-05 23:06:07 +02:00
|
|
|
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
|
2020-12-16 23:40:17 +01:00
|
|
|
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
|
|
|
|
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
|
|
|
|
|
|
|
|
+ if [ -n "$MOZ_PGO" ]; then
|
2023-02-15 22:11:31 +01:00
|
|
|
+ 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"
|
2020-12-16 23:40:17 +01:00
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
# We want to make sure we use binutils and other binaries in the tooltool
|
|
|
|
# package.
|
2023-02-15 22:11:31 +01:00
|
|
|
mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH"
|
2023-07-05 23:06:07 +02:00
|
|
|
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 += [
|
2020-12-16 23:40:17 +01:00
|
|
|
"mozInlineSpellChecker.h",
|
|
|
|
"mozSpellChecker.h",
|
|
|
|
]
|
|
|
|
+
|
|
|
|
+CXXFLAGS += ['-fno-devirtualize']
|
2023-07-05 23:06:07 +02:00
|
|
|
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() {
|
2020-12-16 23:40:17 +01:00
|
|
|
}
|
|
|
|
#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());
|
2022-04-05 22:51:21 +02:00
|
|
|
// crashAfterTicks is guaranteed to be > 0 as
|
|
|
|
// crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS
|