Enabled LTO, added build fixes, removed unused patches

This commit is contained in:
Martin Stransky 2020-10-07 10:22:49 +02:00
parent ef3bf44d9e
commit 2875cd508d
9 changed files with 48 additions and 126 deletions

View File

@ -1,36 +0,0 @@
From: Andrew Osmond <aosmond@mozilla.com>
Date: Wed, 22 Jan 2020 15:19:20 +0000
Subject: Bug 1610814 - Fix NEON compile error with gcc and RGB unpacking.
r=lsalzman
This patch makes us use the correct intrinsic for loading a uint8x16
register. It is not entirely clear why clang accepts this without
complaint but beyond the types, it should be equivalent.
Differential Revision: https://phabricator.services.mozilla.com/D60667
---
gfx/2d/SwizzleNEON.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfx/2d/SwizzleNEON.cpp b/gfx/2d/SwizzleNEON.cpp
index 6b34f76cab1..63f211ff294 100644
--- a/gfx/2d/SwizzleNEON.cpp
+++ b/gfx/2d/SwizzleNEON.cpp
@@ -412,7 +412,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) {
src -= 4 * 3;
dst -= 4 * 4;
while (src >= aSrc) {
- uint8x16_t px = vld1q_u16(reinterpret_cast<const uint16_t*>(src));
+ uint8x16_t px = vld1q_u8(src);
// G2R2B1G1 R1B0G0R0 -> X1R1G1B1 X0R0G0B0
uint8x8_t pxlo = vtbl1_u8(vget_low_u8(px), masklo);
// B3G3R3B2 G2R2B1G1 -> X3R3G3B3 X2R2G2B2
@@ -420,7 +420,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) {
vtbl1_u8(vext_u8(vget_low_u8(px), vget_high_u8(px), 4), maskhi);
px = vcombine_u8(pxlo, pxhi);
px = vorrq_u8(px, alpha);
- vst1q_u16(reinterpret_cast<uint16_t*>(dst), px);
+ vst1q_u8(dst, px);
src -= 4 * 3;
dst -= 4 * 4;
}

View File

@ -1,14 +0,0 @@
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -10,6 +10,10 @@
# commands can be executed directly by make, without doing a round-trip
# through a shell.
+MOZ_MAKE_FLAGS := $(filter-out -j%,$(MAKEFLAGS))
+MAKEFLAGS += -j1
+
+
cargo_host_flag := --target=$(RUST_HOST_TARGET)
cargo_target_flag := --target=$(RUST_TARGET)

View File

@ -1,12 +0,0 @@
diff -up firefox-61.0/build/autoconf/icu.m4.icu firefox-61.0/build/autoconf/icu.m4
--- firefox-61.0/build/autoconf/icu.m4.icu 2018-06-20 09:03:17.957565445 +0200
+++ firefox-61.0/build/autoconf/icu.m4 2018-06-20 09:08:28.159403451 +0200
@@ -77,7 +77,7 @@ if test -n "$USE_ICU"; then
# TODO: the l is actually endian-dependent
# We could make this set as 'l' or 'b' for little or big, respectively,
# but we'd need to check in a big-endian version of the file.
- ICU_DATA_FILE="icudt${version}l.dat"
+ ICU_DATA_FILE="icudt${version}b.dat"
fi
AC_SUBST(MOZ_ICU_VERSION)

View File

@ -1,12 +0,0 @@
diff -up firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky firefox-60.5.0/js/src/jit/AtomicOperations.h
--- firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky 2019-01-22 10:20:27.993697161 +0100
+++ firefox-60.5.0/js/src/jit/AtomicOperations.h 2019-01-22 10:23:15.337873762 +0100
@@ -394,7 +394,7 @@ inline bool AtomicOperations::isLockfree
#elif defined(__s390__) || defined(__s390x__)
#include "jit/none/AtomicOperations-feeling-lucky.h"
#else
-#error "No AtomicOperations support provided for this platform"
+#include "jit/none/AtomicOperations-feeling-lucky.h"
#endif
#endif // jit_AtomicOperations_h

View File

@ -38,7 +38,7 @@ ExcludeArch: s390x
%global build_with_pgo 1
%endif
# Build PGO builds on Wayland backend
%global pgo_wayland 0
%global pgo_wayland 1
%endif
%if 0%{?fedora} > 30
%global wayland_backend_default 1
@ -110,7 +110,7 @@ ExcludeArch: s390x
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 81.0.1
Release: 5%{?dist}
Release: 6%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -139,25 +139,21 @@ Source35: google-loc-api-key
# Build patches
Patch3: mozilla-build-arm.patch
Patch25: rhbz-1219542-s390-build.patch
Patch26: build-icu-big-endian.patch
Patch32: build-rust-ppc64le.patch
Patch35: build-ppc-jit.patch
# Always feel lucky for unsupported platforms:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1347128
Patch37: build-jit-atomic-always-lucky.patch
# Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x)
Patch38: build-cacheFlush-missing.patch
Patch40: build-aarch64-skia.patch
Patch41: build-disable-elfhack.patch
Patch44: build-arm-libopus.patch
#Patch45: build-disable-multijobs-rust.patch
Patch46: firefox-nss-version.patch
Patch47: fedora-shebang-build.patch
Patch48: build-arm-wasm.patch
Patch49: build-arm-libaom.patch
#Patch50: Bug-1610814-Fix-NEON-compile-error-with-gcc-and-RGB-.patch
Patch53: firefox-gcc-build.patch
Patch54: pgo-build-python.patch
# This should be fixed in Firefox 83
Patch54: mozilla-1669639.patch
Patch55: mozilla-1669442.patch
# Fedora specific patches
Patch215: firefox-enable-addons.patch
@ -192,7 +188,6 @@ Patch585: firefox-vaapi-extra-frames.patch
# PGO/LTO patches
Patch600: pgo.patch
Patch601: mozilla-1516081.patch
Patch602: mozilla-1516803.patch
%if %{?system_nss}
@ -348,29 +343,22 @@ This package contains results of tests executed during build.
# there is a compare of config and js/config directories and .orig suffix is
# ignored during this compare.
%ifarch s390
%patch25 -p1 -b .rhbz-1219542-s390
%endif
#%patch37 -p1 -b .jit-atomic-lucky
%patch40 -p1 -b .aarch64-skia
%if 0%{?disable_elfhack}
%patch41 -p1 -b .disable-elfhack
%endif
%patch3 -p1 -b .arm
%patch44 -p1 -b .build-arm-libopus
#%patch45 -p1 -b .build-disable-multijobs-rust
# Patch for big endian platforms only
%if 0%{?big_endian}
#%patch26 -p1 -b .icu
%endif
#%patch46 -p1 -b .nss-version
%patch47 -p1 -b .fedora-shebang
%patch48 -p1 -b .build-arm-wasm
%patch49 -p1 -b .build-arm-libaom
#%patch50 -p1 -b .build-arm-SwizzleNEON
%patch53 -p1 -b .firefox-gcc-build
%patch54 -p1 -b .pgo-build-python
%patch54 -p1 -b .1669639
%patch55 -p1 -b .1669442
# Fedora patches
%patch215 -p1 -b .addons
@ -403,6 +391,7 @@ This package contains results of tests executed during build.
%patch575 -p1 -b .firefox-pipewire-0-3
%endif
# VA-API fixes
%patch584 -p1 -b .firefox-disable-ffvpx-with-vapi
%patch585 -p1 -b .firefox-vaapi-extra-frames
@ -410,8 +399,6 @@ This package contains results of tests executed during build.
%if %{build_with_pgo}
%if !%{build_with_clang}
%patch600 -p1 -b .pgo
#fix
#%patch601 -p1 -b .1516081
%patch602 -p1 -b .1516803
%endif
%endif
@ -627,8 +614,7 @@ echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig
%endif
%if 0%{?build_with_pgo}
echo "ac_add_options MOZ_PGO=1" >> .mozconfig
# Temporary disabled due to https://bugzilla.mozilla.org/show_bug.cgi?id=1669442
# echo "ac_add_options --enable-lto" >> .mozconfig
echo "ac_add_options --enable-lto" >> .mozconfig
# PGO build doesn't work with ccache
export CCACHE_DISABLE=1
%endif
@ -647,8 +633,8 @@ MOZ_SMP_FLAGS=-j1
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
#[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16
#[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24
[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16
[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24
%endif
echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig
@ -985,6 +971,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Wed Oct 7 2020 Martin Stransky <stransky@redhat.com> - 81.0.1-6
- PGO patch update
- Added fix for mzbz#1669442 (LTO builds)
* Mon Oct 5 2020 Martin Stransky <stransky@redhat.com> - 81.0.1-5
- Added fix for mozbz#1656727

View File

@ -1,21 +0,0 @@
diff -up firefox-71.0/build/moz.configure/lto-pgo.configure.1516081 firefox-71.0/build/moz.configure/lto-pgo.configure
--- firefox-71.0/build/moz.configure/lto-pgo.configure.1516081 2019-11-26 01:02:19.000000000 +0100
+++ firefox-71.0/build/moz.configure/lto-pgo.configure 2019-11-26 11:04:10.993077232 +0100
@@ -71,7 +71,7 @@ set_config('PGO_PROFILE_PATH', pgo_profi
def pgo_flags(compiler, target, profdata):
if compiler.type == 'gcc':
return namespace(
- gen_cflags=['-fprofile-generate'],
+ gen_cflags=['-fprofile-generate', '-DMOZ_PROFILE_INSTRUMENTATION'],
gen_ldflags=['-fprofile-generate'],
use_cflags=['-fprofile-use', '-fprofile-correction',
'-Wcoverage-mismatch'],
@@ -92,7 +92,7 @@ def pgo_flags(compiler, target, profdata
gen_ldflags = ['-fprofile-generate']
return namespace(
- gen_cflags=[prefix + '-fprofile-generate'],
+ gen_cflags=[prefix + '-fprofile-generate', '-DMOZ_PROFILE_INSTRUMENTATION'],
gen_ldflags=gen_ldflags,
use_cflags=[prefix + '-fprofile-use=%s' % profdata,
# Some error messages about mismatched profile data

13
mozilla-1669442.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/config/recurse.mk b/config/recurse.mk
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -206,7 +206,7 @@
# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-toolkit/library/target: widget/gtk/mozgtk/gtk3/target
+toolkit/library/build/target: widget/gtk/mozgtk/gtk3/target
endif
ifndef MOZ_FOLD_LIBS

View File

@ -1,6 +1,6 @@
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-01 14:48:15.459225300 +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):
@ -46,7 +46,7 @@ diff -up firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-81.0.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-01 13:54:58.535312905 +0200
+++ firefox-81.0.1/build/pgo/profileserver.py 2020-10-07 09:16:44.071786956 +0200
@@ -11,7 +11,7 @@ import glob
import subprocess
@ -96,7 +96,7 @@ diff -up firefox-81.0.1/build/pgo/profileserver.py.pgo firefox-81.0.1/build/pgo/
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-01 13:54:58.535312905 +0200
+++ firefox-81.0.1/build/unix/mozconfig.unix 2020-10-07 09:16:44.071786956 +0200
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
@ -115,7 +115,7 @@ diff -up firefox-81.0.1/build/unix/mozconfig.unix.pgo firefox-81.0.1/build/unix/
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-01 13:54:58.535312905 +0200
+++ firefox-81.0.1/extensions/spellcheck/src/moz.build 2020-10-07 09:16:44.071786956 +0200
@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
@ -125,7 +125,7 @@ diff -up firefox-81.0.1/extensions/spellcheck/src/moz.build.pgo firefox-81.0.1/e
\ 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-01 13:54:58.535312905 +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):
return status
@ -136,4 +136,18 @@ diff -up firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py.pgo firefox-8
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
@@ -418,6 +418,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());
const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000);
options->crashAfterTicks = crashAfterMS / ticksDuration;