diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2020-01-20 08:31:23 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2020-01-20 08:55:12 -0500 |
commit | 5d3621d2d7be8cefd55dd976a5b20b41b4125633 (patch) | |
tree | 8b3d90e84b0d889e1d0ddf9760dce188ab412037 /libre | |
parent | c301b4e83c1f0b96aca2c5e3117c532c2e6b5bdf (diff) | |
download | abslibre-5d3621d2d7be8cefd55dd976a5b20b41b4125633.tar.gz abslibre-5d3621d2d7be8cefd55dd976a5b20b41b4125633.tar.bz2 abslibre-5d3621d2d7be8cefd55dd976a5b20b41b4125633.zip |
[iceweasel]: wip - i686
Diffstat (limited to 'libre')
-rw-r--r-- | libre/iceweasel/PKGBUILD | 172 |
1 files changed, 99 insertions, 73 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index 0e6ac05eb..d7cc864ba 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -135,15 +135,15 @@ ac_add_options --disable-tests ac_add_options --disable-eme END - if [[ $CARCH = armv7h ]]; then - # TODO: fixme - false - fi - - if [[ $CARCH = i686 ]]; then - # disable LTO and use gcc toolchain (clang has issues on IA32) - export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" - cat >>../mozconfig <<END + ## [ARCH-SPECIFIC CONFIG] ## + case ${CARCH} in + armv7h) + error "armv7h support is not implemented" ; return 1 ; # FIXME: + ;; + i686) + # 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++ @@ -152,15 +152,23 @@ 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 + # 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 + # readelf: Error: Unable to seek to 0x801db328 for section headers + patch -p1 -i "$srcdir"/avoid-libxul-OOM-python-check.patch + ;; + x86_64) + ;; + *) error "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; + ;; + esac - ## Rebranding + + ## branding ## + + msg2 "applying parabola branding" local brandingsrcdir="${srcdir}/${pkgname}-${_brandingver}" local brandingdestdir=browser/branding/${pkgname} rm -rf -- ${brandingdestdir} @@ -192,12 +200,15 @@ END -o "${brandingdestdir}/default$i.png" done - ## Patching + # apply branding patches export QUILT_PATCHES="${brandingsrcdir}"/patches export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index' export QUILT_DIFF_ARGS='--no-timestamps' quilt push -av + + ## libre patching ## + # Remove remaining non-free bits msg "applying libre.patch" patch -Np1 -i "$srcdir/libre.patch" @@ -236,23 +247,6 @@ build() { export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" - if [[ $CARCH = armv7h ]]; then - # TODO: fixme - false - fi - - if [[ $CARCH = i686 ]]; then - # 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 ulimit -n 4096 @@ -265,47 +259,70 @@ build() { CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" - # 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 + ## [ARCH-SPECIFIC CONFIG] ## + case ${CARCH} in + armv7h) + error "armv7h support is not implemented" ; return 1 ; # FIXME: + ;; + 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." + + # 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 + + # gcc and cross PGO are not best friends, skip PGO "instrumented browser" + cp ../mozconfig .mozconfig + ;; + x86_64) + # 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 + + 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 + ;; + *) error "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; + ;; + esac + + # sanity check + [[ ! -f .mozconfig ]] && error ".mozconfig file not found in source root" && return 1 + + msg2 "Building optimized browser..." ./mach build msg2 "Building symbol archive..." @@ -371,11 +388,20 @@ 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 + ## [ARCH-SPECIFIC INSTALL] ## + case ${CARCH} in + armv7h) + ;; + i686) + # 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 + ;; + x86_64) + ;; + *) error "no [ARCH-SPECIFIC INSTALL] for arch: ${CARCH}" ; return 1 ; + ;; + esac # Replace duplicate binary with wrapper # https://bugzilla.mozilla.org/show_bug.cgi?id=658850 |