upgrade to 102.9 & add riscv64 sipdermonkey jit support
This commit is contained in:
parent
8ae09303cb
commit
9e64a95d8d
@ -1,109 +0,0 @@
|
||||
From 0e790bd2eb846e90495eb81952cf35cc7fc8766a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
|
||||
Date: Mon, 27 Jun 2022 19:55:16 +0100
|
||||
Subject: [PATCH] Python/Build: Use r instead of rU file read modes
|
||||
|
||||
Fixes Python 3.11 build
|
||||
---
|
||||
python/mozbuild/mozbuild/action/process_define_files.py | 2 +-
|
||||
python/mozbuild/mozbuild/backend/base.py | 2 +-
|
||||
python/mozbuild/mozbuild/preprocessor.py | 6 +++---
|
||||
python/mozbuild/mozbuild/util.py | 4 ++--
|
||||
python/mozbuild/mozpack/files.py | 4 ++--
|
||||
5 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
|
||||
index f1d401a..aca59d0 100644
|
||||
--- a/python/mozbuild/mozbuild/action/process_define_files.py
|
||||
+++ b/python/mozbuild/mozbuild/action/process_define_files.py
|
||||
@@ -36,7 +36,7 @@ def process_define_file(output, input):
|
||||
) and not config.substs.get("JS_STANDALONE"):
|
||||
config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
|
||||
|
||||
- with open(path, "rU") as input:
|
||||
+ with open(path, "r") as input:
|
||||
r = re.compile(
|
||||
"^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
|
||||
)
|
||||
diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py
|
||||
index 7bc1986..b64a709 100644
|
||||
--- a/python/mozbuild/mozbuild/backend/base.py
|
||||
+++ b/python/mozbuild/mozbuild/backend/base.py
|
||||
@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin):
|
||||
return status
|
||||
|
||||
@contextmanager
|
||||
- def _write_file(self, path=None, fh=None, readmode="rU"):
|
||||
+ def _write_file(self, path=None, fh=None, readmode="r"):
|
||||
"""Context manager to write a file.
|
||||
|
||||
This is a glorified wrapper around FileAvoidWrite with integration to
|
||||
diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
|
||||
index f7820b9..857f1a6 100644
|
||||
--- a/python/mozbuild/mozbuild/preprocessor.py
|
||||
+++ b/python/mozbuild/mozbuild/preprocessor.py
|
||||
@@ -531,7 +531,7 @@ class Preprocessor:
|
||||
|
||||
if args:
|
||||
for f in args:
|
||||
- with io.open(f, "rU", encoding="utf-8") as input:
|
||||
+ with io.open(f, "r", encoding="utf-8") as input:
|
||||
self.processFile(input=input, output=out)
|
||||
if depfile:
|
||||
mk = Makefile()
|
||||
@@ -860,7 +860,7 @@ class Preprocessor:
|
||||
args = self.applyFilters(args)
|
||||
if not os.path.isabs(args):
|
||||
args = os.path.join(self.curdir, args)
|
||||
- args = io.open(args, "rU", encoding="utf-8")
|
||||
+ args = io.open(args, "r", encoding="utf-8")
|
||||
except Preprocessor.Error:
|
||||
raise
|
||||
except Exception:
|
||||
@@ -914,7 +914,7 @@ class Preprocessor:
|
||||
def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
|
||||
pp = Preprocessor(defines=defines, marker=marker)
|
||||
for f in includes:
|
||||
- with io.open(f, "rU", encoding="utf-8") as input:
|
||||
+ with io.open(f, "r", encoding="utf-8") as input:
|
||||
pp.processFile(input=input, output=output)
|
||||
return pp.includes
|
||||
|
||||
diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
|
||||
index 071daec..b59aabb 100644
|
||||
--- a/python/mozbuild/mozbuild/util.py
|
||||
+++ b/python/mozbuild/mozbuild/util.py
|
||||
@@ -236,7 +236,7 @@ class FileAvoidWrite(BytesIO):
|
||||
still occur, as well as diff capture if requested.
|
||||
"""
|
||||
|
||||
- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
|
||||
+ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
|
||||
BytesIO.__init__(self)
|
||||
self.name = filename
|
||||
assert type(capture_diff) == bool
|
||||
diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py
|
||||
index 8150e72..001c497 100644
|
||||
--- a/python/mozbuild/mozpack/files.py
|
||||
+++ b/python/mozbuild/mozpack/files.py
|
||||
@@ -554,7 +554,7 @@ class PreprocessedFile(BaseFile):
|
||||
pp = Preprocessor(defines=self.defines, marker=self.marker)
|
||||
pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
|
||||
|
||||
- with _open(self.path, "rU") as input:
|
||||
+ with _open(self.path, "r") as input:
|
||||
with _open(os.devnull, "w") as output:
|
||||
pp.processFile(input=input, output=output)
|
||||
|
||||
@@ -611,7 +611,7 @@ class PreprocessedFile(BaseFile):
|
||||
pp = Preprocessor(defines=self.defines, marker=self.marker)
|
||||
pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
|
||||
|
||||
- with _open(self.path, "rU") as input:
|
||||
+ with _open(self.path, "r") as input:
|
||||
pp.processFile(input=input, output=dest, depfile=deps_out)
|
||||
|
||||
dest.close()
|
||||
--
|
||||
2.36.1
|
||||
|
||||
73
D134330.diff
Normal file
73
D134330.diff
Normal file
@ -0,0 +1,73 @@
|
||||
diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
|
||||
--- a/build/moz.configure/toolchain.configure
|
||||
+++ b/build/moz.configure/toolchain.configure
|
||||
@@ -1511,11 +1511,11 @@
|
||||
|
||||
|
||||
option(
|
||||
"--enable-linker",
|
||||
nargs=1,
|
||||
- help="Select the linker {bfd, gold, ld64, lld, lld-*}{|}",
|
||||
+ help="Select the linker {bfd, gold, ld64, lld, lld-*, mold}{|}",
|
||||
default=enable_linker_default,
|
||||
when=is_linker_option_enabled,
|
||||
)
|
||||
|
||||
|
||||
@@ -1546,11 +1546,11 @@
|
||||
|
||||
def is_valid_linker(linker):
|
||||
if target.kernel == "Darwin":
|
||||
valid_linkers = ("ld64", "lld")
|
||||
else:
|
||||
- valid_linkers = ("bfd", "gold", "lld")
|
||||
+ valid_linkers = ("bfd", "gold", "lld", "mold")
|
||||
if linker in valid_linkers:
|
||||
return True
|
||||
if "lld" in valid_linkers and linker.startswith("lld-"):
|
||||
return True
|
||||
return False
|
||||
@@ -1591,10 +1591,13 @@
|
||||
kind = "ld64"
|
||||
|
||||
elif retcode != 0:
|
||||
return None
|
||||
|
||||
+ elif "mold" in stdout:
|
||||
+ kind = "mold"
|
||||
+
|
||||
elif "GNU ld" in stdout:
|
||||
# We are using the normal linker
|
||||
kind = "bfd"
|
||||
|
||||
elif "GNU gold" in stdout:
|
||||
@@ -1697,11 +1700,11 @@
|
||||
# There's a wrinkle with MinGW: linker configuration is not enabled, so
|
||||
# `select_linker` is never invoked. Hard-code around it.
|
||||
@depends(select_linker, target, c_compiler)
|
||||
def gcc_use_gnu_ld(select_linker, target, c_compiler):
|
||||
if select_linker is not None and target.kernel != "Darwin":
|
||||
- return select_linker.KIND in ("bfd", "gold", "lld")
|
||||
+ return select_linker.KIND in ("bfd", "gold", "lld", "mold")
|
||||
if target.kernel == "WINNT" and c_compiler.type == "clang":
|
||||
return True
|
||||
return None
|
||||
|
||||
|
||||
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
|
||||
--- a/toolkit/moz.configure
|
||||
+++ b/toolkit/moz.configure
|
||||
@@ -1444,11 +1444,11 @@
|
||||
)
|
||||
|
||||
@depends("--enable-release", enable_linker)
|
||||
def default_elfhack(release, linker):
|
||||
# Disable elfhack when explicitly building with --enable-linker=lld
|
||||
- if linker and linker.origin != "default" and linker[0] == "lld":
|
||||
+ if linker and linker.origin != "default" and linker[0] in ("lld", "mold"):
|
||||
return False
|
||||
return bool(release)
|
||||
|
||||
with only_when(has_elfhack):
|
||||
option(
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
firefox-102.9.0esr.source.tar.xzad
Normal file
BIN
firefox-102.9.0esr.source.tar.xzad
Normal file
Binary file not shown.
@ -18,8 +18,12 @@
|
||||
%global big_endian 1
|
||||
%endif
|
||||
|
||||
%ifarch riscv64
|
||||
%global build_mold 1
|
||||
%endif
|
||||
|
||||
Name: mozjs%{major}
|
||||
Version: 102.6.0
|
||||
Version: 102.9.0
|
||||
Release: 1
|
||||
Summary: SpiderMonkey JavaScript library
|
||||
License: MPL-2.0 AND Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND GPL-3.0-or-later
|
||||
@ -29,10 +33,10 @@ Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/sourc
|
||||
# Known failures with system libicu
|
||||
Source1: known_failures.txt
|
||||
|
||||
Source10: firefox-102.6.0esr.source.tar.xzaa
|
||||
Source11: firefox-102.6.0esr.source.tar.xzab
|
||||
Source12: firefox-102.6.0esr.source.tar.xzac
|
||||
Source13: firefox-102.6.0esr.source.tar.xzad
|
||||
Source10: firefox-102.9.0esr.source.tar.xzaa
|
||||
Source11: firefox-102.9.0esr.source.tar.xzab
|
||||
Source12: firefox-102.9.0esr.source.tar.xzac
|
||||
Source13: firefox-102.9.0esr.source.tar.xzad
|
||||
|
||||
# Patches from mozjs68, rebased for mozjs78:
|
||||
Patch01: fix-soname.patch
|
||||
@ -48,7 +52,6 @@ Patch13: tests-Use-native-TemporaryDirectory.patch
|
||||
# Build fixes
|
||||
Patch14: init_patch.patch
|
||||
Patch15: remove-sloppy-m4-detection-from-bundled-autoconf.patch
|
||||
Patch16: 0001-Python-Build-Use-r-instead-of-rU-file-read-modes.patch
|
||||
|
||||
# TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed
|
||||
Patch20: spidermonkey_checks_disable.patch
|
||||
@ -56,6 +59,14 @@ Patch20: spidermonkey_checks_disable.patch
|
||||
# s390x/ppc64 fixes
|
||||
Patch21: 0001-Skip-failing-tests-on-ppc64-and-s390x.patch
|
||||
|
||||
# riscv64 sipdermonkey jit
|
||||
Patch22: spidermonkey-riscv64-plct.patch
|
||||
|
||||
# mold
|
||||
%if 0%{?build_mold}
|
||||
Patch23: D134330.diff
|
||||
%endif
|
||||
|
||||
BuildRequires: cargo
|
||||
BuildRequires: ccache
|
||||
BuildRequires: clang-devel
|
||||
@ -79,6 +90,9 @@ BuildRequires: python3-six
|
||||
BuildRequires: readline-devel
|
||||
BuildRequires: wget
|
||||
BuildRequires: zip
|
||||
%if 0%{?build_mold}
|
||||
BuildRequires: mold
|
||||
%endif
|
||||
|
||||
%description
|
||||
SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
|
||||
@ -126,7 +140,7 @@ export CARGO_PROFILE_RELEASE_LTO=true
|
||||
export M4=m4
|
||||
export AWK=awk
|
||||
export AC_MACRODIR=%{_builddir}/firefox-%{version}/build/autoconf/
|
||||
|
||||
|
||||
sh ../../build/autoconf/autoconf.sh --localdir=%{_builddir}/firefox-%{version}/js/src configure.in > configure
|
||||
chmod +x configure
|
||||
|
||||
@ -141,7 +155,11 @@ chmod +x configure
|
||||
--enable-optimize \
|
||||
--disable-debug \
|
||||
--enable-pie \
|
||||
--disable-jemalloc
|
||||
--disable-jemalloc \
|
||||
%if 0%{?build_mold}
|
||||
--enable-linker=mold \
|
||||
%endif
|
||||
%{nil}
|
||||
|
||||
%make_build
|
||||
|
||||
@ -156,7 +174,7 @@ case `uname -i` in
|
||||
i386 | ppc | s390 | sparc )
|
||||
wordsize="32"
|
||||
;;
|
||||
x86_64 | ppc64 | s390x | sparc64 )
|
||||
x86_64 | ppc64 | s390x | sparc64 | riscv64 )
|
||||
wordsize="64"
|
||||
;;
|
||||
*)
|
||||
@ -232,6 +250,10 @@ ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
|
||||
%{_includedir}/mozjs-%{major}/
|
||||
|
||||
%changelog
|
||||
* Thu Mar 16 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 102.9.0-1
|
||||
- upgrade to 102.9.0
|
||||
- add sipdermonkey jit support for riscv64
|
||||
|
||||
* Mon Jan 02 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 102.6.0-1
|
||||
- Initial package.
|
||||
|
||||
|
||||
36157
spidermonkey-riscv64-plct.patch
Normal file
36157
spidermonkey-riscv64-plct.patch
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user