Skip to content
Snippets Groups Projects
Commit 1ea3e3be authored by Newbyte's avatar Newbyte :snowflake: Committed by alice
Browse files

testing/mozjs102: new aport

Will be used by GNOME 43.
parent ae76ac3b
No related branches found
No related tags found
2 merge requests!39304[3.16] main/expat: security upgrade to 2.4.9,!38803testing/mozjs102: new aport
Pipeline #135831 canceled
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Newbyte <newbie13xd@gmail.com>
pkgname=mozjs102
pkgver=102.2.0
pkgrel=0
pkgdesc="Standalone Mozilla JavaScript engine (102 ESR)"
url="https://spidermonkey.dev/"
# s390x: no lld
# riscv64: rust
# armhf: unsupported assembly
arch="all !armhf !s390x !riscv64"
license="MPL-2.0"
depends_dev="
$pkgname
icu-dev
libffi-dev
nspr-dev
"
_llvmver=14
makedepends="
$depends_dev
clang
autoconf2.13
cargo
linux-headers
lld
llvm-dev~$_llvmver
perl
python3
rust
sed
zlib-dev
"
checkdepends="icu-data-full"
subpackages="$pkgname-dev"
source="https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz
disable-moz-stackwalk.patch
fix-musl-build.patch
fix-rust-target.patch
simd_fix.patch
"
builddir="$srcdir"/firefox-$pkgver
prepare() {
default_prepare
mkdir "$srcdir/mozbuild"
cat > .mozconfig <<- END
ac_add_options --enable-application=js
mk_add_options MOZ_OBJDIR='${PWD}'/obj
ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --enable-optimize="$CFLAGS -O2"
ac_add_options --enable-rust-simd
ac_add_options --enable-linker=lld
ac_add_options --disable-bootstrap
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-icu
ac_add_options --with-system-nspr
ac_add_options --with-system-zlib
# Features
ac_add_options --enable-shared-js
ac_add_options --enable-tests
ac_add_options --with-intl-api
END
}
build() {
export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576"
# FF doesn't have SIMD available on armhf/v7
case "$CARCH" in
arm*)
echo 'ac_add_options --disable-rust-simd' >> .mozconfig
;;
*)
echo 'ac_add_options --enable-rust-simd' >> .mozconfig
;;
esac
unset CARGO_PROFILE_RELEASE_OPT_LEVEL
unset CARGO_PROFILE_RELEASE_LTO
export CC=clang
export CXX=clang++
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
export MOZ_NOSPAM=1
export PYTHON=/usr/bin/python3
export RUST_TARGET="$CTARGET"
export SHELL=/bin/ash
./mach build
}
check() {
obj/dist/bin/jsapi-tests \
--format=none \
--exclude-random \
basic
}
package() {
cd obj
make DESTDIR="$pkgdir" install
rm -f "$pkgdir"/usr/lib/*.ajs
}
sha512sums="
06d753867ccfe1b2c79148cc60bc816b47a2abfa98219808868e9028bef1763d982ef7012698d06b8959cce79163d7926baf5f9d5ca9daa18c51fbf0efc59993 firefox-102.2.0esr.source.tar.xz
454ea3263cabce099accbdc47aaf83be26a19f8b5a4568c01a7ef0384601cf8315efd86cd917f9c8bf419c2c845db89a905f3ff9a8eb0c8e41042e93aa96a85c disable-moz-stackwalk.patch
bc91c2fb15eb22acb8acc36d086fb18fbf6f202b4511d138769b5ecaaed4a673349c55f808270c762616fafa42e3b01e74dc0af1dcbeea1289e043926e2750c8 fix-musl-build.patch
0b222a36cf3fd446dfb7fd171d77c58c0f19bc4df8f61cb2d99f2dfa0998a24e4d11a92fb88a1144b1bdd8ace95a858dca0a5e9ad5a4ea37a13b2cb7c245758a fix-rust-target.patch
f4ab85a721519d94d5ba3837dbe13221dd3dcea2164a2d152b24b1a166760c5f03a0d85979bb1ec5228d18c300fae263de244fccea5b0bf3525537166ead072f simd_fix.patch
"
diff --git a/mozglue/misc/StackWalk.cpp b/mozglue/misc/StackWalk.cpp
index 7d62921..adcfa44 100644
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -33,13 +33,7 @@ using namespace mozilla;
# define MOZ_STACKWALK_SUPPORTS_MACOSX 0
#endif
-#if (defined(linux) && \
- ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
- defined(HAVE__UNWIND_BACKTRACE)))
-# define MOZ_STACKWALK_SUPPORTS_LINUX 1
-#else
# define MOZ_STACKWALK_SUPPORTS_LINUX 0
-#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
# define HAVE___LIBC_STACK_END 1
Upstream: No
Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD:
https://github.com/void-linux/void-packages/issues/2598
diff --git a/js/src/old-configure.in b/js/src/old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -1272,6 +1272,9 @@
*-android*|*-linuxandroid*)
:
;;
+ *-musl*)
+ :
+ ;;
*)
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
;;
commit 34b3ac3195a40757bc5f51a1db5a47a4b18c68b5
Author: Daniel Kolesa <daniel@octaforge.org>
Date: Sun Jan 23 21:13:38 2022 +0100
bypass rust triplet checks and just force ours
diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
index cd77d72b..0c03cab7 100644
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -261,7 +261,7 @@ def rust_supported_targets(rustc):
data.setdefault(key, []).append(namespace(rust_target=t, target=info))
return data
-
+@imports("os")
def detect_rustc_target(
host_or_target, compiler_info, arm_target, rust_supported_targets
):
@@ -383,7 +383,7 @@ def detect_rustc_target(
return None
- rustc_target = find_candidate(candidates)
+ rustc_target = os.environ["RUST_TARGET"]
if rustc_target is None:
die("Don't know how to translate {} for rustc".format(host_or_target.alias))
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment