diff options
Diffstat (limited to 'pgo.patch')
-rw-r--r-- | pgo.patch | 95 |
1 files changed, 39 insertions, 56 deletions
@@ -1,24 +1,7 @@ -diff -up firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-81.0.1/build/moz.configure/lto-pgo.configure ---- firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo 2020-09-30 19:41:10.000000000 +0200 -+++ firefox-81.0.1/build/moz.configure/lto-pgo.configure 2020-10-07 09:16:44.071786956 +0200 -@@ -69,12 +69,14 @@ set_config('PGO_PROFILE_PATH', pgo_profi - @imports(_from='__builtin__', _import='min') - def pgo_flags(compiler, profdata, target_is_windows): - if compiler.type == 'gcc': -+ #profile_use = '-fprofile-use=$(topobjdir)' -+ profile_use = '-fprofile-use' - return namespace( - gen_cflags=['-fprofile-generate'], - gen_ldflags=['-fprofile-generate'], -- use_cflags=['-fprofile-use', '-fprofile-correction', -+ use_cflags=[profile_use, '-fprofile-correction', - '-Wcoverage-mismatch'], -- use_ldflags=['-fprofile-use'], -+ use_ldflags=[profile_use], - ) - - if compiler.type in ('clang-cl', 'clang'): -@@ -192,13 +194,13 @@ def lto(value, c_compiler, ld64_known_go +diff -up firefox-84.0/build/moz.configure/lto-pgo.configure.pgo firefox-84.0/build/moz.configure/lto-pgo.configure +--- firefox-84.0/build/moz.configure/lto-pgo.configure.pgo 2020-12-10 15:55:41.932635998 +0100 ++++ firefox-84.0/build/moz.configure/lto-pgo.configure 2020-12-10 16:01:24.674052547 +0100 +@@ -228,13 +228,13 @@ def lto(value, c_compiler, ld64_known_go cflags.append("-flto") ldflags.append("-flto") else: @@ -26,17 +9,17 @@ diff -up firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-81.0.1 - ldflags.append("-flto=thin") + cflags.append("-flto") + ldflags.append("-flto") - elif c_compiler.type == 'clang-cl': - if len(value) and value[0].lower() == 'full': + elif c_compiler.type == "clang-cl": + if len(value) and value[0].lower() == "full": 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"); -@@ -232,7 +234,7 @@ def lto(value, c_compiler, ld64_known_go - if len(value) and value[0].lower() == 'full': + cflags.append("-fuse-ld=lld") +@@ -268,7 +268,7 @@ def lto(value, c_compiler, ld64_known_go + if len(value) and value[0].lower() == "full": cflags.append("-flto") else: - cflags.append("-flto=thin") @@ -44,9 +27,9 @@ diff -up firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-81.0.1 cflags.append("-flifetime-dse=1") ldflags.append("-flto=%s" % num_cores) -diff -up firefox-81.0.1/build/pgo/profileserver.py.pgo firefox-81.0.1/build/pgo/profileserver.py ---- firefox-81.0.1/build/pgo/profileserver.py.pgo 2020-09-30 19:41:10.000000000 +0200 -+++ firefox-81.0.1/build/pgo/profileserver.py 2020-10-07 09:16:44.071786956 +0200 +diff -up firefox-84.0/build/pgo/profileserver.py.pgo firefox-84.0/build/pgo/profileserver.py +--- firefox-84.0/build/pgo/profileserver.py.pgo 2020-12-07 23:32:58.000000000 +0100 ++++ firefox-84.0/build/pgo/profileserver.py 2020-12-10 16:05:16.278668657 +0100 @@ -11,7 +11,7 @@ import glob import subprocess @@ -56,11 +39,11 @@ diff -up firefox-81.0.1/build/pgo/profileserver.py.pgo firefox-81.0.1/build/pgo/ from mozfile import TemporaryDirectory from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences -@@ -84,9 +84,22 @@ if __name__ == '__main__': - port=PORT, - options='primary,privileged') +@@ -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') +- old_profraw_files = glob.glob("*.profraw") - for f in old_profraw_files: - os.remove(f) + using_gcc = False @@ -82,21 +65,20 @@ diff -up firefox-81.0.1/build/pgo/profileserver.py.pgo firefox-81.0.1/build/pgo/ with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -@@ -191,6 +204,11 @@ if __name__ == '__main__': +@@ -212,6 +225,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') + llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: - profraw_files = glob.glob('*.profraw') -diff -up firefox-81.0.1/build/unix/mozconfig.unix.pgo firefox-81.0.1/build/unix/mozconfig.unix ---- firefox-81.0.1/build/unix/mozconfig.unix.pgo 2020-09-30 19:41:10.000000000 +0200 -+++ firefox-81.0.1/build/unix/mozconfig.unix 2020-10-07 09:16:44.071786956 +0200 + profraw_files = glob.glob("*.profraw") +diff -up firefox-84.0/build/unix/mozconfig.unix.pgo firefox-84.0/build/unix/mozconfig.unix +--- firefox-84.0/build/unix/mozconfig.unix.pgo 2020-12-07 23:32:58.000000000 +0100 ++++ firefox-84.0/build/unix/mozconfig.unix 2020-12-10 15:55:41.933636031 +0100 @@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -113,32 +95,33 @@ diff -up firefox-81.0.1/build/unix/mozconfig.unix.pgo firefox-81.0.1/build/unix/ # 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:$PATH" -diff -up firefox-81.0.1/extensions/spellcheck/src/moz.build.pgo firefox-81.0.1/extensions/spellcheck/src/moz.build ---- firefox-81.0.1/extensions/spellcheck/src/moz.build.pgo 2020-09-30 19:41:17.000000000 +0200 -+++ firefox-81.0.1/extensions/spellcheck/src/moz.build 2020-10-07 09:16:44.071786956 +0200 +diff -up firefox-84.0/extensions/spellcheck/src/moz.build.pgo firefox-84.0/extensions/spellcheck/src/moz.build +--- firefox-84.0/extensions/spellcheck/src/moz.build.pgo 2020-12-10 15:55:41.933636031 +0100 ++++ firefox-84.0/extensions/spellcheck/src/moz.build 2020-12-10 16:16:05.897011122 +0100 @@ -31,3 +31,5 @@ EXPORTS.mozilla += [ - if CONFIG['CC_TYPE'] in ('clang', 'gcc'): - CXXFLAGS += ['-Wno-error=shadow'] + if CONFIG["CC_TYPE"] in ("clang", "gcc"): + CXXFLAGS += ["-Wno-error=shadow"] + +CXXFLAGS += ['-fno-devirtualize'] -\ No newline at end of file -diff -up firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py.pgo firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py ---- firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py.pgo 2020-09-30 19:41:46.000000000 +0200 -+++ firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py 2020-10-07 09:16:44.071786956 +0200 -@@ -108,7 +108,8 @@ class Build(MachCommandBase): +diff -up firefox-84.0/python/mozbuild/mozbuild/build_commands.py.pgo firefox-84.0/python/mozbuild/mozbuild/build_commands.py +--- firefox-84.0/python/mozbuild/mozbuild/build_commands.py.pgo 2020-12-10 15:55:41.933636031 +0100 ++++ firefox-84.0/python/mozbuild/mozbuild/build_commands.py 2020-12-10 16:14:30.017272529 +0100 +@@ -126,9 +126,8 @@ class Build(MachCommandBase): return status pgo_env = os.environ.copy() -- pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA') +- pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get( +- "LLVM_PROFDATA" +- ) + if instr.config_environment.substs.get('CC_TYPE') != 'gcc': -+ pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA') - pgo_env['JARLOG_FILE'] = mozpath.join(orig_topobjdir, 'jarlog/en-US.log') ++ pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get("LLVM_PROFDATA") + pgo_env["JARLOG_FILE"] = mozpath.join(orig_topobjdir, "jarlog/en-US.log") pgo_cmd = [ instr.virtualenv_manager.python_path, -diff -up firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp ---- firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp.pgo 2020-10-07 09:22:26.698243673 +0200 -+++ firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp 2020-10-07 09:22:43.026312999 +0200 +diff -up firefox-84.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-84.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-84.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2020-12-07 23:33:08.000000000 +0100 ++++ firefox-84.0/toolkit/components/terminator/nsTerminator.cpp 2020-12-10 15:55:41.933636031 +0100 @@ -418,6 +418,11 @@ void nsTerminator::StartWatchdog() { } #endif |