summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-01-19 14:31:12 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2020-01-19 14:31:12 -0500
commit714e1505fa9edb5a7233edbea06df0593d930b61 (patch)
treeb13cbf35fa9b165473dbe589a3b92b0ac635eba3
parentbd5f52e4628f3e1b6f9fcc8c9a508e8563ac38f7 (diff)
downloadabslibre-714e1505fa9edb5a7233edbea06df0593d930b61.tar.gz
abslibre-714e1505fa9edb5a7233edbea06df0593d930b61.tar.bz2
abslibre-714e1505fa9edb5a7233edbea06df0593d930b61.zip
[iceweasel]: wip - i686
-rw-r--r--libre/iceweasel/PKGBUILD103
-rw-r--r--libre/iceweasel/avoid-libxul-OOM-python-check.patch12
-rw-r--r--libre/iceweasel/rust-static-disable-network-test-on-static-libraries.patch32
3 files changed, 115 insertions, 32 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index 61c4fd39a..0e6ac05eb 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -72,6 +72,8 @@ source+=(https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}-${_
libre.patch
libre-searchengines.patch
vendor.js.in)
+source_i686+=('rust-static-disable-network-test-on-static-libraries.patch'
+ 'avoid-libxul-OOM-python-check.patch')
sha256sums=('1fa59aedc8469c3e6ffb12449ab7de2f93776f7679eedebfb74aa309b694956f'
'SKIP'
'5f7ac724a5c5afd9322b1e59006f4170ea5354ca1e0e60dab08b7784c2d8463c'
@@ -81,6 +83,8 @@ sha256sums=('1fa59aedc8469c3e6ffb12449ab7de2f93776f7679eedebfb74aa309b694956f'
'1169ccda88642881e0ba024f0c82fce9ac3064d3587517f9960e88cae479ce3e'
'dfed11d97f1d4198a3dc608be159b6b53a11054f376cdb73bb0fe9a487ae9418'
'4979e733215492372c196cdb93ec61eac1fbbd44f44e637dbd420040c8d9affe')
+sha256sums_i686=('4da71f6614dce71db8e9ec2d317514aae90838c2c65620d435f0df06b45b578b'
+ '5a3e038a57c4576dcb88766d41cbfda5ad109d5cfe41d2000f7ba25563bf00f2')
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>
validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin
@@ -131,14 +135,29 @@ ac_add_options --disable-tests
ac_add_options --disable-eme
END
- if [[ $CARCH = arm* ]]; then
+ if [[ $CARCH = armv7h ]]; then
# TODO: fixme
false
fi
if [[ $CARCH = i686 ]]; then
- # TODO: fixme
- false
+ # disable LTO and use gcc toolchain (clang has issues on IA32)
+ export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE"
+ cat >>../mozconfig <<END
+ac_add_options --disable-lto
+export CC=gcc
+export CXX=g++
+export AR=gcc-ar
+export NM=gcc-nm
+export RANLIB=gcc-ranlib
+END
+
+ # test failure in rust code (complaining about network functions) when PGO is used,
+ # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757
+ patch -p1 -i "$srcdir"/rust-static-disable-network-test-on-static-libraries.patch
+
+ # readelf: Error: Unable to seek to 0x801db328 for section headers
+ patch -p1 -i "$srcdir"/avoid-libxul-OOM-python-check.patch
fi
## Rebranding
@@ -223,8 +242,15 @@ build() {
fi
if [[ $CARCH = i686 ]]; then
- # TODO: fixme
- false
+ # disable LTO and use gcc toolchain (clang has issues on IA32)
+ export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
+ export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
+
+ # 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
+
+ # don't kill build slaves by auto-guessing available CPU cores
+# export MOZ_MAKE_FLAGS=-j1
fi
# LTO needs more open files
@@ -239,40 +265,47 @@ build() {
CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}"
- # Do 3-tier PGO
- msg2 "Building instrumented browser..."
- cat >.mozconfig ../mozconfig - <<END
+ # 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."
+ # gcc and cross PGO are not best friends, disable PGO
+ if [[ $CARCH = x86_64 ]]; then
+ # Do 3-tier PGO
+ msg2 "Building instrumented browser..."
+ cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-profile-generate=cross
END
- ./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 [[ ! -s merged.profdata ]]; 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..."
- cat >.mozconfig ../mozconfig - <<END
+ ./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 [[ ! -s merged.profdata ]]; 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..."
+ 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
./mach build
msg2 "Building symbol archive..."
@@ -338,6 +371,12 @@ END
exec /usr/lib/$pkgname/$pkgname "\$@"
END
+ if [[ $CARCH = i686 ]]; then
+ # libxul.so cannot find it's libraries
+ install -dm 755 "${pkgdir}"/etc/ld.so.conf.d
+ echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf
+ fi
+
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -srfv "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
diff --git a/libre/iceweasel/avoid-libxul-OOM-python-check.patch b/libre/iceweasel/avoid-libxul-OOM-python-check.patch
new file mode 100644
index 000000000..9ab81bb7b
--- /dev/null
+++ b/libre/iceweasel/avoid-libxul-OOM-python-check.patch
@@ -0,0 +1,12 @@
+diff -rauN a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk 2019-10-25 11:08:20.757231756 +0200
++++ b/config/rules.mk 2019-10-25 11:11:04.972821611 +0200
+@@ -663,7 +663,7 @@
+ $(RM) $@
+ endif
+ $(MKSHLIB) $($@_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS)
+- $(call py_action,check_binary,--target $@)
++# $(call py_action,check_binary,--target $@)
+
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ ifdef MSMANIFEST_TOOL
diff --git a/libre/iceweasel/rust-static-disable-network-test-on-static-libraries.patch b/libre/iceweasel/rust-static-disable-network-test-on-static-libraries.patch
new file mode 100644
index 000000000..f5e0f6a0a
--- /dev/null
+++ b/libre/iceweasel/rust-static-disable-network-test-on-static-libraries.patch
@@ -0,0 +1,32 @@
+diff -rauN firefox-72.0.1/config/makefiles/rust.mk firefox-72.0.1-rust-static-disable-network-test-on-static-libraries-patch/config/makefiles/rust.mk
+--- firefox-72.0.1/config/makefiles/rust.mk 2020-01-08 02:23:30.000000000 +0100
++++ firefox-72.0.1-rust-static-disable-network-test-on-static-libraries-patch/config/makefiles/rust.mk 2020-01-10 12:17:40.172666172 +0100
+@@ -292,17 +292,17 @@
+ # the chance of proxy bypasses originating from rust code.
+ # The check only works when rust code is built with -Clto.
+ # Enabling sancov or TSan also causes this to fail.
+-ifndef MOZ_PROFILE_GENERATE
+-ifndef MOZ_TSAN
+-ifeq ($(OS_ARCH), Linux)
+-ifeq (,$(rustflags_sancov))
+-ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
+- $(call py_action,check_binary,--target --networking $@)
+-endif
+-endif
+-endif
+-endif
+-endif
++#ifndef MOZ_PROFILE_GENERATE
++#ifndef MOZ_TSAN
++#ifeq ($(OS_ARCH), Linux)
++#ifeq (,$(rustflags_sancov))
++#ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
++# $(call py_action,check_binary,--target --networking $@)
++#endif
++#endif
++#endif
++#endif
++#endif
+
+ force-cargo-library-check:
+ $(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)