summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD87
-rw-r--r--firefox.desktop41
-rw-r--r--mozconfig.in.clang74
-rw-r--r--mozconfig.in.clang.pgo73
-rw-r--r--no-relinking.patch41
5 files changed, 300 insertions, 16 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f48102a..4c324a0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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"
-
}
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..1f7f1a2
--- /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
diff --git a/mozconfig.in.clang.pgo b/mozconfig.in.clang.pgo
new file mode 100644
index 0000000..97826e6
--- /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
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 <mshal@mozilla.com>
+# 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)
+