enable pgo without cross for aarch64 builds, fix #104
This commit is contained in:
parent
c5e54158d1
commit
ed559afbde
1 changed files with 27 additions and 6 deletions
33
PKGBUILD
33
PKGBUILD
|
|
@ -1,4 +1,4 @@
|
||||||
# Maintainer: lsf
|
# Maintainer: ohfp
|
||||||
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
|
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
|
||||||
# Contributor: Ionut Biru <ibiru@archlinux.org>
|
# Contributor: Ionut Biru <ibiru@archlinux.org>
|
||||||
# Contributor: Jakub Schmidtke <sjakub@gmail.com>
|
# Contributor: Jakub Schmidtke <sjakub@gmail.com>
|
||||||
|
|
@ -95,7 +95,6 @@ END
|
||||||
if [[ $CARCH == 'aarch64' ]]; then
|
if [[ $CARCH == 'aarch64' ]]; then
|
||||||
cat >>../mozconfig <<END
|
cat >>../mozconfig <<END
|
||||||
# taken from manjaro build:
|
# taken from manjaro build:
|
||||||
ac_add_options --enable-lto
|
|
||||||
ac_add_options --enable-optimize="-g0 -O2"
|
ac_add_options --enable-optimize="-g0 -O2"
|
||||||
export MOZ_DEBUG_FLAGS=" "
|
export MOZ_DEBUG_FLAGS=" "
|
||||||
export CFLAGS+=" -g0"
|
export CFLAGS+=" -g0"
|
||||||
|
|
@ -135,7 +134,6 @@ build() {
|
||||||
# LTO needs more open files
|
# LTO needs more open files
|
||||||
ulimit -n 4096
|
ulimit -n 4096
|
||||||
|
|
||||||
if [[ $CARCH != 'aarch64' ]]; then
|
|
||||||
# -fno-plt with cross-LTO causes obscure LLVM errors
|
# -fno-plt with cross-LTO causes obscure LLVM errors
|
||||||
# LLVM ERROR: Function Import: link error
|
# LLVM ERROR: Function Import: link error
|
||||||
CFLAGS="${CFLAGS/-fno-plt/}"
|
CFLAGS="${CFLAGS/-fno-plt/}"
|
||||||
|
|
@ -143,9 +141,20 @@ if [[ $CARCH != 'aarch64' ]]; then
|
||||||
|
|
||||||
# Do 3-tier PGO
|
# Do 3-tier PGO
|
||||||
echo "Building instrumented browser..."
|
echo "Building instrumented browser..."
|
||||||
|
|
||||||
|
if [[ $CARCH == 'aarch64' ]]; then
|
||||||
|
|
||||||
|
cat >.mozconfig ../mozconfig - <<END
|
||||||
|
ac_add_options --enable-profile-generate
|
||||||
|
END
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
cat >.mozconfig ../mozconfig - <<END
|
cat >.mozconfig ../mozconfig - <<END
|
||||||
ac_add_options --enable-profile-generate=cross
|
ac_add_options --enable-profile-generate=cross
|
||||||
END
|
END
|
||||||
|
|
||||||
|
fi
|
||||||
./mach build
|
./mach build
|
||||||
|
|
||||||
echo "Profiling instrumented browser..."
|
echo "Profiling instrumented browser..."
|
||||||
|
|
@ -169,16 +178,28 @@ END
|
||||||
./mach clobber
|
./mach clobber
|
||||||
|
|
||||||
echo "Building optimized browser..."
|
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
|
cat >.mozconfig ../mozconfig - <<END
|
||||||
ac_add_options --enable-lto=cross
|
ac_add_options --enable-lto=cross
|
||||||
ac_add_options --enable-profile-use=cross
|
ac_add_options --enable-profile-use=cross
|
||||||
ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
|
ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
|
||||||
ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
|
ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
|
||||||
# seems to break on arm
|
|
||||||
ac_add_options --enable-linker=gold
|
ac_add_options --enable-linker=gold
|
||||||
END
|
END
|
||||||
else
|
|
||||||
cat >.mozconfig ../mozconfig
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mach build
|
./mach build
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue