From 125d7f1f316e6ebd086e150ac23a8ed81556cd36 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 24 Oct 2019 15:18:39 -0700 Subject: Updated to 68.2.0 --- PKGBUILD | 115 ++++++++++++++++++++++++++++++++++++++++--------- firefox-symbolic.svg | 64 --------------------------- firefox.desktop | 41 +++++++++++++++--- mozconfig.in.clang | 74 +++++++++++++++++++++++++++++++ mozconfig.in.clang.pgo | 73 +++++++++++++++++++++++++++++++ no-relinking.patch | 41 ++++++++++++++++++ 6 files changed, 317 insertions(+), 91 deletions(-) delete mode 100644 firefox-symbolic.svg create mode 100644 mozconfig.in.clang create mode 100644 mozconfig.in.clang.pgo create mode 100644 no-relinking.patch diff --git a/PKGBUILD b/PKGBUILD index b4bc327..0d38826 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -14,17 +14,20 @@ # Arch version enables debug symbols # Arch version lacks privacy and security by default +_modclang=0 +#_modclang=1 # FIXME + _pkgname=firefox pkgname=${_pkgname}-esr -pkgver=68.1.0 +pkgver=68.2.0 _pkgver=${pkgver}esr -pkgrel=1 +pkgrel=2 pkgdesc="Standalone web browser from mozilla.org" arch=(x86_64) license=(MPL GPL LGPL) url="https://www.mozilla.org/firefox/" -depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib - ffmpeg ttf-font libpulse alsa-lib +depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib ffmpeg + ttf-font libpulse alsa-lib bzip2 libffi icu libjpeg-turbo libevent libvpx nspr nss pixman libpng sqlite libwebp zlib) makedepends=(unzip zip diffutils python-setuptools yasm mesa imake inetutils xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2 @@ -40,22 +43,27 @@ options=(!emptydirs !makeflags) conflicts=(firefox) provides=(firefox) source=("https://archive.mozilla.org/pub/$_pkgname/releases/$_pkgver/source/$_pkgname-$_pkgver.source.tar.xz"{,.asc} - $_pkgname.desktop $_pkgname-symbolic.svg + no-relinking.patch + 0001-Use-remoting-name-for-GDK-application-names.patch + $_pkgname.desktop distribution.ini mozconfig.in + mozconfig.in.clang + mozconfig.in.clang.pgo mozconfig.common.override - 0001-Use-remoting-name-for-GDK-application-names.patch pgo-1.patch moz.configure.diff package-manifest.diff) -sha256sums=('f56f5fa5a4744be0b9acf259cb991254d708a50b9a0a12d1d846ffa5a6c409ac' +sha256sums=('85f1c2eaf68ebedcbc0b78a342f6d16ef0865dedd426a1bba94b75c85f716f38' 'SKIP' - '54dcf5e1b91db3f586a7e27814552f96578b9d9495b7b10b268e36f64b49d4d1' - '9a1a572dc88014882d54ba2d3079a1cf5b28fa03c5976ed2cb763c93dabbd797' + '2dc9d1aa5eb7798c89f46478f254ae61e4122b4d1956d6044426288627d8a014' + 'ab07ab26617ff76fce68e07c66b8aa9b96c2d3e5b5517e51a3c3eac2edd88894' + 'a9e5264257041c0b968425b5c97436ba48e8d294e1a0f02c59c35461ea245c33' '0ba4d1a619a3a5750a5a48c6bff8c6a69d3aa4be4c303032c5979ab5f68db208' '1cc0730e0f0285f45f30feeeee6d7757931b25263b35b041abd71c2e0486210d' + '6bf4638134915758466a912dc909fbad165e76cc3807e9eedc659f8f346575fa' + 'b9833cf28af757e17a34e5c7f9db89b97d5c56b8f55cb6bccb70fc48275318af' 'dcf70d24eedab79d811974a75663f0e84c5efca420da61fc444ebe311d0cada9' - 'ab07ab26617ff76fce68e07c66b8aa9b96c2d3e5b5517e51a3c3eac2edd88894' 'a8c15c9d54ef8b360c0932f4ccf5e74954f14e9a9c2a1ae924b6c392075b2b8c' 'ad8a270e1b2affb098440f82517c3952207b28ebf604fef695dad3e29a5ba30e' '927e400d6920b98d2fe7db2b6498f195135909a76e0da49441223956364d8227') @@ -65,14 +73,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 @@ -101,12 +119,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 - < - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - Gnome Symbolic Icon Theme - - diff --git a/firefox.desktop b/firefox.desktop index 70fcd71..da9c3a8 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -2,7 +2,7 @@ Version=1.0 Name=Firefox GenericName=Web Browser -GenericName[ar]=متصفح وِب +GenericName[ar]=متصفح ويب GenericName[ast]=Restolador Web GenericName[bn]=ওয়েব ব্রাউজার GenericName[ca]=Navegador web @@ -19,7 +19,7 @@ GenericName[gl]=Navegador Web GenericName[he]=דפדפן אינטרנט GenericName[hr]=Web preglednik GenericName[hu]=Webböngésző -GenericName[it]=Browser Web +GenericName[it]=Browser web GenericName[ja]=ウェブ・ブラウザ GenericName[ko]=웹 브라우저 GenericName[ku]=Geroka torê @@ -42,8 +42,8 @@ GenericName[uk]=Веб-браузер GenericName[vi]=Trình duyệt Web GenericName[zh_CN]=网络浏览器 GenericName[zh_TW]=網路瀏覽器 -Comment=Browse the Web -Comment[ar]=تصفح الوِب +Comment=Browse the World Wide Web +Comment[ar]=تصفح الشبكة العنكبوتية العالمية Comment[ast]=Restola pela Rede Comment[bn]=ইন্টারনেট ব্রাউজ করুন Comment[ca]=Navegueu per el web @@ -83,15 +83,44 @@ Comment[uk]=Перегляд сторінок Інтернету Comment[vi]=Để duyệt các trang web Comment[zh_CN]=浏览互联网 Comment[zh_TW]=瀏覽網際網路 +Keywords=Internet;WWW;Browser;Web;Explorer +Keywords[ar]=انترنت;إنترنت;متصفح;ويب;وب +Keywords[ast]=Internet;WWW;Restolador;Web;Esplorador +Keywords[ca]=Internet;WWW;Navegador;Web;Explorador;Explorer +Keywords[cs]=Internet;WWW;Prohlížeč;Web;Explorer +Keywords[da]=Internet;Internettet;WWW;Browser;Browse;Web;Surf;Nettet +Keywords[de]=Internet;WWW;Browser;Web;Explorer;Webseite;Site;surfen;online;browsen +Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Περιηγητής;Firefox;Φιρεφοχ;Ιντερνετ +Keywords[es]=Explorador;Internet;WWW +Keywords[fi]=Internet;WWW;Browser;Web;Explorer;selain;Internet-selain;internetselain;verkkoselain;netti;surffaa +Keywords[fr]=Internet;WWW;Browser;Web;Explorer;Fureteur;Surfer;Navigateur +Keywords[he]=דפדפן;אינטרנט;רשת;אתרים;אתר;פיירפוקס;מוזילה; +Keywords[hr]=Internet;WWW;preglednik;Web +Keywords[hu]=Internet;WWW;Böngésző;Web;Háló;Net;Explorer +Keywords[it]=Internet;WWW;Browser;Web;Navigatore +Keywords[is]=Internet;WWW;Vafri;Vefur;Netvafri;Flakk +Keywords[ja]=Internet;WWW;Web;インターネット;ブラウザ;ウェブ;エクスプローラ +Keywords[nb]=Internett;WWW;Nettleser;Explorer;Web;Browser;Nettside +Keywords[nl]=Internet;WWW;Browser;Web;Explorer;Verkenner;Website;Surfen;Online +Keywords[pt]=Internet;WWW;Browser;Web;Explorador;Navegador +Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorador;Navegador +Keywords[ru]=Internet;WWW;Browser;Web;Explorer;интернет;браузер;веб;файрфокс;огнелис +Keywords[sk]=Internet;WWW;Prehliadač;Web;Explorer +Keywords[sl]=Internet;WWW;Browser;Web;Explorer;Brskalnik;Splet +Keywords[tr]=İnternet;WWW;Tarayıcı;Web;Gezgin;Web sitesi;Site;sörf;çevrimiçi;tara +Keywords[uk]=Internet;WWW;Browser;Web;Explorer;Інтернет;мережа;переглядач;оглядач;браузер;веб;файрфокс;вогнелис;перегляд +Keywords[vi]=Internet;WWW;Browser;Web;Explorer;Trình duyệt;Trang web +Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;网页;浏览;上网;火狐;Firefox;ff;互联网;网站; +Keywords[zh_TW]=Internet;WWW;Browser;Web;Explorer;網際網路;網路;瀏覽器;上網;網頁;火狐 Exec=/usr/lib/firefox/firefox %u Icon=firefox Terminal=false +X-MultipleArgs=false Type=Application -MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall; StartupNotify=true StartupWMClass=firefox Categories=Network;WebBrowser; -Keywords=web;browser;internet; Actions=new-window;new-private-window; [Desktop Action new-window] diff --git a/mozconfig.in.clang b/mozconfig.in.clang new file mode 100644 index 0000000..60f170e --- /dev/null +++ b/mozconfig.in.clang @@ -0,0 +1,74 @@ +ac_add_options --enable-application=browser +export MOZ_APP_REMOTINGNAME=firefox + +# Compiler and Linker +ac_add_options --prefix=/usr +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --disable-hardening +ac_add_options --enable-rust-simd +#ac_add_options --enable-linker=gold +ac_add_options --disable-elf-hack +#ac_add_options --enable-strip +#ac_add_options --enable-install-strip +export CC='clang --target=x86_64-unknown-linux-gnu' +export CXX='clang++ --target=x86_64-unknown-linux-gnu' +export AR=llvm-ar +export NM=llvm-nm +export RANLIB=llvm-ranlib + +# Branding +ac_add_options --enable-official-branding +ac_add_options --enable-update-channel=release +ac_add_options --with-distribution-id=org.artixlinux +ac_add_options --with-unsigned-addon-scopes=app,system + +# System libraries +ac_add_options --with-system-bz2 +ac_add_options --with-system-ffi +ac_add_options --with-system-icu +ac_add_options --with-system-jpeg +ac_add_options --with-system-libevent +ac_add_options --with-system-libvpx +ac_add_options --with-system-nspr +ac_add_options --with-system-nss +ac_add_options --enable-system-pixman +ac_add_options --with-system-png +ac_add_options --enable-system-sqlite +ac_add_options --with-system-webp +ac_add_options --with-system-zlib + +# Features +ac_add_options --enable-alsa +ac_add_options --enable-av1 +ac_add_options --enable-jack +ac_add_options --enable-startup-notification + +# Disables +ac_add_options --disable-accessibility +ac_add_options --disable-cdp +ac_add_options --disable-crashreporter +ac_add_options --disable-debug +ac_add_options --disable-debug-symbols +ac_add_options --disable-eme +ac_add_options --disable-gconf +# # marionette required for the xorg tests +# ac_add_options --disable-marionette +ac_add_options --disable-necko-wifi +ac_add_options --disable-parental-controls +# # precompiled-startupcache must be disabled to optimize for a newer +# # instruction set target +#ac_add_options --disable-precompiled-startupcache +ac_add_options --disable-synth-speechd +ac_add_options --disable-tests +ac_add_options --disable-updater +ac_add_options --disable-webrtc +# # Disabling webspeech breaks compiling ff67+ +# ac_add_options --disable-webspeech +export MOZ_ADDON_SIGNING=0 +export MOZ_REQUIRE_SIGNING=0 + +mk_add_options MOZ_MAKE_FLAGS="-j4" + +ac_add_options --enable-lto=cross +ac_add_options --enable-profile-use=cross diff --git a/mozconfig.in.clang.pgo b/mozconfig.in.clang.pgo new file mode 100644 index 0000000..be9f426 --- /dev/null +++ b/mozconfig.in.clang.pgo @@ -0,0 +1,73 @@ +ac_add_options --enable-application=browser +export MOZ_APP_REMOTINGNAME=firefox + +# Compiler and Linker +ac_add_options --prefix=/usr +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --disable-hardening +ac_add_options --enable-rust-simd +#ac_add_options --enable-linker=gold +ac_add_options --disable-elf-hack +#ac_add_options --enable-strip +#ac_add_options --enable-install-strip +export CC='clang --target=x86_64-unknown-linux-gnu' +export CXX='clang++ --target=x86_64-unknown-linux-gnu' +export AR=llvm-ar +export NM=llvm-nm +export RANLIB=llvm-ranlib + +# Branding +ac_add_options --enable-official-branding +ac_add_options --enable-update-channel=release +ac_add_options --with-distribution-id=org.artixlinux +ac_add_options --with-unsigned-addon-scopes=app,system + +# System libraries +ac_add_options --with-system-bz2 +ac_add_options --with-system-ffi +ac_add_options --with-system-icu +ac_add_options --with-system-jpeg +ac_add_options --with-system-libevent +ac_add_options --with-system-libvpx +ac_add_options --with-system-nspr +ac_add_options --with-system-nss +ac_add_options --enable-system-pixman +ac_add_options --with-system-png +ac_add_options --enable-system-sqlite +ac_add_options --with-system-webp +ac_add_options --with-system-zlib + +# Features +ac_add_options --enable-alsa +ac_add_options --enable-av1 +ac_add_options --enable-jack +ac_add_options --enable-startup-notification + +# Disables +ac_add_options --disable-accessibility +ac_add_options --disable-cdp +ac_add_options --disable-crashreporter +ac_add_options --disable-debug +ac_add_options --disable-debug-symbols +ac_add_options --disable-eme +ac_add_options --disable-gconf +# # marionette required for the xorg tests +# ac_add_options --disable-marionette +ac_add_options --disable-necko-wifi +ac_add_options --disable-parental-controls +# # precompiled-startupcache must be disabled to optimize for a newer +# # instruction set target +#ac_add_options --disable-precompiled-startupcache +ac_add_options --disable-synth-speechd +ac_add_options --disable-tests +ac_add_options --disable-updater +ac_add_options --disable-webrtc +# # Disabling webspeech breaks compiling ff67+ +# ac_add_options --disable-webspeech +export MOZ_ADDON_SIGNING=0 +export MOZ_REQUIRE_SIGNING=0 + +mk_add_options MOZ_MAKE_FLAGS="-j4" + +ac_add_options --enable-profile-generate=cross diff --git a/no-relinking.patch b/no-relinking.patch new file mode 100644 index 0000000..6dd9884 --- /dev/null +++ b/no-relinking.patch @@ -0,0 +1,41 @@ + +# HG changeset patch +# User Mike Shal +# Date 1570127498 25200 +# Node ID b8bc2504f108d8a2216ee11405cbbe4cf7a0eaec +# Parent 9a4d6aacc48080f019024c02ac7da1fd576b39fe +Bug XYZ - Only force re-linking on 1-tier PGO builds; r?#firefox-build-system-reviewers + + +diff --git a/config/rules.mk b/config/rules.mk +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -465,25 +465,27 @@ ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_) + $(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);) + else + ifdef GNU_CC + -$(RM) *.gcda + endif + endif + endif + ++ifdef MOZ_1TIER_PGO + ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE)) + ifneq (,$(filter target,$(MAKECMDGOALS))) + ifdef GNU_CC + # Force rebuilding libraries and programs in both passes because each + # pass uses different object files. + $(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE + endif + endif + endif ++endif + + endif # NO_PROFILE_GUIDED_OPTIMIZE + + ############################################## + + clean clobber realclean clobber_all:: + -$(RM) $(ALL_TRASH) + -$(RM) -r $(ALL_TRASH_DIRS) + -- cgit v1.2.1