aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorohfp <1813007-ohfp@users.noreply.gitlab.com>2020-03-15 02:00:46 +0100
committerohfp <1813007-ohfp@users.noreply.gitlab.com>2020-03-15 02:00:46 +0100
commited559afbde44ebb0740cbe0e21a3e28567355694 (patch)
tree37ccfa4ca7a589482a4d8a9573c9980058499b1a
parentmention current state of build scripts in README.md (diff)
downloadlibrewolf-linux-ed559afbde44ebb0740cbe0e21a3e28567355694.tar.gz
librewolf-linux-ed559afbde44ebb0740cbe0e21a3e28567355694.tar.bz2
librewolf-linux-ed559afbde44ebb0740cbe0e21a3e28567355694.zip
enable pgo without cross for aarch64 builds, fix #104
-rw-r--r--PKGBUILD33
1 files changed, 27 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index edd50d4..b75dd8d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,4 @@
-# Maintainer: lsf
+# Maintainer: ohfp
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Jakub Schmidtke <sjakub@gmail.com>
@@ -95,7 +95,6 @@ END
if [[ $CARCH == 'aarch64' ]]; then
cat >>../mozconfig <<END
# taken from manjaro build:
-ac_add_options --enable-lto
ac_add_options --enable-optimize="-g0 -O2"
export MOZ_DEBUG_FLAGS=" "
export CFLAGS+=" -g0"
@@ -135,7 +134,6 @@ build() {
# LTO needs more open files
ulimit -n 4096
-if [[ $CARCH != 'aarch64' ]]; then
# -fno-plt with cross-LTO causes obscure LLVM errors
# LLVM ERROR: Function Import: link error
CFLAGS="${CFLAGS/-fno-plt/}"
@@ -143,9 +141,20 @@ if [[ $CARCH != 'aarch64' ]]; then
# Do 3-tier PGO
echo "Building instrumented browser..."
+
+if [[ $CARCH == 'aarch64' ]]; then
+
+ cat >.mozconfig ../mozconfig - <<END
+ac_add_options --enable-profile-generate
+END
+
+else
+
cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-profile-generate=cross
END
+
+fi
./mach build
echo "Profiling instrumented browser..."
@@ -169,16 +178,28 @@ END
./mach clobber
echo "Building optimized browser..."
+
+if [[ $CARCH == 'aarch64' ]]; then
+
+ cat >.mozconfig ../mozconfig - <<END
+ac_add_options --enable-lto
+ac_add_options --enable-profile-use
+ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
+ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
+# seems to break on arm
+# ac_add_options --enable-linker=gold
+END
+
+else
+
cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-lto=cross
ac_add_options --enable-profile-use=cross
ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
-# seems to break on arm
ac_add_options --enable-linker=gold
END
-else
- cat >.mozconfig ../mozconfig
+
fi
./mach build
bgstack15