From 458a6abbe2289636f00f9b272b4f5c8737bf7c6b Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 07:19:21 +0100 Subject: [PATCH] fix wrong so library links [release 91.8.0-2mamba;Sat Apr 16 2022] --- README.md | 2 + ...-options-to-specify-Rust-target-name.patch | 77 +++++++ ...able_emulate_arm_unaligned_fp_access.patch | 13 ++ mozjs-68.4.2-gcc-10.0.patch | 10 + mozjs-91.8.0-copy-headers.patch | 38 ++++ mozjs-91.8.0-emitter.patch | 67 ++++++ mozjs-91.8.0-fix-soname.patch | 26 +++ ...a-Write-command-output-to-our-stderr.patch | 44 ++++ ...y-Decouple-from-Mozilla-build-system.patch | 29 +++ mozjs-91.8.0-init_patch.patch | 28 +++ ...y-m4-detection-from-bundled-autoconf.patch | 29 +++ ...s-91.8.0-spidermonkey_checks_disable.patch | 22 ++ ...-tests-Use-native-TemporaryDirectory.patch | 66 ++++++ mozjs-91.8.0-tests-increase-timeout.patch | 26 +++ mozjs91-91.8.0-x86-double_t-fix.patch | 100 +++++++++ mozjs91.spec | 206 ++++++++++++++++++ 16 files changed, 783 insertions(+) create mode 100644 mozjs-68.4.2-arm-Add-options-to-specify-Rust-target-name.patch create mode 100644 mozjs-68.4.2-arm-disable_emulate_arm_unaligned_fp_access.patch create mode 100644 mozjs-68.4.2-gcc-10.0.patch create mode 100644 mozjs-91.8.0-copy-headers.patch create mode 100644 mozjs-91.8.0-emitter.patch create mode 100644 mozjs-91.8.0-fix-soname.patch create mode 100644 mozjs-91.8.0-icu_sources_data-Write-command-output-to-our-stderr.patch create mode 100644 mozjs-91.8.0-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch create mode 100644 mozjs-91.8.0-init_patch.patch create mode 100644 mozjs-91.8.0-remove-sloppy-m4-detection-from-bundled-autoconf.patch create mode 100644 mozjs-91.8.0-spidermonkey_checks_disable.patch create mode 100644 mozjs-91.8.0-tests-Use-native-TemporaryDirectory.patch create mode 100644 mozjs-91.8.0-tests-increase-timeout.patch create mode 100644 mozjs91-91.8.0-x86-double_t-fix.patch create mode 100644 mozjs91.spec diff --git a/README.md b/README.md index 3e544d1..e0b6951 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # mozjs91 +Mozilla stand-alone library implementing JavaScript 24. + diff --git a/mozjs-68.4.2-arm-Add-options-to-specify-Rust-target-name.patch b/mozjs-68.4.2-arm-Add-options-to-specify-Rust-target-name.patch new file mode 100644 index 0000000..ef44f6d --- /dev/null +++ b/mozjs-68.4.2-arm-Add-options-to-specify-Rust-target-name.patch @@ -0,0 +1,77 @@ +From: Takuro Ashie +Date: Thu, 18 Apr 2019 07:21:00 -0700 +Subject: Bug 1545437 - Add options to specify Rust target name + +Certain build systems such as Yocto know more suitable Rust target name, so it +would be better that there is a way to pass it to Mozilla's build system. + +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1545437 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954774 +Forwarded: https://phabricator.services.mozilla.com/D28069 +Applied-upstream: no, upstream consider this a workaround and do not support armel +--- + build/moz.configure/rust.configure | 37 +++++++++++++++++++++++++++++++++---- + 1 file changed, 33 insertions(+), 4 deletions(-) + +diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure +index 9647cbc..5aed73f 100644 +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -218,6 +218,28 @@ def rust_supported_targets(rustc): + return namespace(per_os=per_os, per_raw_os=per_raw_os) + + ++option(env='RUST_HOST', ++ nargs=1, ++ help='Define the system type for Rust performing the build') ++ ++@depends('RUST_HOST') ++@checking('rust host', lambda host: host) ++def rust_host_env(value): ++ if value: ++ return value[0] ++ ++ ++option(env='RUST_TARGET', ++ nargs=1, ++ help='Define the system type for Rust where the resulting executables will be used') ++ ++@depends('RUST_TARGET') ++@checking('rust target', lambda target: target) ++def rust_target_env(value): ++ if value: ++ return value[0] ++ ++ + @template + def rust_triple_alias(host_or_target): + """Template defining the alias used for rustc's --target flag. +@@ -228,8 +250,9 @@ def rust_triple_alias(host_or_target): + + host_or_target_str = {host: 'host', target: 'target'}[host_or_target] + +- @depends(rustc, host_or_target, c_compiler, rust_supported_targets, +- arm_target, when=rust_compiler) ++ @depends(rustc, host_or_target, rust_host_env, rust_target_env, ++ c_compiler, rust_supported_targets, arm_target, ++ when=rust_compiler) + @checking('for rust %s triplet' % host_or_target_str) + @imports('os') + @imports('subprocess') +@@ -237,8 +260,14 @@ def rust_triple_alias(host_or_target): + @imports(_from='mozbuild.shellutil', _import='quote') + @imports(_from='tempfile', _import='mkstemp') + @imports(_from='textwrap', _import='dedent') +- def rust_target(rustc, host_or_target, compiler_info, +- rust_supported_targets, arm_target): ++ def rust_target(rustc, host_or_target, rust_host_env, rust_target_env, ++ compiler_info, rust_supported_targets, arm_target): ++ ++ specified_targets = {"host": rust_host_env, "target": rust_target_env} ++ specified_target = specified_targets[host_or_target_str] ++ if (specified_target): ++ return specified_target ++ + # Rust's --target options are similar to, but not exactly the same + # as, the autoconf-derived targets we use. An example would be that + # Rust uses distinct target triples for targetting the GNU C++ ABI diff --git a/mozjs-68.4.2-arm-disable_emulate_arm_unaligned_fp_access.patch b/mozjs-68.4.2-arm-disable_emulate_arm_unaligned_fp_access.patch new file mode 100644 index 0000000..2dc1cce --- /dev/null +++ b/mozjs-68.4.2-arm-disable_emulate_arm_unaligned_fp_access.patch @@ -0,0 +1,13 @@ +--- mozjs-68.4.2/js/src/wasm/WasmSignalHandlers.cpp.orig 2020-04-10 10:54:39.434292787 +0200 ++++ mozjs-68.4.2/js/src/wasm/WasmSignalHandlers.cpp 2020-04-10 10:54:54.684009520 +0200 +@@ -243,10 +243,6 @@ + // If you run into compile problems on a tier-3 platform, you can disable the + // emulation here. + +-#if defined(__linux__) && defined(__arm__) +-# define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-#endif +- + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS + # include + #endif diff --git a/mozjs-68.4.2-gcc-10.0.patch b/mozjs-68.4.2-gcc-10.0.patch new file mode 100644 index 0000000..ddfc5f7 --- /dev/null +++ b/mozjs-68.4.2-gcc-10.0.patch @@ -0,0 +1,10 @@ +--- mozjs-68.4.2/mfbt/FunctionTypeTraits.h.orig 2020-12-01 09:23:27.539907533 +0000 ++++ mozjs-68.4.2/mfbt/FunctionTypeTraits.h 2020-12-01 09:08:14.179410222 +0000 +@@ -10,6 +10,7 @@ + #define mozilla_FunctionTypeTraits_h + + #include ++#include + + namespace mozilla { + diff --git a/mozjs-91.8.0-copy-headers.patch b/mozjs-91.8.0-copy-headers.patch new file mode 100644 index 0000000..aafe1aa --- /dev/null +++ b/mozjs-91.8.0-copy-headers.patch @@ -0,0 +1,38 @@ +From 3b3c8e37cca418e07bdeceaf3a601805df28d925 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-emitter.patch b/mozjs-91.8.0-emitter.patch new file mode 100644 index 0000000..556bebd --- /dev/null +++ b/mozjs-91.8.0-emitter.patch @@ -0,0 +1,67 @@ +From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-fix-soname.patch b/mozjs-91.8.0-fix-soname.patch new file mode 100644 index 0000000..a319d9e --- /dev/null +++ b/mozjs-91.8.0-fix-soname.patch @@ -0,0 +1,26 @@ +From d21c7cb9343d8c495d987e71be0f35887574c820 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-icu_sources_data-Write-command-output-to-our-stderr.patch b/mozjs-91.8.0-icu_sources_data-Write-command-output-to-our-stderr.patch new file mode 100644 index 0000000..8468425 --- /dev/null +++ b/mozjs-91.8.0-icu_sources_data-Write-command-output-to-our-stderr.patch @@ -0,0 +1,44 @@ +From: Simon McVittie +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/mozjs-91.8.0-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch b/mozjs-91.8.0-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch new file mode 100644 index 0000000..8572c21 --- /dev/null +++ b/mozjs-91.8.0-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch @@ -0,0 +1,29 @@ +From: Simon McVittie +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/mozjs-91.8.0-init_patch.patch b/mozjs-91.8.0-init_patch.patch new file mode 100644 index 0000000..1954a55 --- /dev/null +++ b/mozjs-91.8.0-init_patch.patch @@ -0,0 +1,28 @@ +From 00414eb67ab0591911167155963b5524fbf2b0c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-remove-sloppy-m4-detection-from-bundled-autoconf.patch b/mozjs-91.8.0-remove-sloppy-m4-detection-from-bundled-autoconf.patch new file mode 100644 index 0000000..10b8b16 --- /dev/null +++ b/mozjs-91.8.0-remove-sloppy-m4-detection-from-bundled-autoconf.patch @@ -0,0 +1,29 @@ +From 2d99a7b076578a3394fb9d5be6eb44f9cfebc681 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-spidermonkey_checks_disable.patch b/mozjs-91.8.0-spidermonkey_checks_disable.patch new file mode 100644 index 0000000..451d3ee --- /dev/null +++ b/mozjs-91.8.0-spidermonkey_checks_disable.patch @@ -0,0 +1,22 @@ +From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs-91.8.0-tests-Use-native-TemporaryDirectory.patch b/mozjs-91.8.0-tests-Use-native-TemporaryDirectory.patch new file mode 100644 index 0000000..054685c --- /dev/null +++ b/mozjs-91.8.0-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?= +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/mozjs-91.8.0-tests-increase-timeout.patch b/mozjs-91.8.0-tests-increase-timeout.patch new file mode 100644 index 0000000..c86cca4 --- /dev/null +++ b/mozjs-91.8.0-tests-increase-timeout.patch @@ -0,0 +1,26 @@ +From 9be85b155c6df0454c5faef9e850f572c99e3615 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +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/mozjs91-91.8.0-x86-double_t-fix.patch b/mozjs91-91.8.0-x86-double_t-fix.patch new file mode 100644 index 0000000..1d370a2 --- /dev/null +++ b/mozjs91-91.8.0-x86-double_t-fix.patch @@ -0,0 +1,100 @@ +diff -w -ruN firefox-93.0.org/modules/fdlibm/src/math_private.h firefox-93.0/modules/fdlibm/src/math_private.h +--- firefox-93.0.org/modules/fdlibm/src/math_private.h 2021-09-27 16:47:42.000000000 -0600 ++++ firefox-93.0/modules/fdlibm/src/math_private.h 2021-10-16 11:08:55.154643922 -0600 +@@ -30,9 +30,13 @@ + * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t + */ + ++#ifdef __LP64__ + typedef double __double_t; ++#else ++typedef long double __double_t; ++#endif + typedef __double_t double_t; +- ++typedef float __float_t; + /* + * The original fdlibm code used statements like: + * n0 = ((*(int*)&one)>>29)^1; * index of high word * +@@ -630,6 +634,41 @@ + return ((double)(x + 0x1.8p52) - 0x1.8p52); + } + ++static inline float ++rnintf(__float_t x) ++{ ++ /* ++ * As for rnint(), except we could just call that to handle the ++ * extra precision case, usually without losing efficiency. ++ */ ++ return ((float)(x + 0x1.8p23F) - 0x1.8p23F); ++} ++ ++#ifdef LDBL_MANT_DIG ++/* ++ * The complications for extra precision are smaller for rnintl() since it ++ * can safely assume that the rounding precision has been increased from ++ * its default to FP_PE on x86. We don't exploit that here to get small ++ * optimizations from limiting the rangle to double. We just need it for ++ * the magic number to work with long doubles. ld128 callers should use ++ * rnint() instead of this if possible. ld80 callers should prefer ++ * rnintl() since for amd64 this avoids swapping the register set, while ++ * for i386 it makes no difference (assuming FP_PE), and for other arches ++ * it makes little difference. ++ */ ++static inline long double ++rnintl(long double x) ++{ ++#if (LDBL_MANT_DIG == 64) ++ return (x + __CONCAT(0x1.8p, 64) / 2 - ++ __CONCAT(0x1.8p, 64) / 2); ++#else ++ return (x + __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2 - ++ __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2); ++#endif ++} ++#endif /* LDBL_MANT_DIG */ ++ + /* + * irint() and i64rint() give the same result as casting to their integer + * return type provided their arg is a floating point integer. They can +@@ -646,6 +685,39 @@ + #define irint(x) ((int)(x)) + #endif + ++#define i64rint(x) ((int64_t)(x)) /* only needed for ld128 so not opt. */ ++ ++#if defined(__i386__) && defined(__GNUCLIKE_ASM) ++static __inline int ++irintf(float x) ++{ ++ int n; ++ ++ __asm("fistl %0" : "=m" (n) : "t" (x)); ++ return (n); ++} ++ ++static __inline int ++irintd(double x) ++{ ++ int n; ++ ++ __asm("fistl %0" : "=m" (n) : "t" (x)); ++ return (n); ++} ++#endif ++ ++#if (defined(__amd64__) || defined(__i386__)) && defined(__GNUCLIKE_ASM) ++static __inline int ++irintl(long double x) ++{ ++ int n; ++ ++ __asm("fistl %0" : "=m" (n) : "t" (x)); ++ return (n); ++} ++#endif ++ + #ifdef DEBUG + #if defined(__amd64__) || defined(__i386__) + #define breakpoint() asm("int $3") diff --git a/mozjs91.spec b/mozjs91.spec new file mode 100644 index 0000000..ad8ddd1 --- /dev/null +++ b/mozjs91.spec @@ -0,0 +1,206 @@ +%define MAJver %(echo %version | cut -d. -f1) +%define majver %(echo %version | cut -d. -f1-2) +Name: mozjs91 +Version: 91.8.0 +Release: 2mamba +Summary: Mozilla stand-alone library implementing JavaScript 24 +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://www.mozilla.org/en-US/ +Source: https://archive.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz +Patch0: mozjs-91.8.0-fix-soname.patch +Patch1: mozjs-68.4.2-arm-Add-options-to-specify-Rust-target-name.patch +Patch2: mozjs-68.4.2-arm-disable_emulate_arm_unaligned_fp_access.patch +Patch3: mozjs-68.4.2-gcc-10.0.patch +Patch4: mozjs-91.8.0-copy-headers.patch +Patch5: mozjs-91.8.0-tests-increase-timeout.patch +Patch6: mozjs-91.8.0-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch +Patch7: mozjs-91.8.0-icu_sources_data-Write-command-output-to-our-stderr.patch +Patch8: mozjs-91.8.0-emitter.patch +Patch9: mozjs-91.8.0-tests-Use-native-TemporaryDirectory.patch +Patch10: mozjs-91.8.0-init_patch.patch +Patch11: mozjs-91.8.0-remove-sloppy-m4-detection-from-bundled-autoconf.patch +Patch12: mozjs-91.8.0-spidermonkey_checks_disable.patch +Patch13: mozjs91-91.8.0-x86-double_t-fix.patch +# Only GPL because linking to readline +License: GPL +#License: MPL, GPL, LGPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgcc +BuildRequires: libicu-devel +BuildRequires: libreadline-devel +BuildRequires: libstdc++6-devel +BuildRequires: libz-devel +## AUTOBUILDREQ-END +BuildRequires: pkg-config +BuildRequires: autoconf2.13 +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires(post): %{__install_info} +Requires(preun): %{__install_info} + +%description +Mozilla stand-alone library implementing JavaScript 24. + +%package -n lib%{name} +Group: System/Libraries +Summary: Mozilla stand-alone library implementing JavaScript 24 + +%description -n lib%{name} +Mozilla stand-alone library implementing JavaScript 24. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: pkg-config + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q -c -a0 +cd firefox-%{version} +#-D -T +#:<< _EOF +%patch0 -p1 -b .fix-soname +#%ifarch arm +#%patch1 -p1 +#%patch2 -p1 +#%endif +#%patch3 -p1 +%patch4 -p1 -b .copy-headers +%patch5 -p1 -b .tests-increase-timeout +%patch6 -p1 -b .icu_sources_data.py-Decouple-from-Mozilla-build-system +%patch7 -p1 -b .icu_sources_data-Write-command-output-to-our-stderr +%patch8 -p1 -b .emitter +%patch9 -p1 -b .tests-Use-native-TemporaryDirectory +%patch10 -p1 -b .init_patch +%patch11 -p1 -b .remove-sloppy-m4-detection-from-bundled-autoconf +%patch12 -p1 -b .spidermonkey_checks_disable +%ifarch %{ix86} arm +%patch13 -p1 -b .x86-double_t-fix +%endif + +%build +cd firefox-%{version}/js/src +#:<< _EOF +# NOTE: taken from Fedora +# Prefer GCC for now +export CC=gcc +export CXX=g++ + +# Workaround +# error: options `-C embed-bitcode=no` and `-C lto` are incompatible +# error: could not compile `jsrust`. +# https://github.com/japaric/cargo-call-stack/issues/25 +export RUSTFLAGS="-C embed-bitcode" + +# https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd +export CARGO_PROFILE_RELEASE_LTO=true + +export CFLAGS="%{optflags}" +export CXXFLAGS="$CFLAGS" +export LINKFLAGS="%{?build_ldflags}" +export PYTHON="%{python3}" + +# Use bundled autoconf +export M4=m4 +export AWK=awk +export AC_MACRODIR=%{_builddir}/%{name}-%{version}/firefox-%{version}/build/autoconf/ + +sh ../../build/autoconf/autoconf.sh --localdir=%{_builddir}/firefox-%{version}/js/src configure.in > configure +chmod +x configure + +%ifarch arm +sed -i "s|armv4t|arm|" ../../build/moz.configure/rust.configure +%endif + +%configure \ +%ifarch %{ix86} + --host=i686-unknown-linux-gnu \ +%endif +%ifarch arm + --host=arm-unknown-linux-gnueabi \ +%endif + --with-system-icu \ + --with-system-zlib \ + --disable-tests \ + --disable-strip \ + --with-intl-api \ + --enable-readline \ + --enable-shared-js \ + --enable-optimize \ + --disable-debug \ + --enable-pie \ + --disable-jemalloc + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall -C firefox-%{version}/js/src + +# Fix permissions +chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc + +# Remove unneeded files +rm %{buildroot}%{_bindir}/js%{MAJver}-config +rm %{buildroot}%{_libdir}/libjs_static.ajs + +# Rename library and create symlinks, following fix-soname.patch +mv %{buildroot}%{_libdir}/libmozjs-%{MAJver}.so \ + %{buildroot}%{_libdir}/libmozjs-%{MAJver}.so.0.0.0 + +ln -s libmozjs-%{MAJver}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{MAJver}.so.0 +ln -s libmozjs-%{MAJver}.so.0 %{buildroot}%{_libdir}/libmozjs-%{MAJver}.so + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libmozjs-%{MAJver}.so.* +#%{_libdir}/libjs_static.ajs +%doc firefox-%{version}/LICENSE + +%files -n lib%{name}-devel +%defattr(-,root,root) +%{_bindir}/js%{MAJver} +#%{_bindir}/js%{MAJver}-config +%dir %{_includedir}/mozjs-%{MAJver}/ +%{_includedir}/mozjs-%{MAJver}/* +%{_libdir}/libmozjs-%{MAJver}.so +%{_libdir}/pkgconfig/mozjs-%{MAJver}.pc + +%changelog +* Sat Apr 16 2022 Silvan Calarco 91.8.0-2mamba +- fix wrong so library links + +* Fri Apr 15 2022 Silvan Calarco 91.8.0-1mamba +- update to 91.8.0 + +* Sun Mar 22 2020 Silvan Calarco 68.4.2-1mamba +- update to 68.4.2 + +* Sat Jul 06 2019 Silvan Calarco 60.1.0-1mamba +- update to 60.1.0 + +* Tue Dec 11 2018 Silvan Calarco 52.6.0-1mamba +- update to 52.6.0 + +* Mon Dec 10 2018 Silvan Calarco 52.2.1-2mamba +- arm: rebuilt + +* Mon Aug 13 2018 Silvan Calarco 52.2.1-1mamba +- update to 52.2.1 + +* Thu Jun 19 2014 Silvan Calarco 24.2.0-1mamba +- package created from mozjs185