Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0
@ 2022-03-20 11:48 subnut
  2022-03-20 11:50 ` [PR PATCH] [Updated] " subnut
                   ` (68 more replies)
  0 siblings, 69 replies; 70+ messages in thread
From: subnut @ 2022-03-20 11:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] [Help needed] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Building this fails with -
```
mv: cannot stat '/destdir//mozjs91-91.5.0/usr/bin/js91-devel-config': No such file or directory
=> ERROR: mozjs91-devel-91.5.0_1: pkg_install: 'mv ${DESTDIR}/$files ${PKGDESTDIR}/${_targetdir}' exited with 1
=> ERROR:   in _vmove() at common/environment/setup/install.sh:219
=> ERROR:   in _noglob_helper() at common/environment/setup/install.sh:12
=> ERROR:   in pkg_install() at srcpkgs/mozjs91-devel/template:85
```
caused by the line -
```bash
                vmove usr/bin/${pkgname#moz}-config
```

Bug in `vmove` ?

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

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

From 10cab989a6aaf9583d33c400f07c9de03db1af5a Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 90 +++++++++++++++++++
 srcpkgs/mozjs91/template.py                   | 84 +++++++++++++++++
 srcpkgs/mozjs91/update.py                     |  3 +
 21 files changed, 776 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template
 create mode 100644 srcpkgs/mozjs91/template.py
 create mode 100644 srcpkgs/mozjs91/update.py

diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..17e90578e686
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,90 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ awk rust cargo llvm12"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+debug_level=1 # make the debug size not explode
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+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"
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/${pkgname#moz}-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}
diff --git a/srcpkgs/mozjs91/template.py b/srcpkgs/mozjs91/template.py
new file mode 100644
index 000000000000..7957612354f4
--- /dev/null
+++ b/srcpkgs/mozjs91/template.py
@@ -0,0 +1,84 @@
+pkgname = "mozjs91"
+pkgver = "91.5.0"
+pkgrel = 0
+build_wrksrc = "js/src"
+build_style = "gnu_configure"
+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",
+]
+make_cmd = "gmake"
+make_dir = "."
+hostmakedepends = [
+    "gmake", "pkgconf", "python", "python-setuptools", "python-six",
+    "perl", "gm4", "gawk", "rust", "cargo",
+]
+makedepends = [
+    "icu-devel", "libffi-devel", "nspr-devel", "python-devel",
+    "zlib-devel", "libedit-devel", "rust-std", "linux-headers",
+]
+pkgdesc = "Mozilla JavaScript interpreter and library (91.x)"
+maintainer = "q66 <q66@chimera-linux.org>"
+license = "MPL-2.0"
+url = "https://www.mozilla.org/firefox"
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+source = f"$(MOZILLA_SITE)/firefox/releases/{pkgver}esr/source/firefox-{pkgver}esr.source.tar.xz"
+sha256 = "f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813"
+debug_level = 1 # make the debug size not explode
+tool_flags = {
+    "LDFLAGS": ["-Wl,-z,stack-size=1048576"]
+}
+env = {
+    "RUST_TARGET": self.profile().triplet,
+    "PYTHON": "/usr/bin/python",
+    "SHELL": "/usr/bin/sh",
+    "MAKE": "gmake",
+    "AWK": "gawk",
+    "M4": "gm4",
+}
+# dependencies are not crossable for now and it's probably tricky
+options = ["!cross"]
+exec_wrappers = [
+    ("/usr/bin/llvm-objdump", "objdump"),
+    ("/usr/bin/llvm-readelf", "readelf"),
+]
+
+def init_configure(self):
+    self.env["AC_MACRODIR"] = str(
+        self.chroot_builddir / f"{pkgname}-{pkgver}/build/autoconf"
+    )
+
+def pre_configure(self):
+    with open(self.cwd / "configure", "w") as cfg:
+        (self.cwd / "../../build/autoconf/autoconf.sh").chmod(0o755)
+        self.do(
+            "/usr/bin/sh",
+            self.chroot_cwd / "../../build/autoconf/autoconf.sh",
+            "--localdir={self.chroot_cwd}", "configure.in",
+            stdout = cfg
+        )
+    (self.cwd / "configure").chmod(0o755)
+
+def post_install(self):
+    self.rm(self.destdir / "usr/lib/libjs_static.ajs")
+    # it has correct soname but not the right file name
+    self.mv(
+        self.destdir / "usr/lib/libmozjs-91.so",
+        self.destdir / "usr/lib/libmozjs-91.so.0"
+    )
+    self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+def do_check(self):
+    self.do(
+        "python", "jit-test/jit_test.py", "-s", "-t", "2400", "--no-progress",
+        "../../js/src/dist/bin/js", "basic"
+    )
+
+@subpackage("mozjs91-devel")
+def _devel(self):
+    # include the interactive interpreter
+    return self.default_devel(extra = ["usr/bin"])
diff --git a/srcpkgs/mozjs91/update.py b/srcpkgs/mozjs91/update.py
new file mode 100644
index 000000000000..c812277a71f0
--- /dev/null
+++ b/srcpkgs/mozjs91/update.py
@@ -0,0 +1,3 @@
+url = "https://ftp.mozilla.org/pub/firefox/releases/"
+pkgname = "firefox"
+pattern = r"(91.[\d.]+)esr"

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

* Re: [PR PATCH] [Updated] [DRAFT] [Help needed] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
@ 2022-03-20 11:50 ` subnut
  2022-03-20 11:53 ` subnut
                   ` (67 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 11:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] [Help needed] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Building this fails with -
```
mv: cannot stat '/destdir//mozjs91-91.5.0/usr/bin/js91-devel-config': No such file or directory
=> ERROR: mozjs91-devel-91.5.0_1: pkg_install: 'mv ${DESTDIR}/$files ${PKGDESTDIR}/${_targetdir}' exited with 1
=> ERROR:   in _vmove() at common/environment/setup/install.sh:219
=> ERROR:   in _noglob_helper() at common/environment/setup/install.sh:12
=> ERROR:   in pkg_install() at srcpkgs/mozjs91-devel/template:85
```
caused by the line -
```bash
                vmove usr/bin/${pkgname#moz}-config
```

Bug in `vmove` ?

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

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

From 424bda5aca1feaa3d38c6b41b7de82757c12ca86 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 90 +++++++++++++++++++
 19 files changed, 689 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..17e90578e686
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,90 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ awk rust cargo llvm12"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+debug_level=1 # make the debug size not explode
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+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"
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/${pkgname#moz}-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] [Help needed] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
  2022-03-20 11:50 ` [PR PATCH] [Updated] " subnut
@ 2022-03-20 11:53 ` subnut
  2022-03-20 12:00 ` subnut
                   ` (66 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 11:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] [Help needed] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Building this fails with -
```
mv: cannot stat '/destdir//mozjs91-91.5.0/usr/bin/js91-devel-config': No such file or directory
=> ERROR: mozjs91-devel-91.5.0_1: pkg_install: 'mv ${DESTDIR}/$files ${PKGDESTDIR}/${_targetdir}' exited with 1
=> ERROR:   in _vmove() at common/environment/setup/install.sh:219
=> ERROR:   in _noglob_helper() at common/environment/setup/install.sh:12
=> ERROR:   in pkg_install() at srcpkgs/mozjs91-devel/template:85
```
caused by the line -
```bash
                vmove usr/bin/${pkgname#moz}-config
```

Bug in `vmove` ?

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

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

From 40e85d76708a85d85a3ded194747d79cc2d1f94e Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 89 +++++++++++++++++++
 19 files changed, 688 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..d3319cbe3870
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,89 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ awk rust cargo llvm12"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+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"
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/${pkgname#moz}-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] [Help needed] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
  2022-03-20 11:50 ` [PR PATCH] [Updated] " subnut
  2022-03-20 11:53 ` subnut
@ 2022-03-20 12:00 ` subnut
  2022-03-20 12:16 ` [PR PATCH] [Updated] [DRAFT] " subnut
                   ` (65 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 12:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] [Help needed] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 3e2a9b4bc3a1b3a88b5f36733e8cd3f4c798cabe Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 89 +++++++++++++++++++
 19 files changed, 688 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..dd170ee2b189
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,89 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ awk rust cargo llvm12"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+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"
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (2 preceding siblings ...)
  2022-03-20 12:00 ` subnut
@ 2022-03-20 12:16 ` subnut
  2022-03-20 13:07 ` subnut
                   ` (64 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 12:16 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From cca9f790d984558932d80fac06d49430500a09db Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 89 +++++++++++++++++++
 19 files changed, 688 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..772b31fddb82
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,89 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (3 preceding siblings ...)
  2022-03-20 12:16 ` [PR PATCH] [Updated] [DRAFT] " subnut
@ 2022-03-20 13:07 ` subnut
  2022-03-20 13:34 ` subnut
                   ` (63 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 13:07 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From efa5fbe4166a0f3fc5ed29d57cce5f23dea57ae9 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++
 srcpkgs/mozjs91/template                      | 94 +++++++++++++++++++
 20 files changed, 694 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..8c707afcd222
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,94 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+
+	[ "$RUST_TARGET" = i686-pc-linux-gnu ] &&
+		export RUST_TARGET=i686-unknown-linux-gnu
+
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (4 preceding siblings ...)
  2022-03-20 13:07 ` subnut
@ 2022-03-20 13:34 ` subnut
  2022-03-20 13:50 ` subnut
                   ` (62 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 13:34 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From efa5fbe4166a0f3fc5ed29d57cce5f23dea57ae9 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH 1/2] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++
 srcpkgs/mozjs91/template                      | 94 +++++++++++++++++++
 20 files changed, 694 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..8c707afcd222
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,94 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	export M4=m4
+	export AWK=awk
+	export RUST_TARGET="$XBPS_TRIPLET"
+	export AC_MACRODIR=../../build/autoconf
+
+	[ "$RUST_TARGET" = i686-pc-linux-gnu ] &&
+		export RUST_TARGET=i686-unknown-linux-gnu
+
+	chmod 0755 ../../build/autoconf/autoconf.sh
+	sh ../../build/autoconf/autoconf.sh configure.in > configure
+	chmod 0755 configure
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+# @subpackage("mozjs91-devel")
+# def _devel(self):
+#     # include the interactive interpreter
+#     return self.default_devel(extra=["usr/bin"])
+
+# taken from mozjs78
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

From b19911eecc4b2a3476601947bdbcf2503dc92aa0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 19:05:00 +0530
Subject: [PATCH 2/2] Don't define RUST_TARGET

---
 srcpkgs/mozjs91/template | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/srcpkgs/mozjs91/template b/srcpkgs/mozjs91/template
index 8c707afcd222..1f74a468fea0 100644
--- a/srcpkgs/mozjs91/template
+++ b/srcpkgs/mozjs91/template
@@ -42,12 +42,7 @@ fi
 pre_configure() {
 	export M4=m4
 	export AWK=awk
-	export RUST_TARGET="$XBPS_TRIPLET"
 	export AC_MACRODIR=../../build/autoconf
-
-	[ "$RUST_TARGET" = i686-pc-linux-gnu ] &&
-		export RUST_TARGET=i686-unknown-linux-gnu
-
 	chmod 0755 ../../build/autoconf/autoconf.sh
 	sh ../../build/autoconf/autoconf.sh configure.in > configure
 	chmod 0755 configure
@@ -76,12 +71,6 @@ do_check() {
 	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
 }
 
-# @subpackage("mozjs91-devel")
-# def _devel(self):
-#     # include the interactive interpreter
-#     return self.default_devel(extra=["usr/bin"])
-
-# taken from mozjs78
 mozjs91-devel_package() {
 	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (5 preceding siblings ...)
  2022-03-20 13:34 ` subnut
@ 2022-03-20 13:50 ` subnut
  2022-03-20 14:01 ` subnut
                   ` (61 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 13:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 8ac5be6e90badef14bb8ab95b199e167fbae1eb7 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++
 srcpkgs/mozjs91/template                      | 93 +++++++++++++++++++
 20 files changed, 693 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..a39cbdf3e7c5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,93 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		export HOST_CC=cc
+		export TARGET_CC="${CC}"
+		export HOST_CFLAGS="-Os"
+		export HOST_CXXFLAGS="-Os"
+		configure_args+=" --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	else
+		configure_args+=" --target=${XBPS_TRIPLET}"
+	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
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (6 preceding siblings ...)
  2022-03-20 13:50 ` subnut
@ 2022-03-20 14:01 ` subnut
  2022-03-20 14:05 ` [PR PATCH] [Updated] " subnut
                   ` (60 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 14:01 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073258205

Comment:
i686 is failing with
> error: ran out of registers during register allocation


<br>
<code>j&#96;ey</code> in <code>##rust</code> on libera.chat says that it is a compiler bug

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (7 preceding siblings ...)
  2022-03-20 14:01 ` subnut
@ 2022-03-20 14:05 ` subnut
  2022-03-20 14:36 ` [PR PATCH] [Updated] [DRAFT] [ci skip] " subnut
                   ` (59 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 14:05 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 099ae2f558a8fd62520a627b78f9f477d9ae62e6 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++
 srcpkgs/mozjs91/template                      | 94 +++++++++++++++++++
 20 files changed, 694 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..9fca6a190566
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,94 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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 \
+ --host=${XBPS_TRIPLET}"
+hostmakedepends="make pkg-config python3 python3-setuptools python3-six perl m4
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		export HOST_CC=cc
+		export TARGET_CC="${CC}"
+		export HOST_CFLAGS="-Os"
+		export HOST_CXXFLAGS="-Os"
+		configure_args+=" --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	else
+		configure_args+=" --target=${XBPS_TRIPLET}"
+	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
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] [ci skip] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (8 preceding siblings ...)
  2022-03-20 14:05 ` [PR PATCH] [Updated] " subnut
@ 2022-03-20 14:36 ` subnut
  2022-03-20 14:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
                   ` (58 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 14:36 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] [ci skip] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 1cbc28e999f655267461cd823a1e619b8ac779f4 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++
 srcpkgs/mozjs91/template                      | 93 +++++++++++++++++++
 20 files changed, 693 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..a39cbdf3e7c5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,93 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		export HOST_CC=cc
+		export TARGET_CC="${CC}"
+		export HOST_CFLAGS="-Os"
+		export HOST_CXXFLAGS="-Os"
+		configure_args+=" --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+	else
+		configure_args+=" --target=${XBPS_TRIPLET}"
+	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
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (9 preceding siblings ...)
  2022-03-20 14:36 ` [PR PATCH] [Updated] [DRAFT] [ci skip] " subnut
@ 2022-03-20 14:52 ` subnut
  2022-03-20 16:01 ` subnut
                   ` (57 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 14:52 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!--
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 11f5e6ad7f68c948ca7a9f4a9676d078277bd7eb Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 +++++++
 ...cu-sources-data-write-command-stderr.patch | 44 ++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 +++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 86 +++++++++++++++++++
 20 files changed, 686 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..0a7c84adb3d5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,86 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	[ "$CROSS_BUILD" ] &&
+		configure_args+=" --host=${XBPS_TRIPLET} --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+
+	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
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (10 preceding siblings ...)
  2022-03-20 14:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
@ 2022-03-20 16:01 ` subnut
  2022-03-20 16:30 ` subnut
                   ` (56 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 16:01 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->
DRAFT

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

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

From 9c5fe2839c2a64675dc41c91c96c3581d6611d75 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 ++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 ++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 +++++++
 ...cu-sources-data-write-command-stderr.patch | 44 ++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 +++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 +++++++
 .../010-spidermoney-checks-disable.patch      | 22 +++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 ++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++
 srcpkgs/mozjs91/template                      | 86 +++++++++++++++++++
 20 files changed, 686 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..0a7c84adb3d5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,86 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+pre_configure() {
+	[ "$CROSS_BUILD" ] &&
+		configure_args+=" --host=${XBPS_TRIPLET} --target=${XBPS_CROSS_TRIPLET} --enable-linker=bfd"
+
+	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
+}
+
+# def post_install(self):
+#     # it has correct soname but not the right file name
+#     self.mv(
+#         self.destdir / "usr/lib/libmozjs-91.so",
+#         self.destdir / "usr/lib/libmozjs-91.so.0"
+#     )
+#     self.install_link("libmozjs-91.so.0", "usr/lib/libmozjs-91.so")
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (11 preceding siblings ...)
  2022-03-20 16:01 ` subnut
@ 2022-03-20 16:30 ` subnut
  2022-03-20 16:30 ` subnut
                   ` (55 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 16:30 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073258205

Comment:
i686 is failing with
> error: ran out of registers during register allocation


<br>
<code>j&#96;ey</code> in <code>##rust</code> on libera.chat says that it is a compiler bug

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

* Re: [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (12 preceding siblings ...)
  2022-03-20 16:30 ` subnut
@ 2022-03-20 16:30 ` subnut
  2022-03-20 17:03 ` [PR PATCH] [Updated] " subnut
                   ` (54 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 16:30 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073258205

Comment:
i686 is failing with
> error: ran out of registers during register allocation


<br>
<code>j&#96;ey</code> in <code>##rust</code> on libera.chat says that it is a compiler bug

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (13 preceding siblings ...)
  2022-03-20 16:30 ` subnut
@ 2022-03-20 17:03 ` subnut
  2022-03-20 17:11 ` subnut
                   ` (53 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 17:03 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From 017788dd99280bdc0a33b180adc5b77aa3dafebd Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 +++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 +++++++
 ...cu-sources-data-write-command-stderr.patch | 44 +++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 ++++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 +++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 +++++++
 .../010-spidermoney-checks-disable.patch      | 22 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 +++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 +++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 +++++++
 .../patches/015-drop-rustc-validation.patch   | 52 +++++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 ++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 +++++++++
 srcpkgs/mozjs91/template                      | 78 +++++++++++++++++++
 20 files changed, 678 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..109062a1636d
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,78 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+# env={
+#     "PYTHON": "/usr/bin/python",
+#     "SHELL": "/usr/bin/sh",
+#     "MAKE": "gmake",
+# }
+# # dependencies are not crossable for now and it's probably tricky
+# options=["!cross"]
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (14 preceding siblings ...)
  2022-03-20 17:03 ` [PR PATCH] [Updated] " subnut
@ 2022-03-20 17:11 ` subnut
  2022-03-20 17:12 ` [PR PATCH] [Updated] [skip ci][DRAFT] " subnut
                   ` (52 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 17:11 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From abeb3b1dae7491e5c11148c885bd2adecfe601a0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++++
 ...cu-sources-data-write-command-stderr.patch | 44 ++++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++++
 .../010-spidermoney-checks-disable.patch      | 22 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 ++++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++++
 srcpkgs/mozjs91/template                      | 70 +++++++++++++++++++
 20 files changed, 670 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..09d59ba47130
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [skip ci][DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (15 preceding siblings ...)
  2022-03-20 17:11 ` subnut
@ 2022-03-20 17:12 ` subnut
  2022-03-20 17:12 ` subnut
                   ` (51 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 17:12 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[skip ci][DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From 8c918c0a8f979da8e8a12d961430b4400982547a Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++++
 ...cu-sources-data-write-command-stderr.patch | 44 ++++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++++
 .../010-spidermoney-checks-disable.patch      | 22 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 ++++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++++
 srcpkgs/mozjs91/template                      | 70 +++++++++++++++++++
 20 files changed, 670 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..09d59ba47130
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [skip ci][DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (16 preceding siblings ...)
  2022-03-20 17:12 ` [PR PATCH] [Updated] [skip ci][DRAFT] " subnut
@ 2022-03-20 17:12 ` subnut
  2022-03-20 18:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
                   ` (50 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 17:12 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[skip ci][DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From 83684c4374513911c0d753ba3714e06b38244fc0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

---
 common/shlibs                                 |  1 +
 srcpkgs/mozjs91-devel                         |  1 +
 srcpkgs/mozjs91/patches/001-fix-soname.patch  | 26 +++++++
 .../mozjs91/patches/002-copy-headers.patch    | 38 ++++++++++
 .../mozjs91/patches/003-tests-timeout.patch   | 26 +++++++
 .../004-icu-sources-data-py-decouple.patch    | 29 ++++++++
 ...cu-sources-data-write-command-stderr.patch | 44 ++++++++++++
 srcpkgs/mozjs91/patches/006-emitter.patch     | 67 ++++++++++++++++++
 ...-tests-use-native-temporarydirectory.patch | 66 +++++++++++++++++
 srcpkgs/mozjs91/patches/008-init-patch.patch  | 28 ++++++++
 .../patches/009-sloppy-m4-detection.patch     | 29 ++++++++
 .../010-spidermoney-checks-disable.patch      | 22 ++++++
 .../011-failing-tests-ppc64-s390x.patch       | 36 ++++++++++
 srcpkgs/mozjs91/patches/012-fix-musl.patch    | 21 ++++++
 .../013-disable-spidermonkey-jslint.patch     | 26 +++++++
 srcpkgs/mozjs91/patches/014-rust-target.patch | 28 ++++++++
 .../patches/015-drop-rustc-validation.patch   | 52 ++++++++++++++
 srcpkgs/mozjs91/patches/016-use-libedit.patch | 25 +++++++
 .../mozjs91/patches/017-no-lto-readelf.patch  | 35 ++++++++++
 srcpkgs/mozjs91/template                      | 70 +++++++++++++++++++
 20 files changed, 670 insertions(+)
 create mode 120000 srcpkgs/mozjs91-devel
 create mode 100644 srcpkgs/mozjs91/patches/001-fix-soname.patch
 create mode 100644 srcpkgs/mozjs91/patches/002-copy-headers.patch
 create mode 100644 srcpkgs/mozjs91/patches/003-tests-timeout.patch
 create mode 100644 srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
 create mode 100644 srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
 create mode 100644 srcpkgs/mozjs91/patches/006-emitter.patch
 create mode 100644 srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
 create mode 100644 srcpkgs/mozjs91/patches/008-init-patch.patch
 create mode 100644 srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
 create mode 100644 srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
 create mode 100644 srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
 create mode 100644 srcpkgs/mozjs91/patches/012-fix-musl.patch
 create mode 100644 srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
 create mode 100644 srcpkgs/mozjs91/patches/014-rust-target.patch
 create mode 100644 srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
 create mode 100644 srcpkgs/mozjs91/patches/016-use-libedit.patch
 create mode 100644 srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
 create mode 100644 srcpkgs/mozjs91/template

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..c9aa4b6de961
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
@@ -0,0 +1,52 @@
+commit 3f583ac83d813078b8b881133914db6bbd31f34b
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:16:25 2022 +0100
+
+    drop some rust compiler validation
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 97938d69..89c611cd 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -90,11 +90,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)
+ 
+@@ -462,29 +457,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/mozjs91/patches/016-use-libedit.patch b/srcpkgs/mozjs91/patches/016-use-libedit.patch
new file mode 100644
index 000000000000..896603c1fde1
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-use-libedit.patch
@@ -0,0 +1,25 @@
+commit c5f73cc56edc17eee3fadec7e09ff4090b10e9d0
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date:   Sun Jan 23 21:31:08 2022 +0100
+
+    use libedit instead of readline
+
+diff --git a/js/moz.configure b/js/moz.configure
+index 3c3d0d43..985a42a1 100644
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -919,12 +919,12 @@ option(
+ 
+ has_readline = check_symbol(
+     "readline",
+-    flags=["-lreadline"],
++    flags=["-ledit"],
+     when="--enable-readline",
+     onerror=lambda: die("No system readline library found"),
+ )
+ 
+-set_config("EDITLINE_LIBS", ["-lreadline"], when=has_readline)
++set_config("EDITLINE_LIBS", ["-ledit"], when=has_readline)
+ 
+ 
+ @depends("--enable-readline", editline, when=editline)
diff --git a/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..09d59ba47130
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel zlib-devel
+ libedit-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (17 preceding siblings ...)
  2022-03-20 17:12 ` subnut
@ 2022-03-20 18:52 ` subnut
  2022-03-20 18:58 ` subnut
                   ` (49 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 18:52 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From cf9c081a94189d0e232182d09c7c11f877c34651 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/016-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/016-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..eea94b95af12
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (18 preceding siblings ...)
  2022-03-20 18:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
@ 2022-03-20 18:58 ` subnut
  2022-03-20 19:22 ` subnut
                   ` (48 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 18:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

[DRAFT] New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686`, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)
- To fix cross compilation, **I AM CLUELESS.**  
  I tried literally everything I could for 4 continuous hours.
<!--
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

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

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

From cba637065eb49991b91467ec7a2d841ba9401f9b Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..eea94b95af12
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.5.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=f45cd9c96227e3e6eabe37962ce924b7a7ca86b6c191326c1bab18e082b4c813
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [DRAFT] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (19 preceding siblings ...)
  2022-03-20 18:58 ` subnut
@ 2022-03-20 19:22 ` subnut
  2022-03-20 23:02 ` [PR REVIEW] " paper42
                   ` (47 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-20 19:22 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073315910

Comment:
I am not sure whether the built binaries run as expected, because I have never used this package before.  
I had originally set out to try updating gnome-shell to 42.0, but this was needed as a dependency. So, I did this. :)

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

* Re: [PR REVIEW] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (20 preceding siblings ...)
  2022-03-20 19:22 ` subnut
@ 2022-03-20 23:02 ` paper42
  2022-03-21  2:53 ` [PR PATCH] [Updated] " subnut
                   ` (46 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: paper42 @ 2022-03-20 23:02 UTC (permalink / raw)
  To: ml

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

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#discussion_r830687333

Comment:
```suggestion
version=91.7.0
```

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (21 preceding siblings ...)
  2022-03-20 23:02 ` [PR REVIEW] " paper42
@ 2022-03-21  2:53 ` subnut
  2022-03-21  2:53 ` subnut
                   ` (45 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  2:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686` CI, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 5106df74877c409daca7a2017155b4c1f269b8b7 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.5.0

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..d700d7c30aa5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (22 preceding siblings ...)
  2022-03-21  2:53 ` [PR PATCH] [Updated] " subnut
@ 2022-03-21  2:53 ` subnut
  2022-03-21  2:54 ` [PR REVIEW] " subnut
                   ` (44 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  2:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.5.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
- To fix `i686` CI, we need to upgrade `rustc` to a newer version  
  (according to a user in `##rust` in `libera.chat`)

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES** (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 3d27615046008f6c2e2795deb893faeec3814f13 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..d700d7c30aa5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -s "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	      "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR REVIEW] New package: mozjs91-91.5.0
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (23 preceding siblings ...)
  2022-03-21  2:53 ` subnut
@ 2022-03-21  2:54 ` subnut
  2022-03-21  3:08 ` New package: mozjs91-91.7.1 subnut
                   ` (43 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  2:54 UTC (permalink / raw)
  To: ml

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

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#discussion_r830723838

Comment:
Latest is `91.7.1`, so I set `version=91.7.1`

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (24 preceding siblings ...)
  2022-03-21  2:54 ` [PR REVIEW] " subnut
@ 2022-03-21  3:08 ` subnut
  2022-03-21  3:08 ` subnut
                   ` (42 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  3:08 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073315910

Comment:
I am not sure whether the built binaries run as expected, because I have never used this package before.  
I had originally set out to try updating gnome-shell to 42.0, but this was needed as a dependency. So, I did this. :)

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (25 preceding siblings ...)
  2022-03-21  3:08 ` New package: mozjs91-91.7.1 subnut
@ 2022-03-21  3:08 ` subnut
  2022-03-21  3:08 ` subnut
                   ` (41 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  3:08 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073315910

Comment:
I am not sure whether the built binaries run as expected, because I have never used this package before.  
I had originally set out to try updating gnome-shell to 42.0, but this was needed as a dependency. So, I did this. :)

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (26 preceding siblings ...)
  2022-03-21  3:08 ` subnut
@ 2022-03-21  3:08 ` subnut
  2022-03-22  6:03 ` subnut
                   ` (40 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-21  3:08 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1073258205

Comment:
i686 is failing with
> error: ran out of registers during register allocation


<br>
<code>j&#96;ey</code> in <code>##rust</code> on libera.chat says that it is a compiler bug

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (27 preceding siblings ...)
  2022-03-21  3:08 ` subnut
@ 2022-03-22  6:03 ` subnut
  2022-03-23 16:20 ` subnut
                   ` (39 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-22  6:03 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1074772502

Comment:
_sigh_ All this work on #36269 was just to fix the failing i686 build, and it **still** fails with the same error :tired_face: 

Looks like it might be an llvm issue.

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (28 preceding siblings ...)
  2022-03-22  6:03 ` subnut
@ 2022-03-23 16:20 ` subnut
  2022-03-23 17:37 ` [PR REVIEW] " oreo639
                   ` (38 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-23 16:20 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1076485452

Comment:
Looks like the i686 bug still exists when building on rust-1.59 linked with llvm13

I'm defeated.

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

* Re: [PR REVIEW] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (29 preceding siblings ...)
  2022-03-23 16:20 ` subnut
@ 2022-03-23 17:37 ` oreo639
  2022-03-24  2:57 ` [PR PATCH] [Updated] " subnut
                   ` (37 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: oreo639 @ 2022-03-23 17:37 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#discussion_r833550023

Comment:
This symlink is broken. It should be `ln -s libmozjs-91.so.0 "${DESTDIR}"/usr/lib/libmozjs-91.so`

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (30 preceding siblings ...)
  2022-03-23 17:37 ` [PR REVIEW] " oreo639
@ 2022-03-24  2:57 ` subnut
  2022-03-24  2:58 ` [PR REVIEW] " subnut
                   ` (36 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-24  2:57 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
i686 is failing with -
```
error: ran out of registers during register allocation
 ```
LLVM bug or Rust bug?


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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 113456f8b48f99dcb7abf3750fb8239558e913c3 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..cf6288e35faa
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR REVIEW] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (31 preceding siblings ...)
  2022-03-24  2:57 ` [PR PATCH] [Updated] " subnut
@ 2022-03-24  2:58 ` subnut
  2022-03-24  4:58 ` q66
                   ` (35 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-03-24  2:58 UTC (permalink / raw)
  To: ml

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

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#discussion_r833875262

Comment:
Ah, good catch.  
Should be fixed now. Changed `-s` to `-rs`.

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (32 preceding siblings ...)
  2022-03-24  2:58 ` [PR REVIEW] " subnut
@ 2022-03-24  4:58 ` q66
  2022-04-02 19:31 ` [PR PATCH] [Updated] " subnut
                   ` (34 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: q66 @ 2022-03-24  4:58 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1077119362

Comment:
> Looks like the i686 bug still exists when building on rust-1.59 linked with llvm13
> 
> I'm defeated.

try some basics to work around it? (lower optimization level, debug info level, disable LTO...)

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (33 preceding siblings ...)
  2022-03-24  4:58 ` q66
@ 2022-04-02 19:31 ` subnut
  2022-04-03  3:10 ` subnut
                   ` (33 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-02 19:31 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
i686 is failing with -
```
error: ran out of registers during register allocation
 ```
LLVM bug or Rust bug?  

**UPDATE:** The error is caused by `--enable-release`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 00eefdc6e381debb62de4ed80aa62c1f4f597255 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 83b5783cb026..1e19da1227a6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3495,6 +3495,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..cf6288e35faa
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (34 preceding siblings ...)
  2022-04-02 19:31 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03  3:10 ` subnut
  2022-04-03  3:47 ` subnut
                   ` (32 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  3:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
i686 is failing with -
```
error: ran out of registers during register allocation
 ```
LLVM bug or Rust bug?  

**UPDATE:** The error is caused by `--enable-release`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 557e84eccdf9bfa0566e0089b6017d4fd5205745 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..cf6288e35faa
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (35 preceding siblings ...)
  2022-04-03  3:10 ` subnut
@ 2022-04-03  3:47 ` subnut
  2022-04-03  4:27 ` subnut
                   ` (31 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  3:47 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
i686 is failing with -
```
error: ran out of registers during register allocation
 ```
LLVM bug or Rust bug?  

**UPDATE:** The error is caused by `--enable-release`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 062894034a767b33c5c36fe9b365eb52a45e63f2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/010-spidermoney-checks-disable.patch b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
new file mode 100644
index 000000000000..451d3eef47f6
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/010-spidermoney-checks-disable.patch
@@ -0,0 +1,22 @@
+From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
+Date: Mon, 9 Aug 2021 14:41:14 +0200
+Subject: [PATCH] Don't die on SpiderMonkey checks
+
+---
+ config/run_spidermonkey_checks.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py
+index 0f842d9..b49db52 100644
+--- a/config/run_spidermonkey_checks.py
++++ b/config/run_spidermonkey_checks.py
+@@ -11,5 +11,3 @@ import sys
+ def main(output, lib_file, *scripts):
+     for script in scripts:
+         retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
+-        if retcode != 0:
+-            raise Exception(script + " failed")
+--
+2.31.1
+
diff --git a/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..cf6288e35faa
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,70 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+do_check() {
+	python jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js basic
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (36 preceding siblings ...)
  2022-04-03  3:47 ` subnut
@ 2022-04-03  4:27 ` subnut
  2022-04-03  4:56 ` subnut
                   ` (30 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  4:27 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086774252

Comment:
@q66 disabling LTO worked. :slightly_smiling_face: 

But now the tests fail :slightly_frowning_face: 

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (37 preceding siblings ...)
  2022-04-03  4:27 ` subnut
@ 2022-04-03  4:56 ` subnut
  2022-04-03  5:03 ` subnut
                   ` (29 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  4:56 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086776739

Comment:
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`



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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (38 preceding siblings ...)
  2022-04-03  4:56 ` subnut
@ 2022-04-03  5:03 ` subnut
  2022-04-03  6:16 ` [PR PATCH] [Updated] " subnut
                   ` (28 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  5:03 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086776739

Comment:
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`


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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (39 preceding siblings ...)
  2022-04-03  5:03 ` subnut
@ 2022-04-03  6:16 ` subnut
  2022-04-03  6:19 ` subnut
                   ` (27 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  6:16 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 4f673634ea8f4c80393b6875f01dc28655d8c77d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..3d4103e85f0d
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@ check:: check-js-msg
+ 
+-check-js-msg::
+-        (cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..7600ead84c90
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,73 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (40 preceding siblings ...)
  2022-04-03  6:16 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03  6:19 ` subnut
  2022-04-03  6:32 ` [PR PATCH] [Updated] " subnut
                   ` (26 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  6:19 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086776739

Comment:
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`

#### EDIT:
`parseInt(1e21-65569)` returns the correct value `999999999999999900000`

Huh.

---

### EUREKA!!
```
$ python
>>> 65569 - 65537
32
>>> 65568 - 65536
32
```

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (41 preceding siblings ...)
  2022-04-03  6:19 ` subnut
@ 2022-04-03  6:32 ` subnut
  2022-04-03  6:58 ` subnut
                   ` (25 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  6:32 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From ca230e8a64b811d0d29359d07706b5142e5d08af Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e9fc1f9156ff
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..7600ead84c90
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,73 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (42 preceding siblings ...)
  2022-04-03  6:32 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03  6:58 ` subnut
  2022-04-03  7:02 ` subnut
                   ` (24 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  6:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From eb6c8cfe7fc44211178ba3908b6ccd95a5a9295a Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e025606f5ce5
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,14 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
+@@ -51,3 +49,3 @@
+ 
+-check:: check-js-msg
++check:: check-jit-test check-jstests
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..7600ead84c90
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,73 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (43 preceding siblings ...)
  2022-04-03  6:58 ` subnut
@ 2022-04-03  7:02 ` subnut
  2022-04-03  7:14 ` subnut
                   ` (23 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  7:02 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

New package: mozjs91-91.7.1
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Current state -
these i686 tests are failing (`js/src/jit-test/tests/basic/bug653153.js`) -
```js
// This is the boundary in practice.
assertEq(parseInt(1e21 - 65537) > 1e20, true);
assertEq(parseInt(1e21 - 65536), 1);
assertEq(parseInt(1e21 + 65536), 1);
 ```

That's because `parseInt(1e21 - 65537)` returns `1` instead of the correct `999999999999999900000`  
And that's because `(1e21-65537).toString()` returns `"1e+21"` instead of the correct `"999999999999999900000"`

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 6a2f4f200d39eb7f958691829713df7a000b8c5d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e9fc1f9156ff
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..c03ad4b2bd9f
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,74 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper=rust
+make_check_target=check-jit-tests
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (44 preceding siblings ...)
  2022-04-03  7:02 ` subnut
@ 2022-04-03  7:14 ` subnut
  2022-04-03  7:15 ` subnut
                   ` (22 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  7:14 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086792538

Comment:
In case anybody is interested, `make check-jstests` fail with the following errors -  
(only the error-related output is shown here)

```
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js: rc = 3, run time = 0.106024
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Modifier_Symbol}` should match U+000888 (`࢈`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js:122:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js: rc = 3, run time = 0.164799
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Terminal_Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js:250:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js: rc = 3, run time = 0.264442
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Han}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js:90:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js: rc = 3, run time = 0.139439
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Casefolded}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js:1270:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js: rc = 3, run time = 0.12818
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Telugu}` should match U+000C3C (`఼`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js:84:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Diacritic.js: rc = 3, run time = 0.162401
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Diacritic}` should match U+000898 (`࢘`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Diacritic.js:394:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Diacritic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js: rc = 3, run time = 0.221201
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Decimal_Number}` should match U+016AC0 (`𖫀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js:197:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js: rc = 3, run time = 0.17401
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Lowercase_Letter}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js:1352:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js: rc = 3, run time = 0.129365
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Default_Ignorable_Code_Point}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js:75:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js: rc = 3, run time = 0.181653
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Script=Common}` should match U+016FE2 (`𖿢`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js:195:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js: rc = 3, run time = 0.207954
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Number}` should match U+016AC0 (`𖫀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js:328:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js: rc = 3, run time = 0.274961
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Hiragana}` should match U+01B11F (`𛄟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js:61:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js: rc = 3, run time = 0.354468
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Ahom}` should match U+011740 (`𑝀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js:56:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js | (args: "") [0.4 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js: rc = 3, run time = 0.159395
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Open_Punctuation}` should match U+002E55 (`⹕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js:211:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js: rc = 3, run time = 0.16726
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Kaithi}` should match U+0110C2 (`𑃂`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js:55:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Ideographic.js: rc = 3, run time = 0.139965
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Ideographic}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Ideographic.js:79:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Ideographic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js: rc = 3, run time = 0.13528
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Tagalog}` should match U+00170D (`ᜍ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js: rc = 3, run time = 0.214665
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{ID_Continue}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js:1502:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js: rc = 3, run time = 0.155039
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Syriac}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js:74:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js: rc = 3, run time = 0.137076
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Arabic}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js:166:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js: rc = 3, run time = 0.150106
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Latin}` should match U+00A7C0 (`Ꟁ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js: rc = 3, run time = 0.164577
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Titlecased}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js:1278:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js: rc = 3, run time = 0.164939
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Balinese}` should match U+001B4C (`ᭌ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js: rc = 3, run time = 0.159875
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js:447:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js: rc = 3, run time = 0.222694
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Brahmi}` should match U+011070 (`𑁰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js: rc = 3, run time = 0.285617
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Soft_Dotted}` should match U+01DF1A (`𝼚`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js:104:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js: rc = 3, run time = 0.192375
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{XID_Continue}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js:1516:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js: rc = 3, run time = 0.141643
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Bidi_Mirrored}` should match U+002E55 (`⹕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js:268:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js: rc = 3, run time = 0.172671
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Close_Punctuation}` should match U+002E56 (`⹖`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js:206:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js: rc = 3, run time = 0.122727
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Lowercased}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js:1244:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js: rc = 3, run time = 0.179568
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Sentence_Terminal}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js:194:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js: rc = 3, run time = 0.205027
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Modifier_Letter}` should match U+0008C9 (`ࣉ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js:184:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js: rc = 3, run time = 0.201829
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Adlam}` should match U+00061F (`؟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js:59:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js: rc = 3, run time = 0.249364
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Ethiopic}` should match U+01E7E0 (`𞟠`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js: rc = 3, run time = 0.214289
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Katakana}` should match U+01AFF0 (`𚿰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js:82:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Assigned.js: rc = 3, run time = 0.152038
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Assigned}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Assigned.js:1390:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Assigned.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js: rc = 3, run time = 0.097881
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Inherited}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js:118:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js: rc = 3, run time = 0.179185
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Uppercase_Letter}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js:1338:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js: rc = 3, run time = 0.152964
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js:424:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js: rc = 3, run time = 0.129801
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Nonspacing_Mark}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js:349:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Cased.js: rc = 3, run time = 0.158703
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Cased}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Cased.js:319:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Cased.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js: rc = 3, run time = 0.113554
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Kannada}` should match U+000CDD (`ೝ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js:78:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js: rc = 3, run time = 0.192906
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Takri}` should match U+0116B9 (`𑚹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js:58:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js: rc = 3, run time = 0.256605
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Ahom}` should match U+011740 (`𑝀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js:56:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js: rc = 3, run time = 0.12132
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Mongolian}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js:66:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js: rc = 3, run time = 0.167459
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Casemapped}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js:290:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js: rc = 3, run time = 0.192688
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Symbol}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js:426:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js: rc = 3, run time = 0.26271
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Unified_Ideograph}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js:72:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js: rc = 3, run time = 0.24799
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Dash_Punctuation}` should match U+002E5D (`⹝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js:97:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js: rc = 3, run time = 0.179697
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Telugu}` should match U+000C3C (`఼`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js:75:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js: rc = 3, run time = 0.151959
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Nko}` should match U+00060C (`،`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js: rc = 3, run time = 0.180346
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Balinese}` should match U+001B4C (`ᭌ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js: rc = 3, run time = 0.262116
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Takri}` should match U+0116B9 (`𑚹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Lowercase.js: rc = 3, run time = 0.19688
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Lowercase}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Lowercase.js:1346:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Lowercase.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js: rc = 3, run time = 0.261015
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Hiragana}` should match U+01B11F (`𛄟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js:84:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js: rc = 3, run time = 0.159222
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Cased_Letter}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js:326:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js: rc = 3, run time = 0.114022
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Other}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js:703:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js: rc = 3, run time = 0.158188
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Currency_Symbol}` should match U+0020C0 (`⃀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js:103:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js: rc = 3, run time = 0.117543
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Script_Extensions=Common}` should match U+00FD3E (`﴾`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js:170:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js: rc = 3, run time = 0.149114
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Variation_Selector}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js:46:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js: rc = 3, run time = 0.267383
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Grapheme_Base}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js:1710:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js: rc = 3, run time = 0.20066
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Symbol}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js:520:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Extender.js: rc = 3, run time = 0.281274
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Extender}` should match U+010781 (`𐞁`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Extender.js:106:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Extender.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js: rc = 3, run time = 0.288518
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Kaithi}` should match U+0110C2 (`𑃂`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js:59:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js: rc = 3, run time = 0.261371
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Alphabetic}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js:1432:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js: rc = 3, run time = 0.137503
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Tagalog}` should match U+00170D (`ᜍ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js:55:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js: rc = 3, run time = 0.132371
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Uppercased}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js:1280:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js: rc = 3, run time = 0.143618
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Glagolitic}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js:74:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji.js: rc = 3, run time = 0.142026
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji.js:341:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js: rc = 3, run time = 0.180663
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Inherited}` should match U+001AC1 (`᫁`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js:98:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js: rc = 3, run time = 0.133917
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Mongolian}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js:64:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js: rc = 3, run time = 0.328583
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Han}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js:124:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/ID_Start.js: rc = 3, run time = 0.274168
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{ID_Start}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/ID_Start.js:1286:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/ID_Start.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js: rc = 3, run time = 0.168505
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji_Presentation}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js:204:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js: rc = 3, run time = 0.176303
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Arabic}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js:156:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/XID_Start.js: rc = 3, run time = 0.220854
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{XID_Start}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/XID_Start.js:1300:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/XID_Start.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js: rc = 3, run time = 0.245545
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Canadian_Aboriginal}` should match U+011AB0 (`𑪰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js: rc = 3, run time = 0.195247
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Latin}` should match U+00A7C0 (`Ꟁ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js:132:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js: rc = 3, run time = 0.283973
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Letter}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js:1306:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js: rc = 3, run time = 0.158409
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Format}` should match U+000890 (`࢐`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js:102:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js: rc = 3, run time = 0.209329
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Canadian_Aboriginal}` should match U+011AB0 (`𑪰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js: rc = 3, run time = 0.21263
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Brahmi}` should match U+011070 (`𑁰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js: rc = 3, run time = 0.225571
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji_Modifier_Base}` should match U+01FAC3 (`🫃`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js:118:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js: rc = 3, run time = 0.107761
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Case_Ignorable}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js:432:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js: rc = 3, run time = 0.211705
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Spacing_Mark}` should match U+001715 (`᜕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js:412:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js: rc = 3, run time = 0.232658
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Ethiopic}` should match U+01E7E0 (`𞟠`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js: rc = 3, run time = 0.215889
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Katakana}` should match U+01AFF0 (`𚿰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js:70:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js: rc = 3, run time = 0.099774
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Grapheme_Extend}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js:366:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js: rc = 3, run time = 0.235924
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Mark}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js:657:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js: rc = 3, run time = 0.165086
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Unassigned}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js:699:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js: rc = 3, run time = 0.227542
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Letter}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js:1040:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Uppercase.js: rc = 3, run time = 0.145949
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Uppercase}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Uppercase.js:1328:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Uppercase.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js: rc = 3, run time = 0.146537
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_NFKC_Casefolded}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js:1696:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js: rc = 3, run time = 0.300645
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Kannada}` should match U+000CDD (`ೝ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js:94:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Dash.js: rc = 3, run time = 0.188279
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Dash}` should match U+002E5D (`⹝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Dash.js:80:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Dash.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js: rc = 3, run time = 0.223275
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Glagolitic}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js:65:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js | (args: "") [0.2 s]
## non262/Date/reset-time-zone-cache-same-offset.js: rc = 3, run time = 0.05812
/builddir/firefox-91.7.1/js/src/tests/non262/Date/reset-time-zone-cache-same-offset.js:25:17 Error: Assertion failed: got "8/14/2018, 1:00:00 AM GMT+1", expected "8/14/2018, 12:00:00 AM UTC"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/reset-time-zone-cache-same-offset.js:25:17
TEST-UNEXPECTED-FAIL | non262/Date/reset-time-zone-cache-same-offset.js | (args: "") [0.1 s]
## non262/Date/time-zone-path.js: rc = 3, run time = 0.049006
/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zone-path.js:15:9 Error: Assertion failed: got "Central European Summer Time", expected "Eastern European Summer Time"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zone-path.js:15:9
TEST-UNEXPECTED-FAIL | non262/Date/time-zone-path.js | (args: "") [0.0 s]
## non262/Date/time-zones-historic.js: rc = 3, run time = 0.027728
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:146:17 Error: Assertion failed: got "Thu Jan 01 1970 01:00:00 GMT+0100", expected "Thu Jan 01 1970 00:00:00 GMT+0100"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-historic.js:4:11
TEST-UNEXPECTED-FAIL | non262/Date/time-zones-historic.js | (args: "") [0.0 s]
## non262/Date/toString-localized.js: rc = 3, run time = 0.053334
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:160:21 Error: Assertion failed: got "CEST", expected "Central European Summer Time"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/toString-localized.js:5:11
TEST-UNEXPECTED-FAIL | non262/Date/toString-localized.js | (args: "") [0.1 s]
## non262/Date/time-zones-imported.js: rc = 3, run time = 0.03391
/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-imported.js:7:13 Error: Assertion failed: got 63420270000, expected 63506670000: valueOf()[86400000]
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-imported.js:370:11
TEST-UNEXPECTED-FAIL | non262/Date/time-zones-imported.js | (args: "") [0.0 s]
## non262/Date/toString-localized-posix.js: rc = 3, run time = 0.031948
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:160:21 Error: Assertion failed: got "PDT", expected "Pacific Daylight Time"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/toString-localized-posix.js:8:11
TEST-UNEXPECTED-FAIL | non262/Date/toString-localized-posix.js | (args: "") [0.0 s]
## non262/Intl/available-locales-supported.js: rc = 3, run time = 0.054817
/builddir/firefox-91.7.1/js/src/tests/shell.js:143:13 Error: Exception thrown at index 26: Error: Assertion failed: got "en-US-posix", expected "en-US-POSIX": mismatch at element 26
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-supported.js:22:16
TEST-UNEXPECTED-FAIL | non262/Intl/available-locales-supported.js | (args: "") [0.1 s]
## non262/Intl/available-locales-resolved.js: rc = 3, run time = 0.039822
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-resolved.js:36:13 Error: Assertion failed: got "en-US", expected "en-US-POSIX"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-resolved.js:30:22
TEST-UNEXPECTED-FAIL | non262/Intl/available-locales-resolved.js | (args: "") [0.0 s]
## non262/Intl/Date/toLocaleTimeString_timeZone.js: rc = 3, run time = 0.054294
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleTimeString_timeZone.js:39:13 Error: Assertion failed: got "\u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 20:00:00", expected "\u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 \u4E0B\u53488:00:00"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleTimeString_timeZone.js:39:13
TEST-UNEXPECTED-FAIL | non262/Intl/Date/toLocaleTimeString_timeZone.js | (args: "") [0.1 s]
## non262/Intl/Date/toLocaleString_timeZone.js: rc = 3, run time = 0.048695
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleString_timeZone.js:39:13 Error: Assertion failed: got "2012/12/6 \u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 20:00:00", expected "2012/12/6 \u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 \u4E0B\u53488:00:00"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleString_timeZone.js:39:13
TEST-UNEXPECTED-FAIL | non262/Intl/Date/toLocaleString_timeZone.js | (args: "") [0.0 s]
## non262/Intl/Locale/likely-subtags-generated.js: rc = 3, run time = 0.064707
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Locale/likely-subtags-generated.js:3453:13 Error: Assertion failed: got "hnj-Hmnp-US", expected "hnj-Hmng-LA"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Locale/likely-subtags-generated.js:3453:13
TEST-UNEXPECTED-FAIL | non262/Intl/Locale/likely-subtags-generated.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/tz-environment-variable.js: rc = 3, run time = 0.048902
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js:62:17 Error: Assertion failed: got "EST5EDT", expected "CST6CDT"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js:60:15
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/tz-environment-variable.js | (args: "") [0.0 s]
## non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js: rc = 3, run time = 0.055889
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/shell.js:32:17 Error: Assertion failed: got " \u251CF14: ", expected " (Fractional Second: ": value mismatch at 3
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js:55:14
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/day-period-hour-cycle.js: rc = 3, run time = 0.106125
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/day-period-hour-cycle.js:93:17 Error: Assertion failed: got "0 \u251CAM/PM: noon\u2524", expected "0 (AM/PM: noon)": locale=en, date=Tue Jan 01 2019 12:00:00 GMT-0800 (PST), options={"dayPeriod":"short","minute":"numeric"}
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/day-period-hour-cycle.js:90:33
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/day-period-hour-cycle.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/related-year.js: rc = 3, run time = 0.06369
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/shell.js:29:13 Error: Assertion failed: got 5, expected 6: parts count mismatch
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/related-year.js:178:34
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/related-year.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/japanese-gannen-year.js: rc = 3, run time = 0.045667
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/japanese-gannen-year.js:11:9 Error: Assertion failed: got "S64/1/7", expected "\u662D\u548C64\u5E741\u67087\u65E5"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/japanese-gannen-year.js:11:9
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/japanese-gannen-year.js | (args: "") [0.0 s]
make[2]: *** [Makefile:61: check-jstests] Error 1
make[2]: Leaving directory '/builddir/firefox-91.7.1/js/src/js/src'
make[1]: *** [/builddir/firefox-91.7.1/config/recurse.mk:99: js/src/check] Error 2
make[1]: Leaving directory '/builddir/firefox-91.7.1/js/src'
make: *** [/builddir/firefox-91.7.1/config/recurse.mk:34: check] Error 2
```

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (45 preceding siblings ...)
  2022-04-03  7:14 ` subnut
@ 2022-04-03  7:15 ` subnut
  2022-04-03  7:18 ` subnut
                   ` (21 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  7:15 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086792538

Comment:
In case anybody is interested, `make check-jstests` fail with the following errors -  
(only the error-related output is shown here)

```
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js: rc = 3, run time = 0.106024
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Modifier_Symbol}` should match U+000888 (`࢈`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js:122:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Symbol.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js: rc = 3, run time = 0.164799
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Terminal_Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js:250:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js: rc = 3, run time = 0.264442
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Han}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js:90:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js: rc = 3, run time = 0.139439
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Casefolded}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js:1270:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casefolded.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js: rc = 3, run time = 0.12818
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Telugu}` should match U+000C3C (`఼`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js:84:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Telugu.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Diacritic.js: rc = 3, run time = 0.162401
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Diacritic}` should match U+000898 (`࢘`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Diacritic.js:394:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Diacritic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js: rc = 3, run time = 0.221201
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Decimal_Number}` should match U+016AC0 (`𖫀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js:197:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js: rc = 3, run time = 0.17401
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Lowercase_Letter}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js:1352:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js: rc = 3, run time = 0.129365
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Default_Ignorable_Code_Point}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js:75:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Default_Ignorable_Code_Point.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js: rc = 3, run time = 0.181653
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Script=Common}` should match U+016FE2 (`𖿢`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js:195:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js: rc = 3, run time = 0.207954
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Number}` should match U+016AC0 (`𖫀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js:328:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js: rc = 3, run time = 0.274961
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Hiragana}` should match U+01B11F (`𛄟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js:61:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js: rc = 3, run time = 0.354468
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Ahom}` should match U+011740 (`𑝀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js:56:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ahom.js | (args: "") [0.4 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js: rc = 3, run time = 0.159395
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Open_Punctuation}` should match U+002E55 (`⹕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js:211:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Open_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js: rc = 3, run time = 0.16726
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Kaithi}` should match U+0110C2 (`𑃂`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js:55:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Kaithi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Ideographic.js: rc = 3, run time = 0.139965
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Ideographic}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Ideographic.js:79:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Ideographic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js: rc = 3, run time = 0.13528
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Tagalog}` should match U+00170D (`ᜍ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Tagalog.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js: rc = 3, run time = 0.214665
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{ID_Continue}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js:1502:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js: rc = 3, run time = 0.155039
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Syriac}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js:74:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Syriac.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js: rc = 3, run time = 0.137076
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Arabic}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js:166:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js: rc = 3, run time = 0.150106
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Latin}` should match U+00A7C0 (`Ꟁ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js: rc = 3, run time = 0.164577
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Titlecased}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js:1278:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Titlecased.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js: rc = 3, run time = 0.164939
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Balinese}` should match U+001B4C (`ᭌ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Balinese.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js: rc = 3, run time = 0.159875
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js:447:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js: rc = 3, run time = 0.222694
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Brahmi}` should match U+011070 (`𑁰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Brahmi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js: rc = 3, run time = 0.285617
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Soft_Dotted}` should match U+01DF1A (`𝼚`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js:104:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js: rc = 3, run time = 0.192375
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{XID_Continue}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js:1516:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js: rc = 3, run time = 0.141643
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Bidi_Mirrored}` should match U+002E55 (`⹕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js:268:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Bidi_Mirrored.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js: rc = 3, run time = 0.172671
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Close_Punctuation}` should match U+002E56 (`⹖`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js:206:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Close_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js: rc = 3, run time = 0.122727
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Lowercased}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js:1244:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Lowercased.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js: rc = 3, run time = 0.179568
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Sentence_Terminal}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js:194:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js: rc = 3, run time = 0.205027
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Modifier_Letter}` should match U+0008C9 (`ࣉ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js:184:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js: rc = 3, run time = 0.201829
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Adlam}` should match U+00061F (`؟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js:59:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Adlam.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js: rc = 3, run time = 0.249364
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Ethiopic}` should match U+01E7E0 (`𞟠`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Ethiopic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js: rc = 3, run time = 0.214289
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Katakana}` should match U+01AFF0 (`𚿰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js:82:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Assigned.js: rc = 3, run time = 0.152038
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Assigned}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Assigned.js:1390:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Assigned.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js: rc = 3, run time = 0.097881
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Inherited}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js:118:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Inherited.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js: rc = 3, run time = 0.179185
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Uppercase_Letter}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js:1338:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Uppercase_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js: rc = 3, run time = 0.152964
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Punctuation}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js:424:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js: rc = 3, run time = 0.129801
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Nonspacing_Mark}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js:349:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Cased.js: rc = 3, run time = 0.158703
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Cased}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Cased.js:319:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Cased.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js: rc = 3, run time = 0.113554
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Kannada}` should match U+000CDD (`ೝ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js:78:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js: rc = 3, run time = 0.192906
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Takri}` should match U+0116B9 (`𑚹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js:58:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Takri.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js: rc = 3, run time = 0.256605
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Ahom}` should match U+011740 (`𑝀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js:56:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Ahom.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js: rc = 3, run time = 0.12132
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Mongolian}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js:66:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Mongolian.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js: rc = 3, run time = 0.167459
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Casemapped}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js:290:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Casemapped.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js: rc = 3, run time = 0.192688
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Symbol}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js:426:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js: rc = 3, run time = 0.26271
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Unified_Ideograph}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js:72:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js: rc = 3, run time = 0.24799
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Dash_Punctuation}` should match U+002E5D (`⹝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js:97:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Dash_Punctuation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js: rc = 3, run time = 0.179697
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Telugu}` should match U+000C3C (`఼`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js:75:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Telugu.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js: rc = 3, run time = 0.151959
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Nko}` should match U+00060C (`،`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Nko.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js: rc = 3, run time = 0.180346
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Balinese}` should match U+001B4C (`ᭌ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Balinese.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js: rc = 3, run time = 0.262116
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Takri}` should match U+0116B9 (`𑚹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Takri.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Lowercase.js: rc = 3, run time = 0.19688
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Lowercase}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Lowercase.js:1346:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Lowercase.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js: rc = 3, run time = 0.261015
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Hiragana}` should match U+01B11F (`𛄟`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js:84:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js: rc = 3, run time = 0.159222
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Cased_Letter}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js:326:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js: rc = 3, run time = 0.114022
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Other}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js:703:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js: rc = 3, run time = 0.158188
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Currency_Symbol}` should match U+0020C0 (`⃀`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js:103:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Currency_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js: rc = 3, run time = 0.117543
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Script_Extensions=Common}` should match U+00FD3E (`﴾`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js:170:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js: rc = 3, run time = 0.149114
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Variation_Selector}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js:46:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Variation_Selector.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js: rc = 3, run time = 0.267383
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Grapheme_Base}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js:1710:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js: rc = 3, run time = 0.20066
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Symbol}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js:520:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Extender.js: rc = 3, run time = 0.281274
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Extender}` should match U+010781 (`𐞁`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Extender.js:106:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Extender.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js: rc = 3, run time = 0.288518
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Kaithi}` should match U+0110C2 (`𑃂`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js:59:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kaithi.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js: rc = 3, run time = 0.261371
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Alphabetic}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js:1432:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js: rc = 3, run time = 0.137503
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Tagalog}` should match U+00170D (`ᜍ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js:55:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Tagalog.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js: rc = 3, run time = 0.132371
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_Uppercased}` should match U+002C5F (`ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js:1280:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_Uppercased.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js: rc = 3, run time = 0.143618
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Glagolitic}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js:74:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Glagolitic.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji.js: rc = 3, run time = 0.142026
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji.js:341:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js: rc = 3, run time = 0.180663
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Inherited}` should match U+001AC1 (`᫁`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js:98:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Inherited.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js: rc = 3, run time = 0.133917
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Mongolian}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js:64:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Mongolian.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js: rc = 3, run time = 0.328583
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Han}` should match U+009FFD (`鿽`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js:124:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/ID_Start.js: rc = 3, run time = 0.274168
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{ID_Start}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/ID_Start.js:1286:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/ID_Start.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js: rc = 3, run time = 0.168505
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji_Presentation}` should match U+01F979 (`🥹`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js:204:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js: rc = 3, run time = 0.176303
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Arabic}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js:156:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/XID_Start.js: rc = 3, run time = 0.220854
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{XID_Start}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/XID_Start.js:1300:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/XID_Start.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js: rc = 3, run time = 0.245545
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Canadian_Aboriginal}` should match U+011AB0 (`𑪰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Canadian_Aboriginal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js: rc = 3, run time = 0.195247
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Latin}` should match U+00A7C0 (`Ꟁ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js:132:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js: rc = 3, run time = 0.283973
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Letter}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js:1306:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js: rc = 3, run time = 0.158409
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Format}` should match U+000890 (`࢐`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js:102:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js: rc = 3, run time = 0.209329
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Canadian_Aboriginal}` should match U+011AB0 (`𑪰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js:54:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Canadian_Aboriginal.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js: rc = 3, run time = 0.21263
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Brahmi}` should match U+011070 (`𑁰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js:57:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Brahmi.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js: rc = 3, run time = 0.225571
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Emoji_Modifier_Base}` should match U+01FAC3 (`🫃`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js:118:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js: rc = 3, run time = 0.107761
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Case_Ignorable}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js:432:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js: rc = 3, run time = 0.211705
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Spacing_Mark}` should match U+001715 (`᜕`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js:412:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js: rc = 3, run time = 0.232658
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Ethiopic}` should match U+01E7E0 (`𞟠`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js:116:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Ethiopic.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js: rc = 3, run time = 0.215889
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Katakana}` should match U+01AFF0 (`𚿰`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js:70:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js: rc = 3, run time = 0.099774
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{Grapheme_Extend}` should match U+001734 (`᜴`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js:366:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js: rc = 3, run time = 0.235924
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Mark}` should match U+001DFA (`᷺`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js:657:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js: rc = 3, run time = 0.165086
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\p{General_Category=Unassigned}` should match U+00061D (`؝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js:699:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js: rc = 3, run time = 0.227542
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{General_Category=Other_Letter}` should match U+0008B5 (`ࢵ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js:1040:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Uppercase.js: rc = 3, run time = 0.145949
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Uppercase}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Uppercase.js:1328:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Uppercase.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js: rc = 3, run time = 0.146537
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Changes_When_NFKC_Casefolded}` should match U+00180F (`᠏`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js:1696:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js | (args: "") [0.1 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js: rc = 3, run time = 0.300645
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script_Extensions=Kannada}` should match U+000CDD (`ೝ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js:94:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js | (args: "") [0.3 s]
## test262/built-ins/RegExp/property-escapes/generated/Dash.js: rc = 3, run time = 0.188279
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Dash}` should match U+002E5D (`⹝`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Dash.js:80:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Dash.js | (args: "") [0.2 s]
## test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js: rc = 3, run time = 0.223275
/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13 uncaught exception: Test262Error: `\P{Script=Glagolitic}` should match U+002C2F (`Ⱟ`)
Stack:
  testPropertyEscapes@/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/shell.js:39:13
  @/builddir/firefox-91.7.1/js/src/tests/test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js:65:20
TEST-UNEXPECTED-FAIL | test262/built-ins/RegExp/property-escapes/generated/Script_-_Glagolitic.js | (args: "") [0.2 s]
## non262/Date/reset-time-zone-cache-same-offset.js: rc = 3, run time = 0.05812
/builddir/firefox-91.7.1/js/src/tests/non262/Date/reset-time-zone-cache-same-offset.js:25:17 Error: Assertion failed: got "8/14/2018, 1:00:00 AM GMT+1", expected "8/14/2018, 12:00:00 AM UTC"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/reset-time-zone-cache-same-offset.js:25:17
TEST-UNEXPECTED-FAIL | non262/Date/reset-time-zone-cache-same-offset.js | (args: "") [0.1 s]
## non262/Date/time-zone-path.js: rc = 3, run time = 0.049006
/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zone-path.js:15:9 Error: Assertion failed: got "Central European Summer Time", expected "Eastern European Summer Time"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zone-path.js:15:9
TEST-UNEXPECTED-FAIL | non262/Date/time-zone-path.js | (args: "") [0.0 s]
## non262/Date/time-zones-historic.js: rc = 3, run time = 0.027728
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:146:17 Error: Assertion failed: got "Thu Jan 01 1970 01:00:00 GMT+0100", expected "Thu Jan 01 1970 00:00:00 GMT+0100"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-historic.js:4:11
TEST-UNEXPECTED-FAIL | non262/Date/time-zones-historic.js | (args: "") [0.0 s]
## non262/Date/toString-localized.js: rc = 3, run time = 0.053334
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:160:21 Error: Assertion failed: got "CEST", expected "Central European Summer Time"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/toString-localized.js:5:11
TEST-UNEXPECTED-FAIL | non262/Date/toString-localized.js | (args: "") [0.1 s]
## non262/Date/time-zones-imported.js: rc = 3, run time = 0.03391
/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-imported.js:7:13 Error: Assertion failed: got 63420270000, expected 63506670000: valueOf()[86400000]
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/time-zones-imported.js:370:11
TEST-UNEXPECTED-FAIL | non262/Date/time-zones-imported.js | (args: "") [0.0 s]
## non262/Date/toString-localized-posix.js: rc = 3, run time = 0.031948
/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:160:21 Error: Assertion failed: got "PDT", expected "Pacific Daylight Time"
Stack:
  inTimeZone@/builddir/firefox-91.7.1/js/src/tests/non262/Date/shell.js:97:24
  @/builddir/firefox-91.7.1/js/src/tests/non262/Date/toString-localized-posix.js:8:11
TEST-UNEXPECTED-FAIL | non262/Date/toString-localized-posix.js | (args: "") [0.0 s]
## non262/Intl/available-locales-supported.js: rc = 3, run time = 0.054817
/builddir/firefox-91.7.1/js/src/tests/shell.js:143:13 Error: Exception thrown at index 26: Error: Assertion failed: got "en-US-posix", expected "en-US-POSIX": mismatch at element 26
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-supported.js:22:16
TEST-UNEXPECTED-FAIL | non262/Intl/available-locales-supported.js | (args: "") [0.1 s]
## non262/Intl/available-locales-resolved.js: rc = 3, run time = 0.039822
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-resolved.js:36:13 Error: Assertion failed: got "en-US", expected "en-US-POSIX"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/available-locales-resolved.js:30:22
TEST-UNEXPECTED-FAIL | non262/Intl/available-locales-resolved.js | (args: "") [0.0 s]
## non262/Intl/Date/toLocaleTimeString_timeZone.js: rc = 3, run time = 0.054294
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleTimeString_timeZone.js:39:13 Error: Assertion failed: got "\u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 20:00:00", expected "\u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 \u4E0B\u53488:00:00"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleTimeString_timeZone.js:39:13
TEST-UNEXPECTED-FAIL | non262/Intl/Date/toLocaleTimeString_timeZone.js | (args: "") [0.1 s]
## non262/Intl/Date/toLocaleString_timeZone.js: rc = 3, run time = 0.048695
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleString_timeZone.js:39:13 Error: Assertion failed: got "2012/12/6 \u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 20:00:00", expected "2012/12/6 \u4E2D\u56FD\u6807\u51C6\u65F6\u95F4 \u4E0B\u53488:00:00"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Date/toLocaleString_timeZone.js:39:13
TEST-UNEXPECTED-FAIL | non262/Intl/Date/toLocaleString_timeZone.js | (args: "") [0.0 s]
## non262/Intl/Locale/likely-subtags-generated.js: rc = 3, run time = 0.064707
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Locale/likely-subtags-generated.js:3453:13 Error: Assertion failed: got "hnj-Hmnp-US", expected "hnj-Hmng-LA"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/Locale/likely-subtags-generated.js:3453:13
TEST-UNEXPECTED-FAIL | non262/Intl/Locale/likely-subtags-generated.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/tz-environment-variable.js: rc = 3, run time = 0.048902
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js:62:17 Error: Assertion failed: got "EST5EDT", expected "CST6CDT"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js:60:15
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/tz-environment-variable.js | (args: "") [0.0 s]
## non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js: rc = 3, run time = 0.055889
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/shell.js:32:17 Error: Assertion failed: got " \u251CF14: ", expected " (Fractional Second: ": value mismatch at 3
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js:55:14
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/day-period-hour-cycle.js: rc = 3, run time = 0.106125
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/day-period-hour-cycle.js:93:17 Error: Assertion failed: got "0 \u251CAM/PM: noon\u2524", expected "0 (AM/PM: noon)": locale=en, date=Tue Jan 01 2019 12:00:00 GMT-0800 (PST), options={"dayPeriod":"short","minute":"numeric"}
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/day-period-hour-cycle.js:90:33
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/day-period-hour-cycle.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/related-year.js: rc = 3, run time = 0.06369
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/shell.js:29:13 Error: Assertion failed: got 5, expected 6: parts count mismatch
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/related-year.js:178:34
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/related-year.js | (args: "") [0.1 s]
## non262/Intl/DateTimeFormat/japanese-gannen-year.js: rc = 3, run time = 0.045667
/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/japanese-gannen-year.js:11:9 Error: Assertion failed: got "S64/1/7", expected "\u662D\u548C64\u5E741\u67087\u65E5"
Stack:
  @/builddir/firefox-91.7.1/js/src/tests/non262/Intl/DateTimeFormat/japanese-gannen-year.js:11:9
TEST-UNEXPECTED-FAIL | non262/Intl/DateTimeFormat/japanese-gannen-year.js | (args: "") [0.0 s]
make[2]: *** [Makefile:61: check-jstests] Error 1
make[2]: Leaving directory '/builddir/firefox-91.7.1/js/src/js/src'
make[1]: *** [/builddir/firefox-91.7.1/config/recurse.mk:99: js/src/check] Error 2
make[1]: Leaving directory '/builddir/firefox-91.7.1/js/src'
make: *** [/builddir/firefox-91.7.1/config/recurse.mk:34: check] Error 2
```

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (46 preceding siblings ...)
  2022-04-03  7:15 ` subnut
@ 2022-04-03  7:18 ` subnut
  2022-04-03  7:21 ` [PR PATCH] [Updated] " subnut
                   ` (20 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  7:18 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086793055

Comment:
I have not added `check-jstests` to `make_check_target`, because it fails with a lot of errors that we can do nothing about.

To see what those errors are, see the hidden comment just above this one.

I have hidden that comment to reduce everybody's scrolling time :joy: 

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (47 preceding siblings ...)
  2022-04-03  7:18 ` subnut
@ 2022-04-03  7:21 ` subnut
  2022-04-03  8:29 ` subnut
                   ` (19 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  7:21 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From dc7cf1eb8737a2bb6e18b279ce7db9b94239b0f8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e9fc1f9156ff
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..8604929f67a0
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,74 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (48 preceding siblings ...)
  2022-04-03  7:21 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03  8:29 ` subnut
  2022-04-03  8:33 ` subnut
                   ` (18 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  8:29 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From 06cd76e83ce843f864c2dd11af5373425b967068 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e9fc1f9156ff
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..8a4b5c56cca5
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,89 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+# can't include ppc jit yet, interactive interpreter segfaults
+# (i guess because of lack of ion?)
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+		export 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="-x sunspider/check-date-format-tofte.js"
+	fi
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (49 preceding siblings ...)
  2022-04-03  8:29 ` subnut
@ 2022-04-03  8:33 ` subnut
  2022-04-03  8:59 ` subnut
                   ` (17 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  8:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From f8a6c8ea5b7d799713c165eea8db8c11f47430b1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-check.patch b/srcpkgs/mozjs91/patches/fix-check.patch
new file mode 100644
index 000000000000..e9fc1f9156ff
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/fix-check.patch
@@ -0,0 +1,9 @@
+This is not a VCS checkout
+
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -41,4 +41,2 @@
+ 
+-check-js-msg::
+-	(cd $(topsrcdir) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py);
+ 
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..6a82a6a06d1f
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,88 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+pre_check() {
+	# Fix the tests that are trivial to fix, else skip the test
+	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
+		export 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="-x sunspider/check-date-format-tofte.js"
+	fi
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (50 preceding siblings ...)
  2022-04-03  8:33 ` subnut
@ 2022-04-03  8:59 ` subnut
  2022-04-03 10:52 ` subnut
                   ` (16 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03  8:59 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

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

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

From f269e78e66e258c59c24df9197a33399c4352b41 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/015-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/015-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/mozjs91/patches/016-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/016-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/016-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/mozjs91/patches/017-disable-lto.patch b/srcpkgs/mozjs91/patches/017-disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/017-disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..6a82a6a06d1f
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,88 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.so
+}
+
+pre_check() {
+	# Fix the tests that are trivial to fix, else skip the test
+	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
+		export 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="-x sunspider/check-date-format-tofte.js"
+	fi
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (51 preceding siblings ...)
  2022-04-03  8:59 ` subnut
@ 2022-04-03 10:52 ` subnut
  2022-04-03 10:58 ` subnut
                   ` (15 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 10:52 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

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

From 4ce4b84bbbd497f4c5d9d86d89986824d66f3589 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/files/disable-lto.patch b/srcpkgs/mozjs91/files/disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/files/disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..c0631421c5e3
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,97 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <q66@chimera-linux.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+post_extract() {
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		patch -p1 -i "${FILESDIR}/disable-lto.patch"
+	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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (52 preceding siblings ...)
  2022-04-03 10:52 ` subnut
@ 2022-04-03 10:58 ` subnut
  2022-04-03 11:09 ` [PR PATCH] [Updated] " subnut
                   ` (14 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 10:58 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086836889

Comment:
Oops. Forgot to change the email.

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (53 preceding siblings ...)
  2022-04-03 10:58 ` subnut
@ 2022-04-03 11:09 ` subnut
  2022-04-03 11:09 ` subnut
                   ` (13 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 11:09 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

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

From 5ba5d9b8f609a0c43b4dbc2fd47267dafc580ced Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/files/disable-lto.patch b/srcpkgs/mozjs91/files/disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/files/disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..fe488b55f550
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,97 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="Mozilla JavaScript interpreter and library (91.x)"
+maintainer="q66 <daniel@octaforge.org>"
+license="MPL-2.0"
+homepage="https://www.mozilla.org/firefox"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+post_extract() {
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		patch -p1 -i "${FILESDIR}/disable-lto.patch"
+	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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (54 preceding siblings ...)
  2022-04-03 11:09 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03 11:09 ` subnut
  2022-04-03 11:47 ` subnut
                   ` (12 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 11:09 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

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

From 52cbe908986a84bd6d20ebc3ae03b1b3c635bfde Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/files/disable-lto.patch b/srcpkgs/mozjs91/files/disable-lto.patch
new file mode 100644
index 000000000000..bb00c282777e
--- /dev/null
+++ b/srcpkgs/mozjs91/files/disable-lto.patch
@@ -0,0 +1,28 @@
+Disable LTO, otherwise compilation of `jsrust` crate 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
+
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -64,19 +64,6 @@ 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)
+-ifndef DEVELOPER_OPTIONS
+-ifndef MOZ_DEBUG_RUST
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
+-ifndef MOZ_LTO_RUST_CROSS
+-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+ 
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..fa7feb91c5c3
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,97 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="SpiderMonkey JavaScript interpreter and library (91.x)"
+maintainer="q66 <daniel@octaforge.org>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+post_extract() {
+	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
+		patch -p1 -i "${FILESDIR}/disable-lto.patch"
+	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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (55 preceding siblings ...)
  2022-04-03 11:09 ` subnut
@ 2022-04-03 11:47 ` subnut
  2022-04-03 14:01 ` q66
                   ` (11 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 11:47 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086847921

Comment:
Requesting @q66 for review

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (56 preceding siblings ...)
  2022-04-03 11:47 ` subnut
@ 2022-04-03 14:01 ` q66
  2022-04-03 14:02 ` subnut
                   ` (10 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: q66 @ 2022-04-03 14:01 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086875673

Comment:
LTO shouldn't be disabled unconditionally, only where it fails 

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (57 preceding siblings ...)
  2022-04-03 14:01 ` q66
@ 2022-04-03 14:02 ` subnut
  2022-04-03 14:24 ` subnut
                   ` (9 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 14:02 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086875940

Comment:
> LTO shouldn't be disabled unconditionally, only where it fails

@q66 How?

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (58 preceding siblings ...)
  2022-04-03 14:02 ` subnut
@ 2022-04-03 14:24 ` subnut
  2022-04-03 15:10 ` [PR PATCH] [Updated] " subnut
                   ` (8 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 14:24 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086875940

Comment:
> LTO shouldn't be disabled unconditionally, only where it fails

@q66 How?

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (59 preceding siblings ...)
  2022-04-03 14:24 ` subnut
@ 2022-04-03 15:10 ` subnut
  2022-04-03 15:14 ` subnut
                   ` (7 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 15:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

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

From 4adca37946edcf519d0744e807e9b790f4df4e29 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/i686-disable-lto.patch b/srcpkgs/mozjs91/patches/i686-disable-lto.patch
new file mode 100644
index 000000000000..4b720da4084b
--- /dev/null
+++ b/srcpkgs/mozjs91/patches/i686-disable-lto.patch
@@ -0,0 +1,24 @@
+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
+
+--- 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 (i686,$(XBPS_TARGET_MACHINE))
+ 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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..e56e252b2078
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,91 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="SpiderMonkey JavaScript interpreter and library (91.x)"
+maintainer="q66 <daniel@octaforge.org>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+LDFLAGS="-Wl,-z,stack-size=1048576"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (60 preceding siblings ...)
  2022-04-03 15:10 ` [PR PATCH] [Updated] " subnut
@ 2022-04-03 15:14 ` subnut
  2022-04-03 15:24 ` [PR PATCH] [Updated] " subnut
                   ` (6 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 15:14 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086889227

Comment:
@q66 Done. Please review.

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

* Re: [PR PATCH] [Updated] New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (61 preceding siblings ...)
  2022-04-03 15:14 ` subnut
@ 2022-04-03 15:24 ` subnut
  2022-04-10 18:54 ` subnut
                   ` (5 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-03 15:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/subnut/void-packages mozjs91-91.5.0
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

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

From 406636dc674ac3b1755bbffd1cd550b4012bc772 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 20 Mar 2022 17:09:45 +0530
Subject: [PATCH] New package: mozjs91-91.7.1

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

diff --git a/common/shlibs b/common/shlibs
index 7079375524fc..8dd7af450997 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3497,6 +3497,7 @@ 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-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
 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1
 libgtksourceview-5.so.0 gtksourceview5-5.2.0_1
diff --git a/srcpkgs/mozjs91-devel b/srcpkgs/mozjs91-devel
new file mode 120000
index 000000000000..61f05e82a26f
--- /dev/null
+++ b/srcpkgs/mozjs91-devel
@@ -0,0 +1 @@
+mozjs91
\ No newline at end of file
diff --git a/srcpkgs/mozjs91/patches/001-fix-soname.patch b/srcpkgs/mozjs91/patches/001-fix-soname.patch
new file mode 100644
index 000000000000..a319d9e975ef
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/002-copy-headers.patch b/srcpkgs/mozjs91/patches/002-copy-headers.patch
new file mode 100644
index 000000000000..aafe1aa84bd3
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/003-tests-timeout.patch b/srcpkgs/mozjs91/patches/003-tests-timeout.patch
new file mode 100644
index 000000000000..c86cca403deb
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/004-icu-sources-data-py-decouple.patch b/srcpkgs/mozjs91/patches/004-icu-sources-data-py-decouple.patch
new file mode 100644
index 000000000000..8572c21fd4ec
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch b/srcpkgs/mozjs91/patches/005-icu-sources-data-write-command-stderr.patch
new file mode 100644
index 000000000000..84684250ce4c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/006-emitter.patch b/srcpkgs/mozjs91/patches/006-emitter.patch
new file mode 100644
index 000000000000..556bebd257ca
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/007-tests-use-native-temporarydirectory.patch b/srcpkgs/mozjs91/patches/007-tests-use-native-temporarydirectory.patch
new file mode 100644
index 000000000000..054685c1eee2
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/008-init-patch.patch b/srcpkgs/mozjs91/patches/008-init-patch.patch
new file mode 100644
index 000000000000..1954a55bf369
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/009-sloppy-m4-detection.patch b/srcpkgs/mozjs91/patches/009-sloppy-m4-detection.patch
new file mode 100644
index 000000000000..10b8b16ea7dc
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/011-failing-tests-ppc64-s390x.patch b/srcpkgs/mozjs91/patches/011-failing-tests-ppc64-s390x.patch
new file mode 100644
index 000000000000..5c286647325c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/012-fix-musl.patch b/srcpkgs/mozjs91/patches/012-fix-musl.patch
new file mode 100644
index 000000000000..814912633217
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/013-disable-spidermonkey-jslint.patch b/srcpkgs/mozjs91/patches/013-disable-spidermonkey-jslint.patch
new file mode 100644
index 000000000000..93e8c83f9337
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/014-rust-target.patch b/srcpkgs/mozjs91/patches/014-rust-target.patch
new file mode 100644
index 000000000000..4d8918a2a54c
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/015-drop-rustc-validation.patch b/srcpkgs/mozjs91/patches/015-drop-rustc-validation.patch
new file mode 100644
index 000000000000..e2b340cd060e
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/017-no-lto-readelf.patch b/srcpkgs/mozjs91/patches/017-no-lto-readelf.patch
new file mode 100644
index 000000000000..24075c591ff4
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/MOZ_NO_RUST_LTO.patch b/srcpkgs/mozjs91/patches/MOZ_NO_RUST_LTO.patch
new file mode 100644
index 000000000000..4a9b0b42a575
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/patches/fix-i386-fdlibm.patch b/srcpkgs/mozjs91/patches/fix-i386-fdlibm.patch
new file mode 100644
index 000000000000..831e5e03678d
--- /dev/null
+++ b/srcpkgs/mozjs91/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/mozjs91/template b/srcpkgs/mozjs91/template
new file mode 100644
index 000000000000..d9cc756370dd
--- /dev/null
+++ b/srcpkgs/mozjs91/template
@@ -0,0 +1,99 @@
+# Template file for 'mozjs91'
+pkgname=mozjs91
+version=91.7.1
+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
+ awk rust cargo llvm12 clang"
+makedepends="icu-devel libffi-devel nspr-devel python3-devel readline-devel
+ zlib-devel rust-std linux-headers"
+checkdepends=python3
+short_desc="SpiderMonkey JavaScript interpreter and library (91.x)"
+maintainer="q66 <daniel@octaforge.org>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=57494a445e72f7eacb0bb870a3a79cde3c2143e234873c0c3e269df1d4742c92
+
+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-91.so \
+	   "${DESTDIR}"/usr/lib/libmozjs-91.so.0
+	ln -rs "${DESTDIR}"/usr/lib/libmozjs-91.so.0 \
+	       "${DESTDIR}"/usr/lib/libmozjs-91.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
+}
+
+mozjs91-devel_package() {
+	depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/js91-config
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (62 preceding siblings ...)
  2022-04-03 15:24 ` [PR PATCH] [Updated] " subnut
@ 2022-04-10 18:54 ` subnut
  2022-04-10 18:55 ` subnut
                   ` (4 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-10 18:54 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1094347918

Comment:
Pinging @q66 for review

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (63 preceding siblings ...)
  2022-04-10 18:54 ` subnut
@ 2022-04-10 18:55 ` subnut
  2022-05-17  6:26 ` sug0
                   ` (3 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-04-10 18:55 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086836889

Comment:
Oops. Forgot to change the email.

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (64 preceding siblings ...)
  2022-04-10 18:55 ` subnut
@ 2022-05-17  6:26 ` sug0
  2022-05-17  6:31 ` subnut
                   ` (2 subsequent siblings)
  68 siblings, 0 replies; 70+ messages in thread
From: sug0 @ 2022-05-17  6:26 UTC (permalink / raw)
  To: ml

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

New comment by sug0 on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1128464102

Comment:
Any reason why this PR is dead? @subnut @q66 

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (65 preceding siblings ...)
  2022-05-17  6:26 ` sug0
@ 2022-05-17  6:31 ` subnut
  2022-06-10  2:51 ` subnut
  2022-06-11 19:15 ` [PR PATCH] [Merged]: " paper42
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-05-17  6:31 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1128467154

Comment:
@sug0 :shrug:  

I've done everything I've been asked to do. The delay is in the reviewers' end.

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

* Re: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (66 preceding siblings ...)
  2022-05-17  6:31 ` subnut
@ 2022-06-10  2:51 ` subnut
  2022-06-11 19:15 ` [PR PATCH] [Merged]: " paper42
  68 siblings, 0 replies; 70+ messages in thread
From: subnut @ 2022-06-10  2:51 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36241#issuecomment-1086793055

Comment:
I have not added `check-jstests` to `make_check_target`, because it fails with a lot of errors that we can do nothing about.

To see what those errors are, see the hidden comment just above this one.

I have hidden that comment to reduce everybody's scrolling time.

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

* Re: [PR PATCH] [Merged]: New package: mozjs91-91.7.1
  2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
                   ` (67 preceding siblings ...)
  2022-06-10  2:51 ` subnut
@ 2022-06-11 19:15 ` paper42
  68 siblings, 0 replies; 70+ messages in thread
From: paper42 @ 2022-06-11 19:15 UTC (permalink / raw)
  To: ml

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

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

New package: mozjs91-91.7.1
https://github.com/void-linux/void-packages/pull/36241

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

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**  
  (needed by upcoming GNOME 42 and its components)

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl (crossbuilt)
<!-- 
  - armv7l
  - armv6l-musl
-->

#### Additional info
- The PR is mostly based upon @q66's [mozjs91 port for Chimera Linux](https://github.com/chimera-linux/cports/tree/master/main/mozjs91)
- `fix-i386-fdlibm.patch` is common with firefox, firefox-esr and thunderbird patches

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

end of thread, other threads:[~2022-06-11 19:15 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-20 11:48 [PR PATCH] [DRAFT] [Help needed] New package: mozjs91-91.5.0 subnut
2022-03-20 11:50 ` [PR PATCH] [Updated] " subnut
2022-03-20 11:53 ` subnut
2022-03-20 12:00 ` subnut
2022-03-20 12:16 ` [PR PATCH] [Updated] [DRAFT] " subnut
2022-03-20 13:07 ` subnut
2022-03-20 13:34 ` subnut
2022-03-20 13:50 ` subnut
2022-03-20 14:01 ` subnut
2022-03-20 14:05 ` [PR PATCH] [Updated] " subnut
2022-03-20 14:36 ` [PR PATCH] [Updated] [DRAFT] [ci skip] " subnut
2022-03-20 14:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
2022-03-20 16:01 ` subnut
2022-03-20 16:30 ` subnut
2022-03-20 16:30 ` subnut
2022-03-20 17:03 ` [PR PATCH] [Updated] " subnut
2022-03-20 17:11 ` subnut
2022-03-20 17:12 ` [PR PATCH] [Updated] [skip ci][DRAFT] " subnut
2022-03-20 17:12 ` subnut
2022-03-20 18:52 ` [PR PATCH] [Updated] [DRAFT] " subnut
2022-03-20 18:58 ` subnut
2022-03-20 19:22 ` subnut
2022-03-20 23:02 ` [PR REVIEW] " paper42
2022-03-21  2:53 ` [PR PATCH] [Updated] " subnut
2022-03-21  2:53 ` subnut
2022-03-21  2:54 ` [PR REVIEW] " subnut
2022-03-21  3:08 ` New package: mozjs91-91.7.1 subnut
2022-03-21  3:08 ` subnut
2022-03-21  3:08 ` subnut
2022-03-22  6:03 ` subnut
2022-03-23 16:20 ` subnut
2022-03-23 17:37 ` [PR REVIEW] " oreo639
2022-03-24  2:57 ` [PR PATCH] [Updated] " subnut
2022-03-24  2:58 ` [PR REVIEW] " subnut
2022-03-24  4:58 ` q66
2022-04-02 19:31 ` [PR PATCH] [Updated] " subnut
2022-04-03  3:10 ` subnut
2022-04-03  3:47 ` subnut
2022-04-03  4:27 ` subnut
2022-04-03  4:56 ` subnut
2022-04-03  5:03 ` subnut
2022-04-03  6:16 ` [PR PATCH] [Updated] " subnut
2022-04-03  6:19 ` subnut
2022-04-03  6:32 ` [PR PATCH] [Updated] " subnut
2022-04-03  6:58 ` subnut
2022-04-03  7:02 ` subnut
2022-04-03  7:14 ` subnut
2022-04-03  7:15 ` subnut
2022-04-03  7:18 ` subnut
2022-04-03  7:21 ` [PR PATCH] [Updated] " subnut
2022-04-03  8:29 ` subnut
2022-04-03  8:33 ` subnut
2022-04-03  8:59 ` subnut
2022-04-03 10:52 ` subnut
2022-04-03 10:58 ` subnut
2022-04-03 11:09 ` [PR PATCH] [Updated] " subnut
2022-04-03 11:09 ` subnut
2022-04-03 11:47 ` subnut
2022-04-03 14:01 ` q66
2022-04-03 14:02 ` subnut
2022-04-03 14:24 ` subnut
2022-04-03 15:10 ` [PR PATCH] [Updated] " subnut
2022-04-03 15:14 ` subnut
2022-04-03 15:24 ` [PR PATCH] [Updated] " subnut
2022-04-10 18:54 ` subnut
2022-04-10 18:55 ` subnut
2022-05-17  6:26 ` sug0
2022-05-17  6:31 ` subnut
2022-06-10  2:51 ` subnut
2022-06-11 19:15 ` [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).