diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2023-01-30 03:47:42 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2023-02-08 15:56:06 -0500 |
commit | 8867ea4f269fb5266ed7d3c48c6de3917437f9cd (patch) | |
tree | 7420cd246632386ec31eed90d4405fedf5808e80 | |
parent | 166ed64f9498a58f6928a8de0633b335bdd5077a (diff) |
[iceweasel]: housekeeping
-rw-r--r-- | libre/iceweasel/PKGBUILD | 98 |
1 files changed, 53 insertions, 45 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index d50e42516..4303c1bba 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -38,9 +38,9 @@ # from the published source package, and will not be required as makedepends. # # technical: -# - build i686 with GCC instead of clang +# - build 32-bit arches with GCC instead of clang # - disable rust-SIMD, LTO, PGO, and skip profiling build for armv7h and i686 -# - allow skipping profiling build for x86_64 (_x86_64_skip_pgo). +# - allow skipping profiling build for x86_64 (_SHOULD_SKIP_PGO). # this is to avoid OOM problems, and occasional deadlocks in some versions, # which expect active netwokring or internet access at build time. # - prefer as many system libs as possible, over their vendored couterparts @@ -230,22 +230,29 @@ b2sums_i686=('97035e44cd1deae7bb2422c81eec7294feb51f43f460b4d7ddba083e1d8a48d265 # _mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a # anti-feature -## dependency tweaks ## +## compiler and optimization tweaks ## + +# disable PGO for 32-bit arches (always), x86_64 optionally +# normally enabled ('0') for x86_64 - try '1' if the build hangs indefinitely +readonly _SHOULD_SKIP_PGO=$(case "${CARCH}" in armv7h|i686) echo 1 ;; *) echo 0 ;; esac) -# disable PGO for 32-bit arches, x86_64 optionally -_should_skip_pgo=0 # enabled for x86_64 - try '1' if the build hangs indefinitely +# use GCC vs LLVM for 32-bit arches +# normally not needed ('0') for x86_64 +# for 32-bit arches, try one or the other, to resolve compiler/linker issues +readonly _SHOULD_USE_GCC==$(case "${CARCH}" in armv7h) echo 1 ;; + i686 ) echo 1 ;; + x86_64) echo 0 ;; esac) + + +## dependency tweaks ## case "${CARCH}" in armv7h) - _should_skip_pgo=1 - makedepends=( ${makedepends[*]/wasi-*/} ) # armv7h has no wasi compiler depends+=( icu=72.1 ) # --with-system-icu ;; i686) - _should_skip_pgo=1 - makedepends+=( llvm14 ) # rustup: error while loading shared libraries: libLLVM-14.so: makedepends=( ${makedepends[*]/wasi-*/} ) # wasm-ld: error: cannot open /usr/lib/clang/15.0.7/lib/wasi/libclang_rt.builtins-wasm32.a: No such file or directory @@ -354,12 +361,29 @@ prepare() { sed -i "s|# 'LIBYUV_DISABLE_NEON',|'LIBYUV_DISABLE_NEON',|" media/libyuv/libyuv/libyuv.gyp ! grep "# 'LIBYUV_DISABLE_NEON'," media/libyuv/libyuv/libyuv.gyp || ! echo "error patching media/libyuv/libyuv/libyuv.gyp" || exit 1 - # v108 FTBS all arches other than 64bit little-endian - patch -Np1 -i ../update_uniffi_to_0.21.1.patch + patch -p1 -i ../build-arm-libopus.patch ;; i686) - # v108 FTBS all arches other than 64bit little-endian - patch -Np1 -i ../update_uniffi_to_0.21.1.patch + # readelf: Error: Unable to seek to 0x801db328 for section headers + echo "applying avoid-libxul-OOM-python-check.patch" + patch -p1 -i ../avoid-libxul-OOM-python-check.patch + + # test failure in rust code (complaining about network functions) when PGO is used, + # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 + echo "applying rust-static-disable-network-test-on-static-libraries.patch" + patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch + + # FIXME: this patch is probably temporary - it comes from mozilla + # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 + # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: + # error: conflicting declaration ‘typedef __double_t double_t’ + # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ + echo "applying firefox-107.0-fdlibm.patch" + patch -p1 -i "$srcdir/firefox-107.0-fdlibm.patch" + + # js/src/jit/shared/AtomicOperations-shared-jit.cpp:88:9: error: ‘AtomicCopyByteUnsynchronized’ was not declared in this scope; did you mean ‘AtomicMemcpyUpUnsynchronized’? + echo "applying fix-i686-build-moz-1792159.patch" + patch -p1 -i "$srcdir/fix-i686-build-moz-1792159.patch" ;; x86_64) ;; @@ -424,7 +448,7 @@ END aarch64|armv7h) # experimental/version-specific hacks # - # use GCC vs LLVM + (( ! _SHOULD_USE_GCC )) || cat >> ../mozconfig <<EOF export CC=gcc export CXX=g++ @@ -437,7 +461,7 @@ EOF echo 'ac_add_options --with-system-icu' >> ../mozconfig - # upstream # + # archarm configuration # # archarm has these differences in ## general configuration ## above sed -i ' @@ -469,7 +493,7 @@ EOF # archarm `export` commands are under the '[ARCH-SPECIFIC BUILD ENV]' section - patch -p1 -i ../build-arm-libopus.patch + # archarm patching is under the 'technical patching' section # At this point in the script, the arch, arch32, and parabola PKGBUILDs # have prepared a temporary ${srcdir}/mozconfig; but the archarm PKGBUILD @@ -482,7 +506,7 @@ EOF i686) # experimental/version-specific hacks # - # use GCC vs LLVM + (( ! _SHOULD_USE_GCC )) || cat >>../mozconfig <<END export CC=gcc export CXX=g++ @@ -492,11 +516,12 @@ export RANLIB=gcc-ranlib END - # upstream # + # arch32 configuration # - export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" -# export MOZ_MAKE_FLAGS=-j2 + # arch32 `export` commands are under the '[ARCH-SPECIFIC BUILD ENV]' section + # NOTE: these diffs and the compiler flags above, were moved to mozconfig-i686.patch + # they are more handy to tweak in-line though # disable LTO as it has little benefit and uses too many resources # don't compile with clang, use gcc toolchain (clang has issues on IA32) # disable SIMD (SSE2 for i686) @@ -516,26 +541,7 @@ END sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk # FIXME: is this needed? - # readelf: Error: Unable to seek to 0x801db328 for section headers - echo "applying avoid-libxul-OOM-python-check.patch" - patch -p1 -i ../avoid-libxul-OOM-python-check.patch - - # test failure in rust code (complaining about network functions) when PGO is used, - # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 - echo "applying rust-static-disable-network-test-on-static-libraries.patch" - patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch - - # FIXME: this patch is probably temporary - it comes from mozilla - # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 - # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: - # error: conflicting declaration ‘typedef __double_t double_t’ - # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ - echo "applying firefox-107.0-fdlibm.patch" - patch -p1 -i "$srcdir/firefox-107.0-fdlibm.patch" - - # js/src/jit/shared/AtomicOperations-shared-jit.cpp:88:9: error: ‘AtomicCopyByteUnsynchronized’ was not declared in this scope; did you mean ‘AtomicMemcpyUpUnsynchronized’? - echo "applying fix-i686-build-moz-1792159.patch" - patch -p1 -i "$srcdir/fix-i686-build-moz-1792159.patch" + # arch32 patching is under the 'technical patching' section ;; x86_64) ;; @@ -723,8 +729,10 @@ build() { # try hard to tell ld and rust not to use too much memory (no lto, no debug info, etc.) export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" -# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" # with GCC - export LDFLAGS+=" -Wl,--no-keep-memory " # without GCC + export LDFLAGS+=" -Wl,--no-keep-memory " # -Wl,--reduce-memory-overheads -Wl,--max-cache-size=16384000 " + export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" + +# export MOZ_MAKE_FLAGS=-j2 # libvpx has some hard-coded compiler flags for MMX, SSE, SSE2, use the correct one # per CARCH (75.0 uses an intrisic _mm_empty now, which required the corresponding @@ -760,7 +768,7 @@ build() { ## PGO build ## - if (( $_should_skip_pgo )) + if (( _SHOULD_SKIP_PGO )) then # skipping "3-tier PGO" "instrumented browser"; so the final .mozconfig is ready now cp ../mozconfig .mozconfig @@ -796,7 +804,7 @@ 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 # $_should_skip_pgo + fi # _SHOULD_SKIP_PGO ## sanity checks ## @@ -806,7 +814,7 @@ END ## main build ## - (( ! $_should_skip_pgo )) || echo "Building optimized browser..." + (( ! _SHOULD_SKIP_PGO )) || echo "Building optimized browser..." ./mach build # echo "Building symbol archive..." # anti-feature |