From 3193daa925cb21cc4df1980ddb3d02d1f0033e74 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Thu, 27 Feb 2020 16:14:55 +0100 Subject: community/mozjs68: move from testing --- .../mozjs68/0001-silence-sandbox-violations.patch | 25 ++++ community/mozjs68/APKBUILD | 127 +++++++++++++++++++++ community/mozjs68/disable-jslint.patch | 18 +++ .../fd6847c9416f9eebde636e21d794d25d1be8791d.patch | 37 ++++++ community/mozjs68/fix-musl-build.patch | 16 +++ community/mozjs68/fix-rust-target.patch | 23 ++++ 6 files changed, 246 insertions(+) create mode 100644 community/mozjs68/0001-silence-sandbox-violations.patch create mode 100644 community/mozjs68/APKBUILD create mode 100644 community/mozjs68/disable-jslint.patch create mode 100644 community/mozjs68/fd6847c9416f9eebde636e21d794d25d1be8791d.patch create mode 100644 community/mozjs68/fix-musl-build.patch create mode 100644 community/mozjs68/fix-rust-target.patch (limited to 'community/mozjs68') diff --git a/community/mozjs68/0001-silence-sandbox-violations.patch b/community/mozjs68/0001-silence-sandbox-violations.patch new file mode 100644 index 0000000000..5a5b8aba3b --- /dev/null +++ b/community/mozjs68/0001-silence-sandbox-violations.patch @@ -0,0 +1,25 @@ +Upstream: no +From 9ad10569e11a2fb96377188f895bc66abcc9511d Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Wed, 5 Sep 2018 15:05:24 +0200 +Subject: [PATCH] silence sandbox violations + +Signed-off-by: Marc-Antoine Perennou +--- + python/mozbuild/mozbuild/frontend/emitter.py | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/python/mozbuild/mozbuild/frontend/emitter.py ++++ b/python/mozbuild/mozbuild/frontend/emitter.py +@@ -1195,11 +1195,6 @@ + raise SandboxValidationError('Path specified in LOCAL_INCLUDES ' + 'is a filename, but a directory is required: %s ' + '(resolved to %s)' % (local_include, full_path), context) +- if (full_path == context.config.topsrcdir or +- full_path == context.config.topobjdir): +- raise SandboxValidationError('Path specified in LOCAL_INCLUDES ' +- '(%s) resolves to the topsrcdir or topobjdir (%s), which is ' +- 'not allowed' % (local_include, full_path), context) + include_obj = LocalInclude(context, local_include) + local_includes.append(include_obj.path.full_path) + yield include_obj diff --git a/community/mozjs68/APKBUILD b/community/mozjs68/APKBUILD new file mode 100644 index 0000000000..58bbf0f9ef --- /dev/null +++ b/community/mozjs68/APKBUILD @@ -0,0 +1,127 @@ +# Contributor: Rasmus Thomsen +# Maintainer: Rasmus Thomsen +pkgname=mozjs68 +pkgver=68.5.0 +pkgrel=2 +pkgdesc="Standalone Mozilla JavaScript engine" +url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" +arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # limited by rust and cargo +license="MPL-2.0" +depends_dev=" + icu-dev + nspr-dev + libffi-dev + readline-dev + " +makedepends=" + $depends_dev + zlib-dev + python2 + python3-dev + perl + sed + autoconf2.13 + linux-headers + rust + cargo + llvm9 + clang-dev + " +subpackages="$pkgname-dev" +source="https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz + 0001-silence-sandbox-violations.patch + disable-jslint.patch + fix-musl-build.patch + fix-rust-target.patch + fd6847c9416f9eebde636e21d794d25d1be8791d.patch + " +builddir="$srcdir"/firefox-$pkgver +_builddir="$builddir/js/src" + +# secfixes: +# 60.7.2-r0: +# - CVE-2019-11708 +# - CVE-2019-11707 + +build() { + cd "$_builddir" + + export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576" + + # avoid complains about autoconf + touch configure + + # Fix broken ARM_ARCH check which doesn't work with newer GCCs it seems. + case "$CTARGET" in + armv*) + ARM_ARCH=$(echo ${CTARGET#*armv} | sed "s|-.*||") + sed -i "s|ARM_ARCH=.*|ARM_ARCH=$ARM_ARCH|" "$builddir"/build/autoconf/arch.m4 + ;; + esac + + case "$CARCH" in + x86) + export RUST_TARGET="i686-unknown-linux-musl" + ;; + x86_64) + export RUST_TARGET="$CTARGET" + ;; + aarch64) + export RUST_TARGET="aarch64-unknown-linux-musl" + ;; + armv7) + export RUST_TARGET="armv7-unknown-linux-musleabihf" + ;; + armhf) + export RUST_TARGET="arm-unknown-linux-musleabihf" + ;; + ppc64le) + export RUST_TARGET="powerpc64le-unknown-linux-musl" + ;; + esac + + export SHELL=/bin/ash + export PYTHON=/usr/bin/python2 + ./configure --prefix=/usr \ + --with-clang-path=/usr/bin/clang \ + --with-intl-api \ + --with-libclang-path=/usr/lib \ + --with-system-icu \ + --with-system-nspr \ + --with-system-zlib \ + --enable-ctypes \ + --enable-hardening \ + --enable-optimize="$CFLAGS -O2" \ + --enable-readline \ + --enable-release \ + --enable-shared-js \ + --enable-system-ffi \ + --enable-tests \ + --disable-debug \ + --disable-debug-symbols \ + --disable-jemalloc \ + --disable-strip \ + --enable-unaligned-private-values + make +} + +check() { + cd "$_builddir" + dist/bin/jsapi-tests \ + --format=none \ + --exclude-random \ + basic +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + rm -f "$pkgdir"/usr/lib/*.ajs +} + +sha512sums="0acf4ecd47bccf062ab330231e36355f5d84e66ab411f653ae3160583613840925bb473c0f7dfa4b15311a543940293c4633516851c9466c4b0133c9271710d3 firefox-68.5.0esr.source.tar.xz +4d30f4b64b6d9ba03099831aef18f6dffa7f0ff537d71502b8975329c9fa5025f02a43f45cf1311116d917fb507d5961163d659bb4c9f43c22bd61d14d0afb2f 0001-silence-sandbox-violations.patch +6e9e7d811b92e32af29cebec6cb59763004f30b990842b8dd036f971f10d6659e8dbd771f0d61c8a42ea0ac4a6937466c1e6fd450a08efab8a0c7bab4ef3a1ec disable-jslint.patch +bc91c2fb15eb22acb8acc36d086fb18fbf6f202b4511d138769b5ecaaed4a673349c55f808270c762616fafa42e3b01e74dc0af1dcbeea1289e043926e2750c8 fix-musl-build.patch +1bf1f579ced0ca47d156eb45962114f9867cf224c2ba34dfc106227648322ecf729243d2a6e84b72cb011abadc36ed84990960bded764fd4243fc9cb22084ce5 fix-rust-target.patch +60845dcb034b2c4459c30f7d5f25c8176cf42df794e2cc0e86c3e2abb6541c24b962f3a16ca70a288d4d6f377b68d00b2904b22463108559612053d835d9bff1 fd6847c9416f9eebde636e21d794d25d1be8791d.patch" diff --git a/community/mozjs68/disable-jslint.patch b/community/mozjs68/disable-jslint.patch new file mode 100644 index 0000000000..b29aba6df7 --- /dev/null +++ b/community/mozjs68/disable-jslint.patch @@ -0,0 +1,18 @@ +--- a/js/src/build/moz.build ++++ b/js/src/build/moz.build +@@ -83,15 +83,3 @@ + NO_EXPAND_LIBS = True + + DIST_INSTALL = True +- +-# Run SpiderMonkey style checker after linking the static library. This avoids +-# running the script for no-op builds. +-GENERATED_FILES += ['spidermonkey_checks'] +-run_checks = GENERATED_FILES['spidermonkey_checks'] +-run_checks.script = '/config/run_spidermonkey_checks.py' +-run_checks.inputs += [ +- '!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']), +- '/config/check_spidermonkey_style.py', +- '/config/check_macroassembler_style.py', +- '/config/check_js_opcode.py' +-] diff --git a/community/mozjs68/fd6847c9416f9eebde636e21d794d25d1be8791d.patch b/community/mozjs68/fd6847c9416f9eebde636e21d794d25d1be8791d.patch new file mode 100644 index 0000000000..1af68d93c6 --- /dev/null +++ b/community/mozjs68/fd6847c9416f9eebde636e21d794d25d1be8791d.patch @@ -0,0 +1,37 @@ +See https://bugzilla.mozilla.org/show_bug.cgi?id=1539739 + +From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Sat, 1 Jun 2019 09:06:01 +0900 +Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and + user_vfp_exc. + +--- + js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp +index 636537f8478..383c380f04c 100644 +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -248,7 +248,16 @@ using mozilla::DebugOnly; + #endif + + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-# include ++struct user_vfp { ++ unsigned long long fpregs[32]; ++ unsigned long fpscr; ++}; ++ ++struct user_vfp_exc { ++ unsigned long fpexc; ++ unsigned long fpinst; ++ unsigned long fpinst2; ++}; + #endif + + #if defined(ANDROID) +-- +2.20.1 + diff --git a/community/mozjs68/fix-musl-build.patch b/community/mozjs68/fix-musl-build.patch new file mode 100644 index 0000000000..af39467399 --- /dev/null +++ b/community/mozjs68/fix-musl-build.patch @@ -0,0 +1,16 @@ +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) + ;; diff --git a/community/mozjs68/fix-rust-target.patch b/community/mozjs68/fix-rust-target.patch new file mode 100644 index 0000000000..d2d638b9ea --- /dev/null +++ b/community/mozjs68/fix-rust-target.patch @@ -0,0 +1,23 @@ +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -278,9 +280,10 @@ + die("Don't know how to translate {} for rustc".format( + host_or_target.alias)) + ++ fixed_alias = os.environ['RUST_TARGET'] + # Check to see whether our rustc has a reasonably functional stdlib + # for our chosen target. +- target_arg = '--target=' + rustc_target.alias ++ target_arg = '--target=' + fixed_alias + in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs') + out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib') + os.close(out_fd) +@@ -317,7 +320,7 @@ + os.remove(out_path) + + # This target is usable. +- return rustc_target.alias ++ return fixed_alias + + return rust_target + -- cgit v1.2.3