summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-08-28 14:51:15 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-08-28 20:15:49 -0400
commit3d20f50252c5d3a08c983510193af9656bb47c89 (patch)
tree02a244f2dfa1aaad19329d6b65c71668170f169d
parentf1b246cc152b4e52c757ffc412aad94bd1e587a3 (diff)
downloadabslibre-3d20f50252c5d3a08c983510193af9656bb47c89.tar.gz
abslibre-3d20f50252c5d3a08c983510193af9656bb47c89.tar.bz2
abslibre-3d20f50252c5d3a08c983510193af9656bb47c89.zip
[iceweasel]: refactor per-arch configuration
-rw-r--r--libre/iceweasel/PKGBUILD106
1 files changed, 56 insertions, 50 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index cbcefb60e..39a5fcf75 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -96,7 +96,10 @@ validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin
validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
-_x86_64_skip_pgo=0
+_should_skip_pgo_armv7h=1
+_should_skip_pgo_i686=1
+_should_skip_pgo_x86_64=0
+eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}"
prepare() {
@@ -342,19 +345,12 @@ build() {
## [ARCH-SPECIFIC BUILD ENV] ##
- if [[ $CARCH != armv7h ]]; then
- # -fno-plt with cross-LTO causes obscure LLVM errors
- # LLVM ERROR: Function Import: link error
- CFLAGS="${CFLAGS/-fno-plt/}"
- CXXFLAGS="${CXXFLAGS/-fno-plt/}"
- fi
- if [[ $CARCH != i686 ]]; then
- # clang-9: error: unknown argument: '-fvar-tracking-assignments'
- CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
- CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
- fi
case ${CARCH} in
armv7h)
+ # clang-9: error: unknown argument: '-fvar-tracking-assignments'
+ CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
+ CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
+
export MOZ_DEBUG_FLAGS=" "
export CFLAGS+=" -g0"
export CXXFLAGS+=" -g0"
@@ -362,6 +358,10 @@ build() {
export RUSTFLAGS="-Cdebuginfo=0"
;;
i686)
+ # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error
+ CFLAGS="${CFLAGS/-fno-plt/}"
+ CXXFLAGS="${CXXFLAGS/-fno-plt/}"
+
# disable LTO (clang has issues on IA32)
export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
@@ -373,6 +373,20 @@ build() {
export CFLAGS+=" -mmmx"
export CXXFLAGS+=" -mmmx"
;;
+ x86_64)
+ # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error
+ CFLAGS="${CFLAGS/-fno-plt/}"
+ CXXFLAGS="${CXXFLAGS/-fno-plt/}"
+
+ # clang-9 -> error: unknown argument: '-fvar-tracking-assignments'
+ CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
+ CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
+
+ export CFLAGS
+ export CXXFLAGS
+ ;;
+ *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ;
+ ;;
esac
@@ -380,62 +394,54 @@ build() {
case ${CARCH} in
armv7h)
- # skipping PGO "instrumented browser"; so we have the final .mozconfig now
- cp ../mozconfig .mozconfig
;;
i686)
- # do not do profiling on i686: ..or it will for sure run out of memory - it doesn't find libraries:
- # "XPCOMGlueLoad error for file /build/firefox/src/firefox-70.0/obj-i686-pc-linux-gnu/dist/firefox/libxul.so:
- # libmozsandbox.so: cannot open shared object file: No such file or directory
- # Couldn't load XPCOM."
-
# avoid excessive debug symbols in rust leading to out-of-memory situations
sed -i "s/debug_info = '\''2'\''/debug_info = '\''0'\''/" build/moz.configure/toolchain.configure
-
- # skipping PGO "instrumented browser"; so we have the final .mozconfig now
- cp ../mozconfig .mozconfig
;;
x86_64)
- if (( $_x86_64_skip_pgo ))
- then
- # skipping PGO "instrumented browser"; so we have the final .mozconfig now
- cp ../mozconfig .mozconfig
- else
- # Do 3-tier PGO
- echo "Building instrumented browser..."
- cat >.mozconfig ../mozconfig - <<END
+ ;;
+ *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ;
+ ;;
+ esac
+
+ if (( $_should_skip_pgo ))
+ then
+ # skipping "3-tier PGO" "instrumented browser", to avoid OOM problems;
+ # so we have the final .mozconfig now
+ cp ../mozconfig .mozconfig
+ else
+ # Do 3-tier PGO
+ echo "Building instrumented browser..."
+ cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-profile-generate=cross
END
- _check_build_config
- ./mach build
+ _check_build_config
+ ./mach build
- echo "Profiling instrumented browser..."
- ./mach package
- LLVM_PROFDATA=llvm-profdata \
- JARLOG_FILE="$PWD/jarlog" \
- xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
- ./mach python build/pgo/profileserver.py
+ echo "Profiling instrumented browser..."
+ ./mach package
+ LLVM_PROFDATA=llvm-profdata \
+ JARLOG_FILE="$PWD/jarlog" \
+ xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
+ ./mach python build/pgo/profileserver.py
- stat -c "Profile data found (%s bytes)" merged.profdata
- test -s merged.profdata
+ stat -c "Profile data found (%s bytes)" merged.profdata
+ test -s merged.profdata
- stat -c "Jar log found (%s bytes)" jarlog
- test -s jarlog
+ stat -c "Jar log found (%s bytes)" jarlog
+ test -s jarlog
- echo "Removing instrumented browser..."
- ./mach clobber
+ echo "Removing instrumented browser..."
+ ./mach clobber
- cat >.mozconfig ../mozconfig - <<END
+ 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
END
- fi # $_x86_64_skip_pgo
- ;;
- *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ;
- ;;
- esac
+ fi # $_skip_pgo
## sanity checks ##