diff options
Diffstat (limited to 'libre/iceweasel/PKGBUILD')
-rw-r--r-- | libre/iceweasel/PKGBUILD | 103 |
1 files changed, 71 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" |