aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTuan Hoang <tmhoang@linux.ibm.com>2019-05-06 17:29:58 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2019-05-06 15:55:56 +0000
commit867491d8f0e92fa372704458375eadf4d955e1ff (patch)
tree24af9abbda044c8f6f095e767b724d6bbdedb783
parenta9abb60a721b75ac9fd58b9c9e8d63b7bdf73239 (diff)
downloadaports-867491d8f0e92fa372704458375eadf4d955e1ff.tar.bz2
aports-867491d8f0e92fa372704458375eadf4d955e1ff.tar.xz
main/mozjs60: upgrade to 60.6.2, fix s390x
-rw-r--r--main/mozjs60/APKBUILD14
-rw-r--r--main/mozjs60/big-endian.patch166
2 files changed, 174 insertions, 6 deletions
diff --git a/main/mozjs60/APKBUILD b/main/mozjs60/APKBUILD
index 563c521b70..a39e49c403 100644
--- a/main/mozjs60/APKBUILD
+++ b/main/mozjs60/APKBUILD
@@ -1,19 +1,20 @@
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=mozjs60
-pkgver=60.6.1
+pkgver=60.6.2
_majver=${pkgver%%.*}
-pkgrel=1
+pkgrel=0
pkgdesc="standalone mozilla javascript engine"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/60"
-arch="all !s390x"
+arch="all"
license="MPL-2.0"
depends_dev="icu-dev nspr-dev libffi-dev readline-dev"
-makedepends="$depends_dev zlib-dev python2 perl sed autoconf2.13 linux-headers"
+makedepends="$depends_dev zlib-dev python2 python2-dev perl sed autoconf2.13 linux-headers"
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
fix-musl-build.patch
fix-soname-lib.patch
+ big-endian.patch
"
builddir="$srcdir"/firefox-$pkgver
_builddir="$builddir/js/src"
@@ -61,7 +62,8 @@ package() {
rm -f "$pkgdir"/usr/lib/*.ajs
}
-sha512sums="a1683e9ad551c2aa6b84013216393fe1f7107728c253ed8e5700d419cf0956513110ed4e1b5dbac3e3bc23930e3024706f1b24d405b6edcdf8c175b03ab241ed firefox-60.6.1esr.source.tar.xz
+sha512sums="ed4bf61555dcdae953b0a2f7bc23fae581b1c205d401e1bec524f62044455774c5cb18566bc2c96a6465bfd0d2b504fa94fbc719c4a46ea80eec2b776e86309f firefox-60.6.2esr.source.tar.xz
adaacd6e087a07bd4ded598f6a66ee00c67c9092bb93d88729668516f6f00f497ad8ece1866680e6c371e4705e0f9194ade41ea3a986f793bd972c92029cf03a 0001-silence-sandbox-violations.patch
bc91c2fb15eb22acb8acc36d086fb18fbf6f202b4511d138769b5ecaaed4a673349c55f808270c762616fafa42e3b01e74dc0af1dcbeea1289e043926e2750c8 fix-musl-build.patch
-4782794a0f409f767293fb5f61a9ad58985e05197538975ed8f7372bfae6921a3b9bcbbbfcf8ce2843cdfe8ee799d08cee71a6391ed5ae939f051d13038b0960 fix-soname-lib.patch"
+4782794a0f409f767293fb5f61a9ad58985e05197538975ed8f7372bfae6921a3b9bcbbbfcf8ce2843cdfe8ee799d08cee71a6391ed5ae939f051d13038b0960 fix-soname-lib.patch
+d9d587b614e2a08131688cac9bc3c78ffea96a79c7bcf8ae51ce208de5001250e0cd6f03269e1e09a387afcbc003c6f4446eb25411f65ad3073ed06539d7f74b big-endian.patch"
diff --git a/main/mozjs60/big-endian.patch b/main/mozjs60/big-endian.patch
new file mode 100644
index 0000000000..88c3aafde2
--- /dev/null
+++ b/main/mozjs60/big-endian.patch
@@ -0,0 +1,166 @@
+Related
+https://bugzilla.mozilla.org/show_bug.cgi?id=1543659
+https://bugzilla.mozilla.org/show_bug.cgi?id=1543843
+https://hg.mozilla.org/mozilla-central/rev/bc11fcee5741
+https://bugzilla.mozilla.org/show_bug.cgi?id=1488552
+https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/jsproperty-endian.patch
+
+diff --git a/js/src/jsapi.h b/js/src/jsapi.h
+index 0f11787..5042af2 100644
+--- a/js/src/jsapi.h
++++ b/js/src/jsapi.h
+@@ -1581,7 +1581,12 @@ struct JSPropertySpec {
+ uintptr_t type;
+ union {
+ const char* string;
+- int32_t int32;
++ struct {
++#if MOZ_BIG_ENDIAN && JS_BITS_PER_WORD == 64
++ uint32_t padding;
++#endif
++ int32_t int32;
++ };
+ };
+ };
+
+Bug 1488552 - Ensure proper running on 64-bit and 32-bit BE platforms.
+
+diff --git a/js/src/gc/RelocationOverlay.h b/js/src/gc/RelocationOverlay.h
+--- a/js/src/gc/RelocationOverlay.h
++++ b/js/src/gc/RelocationOverlay.h
+@@ -29,23 +29,34 @@ struct Cell;
+ * This structure overlays a Cell that has been moved and provides a way to find
+ * its new location. It's used during generational and compacting GC.
+ */
+ class RelocationOverlay {
+ /* See comment in js/public/HeapAPI.h. */
+ static const uint32_t Relocated = js::gc::Relocated;
+
++#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
+ /*
+- * Keep the low 32 bits untouched. Use them to distinguish strings from
++ * Keep the first 32 bits untouched. Use them to distinguish strings from
+ * objects in the nursery.
+ */
+ uint32_t preserve_;
+
+ /* Set to Relocated when moved. */
+ uint32_t magic_;
++#elif JS_BITS_PER_WORD == 64
++ /*
++ * On big-endian, we need to reorder to keep preserve_ lined up with the
++ * low 32 bits of the aligned group_ pointer in JSObject.
++ */
++ uint32_t magic_;
++ uint32_t preserve_;
++#else
++# error "Unknown endianness or word size"
++#endif
+
+ /* The location |this| was moved to. */
+ Cell* newLocation_;
+
+ /* A list entry to track all relocated things. */
+ RelocationOverlay* next_;
+
+ public:
+diff --git a/js/src/vm/StringType.h b/js/src/vm/StringType.h
+--- a/js/src/vm/StringType.h
++++ b/js/src/vm/StringType.h
+@@ -2,16 +2,17 @@
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ #ifndef vm_StringType_h
+ #define vm_StringType_h
+
++#include "mozilla/EndianUtils.h"
+ #include "mozilla/MemoryReporting.h"
+ #include "mozilla/PodOperations.h"
+ #include "mozilla/Range.h"
+
+ #include "jsapi.h"
+ #include "jsfriendapi.h"
+
+ #include "builtin/String.h"
+@@ -168,8 +168,20 @@ class JSString : public js::gc::Cell
+ struct Data {
+ union {
+ struct {
++#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
+ uint32_t flags; /* JSString */
+ uint32_t length; /* JSString */
++#elif JS_BITS_PER_WORD == 64
++ /*
++ * On big-endian, we need to reorder to keep flags lined up
++ * with the low 32 bits of the aligned group_ pointer in
++ * JSObject.
++ */
++ uint32_t length; /* JSString */
++ uint32_t flags; /* JSString */
++#else
++# error "Unknown endianness or word size"
++#endif
+ };
+ uintptr_t flattenData; /* JSRope (temporary while flattening) */
+ } u1;
+--- thunderbird-60.2.1/js/src/gc/Marking-inl.h.old 2018-10-01 14:51:12.000000000 +0000
++++ thunderbird-60.2.1/js/src/gc/Marking-inl.h 2018-10-12 19:08:28.260000000 +0000
+@@ -92,13 +92,29 @@
+ MOZ_ASSERT(!isForwarded());
+ // The location of magic_ is important because it must never be valid to see
+ // the value Relocated there in a GC thing that has not been moved.
++#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
++ // On 32-bit, the magic_ aliases with whatever comes after the first
++ // pointer; on little-endian 64-bit, the magic_ aliases with the
++ // 32 most significant bits of the pointer, which are the second half.
+ static_assert(offsetof(RelocationOverlay, magic_) ==
+ offsetof(JSObject, group_) + sizeof(uint32_t),
+ "RelocationOverlay::magic_ is in the wrong location");
+ static_assert(offsetof(RelocationOverlay, magic_) ==
+ offsetof(js::Shape, base_) + sizeof(uint32_t),
+ "RelocationOverlay::magic_ is in the wrong location");
++#elif JS_BITS_PER_WORD == 64
++ // On big-endian 64-bit, the magic_ aliases with the 32 most
++ // significant bits of the pointer, but now that's the first half.
++ static_assert(offsetof(RelocationOverlay, magic_) ==
++ offsetof(JSObject, group_),
++ "RelocationOverlay::magic_ is in the wrong location");
++ static_assert(offsetof(RelocationOverlay, magic_) ==
++ offsetof(js::Shape, base_),
++ "RelocationOverlay::magic_ is in the wrong location");
++#else
++# error "Unknown endianness or word size"
++#endif
+ static_assert(
+ offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.length),
+ "RelocationOverlay::magic_ is in the wrong location");
+ magic_ = Relocated;
+--- thunderbird-60.2.1/js/src/jsfriendapi.h.old 2018-10-01 14:51:13.000000000 +0000
++++ thunderbird-60.2.1/js/src/jsfriendapi.h 2018-10-12 19:12:06.190000000 +0000
+@@ -9,6 +9,7 @@
+
+ #include "mozilla/Atomics.h"
+ #include "mozilla/Casting.h"
++#include "mozilla/EndianUtils.h"
+ #include "mozilla/Maybe.h"
+ #include "mozilla/MemoryReporting.h"
+ #include "mozilla/UniquePtr.h"
+@@ -640,8 +641,15 @@
+ static const uint32_t LATIN1_CHARS_BIT = JS_BIT(6);
+ static const uint32_t EXTERNAL_FLAGS = LINEAR_BIT | NON_ATOM_BIT | JS_BIT(5);
+ static const uint32_t TYPE_FLAGS_MASK = JS_BIT(6) - 1;
++#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
+ uint32_t flags;
+ uint32_t length;
++#elif JS_BITS_PER_WORD == 64
++ uint32_t length;
++ uint32_t flags;
++#else
++# error "Unknown endianness or word size"
++#endif
+ union {
+ const JS::Latin1Char* nonInlineCharsLatin1;
+ const char16_t* nonInlineCharsTwoByte;