Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: mozjs102-102.3.0
@ 2022-09-27 23:17 paper42
  2022-10-26 14:56 ` [PR PATCH] [Updated] " paper42
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: paper42 @ 2022-09-27 23:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2478 bytes --]

There is a new pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages mozjs102
https://github.com/void-linux/void-packages/pull/39498

New package: mozjs102-102.3.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

all patches are imported from mozjs91 except for:
* rebased fix-build-ppc32.patch
* imported use-fallback-atomic-operations-on-armv6.patch to fix some issues with armv6l

currently the armv6 builds fails with
```
/builddir/.xbps-mozjs102/wrappers/arm-linux-musleabihf-c++ --sysroot /usr/arm-linux-musleabihf -o Unified_cpp_js_src_jit12.o -c  -I/builddir/firefox-102.3.0/js/src/dist/system_wrappers -include /builddir/firefox-102.3.0/config/gcc_hidden.h -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DJS_HAS_CTYPES -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builddir/firefox-102.3.0/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src -I/builddir/firefox-102.3.0/js/src -I/builddir/firefox-102.3.0/js/src/dist/include -I/usr/arm-linux-musleabihf/usr/include/nspr -DMOZILLA_CLIENT -include /builddir/firefox-102.3.0/js/src/js/src/js-confdefs.h -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard -I/usr/arm-linux-musleabihf/usr/include -fdebug-prefix-map=/builddir/firefox-102.3.0/js/src=. -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -fno-omit-frame-pointer -funwind-tables -Werror=format -Wno-attributes -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_js_src_jit12.o.pp   Unified_cpp_js_src_jit12.cpp
{standard input}: Assembler messages:
{standard input}:14103: Error: selected processor does not support `isb' in ARM mode
```

A patch file from https://github.com/void-linux/void-packages/pull/39498.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mozjs102-39498.patch --]
[-- Type: text/x-diff, Size: 38864 bytes --]

From b4a611ab0fc20bc78a6e71d3d597671979b7cf6a Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Sun, 11 Sep 2022 18:58:40 +0200
Subject: [PATCH] New package: mozjs102-102.3.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs102-devel                        |  1 +
 srcpkgs/mozjs102/patches/001-fix-soname.patch | 26 +++++
 .../mozjs102/patches/002-copy-headers.patch   | 38 +++++++
 .../mozjs102/patches/003-tests-timeout.patch  | 26 +++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs102/patches/006-emitter.patch    | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs102/patches/008-init-patch.patch | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs102/patches/012-fix-musl.patch   | 21 ++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++
 .../mozjs102/patches/014-rust-target.patch    | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 80 +++++++++++++++
 .../mozjs102/patches/017-no-lto-readelf.patch | 35 +++++++
 .../mozjs102/patches/MOZ_NO_RUST_LTO.patch    | 18 ++++
 .../mozjs102/patches/fix-build-ppc32.patch    | 18 ++++
 .../mozjs102/patches/fix-i386-fdlibm.patch    | 18 ++++
 ...-fallback-atomic-operations-on-armv6.patch | 79 +++++++++++++++
 srcpkgs/mozjs102/template                     | 99 +++++++++++++++++++
 srcpkgs/mozjs102/update                       |  2 +
 23 files changed, 815 insertions(+)
 create mode 120000 srcpkgs/mozjs102-devel
 create mode 100644 srcpkgs/mozjs102/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs102/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs102/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs102/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs102/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs102/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs102/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-build-ppc32.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
 create mode 100644 srcpkgs/mozjs102/patches/use-fallback-atomic-operations-on-armv6.patch
 create mode 100644 srcpkgs/mozjs102/template
 create mode 100644 srcpkgs/mozjs102/update

diff --git a/common/shlibs b/common/shlibs
index c962f0ab7622..5a3110949373 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3475,6 +3475,7 @@ libmaxminddb.so.0 libmaxminddb-1.3.2_1
 libmysqlpp.so.3 mysql++-3.2.5_1
 libKF5Syndication.so.5 syndication-5.50.0_1
 liblqr-1.so.0 liblqr-0.4.2_1
+libmozjs-102.so.0 mozjs102-102.3.0_1
 libmozjs-78.so.0 mozjs78-78.1.0_1
 libmozjs-91.so.0 mozjs91-91.5.0_1
 libebur128.so.1 libebur128-1.2.4_1
diff --git a/srcpkgs/mozjs102-devel b/srcpkgs/mozjs102-devel
new file mode 120000
index 000000000000..97b7e735a472
--- /dev/null
+++ b/srcpkgs/mozjs102-devel
@@ -0,0 +1 @@
+mozjs102
\ No newline at end of file
diff --git a/srcpkgs/mozjs102/patches/001-fix-soname.patch b/srcpkgs/mozjs102/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/001-fix-soname.patch
@@ -0,0 +1,26 @@
+From d21c7cb9343d8c495d987e71be0f35887574c820 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:21:47 +0200
+Subject: [PATCH] Add soname switch to linker, regardless of Operating System
+
+Fix backported from Debian: http://bugs.debian.org/746705
+---
+ config/rules.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index 0f9b2ac..f6b4efe 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -285,6 +285,8 @@ ifeq ($(OS_ARCH),GNU)
+ OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
+ endif
+
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # MINGW32
+ #
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/002-copy-headers.patch b/srcpkgs/mozjs102/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/002-copy-headers.patch
@@ -0,0 +1,38 @@
+From 3b3c8e37cca418e07bdeceaf3a601805df28d925 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:27:39 +0200
+Subject: [PATCH] build: Copy headers on install instead of symlinking
+
+Patch by Philip Chimento ported forward to mozjs78
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index d964466..0285ad9 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1568,9 +1568,9 @@ class RecursiveMakeBackend(MakeBackend):
+                                     " of srcdir-relative or absolute paths."
+                                 )
+
+-                            install_manifest.add_pattern_link(basepath, wild, dest_dir)
++                            install_manifest.add_pattern_copy(basepath, wild, dest_dir)
+                         else:
+-                            install_manifest.add_pattern_link(f.srcdir, f, dest_dir)
++                            install_manifest.add_pattern_copy(f.srcdir, f, dest_dir)
+                     elif isinstance(f, AbsolutePath):
+                         if not f.full_path.lower().endswith((".dll", ".pdb", ".so")):
+                             raise Exception(
+@@ -1581,7 +1581,7 @@ class RecursiveMakeBackend(MakeBackend):
+                         install_manifest.add_optional_exists(dest_file)
+                         absolute_files.append(f.full_path)
+                     else:
+-                        install_manifest.add_link(f.full_path, dest_file)
++                        install_manifest.add_copy(f.full_path, dest_file)
+                 else:
+                     install_manifest.add_optional_exists(dest_file)
+                     objdir_files.append(self._pretty_path(f, backend_file))
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/003-tests-timeout.patch b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
@@ -0,0 +1,26 @@
+From 9be85b155c6df0454c5faef9e850f572c99e3615 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:32:44 +0200
+Subject: [PATCH] Increase the test timeout for slower buildds
+
+Ported forward from Debian: https://bugs.debian.org/878284
+---
+ js/src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+index b86aeed..d68655a 100644
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -53,7 +53,7 @@ check:: check-js-msg
+ 
+ check-jstests:
+ 	$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON3) -u $(srcdir)/tests/jstests.py \
+-		--no-progress --format=automation --timeout 300 \
++		--no-progress --format=automation --timeout 600 \
+ 		$(JSTESTS_EXTRA_ARGS) \
+ 		$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
+ 
+-- 
+2.26.2
+
diff --git a/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
@@ -0,0 +1,29 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:22:12 +0100
+Subject: icu_sources_data.py: Decouple from Mozilla build system
+
+mozpack.path is a wrapper around os.path that normalizes path
+separators on Windows, but on Unix we only have one path separator
+so there's nothing to normalize. Avoid needing to import all of it.
+---
+ intl/icu_sources_data.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 2936df9..4db52af 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -21,7 +21,9 @@ import subprocess
+ import sys
+ import tempfile
+
+-from mozpack import path as mozpath
++# Close enough
++import os.path as mozpath
++mozpath.normsep = lambda p: p
+
+ # The following files have been determined to be dead/unused by a
+ # semi-automated analysis. You can just remove any of the files below
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
@@ -0,0 +1,44 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:23:14 +0100
+Subject: icu_sources_data: Write command output to our stderr
+
+Saying "See output in /tmp/foobar" is all very well for a developer
+build, but on a buildd our /tmp is going to get thrown away after
+the build. Just log the usual way instead.
+---
+ intl/icu_sources_data.py | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 4db52af..d62960d 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -188,21 +188,13 @@ def update_sources(topsrcdir):
+
+ def try_run(name, command, cwd=None, **kwargs):
+     try:
+-        with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f:
+-            subprocess.check_call(
+-                command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs
+-            )
+-    except subprocess.CalledProcessError:
+-        print(
+-            """Error running "{}" in directory {}
+-    See output in {}""".format(
+-                " ".join(command), cwd, f.name
+-            ),
+-            file=sys.stderr,
++        subprocess.check_call(
++            command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs
+         )
++    except subprocess.CalledProcessError:
++        print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr)
+         return False
+     else:
+-        os.unlink(f.name)
+         return True
+
+
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/006-emitter.patch b/srcpkgs/mozjs102/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/006-emitter.patch
@@ -0,0 +1,67 @@
+From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:39:47 +0200
+Subject: [PATCH] Build: allow LOCAL_INCLUDES paths with topsrcdir or topobjdir
+
+---
+ python/mozbuild/mozbuild/frontend/emitter.py  | 10 ---------
+ .../mozbuild/test/frontend/test_emitter.py    | 22 -------------------
+ 2 files changed, 32 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+index 44b916e..f2e821d 100644
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -1367,16 +1367,6 @@ class TreeMetadataEmitter(LoggingMixin):
+                         "(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/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+index e53bc5e..c1b9d32 100644
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -1098,28 +1098,6 @@ class TestEmitterBasic(unittest.TestCase):
+
+         self.assertEqual(local_includes, expected)
+
+-    def test_local_includes_invalid(self):
+-        """Test that invalid LOCAL_INCLUDES are properly detected."""
+-        reader = self.reader("local_includes-invalid/srcdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+-        reader = self.reader("local_includes-invalid/objdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+     def test_local_includes_file(self):
+         """Test that a filename can't be used in LOCAL_INCLUDES."""
+         reader = self.reader("local_includes-filename")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
@@ -0,0 +1,66 @@
+From 1af9fdd2124547099eb0cf5a71b513ef5592dbf9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Tue, 10 Aug 2021 00:00:50 +0200
+Subject: [PATCH] Tests: Use native TemporaryDirectory
+
+Without ugly wrapper for Py < 3.2 that doesn't work half of the times...
+---
+ js/src/jit-test/jit_test.py  |  2 +-
+ js/src/tests/jstests.py      |  2 +-
+ js/src/tests/lib/tempfile.py | 17 +----------------
+ 3 files changed, 3 insertions(+), 18 deletions(-)
+
+diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
+index f5d7794..8d443aa 100755
+--- a/js/src/jit-test/jit_test.py
++++ b/js/src/jit-test/jit_test.py
+@@ -38,7 +38,7 @@ from lib.tests import (
+     get_environment_overlay,
+     change_env,
+ )
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+
+ def which(name):
+diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
+index 6fa2f5f..53ceff6 100755
+--- a/js/src/tests/jstests.py
++++ b/js/src/tests/jstests.py
+@@ -37,7 +37,7 @@ from lib.tests import (
+ from lib.results import ResultsSink, TestOutput
+ from lib.progressbar import ProgressBar
+ from lib.adaptor import xdr_annotate
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+ if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
+     from lib.tasks_unix import run_all_tests
+diff --git a/js/src/tests/lib/tempfile.py b/js/src/tests/lib/tempfile.py
+index ecc21c9..f0a1fa3 100644
+--- a/js/src/tests/lib/tempfile.py
++++ b/js/src/tests/lib/tempfile.py
+@@ -2,19 +2,4 @@
+ # 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/.
+ from __future__ import absolute_import
+-
+-try:
+-    # Python 3.2
+-    from tempfile import TemporaryDirectory
+-except ImportError:
+-    import tempfile
+-    import shutil
+-    from contextlib import contextmanager
+-
+-    @contextmanager
+-    def TemporaryDirectory(*args, **kwds):
+-        d = tempfile.mkdtemp(*args, **kwds)
+-        try:
+-            yield d
+-        finally:
+-            shutil.rmtree(d)
++from tempfile import TemporaryDirectory
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/008-init-patch.patch b/srcpkgs/mozjs102/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/008-init-patch.patch
@@ -0,0 +1,28 @@
+From 00414eb67ab0591911167155963b5524fbf2b0c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:38:58 +0200
+Subject: [PATCH] Don't throw InvalidOptionError on invalid options
+
+---
+ python/mozbuild/mozbuild/configure/__init__.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
+index f3167f6..c9e1132 100644
+--- a/python/mozbuild/mozbuild/configure/__init__.py
++++ b/python/mozbuild/mozbuild/configure/__init__.py
+@@ -553,10 +553,7 @@ class ConfigureSandbox(dict):
+         for arg in self._helper:
+             without_value = arg.split("=", 1)[0]
+             msg = "Unknown option: %s" % without_value
+-            if self._help:
+-                self._logger.warning(msg)
+-            else:
+-                raise InvalidOptionError(msg)
++            self._logger.warning(msg)
+
+         # Run the execution queue
+         for func, args in self._execution_queue:
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
@@ -0,0 +1,29 @@
+From 2d99a7b076578a3394fb9d5be6eb44f9cfebc681 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 16:15:37 +0200
+Subject: [PATCH] Remove sloppy m4 detection from bundled autoconf
+
+---
+ build/autoconf/autoconf.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/build/autoconf/autoconf.sh b/build/autoconf/autoconf.sh
+index ceb8a25..606c74e 100644
+--- a/build/autoconf/autoconf.sh
++++ b/build/autoconf/autoconf.sh
+@@ -114,12 +114,6 @@ fi
+ 
+ # Use the frozen version of Autoconf if available.
+ r= f=
+-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+-case `$M4 --help < /dev/null 2>&1` in
+-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+-*traditional*) ;;
+-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+-esac
+ 
+ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
+   { rm -f $tmpin $tmpout; exit 2; }
+-- 
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
@@ -0,0 +1,36 @@
+From db3a0a25b97377b388532b23e73a10d246f66496 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 3 Aug 2020 10:27:00 +0200
+Subject: [PATCH] Skip failing tests on ppc64 and s390x
+
+ppc64 and s390x: non262/extensions/clone-errors.js
+s390x: test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
+s390x, ppc64 and aarch64: test262/built-ins/Date/UTC/fp-evaluation-order.js
+---
+ js/src/tests/jstests.list | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
+index 73ce42f..1797646 100644
+--- a/js/src/tests/jstests.list
++++ b/js/src/tests/jstests.list
+@@ -53,6 +53,15 @@ skip-if(!this.hasOwnProperty("Intl")) include test262/intl402/jstests.list
+ skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list
+ skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list
+
++# Crashes on s390x and ppc64, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x|ppc64-/)) script non262/extensions/clone-errors.js
++
++# Crashes on s390x, ppc64, aarch64
++skip-if(xulRuntime.XPCOMABI.match(/s390x|aarch64|ppc64-/)) script test262/built-ins/Date/UTC/fp-evaluation-order.js
++
++# Crashes on s390x, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
++
+ #####################################
+ # Test262 tests disabled on browser #
+ #####################################
+--
+2.31.1
+
+
diff --git a/srcpkgs/mozjs102/patches/012-fix-musl.patch b/srcpkgs/mozjs102/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/012-fix-musl.patch
@@ -0,0 +1,21 @@
+commit 80ae97f2b875493c5714d00ae5c2a13efbd6e017
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:06:47 2022 +0100
+
+    fix musl miscompilation
+    
+    https://github.com/void-linux/void-packages/issues/2598
+
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+index 77652f67..ab5e917b 100644
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -1069,7 +1069,7 @@ if test "$ac_cv_thread_keyword" = yes; then
+     mips*-*)
+       :
+       ;;
+-    *-android*|*-linuxandroid*)
++    *-android*|*-linuxandroid*|*-musl*)
+       :
+       ;;
+     *)
diff --git a/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
@@ -0,0 +1,26 @@
+commit 34d8f3fb025e930450ce44f7aac501da4c2adc9c
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:09:42 2022 +0100
+
+    disable spidermonkey jslint
+
+diff --git a/js/src/build/moz.build b/js/src/build/moz.build
+index 55c66b97..243f7db2 100644
+--- a/js/src/build/moz.build
++++ b/js/src/build/moz.build
+@@ -97,15 +97,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.
+-GeneratedFile(
+-    "spidermonkey_checks",
+-    script="/config/run_spidermonkey_checks.py",
+-    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/srcpkgs/mozjs102/patches/014-rust-target.patch b/srcpkgs/mozjs102/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/014-rust-target.patch
@@ -0,0 +1,28 @@
+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))
diff --git a/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,80 @@
+drop some rust compiler validation
+
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -91,9 +91,6 @@ def unwrap_rustup(prog, name):
+     return unwrap
+ 
+ 
+-rustc = unwrap_rustup(rustc, "rustc")
+-cargo = unwrap_rustup(cargo, "cargo")
+-
+ 
+ set_config("CARGO", cargo)
+ set_config("RUSTC", rustc)
+@@ -411,35 +408,6 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
+ 
+         os.write(in_fd, ensure_binary(source))
+         os.close(in_fd)
+-
+-        cmd = [
+-            rustc,
+-            "--crate-type",
+-            "staticlib",
+-            target_arg,
+-            "-o",
+-            out_path,
+-            in_path,
+-        ]
+-
+-        def failed():
+-            die(
+-                dedent(
+-                    """\
+-            Cannot compile for {} with {}
+-            The target may be unsupported, or you may not have
+-            a rust std library for that target installed. Try:
+-
+-              rustup target add {}
+-            """.format(
+-                        host_or_target.alias, rustc, rustc_target
+-                    )
+-                )
+-            )
+-
+-        check_cmd_output(*cmd, onerror=failed)
+-        if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-            failed()
+     finally:
+         os.remove(in_path)
+         os.remove(out_path)
+@@ -462,29 +430,6 @@ def rust_host_triple(
+     rustc_target = detect_rustc_target(
+         host, compiler_info, arm_target, rust_supported_targets
+     )
+-    if rustc_target != rustc_host:
+-        if host.alias == rustc_target:
+-            configure_host = host.alias
+-        else:
+-            configure_host = "{}/{}".format(host.alias, rustc_target)
+-        die(
+-            dedent(
+-                """\
+-        The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
+-
+-        You can solve this by:
+-        * Set your configure host to match the rust compiler host by editing your
+-        mozconfig and adding "ac_add_options --host={rustc}".
+-        * Or, install the rust toolchain for {configure}, if supported, by running
+-        "rustup default stable-{rustc_target}"
+-        """.format(
+-                    rustc=rustc_host,
+-                    configure=configure_host,
+-                    rustc_target=rustc_target,
+-                )
+-            )
+-        )
+-    assert_rust_compile(host, rustc_target, rustc)
+     return rustc_target
+ 
+ 
diff --git a/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
@@ -0,0 +1,35 @@
+commit 1cc729c5221d0ce4c80786ccdcb2de4a6ca382b6
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:55:43 2022 +0100
+
+    drop some library checks
+    
+    This calls readelf and won't work with LTO'd setups.
+
+diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
+index 401c2933..ade4f1da 100644
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -405,22 +405,6 @@ force-cargo-library-build:
+ 	$(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
+ 
+ $(RUST_LIBRARY_FILE): force-cargo-library-build
+-# When we are building in --enable-release mode; we add an additional check to confirm
+-# that we are not importing any networking-related functions in rust code. This reduces
+-# the chance of proxy bypasses originating from rust code.
+-# The check only works when rust code is built with -Clto but without MOZ_LTO_RUST_CROSS.
+-# Sanitizers and sancov also fail because compiler-rt hooks network functions.
+-ifndef MOZ_PROFILE_GENERATE
+-ifeq ($(OS_ARCH), Linux)
+-ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
+-ifndef MOZ_LTO_RUST_CROSS
+-ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
+-	$(call py_action,check_binary,--target --networking $@)
+-endif
+-endif
+-endif
+-endif
+-endif
+ 
+ force-cargo-library-check:
+ 	$(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)
diff --git a/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
new file mode 100644
index 000000000000..4a9b0b42a575
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
@@ -0,0 +1,18 @@
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,6 +64,7 @@ endif
+ # These flags are passed via `cargo rustc` and only apply to the final rustc
+ # invocation (i.e., only the top-level crate, not its dependencies).
+ cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
++ifneq (1,$(MOZ_NO_RUST_LTO))
+ ifndef DEVELOPER_OPTIONS
+ ifndef MOZ_DEBUG_RUST
+ # Enable link-time optimization for release builds, but not when linking
+@@ -77,6 +78,7 @@ RUSTFLAGS += -Cembed-bitcode=yes
+ endif
+ endif
+ endif
++endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs102/patches/fix-build-ppc32.patch b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
new file mode 100644
index 000000000000..f9f8e0cd7ace
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
@@ -0,0 +1,18 @@
+From 62780b31095fcd37a5d9218d0393d552bc44149f Mon Sep 17 00:00:00 2001
+From: q66 <daniel@octaforge.org>
+Date: Mon Jun 13 14:01:59 2022 +0200
+Subject: fix ftbfs on powerpc32
+
+diff --git a/js/src/wasm/WasmDebugFrame.h b/js/src/wasm/WasmDebugFrame.h
+index 47652e9..02a13559 100644
+--- a/js/src/wasm/WasmDebugFrame.h
++++ b/js/src/wasm/WasmDebugFrame.h
+@@ -112,7 +112,7 @@ class DebugFrame {
+ 
+   // Avoid -Wunused-private-field warnings.
+  protected:
+-#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__)
++#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__) || (defined(__powerpc__) && !defined(__powerpc64__))
+   // See alignmentStaticAsserts().  For ARM32 and X86 DebugFrame is only
+   // 4-byte aligned, so we add another word to get up to 8-byte
+   // alignment.
diff --git a/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
@@ -0,0 +1,18 @@
+# error: typedef redefinition with different types ('__double_t' (aka 'double') vs 'long double')
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
+
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,12 @@
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
++#if defined(__linux__) && defined(__i386__)
++// rely on glibc's double_t
++typedef long double __double_t;
++#else
+ typedef double      __double_t;
++#endif
+ typedef __double_t  double_t;
+ 
+ /*
diff --git a/srcpkgs/mozjs102/patches/use-fallback-atomic-operations-on-armv6.patch b/srcpkgs/mozjs102/patches/use-fallback-atomic-operations-on-armv6.patch
new file mode 100644
index 000000000000..5993b50d8999
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/use-fallback-atomic-operations-on-armv6.patch
@@ -0,0 +1,79 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1663626084 0
+# Node ID fc934c3360f4bd1a4b4d9dcb0a15dfbd1d6ef881
+# Parent  149d45b6a85b6394a8f6936e54333c6addc4cdc0
+Bug 1786619 - Use fallback atomic operations on ARM < v7. r=jandem
+
+Differential Revision: https://phabricator.services.mozilla.com/D157612
+
+diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py
+--- a/js/src/jit/GenerateAtomicOperations.py
++++ b/js/src/jit/GenerateAtomicOperations.py
+@@ -716,17 +716,19 @@ namespace jit {
+ } // namespace js
+ 
+ #endif // jit_AtomicOperationsGenerated_h
+ """
+ 
+ 
+ def generate_atomics_header(c_out):
+     contents = ""
+-    if cpu_arch in ("x86", "x86_64", "arm", "aarch64"):
++    if cpu_arch in ("x86", "x86_64", "aarch64") or (
++        cpu_arch == "arm" and int(buildconfig.substs["ARM_ARCH"]) >= 7
++    ):
+         contents += "#define JS_HAVE_GENERATED_ATOMIC_OPS 1"
+ 
+         # `fence` performs a full memory barrier.
+         contents += gen_seqcst("AtomicFenceSeqCst")
+ 
+         contents += gen_load("AtomicLoad8SeqCst", "uint8_t", 8, True)
+         contents += gen_load("AtomicLoad16SeqCst", "uint16_t", 16, True)
+         contents += gen_load("AtomicLoad32SeqCst", "uint32_t", 32, True)
+diff --git a/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h b/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
+--- a/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
++++ b/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
+@@ -26,17 +26,18 @@
+ #define jit_shared_AtomicOperations_feeling_lucky_gcc_h
+ 
+ #include "mozilla/Assertions.h"
+ #include "mozilla/Types.h"
+ 
+ // Explicitly exclude tier-1 platforms.
+ 
+ #if (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
+-     defined(_M_IX86) || defined(__arm__) || defined(__aarch64__))
++     defined(_M_IX86) || (defined(__arm__) && __ARM_ARCH >= 7) ||   \
++     defined(__aarch64__))
+ #  error "Do not use on a tier-1 platform where inline assembly is available"
+ #endif
+ 
+ #if !(defined(__clang__) || defined(__GNUC__))
+ #  error "This file only for gcc/Clang"
+ #endif
+ 
+ // 64-bit atomics are not required by the JS spec, and you can compile
+@@ -51,16 +52,20 @@
+     defined(JS_SIMULATOR_MIPS64) || defined(JS_SIMULATOR_LOONG64)
+ // On some x86 (32-bit) systems this will not work because the compiler does not
+ // open-code 64-bit atomics.  If so, try linking with -latomic.  If that doesn't
+ // work, you're mostly on your own.
+ #  define HAS_64BIT_ATOMICS
+ #  define HAS_64BIT_LOCKFREE
+ #endif
+ 
++#if defined(__arm__)
++#  define HAS_64BIT_ATOMICS
++#endif
++
+ #if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
+     defined(__PPC64LE__)
+ #  define HAS_64BIT_ATOMICS
+ #  define HAS_64BIT_LOCKFREE
+ #endif
+ 
+ #if defined(__riscv) && __riscv_xlen == 64
+ #  define HAS_64BIT_ATOMICS
+
diff --git a/srcpkgs/mozjs102/template b/srcpkgs/mozjs102/template
new file mode 100644
index 000000000000..0140da76ddf3
--- /dev/null
+++ b/srcpkgs/mozjs102/template
@@ -0,0 +1,99 @@
+# Template file for 'mozjs102'
+pkgname=mozjs102
+version=102.3.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+make_check_target=check-jit-test
+configure_args="--disable-jemalloc --disable-strip --disable-tests \
+ --disable-optimize --disable-debug --enable-ctypes --enable-readline \
+ --enable-shared-js --enable-system-ffi --with-intl-api --with-system-icu \
+ --with-system-nspr --with-system-zlib --enable-hardening --enable-release"
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std"
+checkdepends="python3"
+short_desc="SpiderMonkey JavaScript interpreter and library (102.x)"
+maintainer="Michal Vasilek <michal@vasilek.cz>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=308e23b6dcf964e342cf95fd0c8a386127371b620a489ae26e537d728341b55a
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+	# Disable LTO on i686, otherwise compilation of `jsrust` fails with -
+	# 	error: ran out of registers during register allocation
+	# 	LLVM ERROR: Cannot emit physreg copy instruction
+	# 	error: could not compile `jsrust` due to previous error
+	export MOZ_NO_RUST_LTO=1
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		configure_args+=" --host=${XBPS_TRIPLET} --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	fi
+	export M4=m4
+	export AWK=awk
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+post_install() {
+	# Remove unneeded static library
+	rm -f "${DESTDIR}"/usr/lib/*.ajs
+
+	# it has correct soname but not the right file name
+	mv "${DESTDIR}"/usr/lib/libmozjs-102.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-102.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-102.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-102.so
+}
+
+pre_check() {
+	if [ "$XBPS_WORDSIZE" = 32 ]; then
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65536/65568/g
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65537/65569/g
+	fi
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x basic/fdlibm-for-sin-cos-tan-argument.js \
+			-x gc/gcparam.js \
+			-x ion/dce-with-rinstructions.js \
+			-x sunspider/check-3d-cube.js \
+			-x sunspider/check-3d-raytrace.js \
+			-x sunspider/check-access-nbody.js \
+			-x wasm/nan-semantics.js \
+			-x wasm/spec/spec/float_literals.wast.js \
+			-x wasm/spec/spec/float_memory.wast.js \
+			-x wasm/spec/threads/float_memory.wast.js \
+			"
+	fi
+	if [ "$XBPS_LIBC" = musl ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x sunspider/check-date-format-tofte.js \
+			"
+	fi
+}
+
+mozjs102-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js102-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}
diff --git a/srcpkgs/mozjs102/update b/srcpkgs/mozjs102/update
new file mode 100644
index 000000000000..f942fe4f0fc9
--- /dev/null
+++ b/srcpkgs/mozjs102/update
@@ -0,0 +1,2 @@
+site="${MOZILLA_SITE}/firefox/releases/"
+pattern="releases/\K${version%%.*}.*(?=esr/\")"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
@ 2022-10-26 14:56 ` paper42
  2022-11-13  7:44 ` oreo639
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2022-10-26 14:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages mozjs102
https://github.com/void-linux/void-packages/pull/39498

New package: mozjs102-102.3.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

all patches are imported from mozjs91 except for:
* rebased fix-build-ppc32.patch
* imported use-fallback-atomic-operations-on-armv6.patch to fix some issues with armv6l

currently the armv6 builds fails with
```
/builddir/.xbps-mozjs102/wrappers/arm-linux-musleabihf-c++ --sysroot /usr/arm-linux-musleabihf -o Unified_cpp_js_src_jit12.o -c  -I/builddir/firefox-102.3.0/js/src/dist/system_wrappers -include /builddir/firefox-102.3.0/config/gcc_hidden.h -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DJS_HAS_CTYPES -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builddir/firefox-102.3.0/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src -I/builddir/firefox-102.3.0/js/src -I/builddir/firefox-102.3.0/js/src/dist/include -I/usr/arm-linux-musleabihf/usr/include/nspr -DMOZILLA_CLIENT -include /builddir/firefox-102.3.0/js/src/js/src/js-confdefs.h -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard -I/usr/arm-linux-musleabihf/usr/include -fdebug-prefix-map=/builddir/firefox-102.3.0/js/src=. -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -fno-omit-frame-pointer -funwind-tables -Werror=format -Wno-attributes -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_js_src_jit12.o.pp   Unified_cpp_js_src_jit12.cpp
{standard input}: Assembler messages:
{standard input}:14103: Error: selected processor does not support `isb' in ARM mode
```

A patch file from https://github.com/void-linux/void-packages/pull/39498.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mozjs102-39498.patch --]
[-- Type: text/x-diff, Size: 35455 bytes --]

From 139bd0f4a882fcee3fc6a2d934edf20e3c5f2049 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Sun, 11 Sep 2022 18:58:40 +0200
Subject: [PATCH] New package: mozjs102-102.4.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs102-devel                        |  1 +
 srcpkgs/mozjs102/patches/001-fix-soname.patch | 26 +++++
 .../mozjs102/patches/002-copy-headers.patch   | 38 +++++++
 .../mozjs102/patches/003-tests-timeout.patch  | 26 +++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs102/patches/006-emitter.patch    | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs102/patches/008-init-patch.patch | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs102/patches/012-fix-musl.patch   | 21 ++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++
 .../mozjs102/patches/014-rust-target.patch    | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 80 +++++++++++++++
 .../mozjs102/patches/017-no-lto-readelf.patch | 35 +++++++
 .../mozjs102/patches/MOZ_NO_RUST_LTO.patch    | 18 ++++
 .../mozjs102/patches/fix-build-ppc32.patch    | 18 ++++
 .../mozjs102/patches/fix-i386-fdlibm.patch    | 18 ++++
 srcpkgs/mozjs102/template                     | 99 +++++++++++++++++++
 srcpkgs/mozjs102/update                       |  2 +
 22 files changed, 736 insertions(+)
 create mode 120000 srcpkgs/mozjs102-devel
 create mode 100644 srcpkgs/mozjs102/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs102/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs102/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs102/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs102/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs102/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs102/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-build-ppc32.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
 create mode 100644 srcpkgs/mozjs102/template
 create mode 100644 srcpkgs/mozjs102/update

diff --git a/common/shlibs b/common/shlibs
index 0ecf4f7437f7..9e6326b8bb87 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3484,6 +3484,7 @@ libmaxminddb.so.0 libmaxminddb-1.3.2_1
 libmysqlpp.so.3 mysql++-3.2.5_1
 libKF5Syndication.so.5 syndication-5.50.0_1
 liblqr-1.so.0 liblqr-0.4.2_1
+libmozjs-102.so.0 mozjs102-102.3.0_1
 libmozjs-78.so.0 mozjs78-78.1.0_1
 libmozjs-91.so.0 mozjs91-91.5.0_1
 libebur128.so.1 libebur128-1.2.4_1
diff --git a/srcpkgs/mozjs102-devel b/srcpkgs/mozjs102-devel
new file mode 120000
index 000000000000..97b7e735a472
--- /dev/null
+++ b/srcpkgs/mozjs102-devel
@@ -0,0 +1 @@
+mozjs102
\ No newline at end of file
diff --git a/srcpkgs/mozjs102/patches/001-fix-soname.patch b/srcpkgs/mozjs102/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/001-fix-soname.patch
@@ -0,0 +1,26 @@
+From d21c7cb9343d8c495d987e71be0f35887574c820 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:21:47 +0200
+Subject: [PATCH] Add soname switch to linker, regardless of Operating System
+
+Fix backported from Debian: http://bugs.debian.org/746705
+---
+ config/rules.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index 0f9b2ac..f6b4efe 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -285,6 +285,8 @@ ifeq ($(OS_ARCH),GNU)
+ OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
+ endif
+
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # MINGW32
+ #
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/002-copy-headers.patch b/srcpkgs/mozjs102/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/002-copy-headers.patch
@@ -0,0 +1,38 @@
+From 3b3c8e37cca418e07bdeceaf3a601805df28d925 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:27:39 +0200
+Subject: [PATCH] build: Copy headers on install instead of symlinking
+
+Patch by Philip Chimento ported forward to mozjs78
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index d964466..0285ad9 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1568,9 +1568,9 @@ class RecursiveMakeBackend(MakeBackend):
+                                     " of srcdir-relative or absolute paths."
+                                 )
+
+-                            install_manifest.add_pattern_link(basepath, wild, dest_dir)
++                            install_manifest.add_pattern_copy(basepath, wild, dest_dir)
+                         else:
+-                            install_manifest.add_pattern_link(f.srcdir, f, dest_dir)
++                            install_manifest.add_pattern_copy(f.srcdir, f, dest_dir)
+                     elif isinstance(f, AbsolutePath):
+                         if not f.full_path.lower().endswith((".dll", ".pdb", ".so")):
+                             raise Exception(
+@@ -1581,7 +1581,7 @@ class RecursiveMakeBackend(MakeBackend):
+                         install_manifest.add_optional_exists(dest_file)
+                         absolute_files.append(f.full_path)
+                     else:
+-                        install_manifest.add_link(f.full_path, dest_file)
++                        install_manifest.add_copy(f.full_path, dest_file)
+                 else:
+                     install_manifest.add_optional_exists(dest_file)
+                     objdir_files.append(self._pretty_path(f, backend_file))
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/003-tests-timeout.patch b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
@@ -0,0 +1,26 @@
+From 9be85b155c6df0454c5faef9e850f572c99e3615 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:32:44 +0200
+Subject: [PATCH] Increase the test timeout for slower buildds
+
+Ported forward from Debian: https://bugs.debian.org/878284
+---
+ js/src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+index b86aeed..d68655a 100644
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -53,7 +53,7 @@ check:: check-js-msg
+ 
+ check-jstests:
+ 	$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON3) -u $(srcdir)/tests/jstests.py \
+-		--no-progress --format=automation --timeout 300 \
++		--no-progress --format=automation --timeout 600 \
+ 		$(JSTESTS_EXTRA_ARGS) \
+ 		$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
+ 
+-- 
+2.26.2
+
diff --git a/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
@@ -0,0 +1,29 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:22:12 +0100
+Subject: icu_sources_data.py: Decouple from Mozilla build system
+
+mozpack.path is a wrapper around os.path that normalizes path
+separators on Windows, but on Unix we only have one path separator
+so there's nothing to normalize. Avoid needing to import all of it.
+---
+ intl/icu_sources_data.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 2936df9..4db52af 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -21,7 +21,9 @@ import subprocess
+ import sys
+ import tempfile
+
+-from mozpack import path as mozpath
++# Close enough
++import os.path as mozpath
++mozpath.normsep = lambda p: p
+
+ # The following files have been determined to be dead/unused by a
+ # semi-automated analysis. You can just remove any of the files below
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
@@ -0,0 +1,44 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:23:14 +0100
+Subject: icu_sources_data: Write command output to our stderr
+
+Saying "See output in /tmp/foobar" is all very well for a developer
+build, but on a buildd our /tmp is going to get thrown away after
+the build. Just log the usual way instead.
+---
+ intl/icu_sources_data.py | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 4db52af..d62960d 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -188,21 +188,13 @@ def update_sources(topsrcdir):
+
+ def try_run(name, command, cwd=None, **kwargs):
+     try:
+-        with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f:
+-            subprocess.check_call(
+-                command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs
+-            )
+-    except subprocess.CalledProcessError:
+-        print(
+-            """Error running "{}" in directory {}
+-    See output in {}""".format(
+-                " ".join(command), cwd, f.name
+-            ),
+-            file=sys.stderr,
++        subprocess.check_call(
++            command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs
+         )
++    except subprocess.CalledProcessError:
++        print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr)
+         return False
+     else:
+-        os.unlink(f.name)
+         return True
+
+
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/006-emitter.patch b/srcpkgs/mozjs102/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/006-emitter.patch
@@ -0,0 +1,67 @@
+From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:39:47 +0200
+Subject: [PATCH] Build: allow LOCAL_INCLUDES paths with topsrcdir or topobjdir
+
+---
+ python/mozbuild/mozbuild/frontend/emitter.py  | 10 ---------
+ .../mozbuild/test/frontend/test_emitter.py    | 22 -------------------
+ 2 files changed, 32 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+index 44b916e..f2e821d 100644
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -1367,16 +1367,6 @@ class TreeMetadataEmitter(LoggingMixin):
+                         "(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/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+index e53bc5e..c1b9d32 100644
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -1098,28 +1098,6 @@ class TestEmitterBasic(unittest.TestCase):
+
+         self.assertEqual(local_includes, expected)
+
+-    def test_local_includes_invalid(self):
+-        """Test that invalid LOCAL_INCLUDES are properly detected."""
+-        reader = self.reader("local_includes-invalid/srcdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+-        reader = self.reader("local_includes-invalid/objdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+     def test_local_includes_file(self):
+         """Test that a filename can't be used in LOCAL_INCLUDES."""
+         reader = self.reader("local_includes-filename")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
@@ -0,0 +1,66 @@
+From 1af9fdd2124547099eb0cf5a71b513ef5592dbf9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Tue, 10 Aug 2021 00:00:50 +0200
+Subject: [PATCH] Tests: Use native TemporaryDirectory
+
+Without ugly wrapper for Py < 3.2 that doesn't work half of the times...
+---
+ js/src/jit-test/jit_test.py  |  2 +-
+ js/src/tests/jstests.py      |  2 +-
+ js/src/tests/lib/tempfile.py | 17 +----------------
+ 3 files changed, 3 insertions(+), 18 deletions(-)
+
+diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
+index f5d7794..8d443aa 100755
+--- a/js/src/jit-test/jit_test.py
++++ b/js/src/jit-test/jit_test.py
+@@ -38,7 +38,7 @@ from lib.tests import (
+     get_environment_overlay,
+     change_env,
+ )
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+
+ def which(name):
+diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
+index 6fa2f5f..53ceff6 100755
+--- a/js/src/tests/jstests.py
++++ b/js/src/tests/jstests.py
+@@ -37,7 +37,7 @@ from lib.tests import (
+ from lib.results import ResultsSink, TestOutput
+ from lib.progressbar import ProgressBar
+ from lib.adaptor import xdr_annotate
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+ if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
+     from lib.tasks_unix import run_all_tests
+diff --git a/js/src/tests/lib/tempfile.py b/js/src/tests/lib/tempfile.py
+index ecc21c9..f0a1fa3 100644
+--- a/js/src/tests/lib/tempfile.py
++++ b/js/src/tests/lib/tempfile.py
+@@ -2,19 +2,4 @@
+ # 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/.
+ from __future__ import absolute_import
+-
+-try:
+-    # Python 3.2
+-    from tempfile import TemporaryDirectory
+-except ImportError:
+-    import tempfile
+-    import shutil
+-    from contextlib import contextmanager
+-
+-    @contextmanager
+-    def TemporaryDirectory(*args, **kwds):
+-        d = tempfile.mkdtemp(*args, **kwds)
+-        try:
+-            yield d
+-        finally:
+-            shutil.rmtree(d)
++from tempfile import TemporaryDirectory
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/008-init-patch.patch b/srcpkgs/mozjs102/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/008-init-patch.patch
@@ -0,0 +1,28 @@
+From 00414eb67ab0591911167155963b5524fbf2b0c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:38:58 +0200
+Subject: [PATCH] Don't throw InvalidOptionError on invalid options
+
+---
+ python/mozbuild/mozbuild/configure/__init__.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
+index f3167f6..c9e1132 100644
+--- a/python/mozbuild/mozbuild/configure/__init__.py
++++ b/python/mozbuild/mozbuild/configure/__init__.py
+@@ -553,10 +553,7 @@ class ConfigureSandbox(dict):
+         for arg in self._helper:
+             without_value = arg.split("=", 1)[0]
+             msg = "Unknown option: %s" % without_value
+-            if self._help:
+-                self._logger.warning(msg)
+-            else:
+-                raise InvalidOptionError(msg)
++            self._logger.warning(msg)
+
+         # Run the execution queue
+         for func, args in self._execution_queue:
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
@@ -0,0 +1,29 @@
+From 2d99a7b076578a3394fb9d5be6eb44f9cfebc681 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 16:15:37 +0200
+Subject: [PATCH] Remove sloppy m4 detection from bundled autoconf
+
+---
+ build/autoconf/autoconf.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/build/autoconf/autoconf.sh b/build/autoconf/autoconf.sh
+index ceb8a25..606c74e 100644
+--- a/build/autoconf/autoconf.sh
++++ b/build/autoconf/autoconf.sh
+@@ -114,12 +114,6 @@ fi
+ 
+ # Use the frozen version of Autoconf if available.
+ r= f=
+-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+-case `$M4 --help < /dev/null 2>&1` in
+-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+-*traditional*) ;;
+-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+-esac
+ 
+ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
+   { rm -f $tmpin $tmpout; exit 2; }
+-- 
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
@@ -0,0 +1,36 @@
+From db3a0a25b97377b388532b23e73a10d246f66496 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 3 Aug 2020 10:27:00 +0200
+Subject: [PATCH] Skip failing tests on ppc64 and s390x
+
+ppc64 and s390x: non262/extensions/clone-errors.js
+s390x: test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
+s390x, ppc64 and aarch64: test262/built-ins/Date/UTC/fp-evaluation-order.js
+---
+ js/src/tests/jstests.list | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
+index 73ce42f..1797646 100644
+--- a/js/src/tests/jstests.list
++++ b/js/src/tests/jstests.list
+@@ -53,6 +53,15 @@ skip-if(!this.hasOwnProperty("Intl")) include test262/intl402/jstests.list
+ skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list
+ skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list
+
++# Crashes on s390x and ppc64, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x|ppc64-/)) script non262/extensions/clone-errors.js
++
++# Crashes on s390x, ppc64, aarch64
++skip-if(xulRuntime.XPCOMABI.match(/s390x|aarch64|ppc64-/)) script test262/built-ins/Date/UTC/fp-evaluation-order.js
++
++# Crashes on s390x, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
++
+ #####################################
+ # Test262 tests disabled on browser #
+ #####################################
+--
+2.31.1
+
+
diff --git a/srcpkgs/mozjs102/patches/012-fix-musl.patch b/srcpkgs/mozjs102/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/012-fix-musl.patch
@@ -0,0 +1,21 @@
+commit 80ae97f2b875493c5714d00ae5c2a13efbd6e017
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:06:47 2022 +0100
+
+    fix musl miscompilation
+    
+    https://github.com/void-linux/void-packages/issues/2598
+
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+index 77652f67..ab5e917b 100644
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -1069,7 +1069,7 @@ if test "$ac_cv_thread_keyword" = yes; then
+     mips*-*)
+       :
+       ;;
+-    *-android*|*-linuxandroid*)
++    *-android*|*-linuxandroid*|*-musl*)
+       :
+       ;;
+     *)
diff --git a/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
@@ -0,0 +1,26 @@
+commit 34d8f3fb025e930450ce44f7aac501da4c2adc9c
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:09:42 2022 +0100
+
+    disable spidermonkey jslint
+
+diff --git a/js/src/build/moz.build b/js/src/build/moz.build
+index 55c66b97..243f7db2 100644
+--- a/js/src/build/moz.build
++++ b/js/src/build/moz.build
+@@ -97,15 +97,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.
+-GeneratedFile(
+-    "spidermonkey_checks",
+-    script="/config/run_spidermonkey_checks.py",
+-    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/srcpkgs/mozjs102/patches/014-rust-target.patch b/srcpkgs/mozjs102/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/014-rust-target.patch
@@ -0,0 +1,28 @@
+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))
diff --git a/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,80 @@
+drop some rust compiler validation
+
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -91,9 +91,6 @@ def unwrap_rustup(prog, name):
+     return unwrap
+ 
+ 
+-rustc = unwrap_rustup(rustc, "rustc")
+-cargo = unwrap_rustup(cargo, "cargo")
+-
+ 
+ set_config("CARGO", cargo)
+ set_config("RUSTC", rustc)
+@@ -411,35 +408,6 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
+ 
+         os.write(in_fd, ensure_binary(source))
+         os.close(in_fd)
+-
+-        cmd = [
+-            rustc,
+-            "--crate-type",
+-            "staticlib",
+-            target_arg,
+-            "-o",
+-            out_path,
+-            in_path,
+-        ]
+-
+-        def failed():
+-            die(
+-                dedent(
+-                    """\
+-            Cannot compile for {} with {}
+-            The target may be unsupported, or you may not have
+-            a rust std library for that target installed. Try:
+-
+-              rustup target add {}
+-            """.format(
+-                        host_or_target.alias, rustc, rustc_target
+-                    )
+-                )
+-            )
+-
+-        check_cmd_output(*cmd, onerror=failed)
+-        if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-            failed()
+     finally:
+         os.remove(in_path)
+         os.remove(out_path)
+@@ -462,29 +430,6 @@ def rust_host_triple(
+     rustc_target = detect_rustc_target(
+         host, compiler_info, arm_target, rust_supported_targets
+     )
+-    if rustc_target != rustc_host:
+-        if host.alias == rustc_target:
+-            configure_host = host.alias
+-        else:
+-            configure_host = "{}/{}".format(host.alias, rustc_target)
+-        die(
+-            dedent(
+-                """\
+-        The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
+-
+-        You can solve this by:
+-        * Set your configure host to match the rust compiler host by editing your
+-        mozconfig and adding "ac_add_options --host={rustc}".
+-        * Or, install the rust toolchain for {configure}, if supported, by running
+-        "rustup default stable-{rustc_target}"
+-        """.format(
+-                    rustc=rustc_host,
+-                    configure=configure_host,
+-                    rustc_target=rustc_target,
+-                )
+-            )
+-        )
+-    assert_rust_compile(host, rustc_target, rustc)
+     return rustc_target
+ 
+ 
diff --git a/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
@@ -0,0 +1,35 @@
+commit 1cc729c5221d0ce4c80786ccdcb2de4a6ca382b6
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:55:43 2022 +0100
+
+    drop some library checks
+    
+    This calls readelf and won't work with LTO'd setups.
+
+diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
+index 401c2933..ade4f1da 100644
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -405,22 +405,6 @@ force-cargo-library-build:
+ 	$(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
+ 
+ $(RUST_LIBRARY_FILE): force-cargo-library-build
+-# When we are building in --enable-release mode; we add an additional check to confirm
+-# that we are not importing any networking-related functions in rust code. This reduces
+-# the chance of proxy bypasses originating from rust code.
+-# The check only works when rust code is built with -Clto but without MOZ_LTO_RUST_CROSS.
+-# Sanitizers and sancov also fail because compiler-rt hooks network functions.
+-ifndef MOZ_PROFILE_GENERATE
+-ifeq ($(OS_ARCH), Linux)
+-ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
+-ifndef MOZ_LTO_RUST_CROSS
+-ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
+-	$(call py_action,check_binary,--target --networking $@)
+-endif
+-endif
+-endif
+-endif
+-endif
+ 
+ force-cargo-library-check:
+ 	$(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)
diff --git a/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
new file mode 100644
index 000000000000..4a9b0b42a575
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
@@ -0,0 +1,18 @@
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,6 +64,7 @@ endif
+ # These flags are passed via `cargo rustc` and only apply to the final rustc
+ # invocation (i.e., only the top-level crate, not its dependencies).
+ cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
++ifneq (1,$(MOZ_NO_RUST_LTO))
+ ifndef DEVELOPER_OPTIONS
+ ifndef MOZ_DEBUG_RUST
+ # Enable link-time optimization for release builds, but not when linking
+@@ -77,6 +78,7 @@ RUSTFLAGS += -Cembed-bitcode=yes
+ endif
+ endif
+ endif
++endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs102/patches/fix-build-ppc32.patch b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
new file mode 100644
index 000000000000..f9f8e0cd7ace
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
@@ -0,0 +1,18 @@
+From 62780b31095fcd37a5d9218d0393d552bc44149f Mon Sep 17 00:00:00 2001
+From: q66 <daniel@octaforge.org>
+Date: Mon Jun 13 14:01:59 2022 +0200
+Subject: fix ftbfs on powerpc32
+
+diff --git a/js/src/wasm/WasmDebugFrame.h b/js/src/wasm/WasmDebugFrame.h
+index 47652e9..02a13559 100644
+--- a/js/src/wasm/WasmDebugFrame.h
++++ b/js/src/wasm/WasmDebugFrame.h
+@@ -112,7 +112,7 @@ class DebugFrame {
+ 
+   // Avoid -Wunused-private-field warnings.
+  protected:
+-#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__)
++#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__) || (defined(__powerpc__) && !defined(__powerpc64__))
+   // See alignmentStaticAsserts().  For ARM32 and X86 DebugFrame is only
+   // 4-byte aligned, so we add another word to get up to 8-byte
+   // alignment.
diff --git a/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
@@ -0,0 +1,18 @@
+# error: typedef redefinition with different types ('__double_t' (aka 'double') vs 'long double')
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
+
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,12 @@
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
++#if defined(__linux__) && defined(__i386__)
++// rely on glibc's double_t
++typedef long double __double_t;
++#else
+ typedef double      __double_t;
++#endif
+ typedef __double_t  double_t;
+ 
+ /*
diff --git a/srcpkgs/mozjs102/template b/srcpkgs/mozjs102/template
new file mode 100644
index 000000000000..90a96bcce884
--- /dev/null
+++ b/srcpkgs/mozjs102/template
@@ -0,0 +1,99 @@
+# Template file for 'mozjs102'
+pkgname=mozjs102
+version=102.4.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+make_check_target=check-jit-test
+configure_args="--disable-jemalloc --disable-strip --disable-tests \
+ --disable-optimize --disable-debug --enable-ctypes --enable-readline \
+ --enable-shared-js --enable-system-ffi --with-intl-api --with-system-icu \
+ --with-system-nspr --with-system-zlib --enable-hardening --enable-release"
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std"
+checkdepends="python3"
+short_desc="SpiderMonkey JavaScript interpreter and library (102.x)"
+maintainer="Michal Vasilek <michal@vasilek.cz>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=e79f0ddd4914dfbff61c5eea7ff28ad2dd12ecfbf3d63a41dab57d50171d904e
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+	# Disable LTO on i686, otherwise compilation of `jsrust` fails with -
+	# 	error: ran out of registers during register allocation
+	# 	LLVM ERROR: Cannot emit physreg copy instruction
+	# 	error: could not compile `jsrust` due to previous error
+	export MOZ_NO_RUST_LTO=1
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		configure_args+=" --host=${XBPS_TRIPLET} --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	fi
+	export M4=m4
+	export AWK=awk
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+post_install() {
+	# Remove unneeded static library
+	rm -f "${DESTDIR}"/usr/lib/*.ajs
+
+	# it has correct soname but not the right file name
+	mv "${DESTDIR}"/usr/lib/libmozjs-102.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-102.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-102.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-102.so
+}
+
+pre_check() {
+	if [ "$XBPS_WORDSIZE" = 32 ]; then
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65536/65568/g
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65537/65569/g
+	fi
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x basic/fdlibm-for-sin-cos-tan-argument.js \
+			-x gc/gcparam.js \
+			-x ion/dce-with-rinstructions.js \
+			-x sunspider/check-3d-cube.js \
+			-x sunspider/check-3d-raytrace.js \
+			-x sunspider/check-access-nbody.js \
+			-x wasm/nan-semantics.js \
+			-x wasm/spec/spec/float_literals.wast.js \
+			-x wasm/spec/spec/float_memory.wast.js \
+			-x wasm/spec/threads/float_memory.wast.js \
+			"
+	fi
+	if [ "$XBPS_LIBC" = musl ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x sunspider/check-date-format-tofte.js \
+			"
+	fi
+}
+
+mozjs102-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js102-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}
diff --git a/srcpkgs/mozjs102/update b/srcpkgs/mozjs102/update
new file mode 100644
index 000000000000..f942fe4f0fc9
--- /dev/null
+++ b/srcpkgs/mozjs102/update
@@ -0,0 +1,2 @@
+site="${MOZILLA_SITE}/firefox/releases/"
+pattern="releases/\K${version%%.*}.*(?=esr/\")"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
  2022-10-26 14:56 ` [PR PATCH] [Updated] " paper42
@ 2022-11-13  7:44 ` oreo639
  2022-11-13  7:46 ` oreo639
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: oreo639 @ 2022-11-13  7:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/39498#issuecomment-1312662056

Comment:
I assume the isb error is caused by this:
https://github.com/mozilla/gecko-dev/blob/esr102/js/src/jit/arm/Architecture-arm.cpp#L534

Which was added between esr91 and esr102.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
  2022-10-26 14:56 ` [PR PATCH] [Updated] " paper42
  2022-11-13  7:44 ` oreo639
@ 2022-11-13  7:46 ` oreo639
  2022-11-22 16:33 ` [PR PATCH] [Updated] " paper42
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: oreo639 @ 2022-11-13  7:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/39498#issuecomment-1312662056

Comment:
I assume the isb error is caused by this:
https://github.com/mozilla/gecko-dev/blob/esr102/js/src/jit/arm/Architecture-arm.cpp#L534
https://github.com/mozilla/gecko-dev/commit/de088a7d3653bce96dd83bb78e0e74954dcea312

Which was added between esr91 and esr102.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
                   ` (2 preceding siblings ...)
  2022-11-13  7:46 ` oreo639
@ 2022-11-22 16:33 ` paper42
  2022-11-22 20:26 ` paper42
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2022-11-22 16:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages mozjs102
https://github.com/void-linux/void-packages/pull/39498

New package: mozjs102-102.3.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

all patches are imported from mozjs91 except for:
* rebased fix-build-ppc32.patch
* imported use-fallback-atomic-operations-on-armv6.patch to fix some issues with armv6l

currently the armv6 builds fails with
```
/builddir/.xbps-mozjs102/wrappers/arm-linux-musleabihf-c++ --sysroot /usr/arm-linux-musleabihf -o Unified_cpp_js_src_jit12.o -c  -I/builddir/firefox-102.3.0/js/src/dist/system_wrappers -include /builddir/firefox-102.3.0/config/gcc_hidden.h -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DJS_HAS_CTYPES -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builddir/firefox-102.3.0/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src -I/builddir/firefox-102.3.0/js/src -I/builddir/firefox-102.3.0/js/src/dist/include -I/usr/arm-linux-musleabihf/usr/include/nspr -DMOZILLA_CLIENT -include /builddir/firefox-102.3.0/js/src/js/src/js-confdefs.h -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard -I/usr/arm-linux-musleabihf/usr/include -fdebug-prefix-map=/builddir/firefox-102.3.0/js/src=. -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -fno-omit-frame-pointer -funwind-tables -Werror=format -Wno-attributes -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_js_src_jit12.o.pp   Unified_cpp_js_src_jit12.cpp
{standard input}: Assembler messages:
{standard input}:14103: Error: selected processor does not support `isb' in ARM mode
```

A patch file from https://github.com/void-linux/void-packages/pull/39498.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mozjs102-39498.patch --]
[-- Type: text/x-diff, Size: 43022 bytes --]

From 4ffcdc8ba58c06bf99d8b621e0c11b2c2b6d7ff7 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Sun, 11 Sep 2022 18:58:40 +0200
Subject: [PATCH] New package: mozjs102-102.5.0

---
 common/shlibs                                 |   1 +
 srcpkgs/mozjs102-devel                        |   1 +
 srcpkgs/mozjs102/patches/001-fix-soname.patch |  26 ++++
 .../mozjs102/patches/002-copy-headers.patch   |  38 +++++
 .../mozjs102/patches/003-tests-timeout.patch  |  26 ++++
 .../004-icu-sources-data-py-decouple.patch    |  29 ++++
 ...cu-sources-data-write-command-stderr.patch |  44 ++++++
 srcpkgs/mozjs102/patches/006-emitter.patch    |  67 +++++++++
 ...-tests-use-native-temporarydirectory.patch |  66 +++++++++
 srcpkgs/mozjs102/patches/008-init-patch.patch |  28 ++++
 .../patches/009-sloppy-m4-detection.patch     |  29 ++++
 .../011-failing-tests-ppc64-s390x.patch       |  36 +++++
 srcpkgs/mozjs102/patches/012-fix-musl.patch   |  21 +++
 .../013-disable-spidermonkey-jslint.patch     |  26 ++++
 .../mozjs102/patches/014-rust-target.patch    |  28 ++++
 .../patches/015-drop-rustc-validation.patch   |  80 +++++++++++
 .../mozjs102/patches/017-no-lto-readelf.patch |  35 +++++
 .../mozjs102/patches/MOZ_NO_RUST_LTO.patch    |  18 +++
 srcpkgs/mozjs102/patches/armv6l-isb.patch     |  16 +++
 .../mozjs102/patches/fix-build-ppc32.patch    |  18 +++
 .../mozjs102/patches/fix-i386-fdlibm.patch    |  18 +++
 srcpkgs/mozjs102/patches/python-3.11.patch    | 130 ++++++++++++++++++
 srcpkgs/mozjs102/template                     |  98 +++++++++++++
 srcpkgs/mozjs102/update                       |   2 +
 24 files changed, 881 insertions(+)
 create mode 120000 srcpkgs/mozjs102-devel
 create mode 100644 srcpkgs/mozjs102/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs102/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs102/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs102/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs102/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs102/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs102/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
 create mode 100644 srcpkgs/mozjs102/patches/armv6l-isb.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-build-ppc32.patch
 create mode 100644 srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
 create mode 100644 srcpkgs/mozjs102/patches/python-3.11.patch
 create mode 100644 srcpkgs/mozjs102/template
 create mode 100644 srcpkgs/mozjs102/update

diff --git a/common/shlibs b/common/shlibs
index 7764c5c6de8b..37895879b1ba 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3491,6 +3491,7 @@ libmaxminddb.so.0 libmaxminddb-1.3.2_1
 libmysqlpp.so.3 mysql++-3.2.5_1
 libKF5Syndication.so.5 syndication-5.50.0_1
 liblqr-1.so.0 liblqr-0.4.2_1
+libmozjs-102.so.0 mozjs102-102.3.0_1
 libmozjs-78.so.0 mozjs78-78.1.0_1
 libmozjs-91.so.0 mozjs91-91.5.0_1
 libebur128.so.1 libebur128-1.2.4_1
diff --git a/srcpkgs/mozjs102-devel b/srcpkgs/mozjs102-devel
new file mode 120000
index 000000000000..97b7e735a472
--- /dev/null
+++ b/srcpkgs/mozjs102-devel
@@ -0,0 +1 @@
+mozjs102
\ No newline at end of file
diff --git a/srcpkgs/mozjs102/patches/001-fix-soname.patch b/srcpkgs/mozjs102/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/001-fix-soname.patch
@@ -0,0 +1,26 @@
+From d21c7cb9343d8c495d987e71be0f35887574c820 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:21:47 +0200
+Subject: [PATCH] Add soname switch to linker, regardless of Operating System
+
+Fix backported from Debian: http://bugs.debian.org/746705
+---
+ config/rules.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index 0f9b2ac..f6b4efe 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -285,6 +285,8 @@ ifeq ($(OS_ARCH),GNU)
+ OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
+ endif
+
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # MINGW32
+ #
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/002-copy-headers.patch b/srcpkgs/mozjs102/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/002-copy-headers.patch
@@ -0,0 +1,38 @@
+From 3b3c8e37cca418e07bdeceaf3a601805df28d925 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:27:39 +0200
+Subject: [PATCH] build: Copy headers on install instead of symlinking
+
+Patch by Philip Chimento ported forward to mozjs78
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index d964466..0285ad9 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1568,9 +1568,9 @@ class RecursiveMakeBackend(MakeBackend):
+                                     " of srcdir-relative or absolute paths."
+                                 )
+
+-                            install_manifest.add_pattern_link(basepath, wild, dest_dir)
++                            install_manifest.add_pattern_copy(basepath, wild, dest_dir)
+                         else:
+-                            install_manifest.add_pattern_link(f.srcdir, f, dest_dir)
++                            install_manifest.add_pattern_copy(f.srcdir, f, dest_dir)
+                     elif isinstance(f, AbsolutePath):
+                         if not f.full_path.lower().endswith((".dll", ".pdb", ".so")):
+                             raise Exception(
+@@ -1581,7 +1581,7 @@ class RecursiveMakeBackend(MakeBackend):
+                         install_manifest.add_optional_exists(dest_file)
+                         absolute_files.append(f.full_path)
+                     else:
+-                        install_manifest.add_link(f.full_path, dest_file)
++                        install_manifest.add_copy(f.full_path, dest_file)
+                 else:
+                     install_manifest.add_optional_exists(dest_file)
+                     objdir_files.append(self._pretty_path(f, backend_file))
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/003-tests-timeout.patch b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/003-tests-timeout.patch
@@ -0,0 +1,26 @@
+From 9be85b155c6df0454c5faef9e850f572c99e3615 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:32:44 +0200
+Subject: [PATCH] Increase the test timeout for slower buildds
+
+Ported forward from Debian: https://bugs.debian.org/878284
+---
+ js/src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+index b86aeed..d68655a 100644
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -53,7 +53,7 @@ check:: check-js-msg
+ 
+ check-jstests:
+ 	$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON3) -u $(srcdir)/tests/jstests.py \
+-		--no-progress --format=automation --timeout 300 \
++		--no-progress --format=automation --timeout 600 \
+ 		$(JSTESTS_EXTRA_ARGS) \
+ 		$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
+ 
+-- 
+2.26.2
+
diff --git a/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/004-icu-sources-data-py-decouple.patch
@@ -0,0 +1,29 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:22:12 +0100
+Subject: icu_sources_data.py: Decouple from Mozilla build system
+
+mozpack.path is a wrapper around os.path that normalizes path
+separators on Windows, but on Unix we only have one path separator
+so there's nothing to normalize. Avoid needing to import all of it.
+---
+ intl/icu_sources_data.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 2936df9..4db52af 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -21,7 +21,9 @@ import subprocess
+ import sys
+ import tempfile
+
+-from mozpack import path as mozpath
++# Close enough
++import os.path as mozpath
++mozpath.normsep = lambda p: p
+
+ # The following files have been determined to be dead/unused by a
+ # semi-automated analysis. You can just remove any of the files below
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/005-icu-sources-data-write-command-stderr.patch
@@ -0,0 +1,44 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 9 Oct 2017 09:23:14 +0100
+Subject: icu_sources_data: Write command output to our stderr
+
+Saying "See output in /tmp/foobar" is all very well for a developer
+build, but on a buildd our /tmp is going to get thrown away after
+the build. Just log the usual way instead.
+---
+ intl/icu_sources_data.py | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
+index 4db52af..d62960d 100644
+--- a/intl/icu_sources_data.py
++++ b/intl/icu_sources_data.py
+@@ -188,21 +188,13 @@ def update_sources(topsrcdir):
+
+ def try_run(name, command, cwd=None, **kwargs):
+     try:
+-        with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f:
+-            subprocess.check_call(
+-                command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs
+-            )
+-    except subprocess.CalledProcessError:
+-        print(
+-            """Error running "{}" in directory {}
+-    See output in {}""".format(
+-                " ".join(command), cwd, f.name
+-            ),
+-            file=sys.stderr,
++        subprocess.check_call(
++            command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs
+         )
++    except subprocess.CalledProcessError:
++        print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr)
+         return False
+     else:
+-        os.unlink(f.name)
+         return True
+
+
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/006-emitter.patch b/srcpkgs/mozjs102/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/006-emitter.patch
@@ -0,0 +1,67 @@
+From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Wed, 15 Jul 2020 08:39:47 +0200
+Subject: [PATCH] Build: allow LOCAL_INCLUDES paths with topsrcdir or topobjdir
+
+---
+ python/mozbuild/mozbuild/frontend/emitter.py  | 10 ---------
+ .../mozbuild/test/frontend/test_emitter.py    | 22 -------------------
+ 2 files changed, 32 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+index 44b916e..f2e821d 100644
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -1367,16 +1367,6 @@ class TreeMetadataEmitter(LoggingMixin):
+                         "(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/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+index e53bc5e..c1b9d32 100644
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -1098,28 +1098,6 @@ class TestEmitterBasic(unittest.TestCase):
+
+         self.assertEqual(local_includes, expected)
+
+-    def test_local_includes_invalid(self):
+-        """Test that invalid LOCAL_INCLUDES are properly detected."""
+-        reader = self.reader("local_includes-invalid/srcdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+-        reader = self.reader("local_includes-invalid/objdir")
+-
+-        with six.assertRaisesRegex(
+-            self,
+-            SandboxValidationError,
+-            "Path specified in LOCAL_INCLUDES.*resolves to the "
+-            "topsrcdir or topobjdir",
+-        ):
+-            self.read_topsrcdir(reader)
+-
+     def test_local_includes_file(self):
+         """Test that a filename can't be used in LOCAL_INCLUDES."""
+         reader = self.reader("local_includes-filename")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/007-tests-use-native-temporarydirectory.patch
@@ -0,0 +1,66 @@
+From 1af9fdd2124547099eb0cf5a71b513ef5592dbf9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Tue, 10 Aug 2021 00:00:50 +0200
+Subject: [PATCH] Tests: Use native TemporaryDirectory
+
+Without ugly wrapper for Py < 3.2 that doesn't work half of the times...
+---
+ js/src/jit-test/jit_test.py  |  2 +-
+ js/src/tests/jstests.py      |  2 +-
+ js/src/tests/lib/tempfile.py | 17 +----------------
+ 3 files changed, 3 insertions(+), 18 deletions(-)
+
+diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
+index f5d7794..8d443aa 100755
+--- a/js/src/jit-test/jit_test.py
++++ b/js/src/jit-test/jit_test.py
+@@ -38,7 +38,7 @@ from lib.tests import (
+     get_environment_overlay,
+     change_env,
+ )
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+
+ def which(name):
+diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
+index 6fa2f5f..53ceff6 100755
+--- a/js/src/tests/jstests.py
++++ b/js/src/tests/jstests.py
+@@ -37,7 +37,7 @@ from lib.tests import (
+ from lib.results import ResultsSink, TestOutput
+ from lib.progressbar import ProgressBar
+ from lib.adaptor import xdr_annotate
+-from lib.tempfile import TemporaryDirectory
++from tempfile import TemporaryDirectory
+
+ if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
+     from lib.tasks_unix import run_all_tests
+diff --git a/js/src/tests/lib/tempfile.py b/js/src/tests/lib/tempfile.py
+index ecc21c9..f0a1fa3 100644
+--- a/js/src/tests/lib/tempfile.py
++++ b/js/src/tests/lib/tempfile.py
+@@ -2,19 +2,4 @@
+ # 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/.
+ from __future__ import absolute_import
+-
+-try:
+-    # Python 3.2
+-    from tempfile import TemporaryDirectory
+-except ImportError:
+-    import tempfile
+-    import shutil
+-    from contextlib import contextmanager
+-
+-    @contextmanager
+-    def TemporaryDirectory(*args, **kwds):
+-        d = tempfile.mkdtemp(*args, **kwds)
+-        try:
+-            yield d
+-        finally:
+-            shutil.rmtree(d)
++from tempfile import TemporaryDirectory
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/008-init-patch.patch b/srcpkgs/mozjs102/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/008-init-patch.patch
@@ -0,0 +1,28 @@
+From 00414eb67ab0591911167155963b5524fbf2b0c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:38:58 +0200
+Subject: [PATCH] Don't throw InvalidOptionError on invalid options
+
+---
+ python/mozbuild/mozbuild/configure/__init__.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
+index f3167f6..c9e1132 100644
+--- a/python/mozbuild/mozbuild/configure/__init__.py
++++ b/python/mozbuild/mozbuild/configure/__init__.py
+@@ -553,10 +553,7 @@ class ConfigureSandbox(dict):
+         for arg in self._helper:
+             without_value = arg.split("=", 1)[0]
+             msg = "Unknown option: %s" % without_value
+-            if self._help:
+-                self._logger.warning(msg)
+-            else:
+-                raise InvalidOptionError(msg)
++            self._logger.warning(msg)
+
+         # Run the execution queue
+         for func, args in self._execution_queue:
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/009-sloppy-m4-detection.patch
@@ -0,0 +1,29 @@
+From 2d99a7b076578a3394fb9d5be6eb44f9cfebc681 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 16:15:37 +0200
+Subject: [PATCH] Remove sloppy m4 detection from bundled autoconf
+
+---
+ build/autoconf/autoconf.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/build/autoconf/autoconf.sh b/build/autoconf/autoconf.sh
+index ceb8a25..606c74e 100644
+--- a/build/autoconf/autoconf.sh
++++ b/build/autoconf/autoconf.sh
+@@ -114,12 +114,6 @@ fi
+ 
+ # Use the frozen version of Autoconf if available.
+ r= f=
+-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+-case `$M4 --help < /dev/null 2>&1` in
+-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+-*traditional*) ;;
+-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+-esac
+ 
+ $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
+   { rm -f $tmpin $tmpout; exit 2; }
+-- 
+2.31.1
+
diff --git a/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/011-failing-tests-ppc64-s390x.patch
@@ -0,0 +1,36 @@
+From db3a0a25b97377b388532b23e73a10d246f66496 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 3 Aug 2020 10:27:00 +0200
+Subject: [PATCH] Skip failing tests on ppc64 and s390x
+
+ppc64 and s390x: non262/extensions/clone-errors.js
+s390x: test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
+s390x, ppc64 and aarch64: test262/built-ins/Date/UTC/fp-evaluation-order.js
+---
+ js/src/tests/jstests.list | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
+index 73ce42f..1797646 100644
+--- a/js/src/tests/jstests.list
++++ b/js/src/tests/jstests.list
+@@ -53,6 +53,15 @@ skip-if(!this.hasOwnProperty("Intl")) include test262/intl402/jstests.list
+ skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list
+ skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list
+
++# Crashes on s390x and ppc64, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x|ppc64-/)) script non262/extensions/clone-errors.js
++
++# Crashes on s390x, ppc64, aarch64
++skip-if(xulRuntime.XPCOMABI.match(/s390x|aarch64|ppc64-/)) script test262/built-ins/Date/UTC/fp-evaluation-order.js
++
++# Crashes on s390x, avoid it
++skip-if(xulRuntime.XPCOMABI.match(/s390x/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
++
+ #####################################
+ # Test262 tests disabled on browser #
+ #####################################
+--
+2.31.1
+
+
diff --git a/srcpkgs/mozjs102/patches/012-fix-musl.patch b/srcpkgs/mozjs102/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/012-fix-musl.patch
@@ -0,0 +1,21 @@
+commit 80ae97f2b875493c5714d00ae5c2a13efbd6e017
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:06:47 2022 +0100
+
+    fix musl miscompilation
+    
+    https://github.com/void-linux/void-packages/issues/2598
+
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+index 77652f67..ab5e917b 100644
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -1069,7 +1069,7 @@ if test "$ac_cv_thread_keyword" = yes; then
+     mips*-*)
+       :
+       ;;
+-    *-android*|*-linuxandroid*)
++    *-android*|*-linuxandroid*|*-musl*)
+       :
+       ;;
+     *)
diff --git a/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/013-disable-spidermonkey-jslint.patch
@@ -0,0 +1,26 @@
+commit 34d8f3fb025e930450ce44f7aac501da4c2adc9c
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:09:42 2022 +0100
+
+    disable spidermonkey jslint
+
+diff --git a/js/src/build/moz.build b/js/src/build/moz.build
+index 55c66b97..243f7db2 100644
+--- a/js/src/build/moz.build
++++ b/js/src/build/moz.build
+@@ -97,15 +97,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.
+-GeneratedFile(
+-    "spidermonkey_checks",
+-    script="/config/run_spidermonkey_checks.py",
+-    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/srcpkgs/mozjs102/patches/014-rust-target.patch b/srcpkgs/mozjs102/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/014-rust-target.patch
@@ -0,0 +1,28 @@
+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))
diff --git a/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,80 @@
+drop some rust compiler validation
+
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -91,9 +91,6 @@ def unwrap_rustup(prog, name):
+     return unwrap
+ 
+ 
+-rustc = unwrap_rustup(rustc, "rustc")
+-cargo = unwrap_rustup(cargo, "cargo")
+-
+ 
+ set_config("CARGO", cargo)
+ set_config("RUSTC", rustc)
+@@ -411,35 +408,6 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
+ 
+         os.write(in_fd, ensure_binary(source))
+         os.close(in_fd)
+-
+-        cmd = [
+-            rustc,
+-            "--crate-type",
+-            "staticlib",
+-            target_arg,
+-            "-o",
+-            out_path,
+-            in_path,
+-        ]
+-
+-        def failed():
+-            die(
+-                dedent(
+-                    """\
+-            Cannot compile for {} with {}
+-            The target may be unsupported, or you may not have
+-            a rust std library for that target installed. Try:
+-
+-              rustup target add {}
+-            """.format(
+-                        host_or_target.alias, rustc, rustc_target
+-                    )
+-                )
+-            )
+-
+-        check_cmd_output(*cmd, onerror=failed)
+-        if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-            failed()
+     finally:
+         os.remove(in_path)
+         os.remove(out_path)
+@@ -462,29 +430,6 @@ def rust_host_triple(
+     rustc_target = detect_rustc_target(
+         host, compiler_info, arm_target, rust_supported_targets
+     )
+-    if rustc_target != rustc_host:
+-        if host.alias == rustc_target:
+-            configure_host = host.alias
+-        else:
+-            configure_host = "{}/{}".format(host.alias, rustc_target)
+-        die(
+-            dedent(
+-                """\
+-        The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
+-
+-        You can solve this by:
+-        * Set your configure host to match the rust compiler host by editing your
+-        mozconfig and adding "ac_add_options --host={rustc}".
+-        * Or, install the rust toolchain for {configure}, if supported, by running
+-        "rustup default stable-{rustc_target}"
+-        """.format(
+-                    rustc=rustc_host,
+-                    configure=configure_host,
+-                    rustc_target=rustc_target,
+-                )
+-            )
+-        )
+-    assert_rust_compile(host, rustc_target, rustc)
+     return rustc_target
+ 
+ 
diff --git a/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/017-no-lto-readelf.patch
@@ -0,0 +1,35 @@
+commit 1cc729c5221d0ce4c80786ccdcb2de4a6ca382b6
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:55:43 2022 +0100
+
+    drop some library checks
+    
+    This calls readelf and won't work with LTO'd setups.
+
+diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
+index 401c2933..ade4f1da 100644
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -405,22 +405,6 @@ force-cargo-library-build:
+ 	$(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
+ 
+ $(RUST_LIBRARY_FILE): force-cargo-library-build
+-# When we are building in --enable-release mode; we add an additional check to confirm
+-# that we are not importing any networking-related functions in rust code. This reduces
+-# the chance of proxy bypasses originating from rust code.
+-# The check only works when rust code is built with -Clto but without MOZ_LTO_RUST_CROSS.
+-# Sanitizers and sancov also fail because compiler-rt hooks network functions.
+-ifndef MOZ_PROFILE_GENERATE
+-ifeq ($(OS_ARCH), Linux)
+-ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
+-ifndef MOZ_LTO_RUST_CROSS
+-ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
+-	$(call py_action,check_binary,--target --networking $@)
+-endif
+-endif
+-endif
+-endif
+-endif
+ 
+ force-cargo-library-check:
+ 	$(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)
diff --git a/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
new file mode 100644
index 000000000000..4a9b0b42a575
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/MOZ_NO_RUST_LTO.patch
@@ -0,0 +1,18 @@
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,6 +64,7 @@ endif
+ # These flags are passed via `cargo rustc` and only apply to the final rustc
+ # invocation (i.e., only the top-level crate, not its dependencies).
+ cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
++ifneq (1,$(MOZ_NO_RUST_LTO))
+ ifndef DEVELOPER_OPTIONS
+ ifndef MOZ_DEBUG_RUST
+ # Enable link-time optimization for release builds, but not when linking
+@@ -77,6 +78,7 @@ RUSTFLAGS += -Cembed-bitcode=yes
+ endif
+ endif
+ endif
++endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs102/patches/armv6l-isb.patch b/srcpkgs/mozjs102/patches/armv6l-isb.patch
new file mode 100644
index 000000000000..c08c776261e3
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/armv6l-isb.patch
@@ -0,0 +1,16 @@
+diff -rup Architecture-arm.cpp.orig Architecture-arm.cpp
+--- a/js/src/jit/arm/Architecture-arm.cpp
++++ b/js/src/jit/arm/Architecture-arm.cpp
+@@ -531,7 +531,11 @@ void FlushExecutionContext() {
+ #ifndef JS_SIMULATOR_ARM
+   // Ensure that any instructions already in the pipeline are discarded and
+   // reloaded from the icache.
+-  asm volatile("isb\n" : : : "memory");
++#  if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
++    asm volatile("isb\n" : : : "memory");
++#  else
++    asm volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory");
++#  endif
+ #else
+   // We assume the icache flushing routines on other platforms take care of this
+ #endif
\ No newline at end of file
diff --git a/srcpkgs/mozjs102/patches/fix-build-ppc32.patch b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
new file mode 100644
index 000000000000..f9f8e0cd7ace
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-build-ppc32.patch
@@ -0,0 +1,18 @@
+From 62780b31095fcd37a5d9218d0393d552bc44149f Mon Sep 17 00:00:00 2001
+From: q66 <daniel@octaforge.org>
+Date: Mon Jun 13 14:01:59 2022 +0200
+Subject: fix ftbfs on powerpc32
+
+diff --git a/js/src/wasm/WasmDebugFrame.h b/js/src/wasm/WasmDebugFrame.h
+index 47652e9..02a13559 100644
+--- a/js/src/wasm/WasmDebugFrame.h
++++ b/js/src/wasm/WasmDebugFrame.h
+@@ -112,7 +112,7 @@ class DebugFrame {
+ 
+   // Avoid -Wunused-private-field warnings.
+  protected:
+-#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__)
++#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_X86) || defined(__wasi__) || (defined(__powerpc__) && !defined(__powerpc64__))
+   // See alignmentStaticAsserts().  For ARM32 and X86 DebugFrame is only
+   // 4-byte aligned, so we add another word to get up to 8-byte
+   // alignment.
diff --git a/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/fix-i386-fdlibm.patch
@@ -0,0 +1,18 @@
+# error: typedef redefinition with different types ('__double_t' (aka 'double') vs 'long double')
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
+
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,12 @@
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
++#if defined(__linux__) && defined(__i386__)
++// rely on glibc's double_t
++typedef long double __double_t;
++#else
+ typedef double      __double_t;
++#endif
+ typedef __double_t  double_t;
+ 
+ /*
diff --git a/srcpkgs/mozjs102/patches/python-3.11.patch b/srcpkgs/mozjs102/patches/python-3.11.patch
new file mode 100644
index 000000000000..9098aa1ddae9
--- /dev/null
+++ b/srcpkgs/mozjs102/patches/python-3.11.patch
@@ -0,0 +1,130 @@
+From 964834abba3b093385409f1d594835ad94362def Mon Sep 17 00:00:00 2001
+From: ahochheiden <ahochheiden@mozilla.com>
+Date: Thu, 2 Jun 2022 06:27:44 +0000
+Subject: [PATCH] Bug 1769631 - Remove 'U' from 'mode' parameters for various
+ 'open' calls to ensure Python3.11 compatibility
+ r=firefox-build-system-reviewers,glandium
+
+The 'U' flag represents "universal newline". It has been deprecated
+since Python3.3. Since then "universal newline" is the default when a
+file is opened in text mode (not bytes). In Python3.11 using the 'U'
+flag throws errors. There should be no harm in removing 'U' from 'open'
+everywhere it is used, and doing allows the use of Python3.11.
+
+For more reading see: https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api
+
+Differential Revision: https://phabricator.services.mozilla.com/D147721
+---
+ dom/base/usecounters.py                                 | 2 +-
+ python/mozbuild/mozbuild/action/process_define_files.py | 2 +-
+ python/mozbuild/mozbuild/backend/base.py                | 2 +-
+ python/mozbuild/mozbuild/preprocessor.py                | 6 +++---
+ python/mozbuild/mozbuild/util.py                        | 2 +-
+ python/mozbuild/mozpack/files.py                        | 4 ++--
+ 6 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py
+index 780e3b32b2131..7e2c7148ece55 100644
+--- a/dom/base/usecounters.py
++++ b/dom/base/usecounters.py
+@@ -8,7 +8,7 @@
+ 
+ def read_conf(conf_filename):
+     # Can't read/write from a single StringIO, so make a new one for reading.
+-    stream = open(conf_filename, "rU")
++    stream = open(conf_filename, "r")
+ 
+     def parse_counters(stream):
+         for line_num, line in enumerate(stream):
+diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
+index f1d401ac26006..aca59d0f05177 100644
+--- a/python/mozbuild/mozbuild/action/process_define_files.py
++++ b/python/mozbuild/mozbuild/action/process_define_files.py
+@@ -36,7 +36,7 @@ def process_define_file(output, input):
+     ) and not config.substs.get("JS_STANDALONE"):
+         config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
+ 
+-    with open(path, "rU") as input:
++    with open(path, "r") as input:
+         r = re.compile(
+             "^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
+         )
+diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py
+index 7bc1986d863b5..b64a70946863d 100644
+--- a/python/mozbuild/mozbuild/backend/base.py
++++ b/python/mozbuild/mozbuild/backend/base.py
+@@ -272,7 +272,7 @@ def post_build(self, config, output, jobs, verbose, status):
+         return status
+ 
+     @contextmanager
+-    def _write_file(self, path=None, fh=None, readmode="rU"):
++    def _write_file(self, path=None, fh=None, readmode="r"):
+         """Context manager to write a file.
+ 
+         This is a glorified wrapper around FileAvoidWrite with integration to
+diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
+index f7820b9c91473..857f1a6c9bfd1 100644
+--- a/python/mozbuild/mozbuild/preprocessor.py
++++ b/python/mozbuild/mozbuild/preprocessor.py
+@@ -531,7 +531,7 @@ def get_output_file(path, encoding=None):
+ 
+         if args:
+             for f in args:
+-                with io.open(f, "rU", encoding="utf-8") as input:
++                with io.open(f, "r", encoding="utf-8") as input:
+                     self.processFile(input=input, output=out)
+             if depfile:
+                 mk = Makefile()
+@@ -860,7 +860,7 @@ def do_include(self, args, filters=True):
+                     args = self.applyFilters(args)
+                 if not os.path.isabs(args):
+                     args = os.path.join(self.curdir, args)
+-                args = io.open(args, "rU", encoding="utf-8")
++                args = io.open(args, "r", encoding="utf-8")
+             except Preprocessor.Error:
+                 raise
+             except Exception:
+@@ -914,7 +914,7 @@ def do_error(self, args):
+ def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
+     pp = Preprocessor(defines=defines, marker=marker)
+     for f in includes:
+-        with io.open(f, "rU", encoding="utf-8") as input:
++        with io.open(f, "r", encoding="utf-8") as input:
+             pp.processFile(input=input, output=output)
+     return pp.includes
+ 
+diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
+index b09f1646988f0..4f1e0cdc5f568 100644
+--- a/python/mozbuild/mozbuild/util.py
++++ b/python/mozbuild/mozbuild/util.py
+@@ -236,7 +236,7 @@ class FileAvoidWrite(BytesIO):
+     still occur, as well as diff capture if requested.
+     """
+ 
+-    def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
++    def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
+         BytesIO.__init__(self)
+         self.name = filename
+         assert type(capture_diff) == bool
+diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py
+index 1d8a1ed2d8a7e..a295a67b5a34f 100644
+--- a/python/mozbuild/mozpack/files.py
++++ b/python/mozbuild/mozpack/files.py
+@@ -554,7 +554,7 @@ def inputs(self):
+         pp = Preprocessor(defines=self.defines, marker=self.marker)
+         pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+ 
+-        with _open(self.path, "rU") as input:
++        with _open(self.path, "r") as input:
+             with _open(os.devnull, "w") as output:
+                 pp.processFile(input=input, output=output)
+ 
+@@ -611,7 +611,7 @@ def copy(self, dest, skip_if_older=True):
+         pp = Preprocessor(defines=self.defines, marker=self.marker)
+         pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+ 
+-        with _open(self.path, "rU") as input:
++        with _open(self.path, "r") as input:
+             pp.processFile(input=input, output=dest, depfile=deps_out)
+ 
+         dest.close()
diff --git a/srcpkgs/mozjs102/template b/srcpkgs/mozjs102/template
new file mode 100644
index 000000000000..46e72e65d429
--- /dev/null
+++ b/srcpkgs/mozjs102/template
@@ -0,0 +1,98 @@
+# Template file for 'mozjs102'
+pkgname=mozjs102
+version=102.5.0
+revision=1
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+make_check_target=check-jit-test
+configure_args="--disable-jemalloc --disable-strip --disable-tests \
+ --disable-optimize --disable-debug --enable-ctypes --enable-readline \
+ --enable-shared-js --enable-system-ffi --with-intl-api --with-system-icu \
+ --with-system-nspr --with-system-zlib --enable-hardening --enable-release"
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std"
+checkdepends="python3"
+short_desc="SpiderMonkey JavaScript interpreter and library (102.x)"
+maintainer="Michal Vasilek <michal@vasilek.cz>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=017dd44b1285913f477074802707a4c76ed1a28270ec5a327bbb76574cc057d8
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+	# Disable LTO on i686, otherwise compilation of `jsrust` fails with -
+	# 	error: ran out of registers during register allocation
+	# 	LLVM ERROR: Cannot emit physreg copy instruction
+	# 	error: could not compile `jsrust` due to previous error
+	export MOZ_NO_RUST_LTO=1
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		configure_args+=" --host=${XBPS_TRIPLET} --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	fi
+	export M4=m4
+	export AWK=awk
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+post_install() {
+	# Remove unneeded static library
+	rm -f "${DESTDIR}"/usr/lib/*.ajs
+
+	# it has correct soname but not the right file name
+	mv "${DESTDIR}"/usr/lib/libmozjs-102.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-102.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-102.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-102.so
+}
+
+pre_check() {
+	if [ "$XBPS_WORDSIZE" = 32 ]; then
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65536/65568/g
+		vsed -i jit-test/tests/basic/bug653153.js -e s/65537/65569/g
+	fi
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x basic/fdlibm-for-sin-cos-tan-argument.js \
+			-x gc/gcparam.js \
+			-x ion/dce-with-rinstructions.js \
+			-x sunspider/check-3d-cube.js \
+			-x sunspider/check-3d-raytrace.js \
+			-x sunspider/check-access-nbody.js \
+			-x wasm/nan-semantics.js \
+			-x wasm/spec/spec/float_literals.wast.js \
+			-x wasm/spec/spec/float_memory.wast.js \
+			-x wasm/spec/threads/float_memory.wast.js \
+			"
+	fi
+	if [ "$XBPS_LIBC" = musl ]; then
+		export JITTEST_EXTRA_ARGS="${JITTEST_EXTRA_ARGS} \
+			-x sunspider/check-date-format-tofte.js \
+			"
+	fi
+}
+
+mozjs102-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js102-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}
diff --git a/srcpkgs/mozjs102/update b/srcpkgs/mozjs102/update
new file mode 100644
index 000000000000..f942fe4f0fc9
--- /dev/null
+++ b/srcpkgs/mozjs102/update
@@ -0,0 +1,2 @@
+site="${MOZILLA_SITE}/firefox/releases/"
+pattern="releases/\K${version%%.*}.*(?=esr/\")"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
                   ` (3 preceding siblings ...)
  2022-11-22 16:33 ` [PR PATCH] [Updated] " paper42
@ 2022-11-22 20:26 ` paper42
  2022-11-22 20:59 ` oreo639
  2022-11-22 21:00 ` [PR PATCH] [Merged]: " paper42
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2022-11-22 20:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/39498#issuecomment-1324203611

Comment:
@oreo639 would you like to be the maintainer of this package? You did the most work on this.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
                   ` (4 preceding siblings ...)
  2022-11-22 20:26 ` paper42
@ 2022-11-22 20:59 ` oreo639
  2022-11-22 21:00 ` [PR PATCH] [Merged]: " paper42
  6 siblings, 0 replies; 8+ messages in thread
From: oreo639 @ 2022-11-22 20:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/39498#issuecomment-1324232098

Comment:
> would you like to be the maintainer of this package?

Not really tbh.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Merged]: New package: mozjs102-102.3.0
  2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
                   ` (5 preceding siblings ...)
  2022-11-22 20:59 ` oreo639
@ 2022-11-22 21:00 ` paper42
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2022-11-22 21:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

There's a merged pull request on the void-packages repository

New package: mozjs102-102.3.0
https://github.com/void-linux/void-packages/pull/39498

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

all patches are imported from mozjs91 except for:
* rebased fix-build-ppc32.patch
* imported use-fallback-atomic-operations-on-armv6.patch to fix some issues with armv6l

currently the armv6 builds fails with
```
/builddir/.xbps-mozjs102/wrappers/arm-linux-musleabihf-c++ --sysroot /usr/arm-linux-musleabihf -o Unified_cpp_js_src_jit12.o -c  -I/builddir/firefox-102.3.0/js/src/dist/system_wrappers -include /builddir/firefox-102.3.0/config/gcc_hidden.h -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DJS_HAS_CTYPES -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builddir/firefox-102.3.0/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src/jit -I/builddir/firefox-102.3.0/js/src/js/src -I/builddir/firefox-102.3.0/js/src -I/builddir/firefox-102.3.0/js/src/dist/include -I/usr/arm-linux-musleabihf/usr/include/nspr -DMOZILLA_CLIENT -include /builddir/firefox-102.3.0/js/src/js/src/js-confdefs.h -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard -I/usr/arm-linux-musleabihf/usr/include -fdebug-prefix-map=/builddir/firefox-102.3.0/js/src=. -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -fno-omit-frame-pointer -funwind-tables -Werror=format -Wno-attributes -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_js_src_jit12.o.pp   Unified_cpp_js_src_jit12.cpp
{standard input}: Assembler messages:
{standard input}:14103: Error: selected processor does not support `isb' in ARM mode
```

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-22 21:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 23:17 [PR PATCH] New package: mozjs102-102.3.0 paper42
2022-10-26 14:56 ` [PR PATCH] [Updated] " paper42
2022-11-13  7:44 ` oreo639
2022-11-13  7:46 ` oreo639
2022-11-22 16:33 ` [PR PATCH] [Updated] " paper42
2022-11-22 20:26 ` paper42
2022-11-22 20:59 ` oreo639
2022-11-22 21:00 ` [PR PATCH] [Merged]: " paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).