Skip to content
Permalink
Browse files

firefox: update to 64.0.2; #1536

- Enable PGO on AMD64, patches from Fedora and upstream.
- Clean up defines.
- Remove deprecated --enable-pie option.
- More vendor-specific preferences to further limit Pocket integration and telemetry.
  • Loading branch information...
MingcongBai committed Jan 14, 2019
1 parent a835002 commit 19c2601c44671478f2f253828ed8c5bb366f23e8
@@ -5,9 +5,9 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie
ac_add_options --enable-application=browser
ac_add_options --enable-rust-simd
ac_add_options MOZ_PGO=1

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie
ac_add_options --enable-optimize="-g -O2"

ac_add_options --with-system-zlib
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -1,4 +1,11 @@
./mach build
export MOZ_NOSPAM=1
export MOZBUILD_STATE_PATH="$SRCDIR"/mozbuild
export MOZ_SERVICES_SYNC="1"
export GDK_BACKEND=x11

ulimit -n 4096

xvfb-run ./mach build
DESTDIR="$PKGDIR" ./mach install

for i in 16 22 24 32 48 64 128 256; do
@@ -3,7 +3,7 @@ PKGSEC=web
PKGDEP="gtk-2 startup-notification mime-types dbus-glib alsa-lib \
desktop-file-utils hicolor-icon-theme libevent nss hunspell sqlite \
networkmanager mozilla-common ffmpeg icu"
BUILDDEP="autoconf-2.13 rustc unzip llvm mercurial nodejs"
BUILDDEP="autoconf-2.13 rustc unzip llvm mercurial nodejs libnotify xorg-server"
if [[ "${CROSS:-$ARCH}" = "amd64" ]]; then
BUILDDEP+=" openjdk yasm"
fi
@@ -15,13 +15,11 @@ if [[ "${CROSS:-$ARCH}" != "ppc64" ]]; then
fi
PKGDES="Standalone Web browser from Mozilla"

# AB_FLAGS_O3=1
PKGBREAK="firefox-i18n<=43.0.1"
PKGREP="firefox-i18n<=43.0.1"

NOLTO=1
NOPARALLEL=1

if [[ "${CROSS:-$ARCH}" = "powerpc" || "${CROSS:-$ARCH}" = "ppc64" ]]; then
PKGEPOCH=1
fi

NOLTO=1
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -25,10 +25,32 @@ pref("browser.shell.checkDefaultBrowser", false);
// Always use system defined logical resolution for CSS DPI detection.
pref("layout.css.dpi", 0);

// ... AOSC OS policies ...

// Disable Pocket by default.
pref("browser.pocket.enabled", false);
pref("extensions.pocket.enabled", false);
pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);

// Disable (targeted) sponsored contents.
pref("browser.newtabpage.activity-stream.showSponsored" , false);
pref("browser.newtabpage.activity-stream.showSponsored", false);

// Disable Telemetry.
pref("browser.newtabpage.activity-stream.feeds.telemetry", false);
pref("browser.newtabpage.activity-stream.telemetry", false);
pref("browser.newtabpage.activity-stream.telemetry.ut.events", false);
pref("browser.ping-centre.telemetry", false);
pref("devtools.onboarding.telemetry.logged", false);
pref("security.certerrors.recordEventTelemetry", false);
pref("security.identitypopup.recordEventElemetry", false);
pref("toolkit.telemetry.archive.enabled", false);
pref("toolkit.telemetry.bhrPing.enabled", false);
pref("toolkit.telemetry.enabled", false);
pref("toolkit.telemetry.firstShutdownPing.enabled", false);
pref("toolkit.telemetry.hybridContent.enabled", false);
pref("toolkit.telemetry.newProfilePing.enabled", false);
pref("toolkit.telemetry.reportingpolicy.firstRun", false);
pref("toolkit.telemetry.shutdownPingSender.enabled", false);
pref("toolkit.telemetry.shutdownPingSender.enabledFirstSession", false);
pref("toolkit.telemetry.unified", false);
pref("toolkit.telemetry.updatePing.enabled", false);

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,38 @@
diff -up firefox-64.0/build/moz.configure/toolchain.configure.1516081 firefox-64.0/build/moz.configure/toolchain.configure
--- firefox-64.0/build/moz.configure/toolchain.configure.1516081 2018-12-07 03:56:20.000000000 +0100
+++ firefox-64.0/build/moz.configure/toolchain.configure 2019-01-03 15:30:08.207368056 +0100
@@ -1304,7 +1304,7 @@ def pgo_flags(compiler, build_env, targe

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'],
@@ -1325,7 +1325,8 @@ def pgo_flags(compiler, build_env, targe

if gen_ldflags:
return namespace(
- gen_cflags=['-fprofile-instr-generate'],
+ gen_cflags=['-fprofile-instr-generate',
+ '-DMOZ_PROFILE_INSTRUMENTATION'],
gen_ldflags=gen_ldflags,
use_cflags=['-fprofile-instr-use=%s' % profdata,
'-Wno-error=profile-instr-out-of-date',
diff -up firefox-64.0/toolkit/components/terminator/nsTerminator.cpp.1516081 firefox-64.0/toolkit/components/terminator/nsTerminator.cpp
--- firefox-64.0/toolkit/components/terminator/nsTerminator.cpp.1516081 2019-01-03 15:30:08.207368056 +0100
+++ firefox-64.0/toolkit/components/terminator/nsTerminator.cpp 2019-01-03 15:31:33.445034029 +0100
@@ -441,6 +441,12 @@ 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.
+#ifdef MOZ_PROFILE_INSTRUMENTATION
+ crashAfterMS = INT32_MAX;
+#endif

UniquePtr<Options> options(new Options());
const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000);
@@ -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()

@@ -0,0 +1,29 @@
diff -up firefox-64.0/build/unix/mozconfig.unix.pgo firefox-64.0/build/unix/mozconfig.unix
--- firefox-64.0/build/unix/mozconfig.unix.pgo 2019-01-03 15:23:16.792980384 +0100
+++ firefox-64.0/build/unix/mozconfig.unix 2019-01-03 15:24:29.978693550 +0100
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$TOOLTOOL_DIR/gcc/bin/gcc"
CXX="$TOOLTOOL_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=$TOOLTOOL_DIR/gcc/bin:$PATH"
diff -up firefox-64.0/extensions/spellcheck/src/moz.build.pgo firefox-64.0/extensions/spellcheck/src/moz.build
--- firefox-64.0/extensions/spellcheck/src/moz.build.pgo 2018-12-07 03:56:27.000000000 +0100
+++ firefox-64.0/extensions/spellcheck/src/moz.build 2019-01-03 15:21:32.793385074 +0100
@@ -28,3 +28,5 @@ EXPORTS.mozilla += [

if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
+
+CXXFLAGS += ['-fno-devirtualize']
\ No newline at end of file
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --disable-gold
ac_add_options --enable-pie

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -5,7 +5,6 @@ ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-gold
ac_add_options --enable-pie

ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
@@ -1,3 +1,2 @@
VER=63.0.1
REL=1
SRCTBL="http://releases.mozilla.org/pub/firefox/releases/$VER/source/firefox-$VER.source.tar.xz"
VER=64.0.2
SRCTBL="https://download-origin.cdn.mozilla.net/pub/firefox/releases/$VER/source/firefox-$VER.source.tar.xz"

0 comments on commit 19c2601

Please sign in to comment.
You can’t perform that action at this time.