1152
|
1 |
# HG changeset patch
|
|
2 |
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
1190
|
3 |
# Parent 9959fe2a13a39cbeb98ca1bef2e21caba16717bd
|
1152
|
4 |
|
1190
|
5 |
Index: firefox-115.0/build/moz.configure/lto-pgo.configure
|
|
6 |
===================================================================
|
|
7 |
--- firefox-115.0.orig/build/moz.configure/lto-pgo.configure
|
|
8 |
+++ firefox-115.0/build/moz.configure/lto-pgo.configure
|
|
9 |
@@ -251,8 +251,8 @@ def lto(
|
1169
|
10 |
cflags.append("-flto")
|
|
11 |
ldflags.append("-flto")
|
|
12 |
else:
|
|
13 |
- cflags.append("-flto=thin")
|
|
14 |
- ldflags.append("-flto=thin")
|
|
15 |
+ cflags.append("-flto")
|
|
16 |
+ ldflags.append("-flto")
|
1152
|
17 |
|
1190
|
18 |
if target.os == "Android" and "cross" in values:
|
1169
|
19 |
# Work around https://github.com/rust-lang/rust/issues/90088
|
1190
|
20 |
@@ -268,7 +268,7 @@ def lto(
|
|
21 |
if "full" in values:
|
1169
|
22 |
cflags.append("-flto")
|
|
23 |
else:
|
|
24 |
- cflags.append("-flto=thin")
|
|
25 |
+ cflags.append("-flto")
|
|
26 |
# With clang-cl, -flto can only be used with -c or -fuse-ld=lld.
|
|
27 |
# AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld.
|
|
28 |
cflags.append("-fuse-ld=lld")
|
1190
|
29 |
Index: firefox-115.0/build/pgo/profileserver.py
|
|
30 |
===================================================================
|
|
31 |
--- firefox-115.0.orig/build/pgo/profileserver.py
|
|
32 |
+++ firefox-115.0/build/pgo/profileserver.py
|
|
33 |
@@ -11,7 +11,7 @@ import subprocess
|
1152
|
34 |
import sys
|
|
35 |
|
|
36 |
import mozcrash
|
1183
|
37 |
-from mozbuild.base import BinaryNotFoundException, MozbuildObject
|
|
38 |
+from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException
|
1152
|
39 |
from mozfile import TemporaryDirectory
|
|
40 |
from mozhttpd import MozHttpd
|
|
41 |
from mozprofile import FirefoxProfile, Preferences
|
1190
|
42 |
@@ -87,9 +87,22 @@ if __name__ == "__main__":
|
1152
|
43 |
locations = ServerLocations()
|
|
44 |
locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged")
|
|
45 |
|
|
46 |
- old_profraw_files = glob.glob("*.profraw")
|
|
47 |
- for f in old_profraw_files:
|
|
48 |
- os.remove(f)
|
|
49 |
+ using_gcc = False
|
|
50 |
+ try:
|
|
51 |
+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
|
|
52 |
+ using_gcc = True
|
|
53 |
+ except BuildEnvironmentNotFoundException:
|
|
54 |
+ pass
|
|
55 |
+
|
|
56 |
+ if using_gcc:
|
|
57 |
+ for dirpath, _, filenames in os.walk('.'):
|
|
58 |
+ for f in filenames:
|
|
59 |
+ if f.endswith('.gcda'):
|
|
60 |
+ os.remove(os.path.join(dirpath, f))
|
|
61 |
+ else:
|
|
62 |
+ old_profraw_files = glob.glob('*.profraw')
|
|
63 |
+ for f in old_profraw_files:
|
|
64 |
+ os.remove(f)
|
|
65 |
|
|
66 |
with TemporaryDirectory() as profilePath:
|
|
67 |
# TODO: refactor this into mozprofile
|
1190
|
68 |
@@ -213,6 +226,10 @@ if __name__ == "__main__":
|
1152
|
69 |
print("Firefox exited successfully, but produced a crashreport")
|
|
70 |
sys.exit(1)
|
|
71 |
|
|
72 |
+ print('Copying profile data....')
|
|
73 |
+ os.system('pwd');
|
|
74 |
+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;');
|
|
75 |
+
|
|
76 |
llvm_profdata = env.get("LLVM_PROFDATA")
|
|
77 |
if llvm_profdata:
|
|
78 |
profraw_files = glob.glob("*.profraw")
|
1190
|
79 |
Index: firefox-115.0/build/unix/mozconfig.unix
|
|
80 |
===================================================================
|
|
81 |
--- firefox-115.0.orig/build/unix/mozconfig.unix
|
|
82 |
+++ firefox-115.0/build/unix/mozconfig.unix
|
|
83 |
@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then
|
1152
|
84 |
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
|
|
85 |
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
|
|
86 |
|
|
87 |
+ if [ -n "$MOZ_PGO" ]; then
|
1184
|
88 |
+ if [ -z "$USE_ARTIFACT" ]; then
|
|
89 |
+ ac_add_options --enable-lto
|
|
90 |
+ fi
|
|
91 |
+ export AR="$topsrcdir/gcc/bin/gcc-ar"
|
|
92 |
+ export NM="$topsrcdir/gcc/bin/gcc-nm"
|
|
93 |
+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
|
1152
|
94 |
+ fi
|
|
95 |
+
|
|
96 |
# We want to make sure we use binutils and other binaries in the tooltool
|
|
97 |
# package.
|
1184
|
98 |
mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH"
|
1190
|
99 |
Index: firefox-115.0/extensions/spellcheck/src/moz.build
|
|
100 |
===================================================================
|
|
101 |
--- firefox-115.0.orig/extensions/spellcheck/src/moz.build
|
|
102 |
+++ firefox-115.0/extensions/spellcheck/src/moz.build
|
|
103 |
@@ -28,3 +28,5 @@ EXPORTS.mozilla += [
|
1152
|
104 |
"mozInlineSpellChecker.h",
|
|
105 |
"mozSpellChecker.h",
|
|
106 |
]
|
|
107 |
+
|
|
108 |
+CXXFLAGS += ['-fno-devirtualize']
|
1190
|
109 |
Index: firefox-115.0/toolkit/components/terminator/nsTerminator.cpp
|
|
110 |
===================================================================
|
|
111 |
--- firefox-115.0.orig/toolkit/components/terminator/nsTerminator.cpp
|
|
112 |
+++ firefox-115.0/toolkit/components/terminator/nsTerminator.cpp
|
|
113 |
@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() {
|
1152
|
114 |
}
|
|
115 |
#endif
|
|
116 |
|
|
117 |
+ // Disable watchdog for PGO train builds - writting profile information at
|
|
118 |
+ // exit may take time and it is better to make build hang rather than
|
|
119 |
+ // silently produce poorly performing binary.
|
|
120 |
+ crashAfterMS = INT32_MAX;
|
|
121 |
+
|
|
122 |
UniquePtr<Options> options(new Options());
|
1173
|
123 |
// crashAfterTicks is guaranteed to be > 0 as
|
|
124 |
// crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS
|