summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2023-12-04 05:56:26 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2023-12-07 20:50:21 -0600
commitf6153b23bf3372d6d8093c2a8ef158d626f75018 (patch)
treec0b0449ccacadfc932472abdfbced1a3ab2e6876 /legacy
parent7a2994761b1b0c34f270a808330d297dfd0d5eb2 (diff)
downloadpackages-f6153b23bf3372d6d8093c2a8ef158d626f75018.tar.gz
packages-f6153b23bf3372d6d8093c2a8ef158d626f75018.tar.bz2
packages-f6153b23bf3372d6d8093c2a8ef158d626f75018.tar.xz
packages-f6153b23bf3372d6d8093c2a8ef158d626f75018.zip
user/mozjs: Move to legacy/
We do not need years-old SpiderMonkey any more.
Diffstat (limited to 'legacy')
-rw-r--r--legacy/mozjs/0003-build-Fix-library-install-name-on-macOS.patch30
-rw-r--r--legacy/mozjs/0009-build-Include-configure-script-be-nicer-about-option.patch53
-rw-r--r--legacy/mozjs/1002_drop_build_id.patch33
-rw-r--r--legacy/mozjs/1004_fix_pie_detection.patch34
-rw-r--r--legacy/mozjs/6006_musl_pthread_setname.patch29
-rw-r--r--legacy/mozjs/APKBUILD90
-rw-r--r--legacy/mozjs/endian.patch141
7 files changed, 410 insertions, 0 deletions
diff --git a/legacy/mozjs/0003-build-Fix-library-install-name-on-macOS.patch b/legacy/mozjs/0003-build-Fix-library-install-name-on-macOS.patch
new file mode 100644
index 000000000..7d66d5aac
--- /dev/null
+++ b/legacy/mozjs/0003-build-Fix-library-install-name-on-macOS.patch
@@ -0,0 +1,30 @@
+From fd8fc6e7b8760c961be7a3b9c6559d15f5ad008f Mon Sep 17 00:00:00 2001
+From: Philip Chimento <philip.chimento@gmail.com>
+Date: Wed, 5 Jul 2017 22:44:18 -0700
+Subject: [PATCH 03/10] build: Fix library install name on macOS
+
+In order for the library to work under JHbuild, it has to have an install
+name with an absolute path, since it will be installed in a shared
+location.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1379536
+---
+ config/rules.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index a21128cf..d88bada3 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -352,7 +352,7 @@ else
+ ifdef MOZ_IOS
+ _LOADER_PATH := @rpath
+ else
+-_LOADER_PATH := @executable_path
++_LOADER_PATH := $(abspath $(prefix))/lib
+ endif
+ EXTRA_DSO_LDOPTS += -dynamiclib -install_name $(_LOADER_PATH)/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
+ endif
+--
+2.13.0
+
diff --git a/legacy/mozjs/0009-build-Include-configure-script-be-nicer-about-option.patch b/legacy/mozjs/0009-build-Include-configure-script-be-nicer-about-option.patch
new file mode 100644
index 000000000..1a27b9ab5
--- /dev/null
+++ b/legacy/mozjs/0009-build-Include-configure-script-be-nicer-about-option.patch
@@ -0,0 +1,53 @@
+From 83374895c64a673acfc7a1898f134a04c1a45d15 Mon Sep 17 00:00:00 2001
+From: Philip Chimento <philip.chimento@gmail.com>
+Date: Wed, 5 Jul 2017 22:57:09 -0700
+Subject: [PATCH 09/10] build: Include configure script, be nicer about options
+
+A configure script is not included in the SpiderMonkey tarball by
+default. Also, we have to account for JHbuild passing extra unknown
+options like --disable-Werror.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1379540
+
+MODIFIED by Ian Stakenvicius, to *not* attempt to overwrite the existing
+js/src/configure that 'make-source-package.sh' apparently adds to the
+tarball.
+
+---
+ python/mozbuild/mozbuild/configure/__init__.py | 2 +-
+ python/mozbuild/mozbuild/configure/options.py | 6 +++++-
+ 2 files changed
+
+diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
+index 0fe640ca..09b460d3 100644
+--- a/python/mozbuild/mozbuild/configure/__init__.py
++++ b/python/mozbuild/mozbuild/configure/__init__.py
+@@ -356,7 +356,7 @@ class ConfigureSandbox(dict):
+ # All options should have been removed (handled) by now.
+ for arg in self._helper:
+ without_value = arg.split('=', 1)[0]
+- raise InvalidOptionError('Unknown option: %s' % without_value)
++ print('Ignoring', without_value, ': Unknown option')
+
+ # Run the execution queue
+ for func, args in self._execution_queue:
+diff --git a/python/mozbuild/mozbuild/configure/options.py b/python/mozbuild/mozbuild/configure/options.py
+index 4310c862..15bfe425 100644
+--- a/python/mozbuild/mozbuild/configure/options.py
++++ b/python/mozbuild/mozbuild/configure/options.py
+@@ -402,7 +402,11 @@ class CommandLineHelper(object):
+
+ def add(self, arg, origin='command-line', args=None):
+ assert origin != 'default'
+- prefix, name, values = Option.split_option(arg)
++ try:
++ prefix, name, values = Option.split_option(arg)
++ except InvalidOptionError as e:
++ print('Ignoring', arg, ':', e)
++ return
+ if args is None:
+ args = self._extra_args
+ if args is self._extra_args and name in self._extra_args:
+--
+2.13.0
+
diff --git a/legacy/mozjs/1002_drop_build_id.patch b/legacy/mozjs/1002_drop_build_id.patch
new file mode 100644
index 000000000..9f62abaea
--- /dev/null
+++ b/legacy/mozjs/1002_drop_build_id.patch
@@ -0,0 +1,33 @@
+From: Jory A. Pratt <anarchy@gentoo.org>
+
+We must drop build id as it causes conflicts when merging
+thunderbird/firefox/seamonkey on same system when using
+splitdebug
+
+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
+@@ -478,23 +478,16 @@ if test "$GNU_CC"; then
+
+ AC_MSG_CHECKING([for -z relro option to ld])
+ _SAVE_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-z,relro"
+ AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ LDFLAGS=$_SAVE_LDFLAGS)
+
+- AC_MSG_CHECKING([for --build-id option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+-
+ _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
+ _USE_CPP_INCLUDE_FLAG=1
+ fi
+
+ if test "$GNU_CXX"; then
+ _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $jsconfdefs"
+ _USE_CPP_INCLUDE_FLAG=1
+ fi
diff --git a/legacy/mozjs/1004_fix_pie_detection.patch b/legacy/mozjs/1004_fix_pie_detection.patch
new file mode 100644
index 000000000..e24adf365
--- /dev/null
+++ b/legacy/mozjs/1004_fix_pie_detection.patch
@@ -0,0 +1,34 @@
+From: Jory A. Pratt <anarchy@gentoo.org>
+
+CFLAGS must contain -fPIC when checking the linker
+
+diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
+--- a/build/autoconf/compiler-opts.m4
++++ b/build/autoconf/compiler-opts.m4
+@@ -205,23 +205,26 @@ MOZ_PIE=
+
+ MOZ_ARG_ENABLE_BOOL(pie,
+ [ --enable-pie Enable Position Independent Executables],
+ MOZ_PIE=1,
+ MOZ_PIE= )
+
+ if test "$GNU_CC$CLANG_CC" -a -n "$MOZ_PIE"; then
+ AC_MSG_CHECKING([for PIE support])
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS -fPIC"
+ _SAVE_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS -pie"
+ AC_TRY_LINK(,,AC_MSG_RESULT([yes])
+ [MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -pie"],
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([--enable-pie requires PIE support from the linker.]))
+ LDFLAGS=$_SAVE_LDFLAGS
++ CFLAGS=$_SAVE_CFLAGS
+ fi
+
+ AC_SUBST(MOZ_PROGRAM_LDFLAGS)
+
+ dnl ASan assumes no symbols are being interposed, and when that happens,
+ dnl it's not happy with it. Unconveniently, since Firefox is exporting
+ dnl libffi symbols and Gtk+3 pulls system libffi via libwayland-client,
+ dnl system libffi interposes libffi symbols that ASan assumes are in
diff --git a/legacy/mozjs/6006_musl_pthread_setname.patch b/legacy/mozjs/6006_musl_pthread_setname.patch
new file mode 100644
index 000000000..213509ff7
--- /dev/null
+++ b/legacy/mozjs/6006_musl_pthread_setname.patch
@@ -0,0 +1,29 @@
+From: Jory A. Pratt <anarchy@gentoo.org>
+
+set pthread name for non glibc systems
+
+diff --git a/js/src/threading/posix/Thread.cpp b/js/src/threading/posix/Thread.cpp
+--- a/js/src/threading/posix/Thread.cpp
++++ b/js/src/threading/posix/Thread.cpp
+@@ -155,18 +155,20 @@
+ int rv;
+ #ifdef XP_DARWIN
+ rv = pthread_setname_np(name);
+ #elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ pthread_set_name_np(pthread_self(), name);
+ rv = 0;
+ #elif defined(__NetBSD__)
+ rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
+-#else
++#elif defined(__GLIBC__)
+ rv = pthread_setname_np(pthread_self(), name);
++#else
++ rv = 0;
+ #endif
+ MOZ_RELEASE_ASSERT(!rv);
+ }
+
+ void js::ThisThread::GetName(char* nameBuffer, size_t len) {
+ MOZ_RELEASE_ASSERT(len >= 16);
+
+ int rv = -1;
diff --git a/legacy/mozjs/APKBUILD b/legacy/mozjs/APKBUILD
new file mode 100644
index 000000000..86c7c5c0c
--- /dev/null
+++ b/legacy/mozjs/APKBUILD
@@ -0,0 +1,90 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=mozjs
+pkgver=60.5.2
+pkgrel=0
+pkgdesc="Standalone JavaScript interpreter from Mozilla"
+url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
+arch="all"
+license="NPL-1.1"
+depends=""
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="autoconf2.13 icu-dev libffi-dev nspr-dev python3 cmd:which
+ zlib-dev
+ ncurses-dev openssl-dev"
+subpackages="$pkgname-dev"
+source="https://distfiles.adelielinux.org/source/mozilla/mozjs-$pkgver.tar.bz2
+ https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
+ 0003-build-Fix-library-install-name-on-macOS.patch
+ 0009-build-Include-configure-script-be-nicer-about-option.patch
+ 1002_drop_build_id.patch
+ 1004_fix_pie_detection.patch
+ 6006_musl_pthread_setname.patch
+ endian.patch
+ "
+builddir="$srcdir/mozjs-$pkgver"
+
+unpack() {
+ default_unpack
+ [ -z $SKIP_PYTHON ] || return 0
+
+ msg "Killing all remaining hope for humanity and building Python 2..."
+ cd "$srcdir/Python-2.7.15"
+ [ -d ../python ] && rm -r ../python
+ # 19:39 <+solar> just make the firefox build process build its own py2 copy
+ # 20:03 <calvin> TheWilfox: there's always violence
+ ./configure --prefix="$srcdir/python"
+ make -j $JOBS
+ # 6 tests failed:
+ # test__locale test_os test_posix test_re test_strptime test_time
+ # make test
+ make -j $JOBS install
+}
+
+prepare() {
+ default_prepare
+ cd "$builddir"/js/src
+ export PATH="$srcdir/python/bin:$PATH"
+ autoconf-2.13 old-configure.in >/dev/null
+ autoconf-2.13
+}
+
+build() {
+ cd "$builddir"/js/src/build
+ export PATH="$srcdir/python/bin:$PATH"
+ ../configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --disable-jemalloc \
+ --disable-optimize \
+ --enable-tests \
+ --with-intl-api \
+ --with-system-icu \
+ --with-system-nspr \
+ --with-system-zlib
+ MOZ_MAKE_FLAGS="$MAKEFLAGS" make
+}
+
+check() {
+ cd "$builddir"/js/src/build
+ dist/bin/jsapi-tests
+}
+
+package() {
+ cd "$builddir"/js/src/build
+ make DESTDIR="$pkgdir" install
+
+ # no real point for 400 MB monster.
+ # if someone needs this, we can split it into -dev.
+ rm "$pkgdir"/usr/lib/libjs_static.ajs
+}
+
+sha512sums="5fb73330e7803bdd524fbe7cfdf4e6b72e85d4b22b0c827400317b5d052d1088d36e558ceac376393089e9d03e658b24e69262851fc04a66bbcda47135423dc0 mozjs-60.5.2.tar.bz2
+27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6 Python-2.7.15.tar.xz
+8563264274c8b47c41fcce0b23d8d31467c60b4f1e6b37e14a390950f0d4c84be08919e0cf3578367ca1c76633201fc7d182c98a1efb57b17ce176a3e1ed5b0d 0003-build-Fix-library-install-name-on-macOS.patch
+2556f3322c5bc39c1efbbbd19b6843cf69b63a0255e8e3617f58b229e75ac221b6cb57fce15452cd1f25498c66f29f588f38c10c175b82c6fe163faaa7e3e2b0 0009-build-Include-configure-script-be-nicer-about-option.patch
+0882664005d65d491d4b3d0cd73a2163637730eff41a2ad3ae1ea4e855e8728b83d1bc42632901d717f947a11e6c1c42a33f5286b0adedda3111068ae1425259 1002_drop_build_id.patch
+11cef339e8ba5d446d9fbb3947c6526294a3577025f21323cfd959707cbcc36f24535d5b68ea286220891de584ae6deef9408e838fc720af453062a179f22f42 1004_fix_pie_detection.patch
+00cc3ea149ea8527393fa3995fcb6fa7af41fc79488c38df2bcd3326dbf43bcc83db509b6dbf2c9c8d68998ce2c1ab1f18c1c46584d9aeb63ddd2cf05b1ca1ce 6006_musl_pthread_setname.patch
+363f1df1a78799783b4e9f887dc85d83ec83c6ec392aeacbd98dc89e543d0cd3b9d1964ce274142b44847a03c47f845cbf6fa7fa17a04b25bbaa37fc5d714730 endian.patch"
diff --git a/legacy/mozjs/endian.patch b/legacy/mozjs/endian.patch
new file mode 100644
index 000000000..1a04573ea
--- /dev/null
+++ b/legacy/mozjs/endian.patch
@@ -0,0 +1,141 @@
+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;