The package rpms/icecat.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/icecat.git/commit/?id=42bafbe14ed....
Change:
+%ifarch x86_64
Thanks.
Full change:
============
commit 42bafbe14edefad963c300446f06ae46002ce712
Author: sagitter <sagitter(a)fedoraproject.org>
Date: Sun Oct 4 18:08:38 2020 +0200
PGO build test
diff --git a/icecat-pgo.patch b/icecat-pgo.patch
new file mode 100644
index 0000000..b63917c
--- /dev/null
+++ b/icecat-pgo.patch
@@ -0,0 +1,129 @@
+diff -up a/build/moz.configure/lto-pgo.configure.pgo
b/build/moz.configure/lto-pgo.configure
+--- a/build/moz.configure/lto-pgo.configure.pgo 2020-09-30 19:41:10.000000000 +0200
++++ b/build/moz.configure/lto-pgo.configure 2020-10-01 14:48:15.459225300 +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
+ cflags.append("-flto")
+ ldflags.append("-flto")
+ else:
+- cflags.append("-flto=thin")
+- ldflags.append("-flto=thin")
++ cflags.append("-flto")
++ ldflags.append("-flto")
+ 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");
+diff -up a/build/pgo/profileserver.py.pgo b/build/pgo/profileserver.py
+--- a/build/pgo/profileserver.py.pgo 2020-09-30 19:41:10.000000000 +0200
++++ b/build/pgo/profileserver.py 2020-10-01 13:54:58.535312905 +0200
+@@ -11,7 +11,7 @@
+ import subprocess
+
+ import mozcrash
+-from mozbuild.base import MozbuildObject, BinaryNotFoundException
++from mozbuild.base import MozbuildObject, BinaryNotFoundException,
BuildEnvironmentNotFoundException
+ from mozfile import TemporaryDirectory
+ from mozhttpd import MozHttpd
+ from mozprofile import IceCatProfile, Preferences
+@@ -84,9 +84,22 @@ if __name__ == '__main__':
+ 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
+@@ -191,6 +204,11 @@
+ print("IceCat 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')
+diff -up a/build/unix/mozconfig.unix.pgo b/build/unix/mozconfig.unix
+--- a/build/unix/mozconfig.unix.pgo 2020-09-30 19:41:10.000000000 +0200
++++ b/build/unix/mozconfig.unix 2020-10-01 13:54:58.535312905 +0200
+@@ -6,6 +6,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:$PATH"
+diff -up a/extensions/spellcheck/src/moz.build.pgo b/extensions/spellcheck/src/moz.build
+--- a/extensions/spellcheck/src/moz.build.pgo 2020-09-30 19:41:17.000000000 +0200
++++ b/extensions/spellcheck/src/moz.build 2020-10-01 13:54:58.535312905 +0200
+@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
+
+ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+ CXXFLAGS += ['-Wno-error=shadow']
++
++CXXFLAGS += ['-fno-devirtualize']
+\ No newline at end of file
+diff -up a/python/mozbuild/mozbuild/build_commands.py.pgo
b/python/mozbuild/mozbuild/build_commands.py
+--- a/python/mozbuild/mozbuild/build_commands.py.pgo 2020-09-30 19:41:46.000000000 +0200
++++ b/python/mozbuild/mozbuild/build_commands.py 2020-10-01 13:54:58.535312905 +0200
+@@ -108,7 +108,8 @@ class Build(MachCommandBase):
+ return status
+
+ pgo_env = os.environ.copy()
+- 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_cmd = [
+ instr.virtualenv_manager.python_path,
diff --git a/icecat.spec b/icecat.spec
index d969b00..148e461 100644
--- a/icecat.spec
+++ b/icecat.spec
@@ -17,9 +17,8 @@
%global extra_ver %{nil}
%endif
-%if !%{release_build}
%global pre_tag .test
-%endif
+
####################
### Optimization ###
@@ -33,10 +32,15 @@
%global hardened_build 1
####################
-# Use PGO/LTO
+# Build PGO+LTO on x86_64 and aarch64 only due to build issues
+# on other arches.
+%ifarch x86_64
%if %{release_build}
+%global build_with_pgo 1
+%else
%global build_with_pgo 0
%endif
+%endif
# Disable LTO to work around rhbz#1883904
%define _lto_cflags %{nil}
@@ -121,7 +125,7 @@ ExcludeArch: ppc64le
Name: icecat
Version: 78.3.1
-Release: 1%{extra_ver}.%{redhat_ver}%{?pre_tag}%{?dist}
+Release: 2%{extra_ver}.%{redhat_ver}%{?pre_tag}%{?dist}
Summary: GNU version of Firefox browser
# Tri-licensing scheme for Gnuzilla/IceCat in parentheses, and licenses for the
extensions included
@@ -198,6 +202,11 @@ Patch412: mozilla-1337988.patch
Patch414: Bug-1238661_fix-mozillaSignalTrampoline-to-work-.patch
Patch422: mozilla-1580174-webrtc-popup.patch
+# PGO/LTO patches
+Patch600: %{name}-pgo.patch
+Patch601: mozilla-1516081.patch
+Patch602: mozilla-1516803.patch
+
# Fix crash on ppc64le (mozilla#1512162)
Patch423: mozilla-1512162.patch
@@ -415,6 +424,16 @@ tar -xf %{SOURCE5}
%patch585 -p1 -b .firefox-vaapi-extra-frames
%patch589 -p1 -b .mozilla-1634213
+# PGO patches
+%if %{build_with_pgo}
+%if !%{build_with_clang}
+%patch600 -p1 -b .pgo
+#fix
+#%patch601 -p1 -b .1516081
+%patch602 -p1 -b .1516803
+%endif
+%endif
+
# Remove default configuration and copy the customized one
rm -f .mozconfig
cp -p %{SOURCE3} .mozconfig
@@ -843,15 +862,18 @@ desktop-file-validate
%{buildroot}%{_datadir}/applications/*.desktop
%endif
%changelog
+* Sun Oct 04 2020 Antonio Trande <sagitter(a)fedoraproject.org> - 78.3.1-2.rh1.test
+- PGO build test
+
* Thu Oct 01 2020 Antonio Trande <sagitter(a)fedoraproject.org> - 78.3.1-1.rh1
-- Mozilla Release 78.3.1ESR-rh1
+- Mozilla Release 78.3.1ESR (rh1)
- Patched for mzbz#1640567
* Wed Sep 23 2020 Antonio Trande <sagitter(a)fedoraproject.org> - 78.3.0-2.rh1
- Rebuild for libevent-2.1.12
* Mon Sep 21 2020 Antonio Trande <sagitter(a)fedoraproject.org> - 78.3.0-1.rh1
-- Mozilla Release 78.3.0ESR-rh1
+- Mozilla Release 78.3.0ESR (rh1)
* Fri Sep 18 2020 Miro Hrončok <mhroncok(a)redhat.com> - 78.2.0-7.rh6
- Use python3 instead of python2 for build
diff --git a/mozilla-1516081.patch b/mozilla-1516081.patch
new file mode 100644
index 0000000..a15facd
--- /dev/null
+++ b/mozilla-1516081.patch
@@ -0,0 +1,21 @@
+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
diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch
new file mode 100644
index 0000000..f1f37f4
--- /dev/null
+++ b/mozilla-1516803.patch
@@ -0,0 +1,16 @@
+diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -99,9 +99,8 @@
+ # 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()
+