summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Bidar2019-01-09 06:34:07 +0100
committerBjörn Bidar2019-01-09 06:40:06 +0100
commite1ea7c08c24430e306d15861c53ee47b45d8348a (patch)
tree05ddbbb0c096225696e5370169303728d90f3deb
parent6d7c34e1b374b8a19342d651ae8291a6a1fde8b6 (diff)
downloadaur-e1ea7c08c24430e306d15861c53ee47b45d8348a.tar.gz
urel
- fix pgo build with gcc (and 8.x to that extend) - apply patches from Jan Hubička and Fedora to fix pgo builds - disable-elfhack on pgo builds (mimic Fedora) - remove gcc7 workaround - clean up mentions of experimental wayland support as its enabled by default - clean up PKGBUILD and set CC just one
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD89
-rw-r--r--mozilla-1516081.patch38
-rw-r--r--mozilla-1516803.patch16
-rw-r--r--pgo.patch29
5 files changed, 138 insertions, 45 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c782ef4c0ca3..7c0bd45af163 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Mon Jan 7 02:48:41 UTC 2019
+# Wed Jan 9 05:33:58 UTC 2019
pkgbase = firefox-kde-opensuse
pkgdesc = Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE
pkgver = 64.0
- pkgrel = 1
+ pkgrel = 2
url = https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox
arch = i686
arch = x86_64
@@ -29,7 +29,6 @@ pkgbase = firefox-kde-opensuse
makedepends = gtk2
makedepends = nodejs
makedepends = cbindgen
- makedepends = gcc7
depends = mozilla-common
depends = libxt
depends = startup-notification
@@ -66,6 +65,9 @@ pkgbase = firefox-kde-opensuse
source = pgo_fix_missing_kdejs.patch
source = 2001_system_graphite2_support.patch
source = 2000_system_harfbuzz_support.patch
+ source = mozilla-1516803.patch
+ source = mozilla-1516081.patch
+ source = pgo.patch
md5sums = SKIP
md5sums = 49c2d3dc354e18ab12c8c4e6f7d68d6b
md5sums = 14e0f6237a79b85e60256f4808163160
@@ -80,6 +82,9 @@ pkgbase = firefox-kde-opensuse
md5sums = 3fa8bd22d97248de529780f5797178af
md5sums = f31a90ed4c0b0c15346ea5098765771f
md5sums = a85ca9c88f49184c8b0feae206f0ba0c
+ md5sums = becf6bf9ceb6008401832c855ccadff9
+ md5sums = fded487ab30d9ed99a3e5ea6807a0dca
+ md5sums = f867ae41a722630cc5567e2dcc51676d
pkgname = firefox-kde-opensuse
diff --git a/PKGBUILD b/PKGBUILD
index 1df6fe80c836..e578ef522756 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,12 +5,8 @@
# enable this if you run out of memory during linking
#_lowmem=true
-# enable gtk3 wayland (experimental)
-_gtk3_wayland=false
-
-# try to build with PGO
-# currently needs gcc7
-# _pgo=true
+# build with PGO
+_pgo=true
# globalmenu
# to support globalmenu a patch from ubuntu is applied
@@ -21,7 +17,7 @@ _gtk3_wayland=false
_pkgname=firefox
pkgname=$_pkgname-kde-opensuse
pkgver=64.0
-pkgrel=1
+pkgrel=2
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')
@@ -35,9 +31,7 @@ makedepends=('unzip' 'zip' 'diffutils' 'python' 'yasm' 'mesa' 'imake'
'xorg-server-xvfb' 'libpulse' 'inetutils' 'autoconf2.13' 'rust'
'cargo' 'mercurial' 'llvm' 'clang'
'gtk2' 'nodejs' 'cbindgen')
-if [[ -n $_pgo ]] ; then
- makedepends+=('gcc7')
-fi
+
optdepends=('networkmanager: Location detection via available WiFi networks'
'speech-dispatcher: Text-to-Speech')
provides=("firefox=${pkgver}")
@@ -62,10 +56,12 @@ source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE"
pgo_fix_missing_kdejs.patch
2001_system_graphite2_support.patch
2000_system_harfbuzz_support.patch
+ # pgo fixes
+ mozilla-1516803.patch
+ mozilla-1516081.patch
+ pgo.patch
)
-
-
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for
@@ -86,11 +82,6 @@ prepare() {
cp "$srcdir/mozconfig" .mozconfig
- if [ $_gtk3_wayland = true ] ; then
- echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" \
- >> .mozconfig
- fi
-
echo -n "$_google_api_key" >google-api-key
echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig
@@ -109,15 +100,27 @@ prepare() {
# add globalmenu support
patch -Np1 -i "$srcdir/unity-menubar.patch"
-
- # add missing rule for pgo builds
- patch -Np1 -i "$srcdir"/add_missing_pgo_rule.patch
-
- # add missing file Makefile for pgo builds
- patch -Np1 -i "$srcdir"/pgo_fix_missing_kdejs.patch
patch -Np1 -i "$srcdir"/2000_system_harfbuzz_support.patch
patch -Np1 -i "$srcdir"/2001_system_graphite2_support.patch
+
+ if [[ $_pgo ]] ; then
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
+ patch -Np1 -i "$srcdir"/mozilla-1516803.patch
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1516081
+ patch -Np1 -i "$srcdir"/mozilla-1516081.patch
+
+ # add missing rule for pgo builds
+ patch -Np1 -i "$srcdir"/add_missing_pgo_rule.patch
+
+ patch -Np1 -i "$srcdir"/pgo.patch
+
+ # add missing file Makefile for pgo builds
+ patch -Np1 -i "$srcdir"/pgo_fix_missing_kdejs.patch
+
+ echo "ac_add_options --enable-lto" >> .mozconfig
+ echo "ac_add_options --disable-elf-hack" >> .mozconfig
+ fi
}
build() {
@@ -125,31 +128,30 @@ build() {
cd mozilla-unified
export MOZ_SOURCE_REPO="$_repo"
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
-
+
+
+ export CC=gcc
+ export CXX=g++
+ export AR="gcc-ar"
+ export NM="gcc-nm"
+ export RANLIB="gcc-ranlib"
+
+ export MOZ_MAKE_FLAGS="$MAKEFLAGS"
+ export STRIP=/bin/true
+
if [[ -n $_lowmem || $CARCH == i686 ]]; then
LDFLAGS+=" -Xlinker --no-keep-memory"
fi
if [[ -n $_pgo ]]; then
- CC=/usr/bin/gcc-7
- CXX=/usr/bin/g++-7
+ export DISPLAY=:99
+ export MOZ_PGO=1
- if in_array ccache ${BUILDENV[*]} ; then
- CC="ccache gcc-7"
- CXX="ccache g++-7"
- fi
- AS="/usr/bin/gcc" \ #FIXME see https://bugzilla.mozilla.org/show_bug.cgi?id=1514671
- CCACHE_CC=/usr/bin/gcc-7 \
- CC=$CC\
- CXX=$CXX \
- DISPLAY=:99 MOZ_PGO=1 \
- xvfb-run \
- -a \
- -s "-extension GLX -screen 0 1280x1024x24" \
- ./mach build
+ xvfb-run \
+ -a \
+ -s "-extension GLX -screen 0 1280x1024x24" \
+ ./mach build
else
- export CC=/usr/bin/gcc
- export CXX=/usr/bin/g++
./mach build
fi
./mach buildsymbols
@@ -208,4 +210,7 @@ md5sums=('SKIP'
'fe24f5ea463013bb7f1c12d12dce41b2'
'3fa8bd22d97248de529780f5797178af'
'f31a90ed4c0b0c15346ea5098765771f'
- 'a85ca9c88f49184c8b0feae206f0ba0c')
+ 'a85ca9c88f49184c8b0feae206f0ba0c'
+ 'becf6bf9ceb6008401832c855ccadff9'
+ 'fded487ab30d9ed99a3e5ea6807a0dca'
+ 'f867ae41a722630cc5567e2dcc51676d')
diff --git a/mozilla-1516081.patch b/mozilla-1516081.patch
new file mode 100644
index 000000000000..174bbfb74040
--- /dev/null
+++ b/mozilla-1516081.patch
@@ -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);
diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch
new file mode 100644
index 000000000000..f1f37f4991ae
--- /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()
+
diff --git a/pgo.patch b/pgo.patch
new file mode 100644
index 000000000000..20eb98de30a9
--- /dev/null
+++ b/pgo.patch
@@ -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