extra/js78 to 78.15.0-3

This commit is contained in:
Kevin Mihelich 2022-01-23 23:41:24 +00:00
parent 56ca928dbe
commit 42aebef3d9

View file

@ -6,10 +6,10 @@
pkgname=js78
pkgver=78.15.0
pkgrel=2
pkgrel=3
pkgdesc="JavaScript interpreter and libraries - Version 78"
arch=(x86_64)
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
url="https://spidermonkey.dev/"
license=(MPL)
depends=(gcc-libs readline zlib sh)
makedepends=(zip autoconf2.13 python-setuptools python-psutil rust llvm clang lld)
@ -33,8 +33,8 @@ validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Rel
COMPRESSZST+=(--long)
prepare() {
mkdir mozbuild
cd firefox-$pkgver
mkdir obj
patch -p1 -i ../arm.patch
# Post-78 fixes to fix LTO with LLVM 11
@ -45,53 +45,54 @@ prepare() {
# Fix build with Rust 1.56
patch -Np1 -i ../0003-Fixes-for-Rust-1.56.patch
cat >../mozconfig <<END
ac_add_options --enable-application=js
mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --disable-lto
ac_add_options --enable-optimize
ac_add_options --disable-rust-simd
ac_add_options --enable-linker=lld
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-jemalloc
ac_add_options --disable-strip
# System libraries
ac_add_options --with-system-zlib
ac_add_options --without-system-icu
# Features
ac_add_options --enable-readline
ac_add_options --enable-shared-js
ac_add_options --enable-tests
ac_add_options --with-intl-api
END
}
build() {
local configure_args=(
--prefix=/usr
--disable-debug
--disable-debug-symbols
--disable-jemalloc
--disable-strip
--enable-hardening
--disable-lto
--enable-linker=lld
--enable-optimize
--enable-readline
--enable-release
--disable-rust-simd
--enable-shared-js
--enable-tests
--with-intl-api
--with-system-zlib
--without-system-icu
)
cd firefox-$pkgver
export CC='clang'
export CXX='clang++'
export AR=llvm-ar
export NM=llvm-nm
export RANLIB=llvm-ranlib
CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition"
CXXFLAGS="${CXXFLAGS/-O2/-O3} -fno-semantic-interposition"
LDFLAGS+=" -Wl,-Bsymbolic-functions"
cd firefox-$pkgver/obj
export MOZ_NOSPAM=1
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
# Do 3-tier PGO
echo "Building instrumented JS..."
sh ../js/src/configure "${configure_args[@]}" \
--enable-profile-generate=cross
make
cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-profile-generate=cross
END
./mach build
echo "Profiling instrumented JS..."
(
local js="$PWD/dist/bin/js"
local js="$PWD/obj/dist/bin/js"
export LLVM_PROFILE_FILE="$PWD/js-%p-%m.profraw"
cd ../js/src/octane
cd js/src/octane
"$js" run.js
cd ../../../third_party/webkit/PerformanceTests/ARES-6
@ -107,13 +108,14 @@ build() {
test -s merged.profdata
echo "Removing instrumented JS..."
make clobber
./mach clobber
echo "Building optimized JS..."
sh ../js/src/configure "${configure_args[@]}" \
--enable-profile-use=cross \
--with-pgo-profile-path="$PWD/merged.profdata"
make
cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-profile-use=cross
ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
END
./mach build
}
check() {