diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-10-11 17:38:18 -0700 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-10-11 17:38:18 -0700 |
commit | d5af5543d54dfe97d918a202d0e974a6915155ba (patch) | |
tree | 2399bcfb6657597159371f218c1401ad5488c726 /PKGBUILD | |
parent | Updated to 69.0.1 (diff) | |
download | firefox-d5af5543d54dfe97d918a202d0e974a6915155ba.tar.xz |
Updated to 69.0.3
Added partial progress for clang pgo build, gated behind toggle.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 87 |
1 files changed, 77 insertions, 10 deletions
@@ -14,8 +14,11 @@ # Arch version enables debug symbols # Arch version lacks privacy and security by default +_modclang=0 +#_modclang=1 # FIXME + pkgname=firefox -pkgver=69.0.1 +pkgver=69.0.3 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org" arch=(x86_64) @@ -40,18 +43,24 @@ source=("https://archive.mozilla.org/pub/$pkgname/releases/$pkgver/source/$pkgna $pkgname.desktop $pkgname-symbolic.svg distribution.ini mozconfig.in + mozconfig.in.clang + mozconfig.in.clang.pgo mozconfig.common.override + no-relinking.patch 0001-Use-remoting-name-for-GDK-application-names.patch pgo-1.patch moz.configure.diff package-manifest.diff) -sha256sums=('f5f2f592b8296812d43244d6a50c0c57ad11a5324db8e4e79749545482b79033' +sha256sums=('7527947a876c1734b8b2339f19b8ff8da6f4e4d06351b44940cb48d3509bb891' 'SKIP' - '54dcf5e1b91db3f586a7e27814552f96578b9d9495b7b10b268e36f64b49d4d1' + 'a9e5264257041c0b968425b5c97436ba48e8d294e1a0f02c59c35461ea245c33' '9a1a572dc88014882d54ba2d3079a1cf5b28fa03c5976ed2cb763c93dabbd797' '0ba4d1a619a3a5750a5a48c6bff8c6a69d3aa4be4c303032c5979ab5f68db208' '1cc0730e0f0285f45f30feeeee6d7757931b25263b35b041abd71c2e0486210d' + '0194afec7fa92b08b1583037e2042cbc024238878c3fcb7a4b5b1a61d1274412' + 'b6027c19e7f95ec5c81272b6a2680ca0ffb2d6a520ab8c5f586e9642ee16e351' 'dcf70d24eedab79d811974a75663f0e84c5efca420da61fc444ebe311d0cada9' + '2dc9d1aa5eb7798c89f46478f254ae61e4122b4d1956d6044426288627d8a014' 'ab07ab26617ff76fce68e07c66b8aa9b96c2d3e5b5517e51a3c3eac2edd88894' 'a8c15c9d54ef8b360c0932f4ccf5e74954f14e9a9c2a1ae924b6c392075b2b8c' 'ad8a270e1b2affb098440f82517c3952207b28ebf604fef695dad3e29a5ba30e' @@ -62,14 +71,24 @@ prepare() { # mkdir mozbuild cd ${pkgname}-${pkgver} + # Avoid relinking during buildsymbols + patch -Np1 -i ../no-relinking.patch + # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch - # Apply pgo patches - patch -p0 $srcdir/${pkgname}-${pkgver}/security/sandbox/linux/moz.build $srcdir/pgo-1.patch + if [ "${_modclang}" != "1" ]; then + # Apply gcc pgo patches + patch -p0 $srcdir/${pkgname}-${pkgver}/security/sandbox/linux/moz.build $srcdir/pgo-1.patch + fi - # Add the custom mozconfig - cp $srcdir/mozconfig.in $srcdir/${pkgname}-${pkgver}/.mozconfig + if [ "${_modclang}" == "1" ]; then + # Add the custom mozconfig for pgo + cp $srcdir/mozconfig.in.clang.pgo $srcdir/${pkgname}-${pkgver}/.mozconfig + else + # Add the custom mozconfig + cp $srcdir/mozconfig.in $srcdir/${pkgname}-${pkgver}/.mozconfig + fi # MOZ_TELEMETRY_REPORTING only applied correctly when set in this override file cp $srcdir/mozconfig.common.override $srcdir/${pkgname}-${pkgver}/build/mozconfig.common.override @@ -98,12 +117,58 @@ build() { export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" + export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIC" export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIC" + # LTO needs more open files ulimit -n 4096 - msg2 "Building browser..." - xvfb-run -a -n 97 -s "-screen 0 1600x1200x24" ./mach build + + if [ "${_modclang}" == "1" ]; then + # clang does not support -fstack-clash-protection, so remove it + export CFLAGS="$(echo $CFLAGS | sed 's/ -fstack-clash-protection//' - )" + export CXXFLAGS="$(echo $CXXFLAGS | sed 's/ -fstack-clash-protection//' - )" +# # -fno-plt with cross-LTO causes obscure LLVM errors +# # LLVM ERROR: Function Import: link error +# CFLAGS="${CFLAGS/-fno-plt/}" +# CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + # Do 3-tier PGO + msg2 "Building instrumented browser..." + ./mach build + + msg2 "Profiling instrumented browser..." + ./mach package + LLVM_PROFDATA=llvm-profdata \ + JARLOG_FILE="$PWD/jarlog" \ + xvfb-run -a -n 92 -s "-screen 0 1600x1200x24" \ + ./mach python build/pgo/profileserver.py + + if ! compgen -G '*.profraw' >&2; then + error "No profile data produced." + return 1 + fi + + if [[ ! -s jarlog ]]; then + error "No jar log produced." + return 1 + fi + + msg2 "Removing instrumented browser..." + ./mach clobber + + msg2 "Building optimized browser..." + # Add the custom mozconfig + cp $srcdir/mozconfig.in.clang $srcdir/${pkgname}-${pkgver}/.mozconfig + cat >.mozconfig - <<END +ac_add_options --with-pgo-profile-path=${PWD@Q} +ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog +END + ./mach build + else + msg2 "Building optimized browser..." + xvfb-run -a -n 97 -s "-screen 0 1600x1200x24" ./mach build + fi msg2 "Building symbol archive..." ./mach buildsymbols @@ -121,6 +186,9 @@ package() { rm "$pkgdir/usr/bin/firefox" ln -s "/usr/lib/$pkgname/firefox" "$pkgdir/usr/bin/firefox" + find . -name '*crashreporter-symbols-full.zip' -exec \ + cp -fvt "$startdir" {} + + # icons for i in 16 22 24 32 48 64 128 256; do @@ -137,5 +205,4 @@ package() { # install desktop file install -Dm644 ../$pkgname.desktop \ "$pkgdir/usr/share/applications/$pkgname.desktop" - } |