mozjs-128

This commit is contained in:
Rmys
2025-12-20 15:18:52 +03:00
parent 06089a71b8
commit d5bf96bf30
18 changed files with 662 additions and 301 deletions
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
#WorkDir = "mozjs%s/js/src" % get.srcVERSION()
ObjDir = "obj"
shelltools.export("SHELL","/bin/sh")
WorkDir = "firefox-%s" %get.srcVERSION()
shelltools.system("export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=pip")
shelltools.export("MOZBUILD_STATE_PATH", "mozbuild")
shelltools.system("export MOZ_NOSPAM=1")
def setup():
# shelltools.export("CC", "gcc")
# shelltools.export("CXX", "g++")
# shelltools.system("cp mozconfig .mozconfig")
shelltools.system("cp mozconfig js/src/.mozconfig")
def build():
# shelltools.cd("build-js")
shelltools.system("./mach build")
def install():
shelltools.cd("build")
autotools.rawInstall("DESTDIR=%s prefix=/usr" % get.installDIR())
# shelltools.system("DESTDIR=%s ./mach install " % get.installDIR())
pisitools.remove("/usr/lib/*.ajs")
pisitools.dosym("/usr/lib/libmozjs-128.so", "/usr/lib/libmozjs-128.so.0")
shelltools.cd("..")
pisitools.dodoc("README*")
# add link for polkit
#pisitools.dosym("libmozjs-..so", "/usr/lib/libmozjs-17.0.so")
@@ -0,0 +1,72 @@
Description: Remove unused LLVM and Rust build dependencies
Since the Javascript engine is normally part of Firefox, its build
system has dependencies on the LLVM and Rust toolchains. This limits
the number of architectures which mozjs68 can be built on.
.
It turns out, however, that neither LLVM nor Rust are used when mozjs68
is being built and these build dependencies are therefore not necessary.
.
This patch removes them and allows mozjs68 to be built on any architecture.
.
Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
Forwarded: no
Last-Update: 2020-04-30
Index: mozjs68-68.6.0/js/moz.configure
===================================================================
--- mozjs68-68.6.0.orig/js/moz.configure
+++ mozjs68-68.6.0/js/moz.configure
@@ -18,11 +18,6 @@ def building_js(build_project):
option(env='JS_STANDALONE', default=building_js,
help='Reserved for internal use')
-include('../build/moz.configure/rust.configure',
- when='--enable-compile-environment')
-include('../build/moz.configure/bindgen.configure',
- when='--enable-compile-environment')
-
@depends('JS_STANDALONE')
def js_standalone(value):
if value:
Index: mozjs68-68.6.0/moz.configure
===================================================================
--- mozjs68-68.6.0.orig/moz.configure
+++ mozjs68-68.6.0/moz.configure
@@ -598,36 +598,6 @@ set_config('MAKENSISU_FLAGS', nsis_flags
check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
-
-@depends(host_c_compiler, c_compiler, bindgen_config_paths)
-def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths):
- clang = None
- for compiler in (host_c_compiler, c_compiler):
- if compiler and compiler.type == 'clang':
- clang = compiler.compiler
- break
- elif compiler and compiler.type == 'clang-cl':
- clang = os.path.join(os.path.dirname(compiler.compiler), 'clang')
- break
-
- if not clang and bindgen_config_paths:
- clang = bindgen_config_paths.clang_path
- llvm_objdump = 'llvm-objdump'
- if clang:
- out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
- onerror=lambda: None)
- if out:
- llvm_objdump = out.rstrip()
- return (llvm_objdump,)
-
-
-llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
- when='--enable-compile-environment',
- paths=toolchain_search_path)
-
-add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump)
-
-
# Please do not add configure checks from here on.
# Fallthrough to autoconf-based configure
@@ -0,0 +1,127 @@
# HG changeset patch
# User André Bargull <andre.bargull@gmail.com>
# Date 1510140221 28800
# Wed Nov 08 03:23:41 2017 -0800
# Node ID 8bf5e7460a7c5ba3430b501d1659c469a862a929
# Parent 60fd4a5b01ec70ded9ddfd560fd5be191b1c74b9
Bug 1415202: Always use the equivalent year to determine the time zone offset and name. r=Waldo
diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -2348,22 +2348,26 @@ static PRMJTime ToPRMJTime(double localT
prtm.tm_isdst = (DaylightSavingTA(utcTime) != 0);
return prtm;
}
static size_t FormatTime(char* buf, int buflen, const char* fmt, double utcTime,
double localTime) {
PRMJTime prtm = ToPRMJTime(localTime, utcTime);
- int eqivalentYear = IsRepresentableAsTime32(utcTime)
+
+ // If an equivalent year was used to compute the date/time components, use
+ // the same equivalent year to determine the time zone name and offset in
+ // PRMJ_FormatTime(...).
+ int timeZoneYear = IsRepresentableAsTime32(utcTime)
? prtm.tm_year
: EquivalentYearForDST(prtm.tm_year);
int offsetInSeconds = (int)floor((localTime - utcTime) / msPerSecond);
- return PRMJ_FormatTime(buf, buflen, fmt, &prtm, eqivalentYear,
+ return PRMJ_FormatTime(buf, buflen, fmt, &prtm, timeZoneYear,
offsetInSeconds);
}
enum class FormatSpec { DateTime, Date, Time };
static bool FormatDate(JSContext* cx, double utcTime, FormatSpec format,
MutableHandleValue rval) {
JSString* str;
diff --git a/js/src/vm/Time.cpp b/js/src/vm/Time.cpp
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -242,17 +242,17 @@ static void PRMJ_InvalidParameterHandler
const wchar_t* file, unsigned int line,
uintptr_t pReserved) {
/* empty */
}
#endif
/* Format a time value into a buffer. Same semantics as strftime() */
size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt,
- const PRMJTime* prtm, int equivalentYear,
+ const PRMJTime* prtm, int timeZoneYear,
int offsetInSeconds) {
size_t result = 0;
#if defined(XP_UNIX) || defined(XP_WIN)
struct tm a;
#ifdef XP_WIN
_invalid_parameter_handler oldHandler;
#ifndef __MINGW32__
int oldReportMode;
@@ -275,39 +275,33 @@ size_t PRMJ_FormatTime(char* buf, int bu
*/
#if defined(HAVE_LOCALTIME_R) && defined(HAVE_TM_ZONE_TM_GMTOFF)
char emptyTimeZoneId[] = "";
{
/*
* Fill out |td| to the time represented by |prtm|, leaving the
* timezone fields zeroed out. localtime_r will then fill in the
* timezone fields for that local time according to the system's
- * timezone parameters.
+ * timezone parameters. Use |timeZoneYear| for the year to ensure the
+ * time zone name matches the time zone offset used by the caller.
*/
struct tm td;
memset(&td, 0, sizeof(td));
td.tm_sec = prtm->tm_sec;
td.tm_min = prtm->tm_min;
td.tm_hour = prtm->tm_hour;
td.tm_mday = prtm->tm_mday;
td.tm_mon = prtm->tm_mon;
td.tm_wday = prtm->tm_wday;
- td.tm_year = prtm->tm_year - 1900;
+ td.tm_year = timeZoneYear - 1900;
td.tm_yday = prtm->tm_yday;
td.tm_isdst = prtm->tm_isdst;
time_t t = mktime(&td);
- // If |prtm| cannot be represented in |time_t| the year is probably
- // out of range, try again with the DST equivalent year.
- if (t == static_cast<time_t>(-1)) {
- td.tm_year = equivalentYear - 1900;
- t = mktime(&td);
- }
-
// If either mktime or localtime_r failed, fill in the fallback time
// zone offset |offsetInSeconds| and set the time zone identifier to
// the empty string.
if (t != static_cast<time_t>(-1) && localtime_r(&t, &td)) {
a.tm_gmtoff = td.tm_gmtoff;
a.tm_zone = td.tm_zone;
} else {
a.tm_gmtoff = offsetInSeconds;
diff --git a/js/src/vm/Time.h b/js/src/vm/Time.h
--- a/js/src/vm/Time.h
+++ b/js/src/vm/Time.h
@@ -44,17 +44,17 @@ inline void PRMJ_NowInit() {}
#ifdef XP_WIN
extern void PRMJ_NowShutdown();
#else
inline void PRMJ_NowShutdown() {}
#endif
/* Format a time value into a buffer. Same semantics as strftime() */
extern size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt,
- const PRMJTime* tm, int equivalentYear,
+ const PRMJTime* tm, int timeZoneYear,
int offsetInSeconds);
/**
* Requesting the number of cycles from the CPU.
*
* `rdtsc`, or Read TimeStamp Cycle, is an instruction provided by
* x86-compatible CPUs that lets processes request the number of
* cycles spent by the CPU executing instructions since the CPU was
@@ -0,0 +1,24 @@
ac_add_options --enable-application=js
# mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/build
ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-rust-simd
ac_add_options --enable-linker=lld
ac_add_options --disable-bootstrap
ac_add_options --disable-debug
ac_add_options --disable-jemalloc
ac_add_options --disable-strip
# System libraries
ac_add_options --with-system-zlib
ac_add_options --without-system-icu
# Features
ac_add_options --enable-readline
ac_add_options --enable-shared-js
ac_add_options --enable-tests
ac_add_options --with-intl-api
@@ -0,0 +1,25 @@
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 90a9946..dc87789 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -291,6 +291,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.37.1
@@ -0,0 +1,25 @@
diff --git i/js/src/build/Makefile.in w/js/src/build/Makefile.in
index ee19104e0ef5..a0f06fd35a18 100644
--- i/js/src/build/Makefile.in
+++ w/js/src/build/Makefile.in
@@ -89,6 +89,8 @@ ifneq (,$(REAL_LIBRARY))
endif
ifneq (,$(SHARED_LIBRARY))
$(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
+ mv -f $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).0
+ ln -s $(SHARED_LIBRARY).0 $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
ifeq ($(OS_ARCH),Darwin)
install_name_tool -id $(abspath $(libdir)/$(SHARED_LIBRARY)) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
endif
diff --git i/js/src/build/moz.build w/js/src/build/moz.build
index a7f5fa4ce8eb..726687c13fb0 100644
--- i/js/src/build/moz.build
+++ w/js/src/build/moz.build
@@ -23,6 +23,7 @@ if not CONFIG['JS_STANDALONE']:
if CONFIG['JS_SHARED_LIBRARY']:
GeckoSharedLibrary('js', linkage=None)
SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
+ LDFLAGS += ['-Wl,-soname,lib{}.so.0'.format(SHARED_LIBRARY_NAME)]
else:
Library('js')
@@ -0,0 +1,38 @@
"Carried over from mozjs68"
--- a/js/src/build/Makefile.in
+++ b/js/src/build/Makefile.in
@@ -78,6 +78,8 @@
endif
ifneq (,$(SHARED_LIBRARY))
$(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
+ mv -f $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).0
+ ln -s $(SHARED_LIBRARY).0 $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
ifeq ($(OS_ARCH),Darwin)
install_name_tool -id $(abspath $(libdir)/$(SHARED_LIBRARY)) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
endif
--- a/js/src/build/moz.build 2022-03-13 17:31:39.000000000 +0300
+++ b/js/src/build/moz.build 2022-03-21 23:32:34.252893769 +0300
@@ -26,6 +26,7 @@
if CONFIG["JS_SHARED_LIBRARY"]:
GeckoSharedLibrary("js", linkage=None)
SHARED_LIBRARY_NAME = CONFIG["JS_LIBRARY_NAME"]
+ LDFLAGS += ['-Wl,-soname,lib{}.so.0'.format(SHARED_LIBRARY_NAME)]
# Ensure symbol versions of shared library on Linux do not conflict
# with those in libxul.
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
@@ -0,0 +1,27 @@
"Carried over + updated from mozjs68"
Upstream: no
From 9ad10569e11a2fb96377188f895bc66abcc9511d Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Wed, 5 Sep 2018 15:05:24 +0200
Subject: [PATCH] silence sandbox violations
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
python/mozbuild/mozbuild/frontend/emitter.py | 5 -----
1 file changed, 5 deletions(-)
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -1239,12 +1239,6 @@ class TreeMetadataEmitter(LoggingMixin):
'is a filename, but a directory is required: %s '
'(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
@@ -0,0 +1,88 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>mozjs-128</Name>
<Homepage>http://www.mozilla.org/js/spidermonkey/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>NPL-1.1</License>
<IsA>library</IsA>
<Summary>Stand-alone JavaScript C Library</Summary>
<Description>Spidermonkey is Mozilla's C implementation of JavaScript.</Description>
<Archive type="tarxz" sha1sum="ca5f1c7eae739168c1b8149cafa27194b93f71c7">https://ftp.mozilla.org/pub/firefox/releases/128.14.0esr/source/firefox-128.14.0esr.source.tar.xz</Archive>
<AdditionalFiles>
<AdditionalFile target="mozconfig" permission="0644">mozconfig</AdditionalFile>
</AdditionalFiles>
<BuildDependencies>
<Dependency>rust</Dependency>
<Dependency>llvm</Dependency>
<Dependency>cbindgen</Dependency>
<Dependency>lld-devel</Dependency>
<Dependency>zlib-devel</Dependency>
<Dependency>nspr-devel</Dependency>
<Dependency>autoconf213</Dependency>
<Dependency>python3-devel</Dependency>
<Dependency>readline-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1">mozjs78-silence-sandbox-violations.patch</Patch> -->
<Patch level="1">mozjs128-fix-soname.patch</Patch>
<!--Patch level="1">Remove-unused-LLVM-and-Rust-build-dependencies.patch</Patch-->
</Patches>
</Source>
<Package>
<Name>mozjs-128</Name>
<RuntimeDependencies>
<Dependency>nspr</Dependency>
<Dependency>zlib</Dependency>
<Dependency>libgcc</Dependency>
<Dependency>readline</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
<Replaces>
<Package>mozjs-115</Package>
</Replaces>
</Package>
<Package>
<Name>mozjs-128-devel</Name>
<Summary>Development files for spidermonkey</Summary>
<RuntimeDependencies>
<Dependency release="current">mozjs-128</Dependency>
<Dependency>nspr-devel</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include</Path>
<Path fileType="data">/usr/lib/pkgconfig</Path>
<!--Path fileType="executable">/usr/bin/js17-config</Path-->
</Files>
<Replaces>
<Package>mozjs-115-devel</Package>
</Replaces>
</Package>
<History>
<Update release="2">
<Date>2025-12-20</Date>
<Version>128.14.0</Version>
<Comment>Version bump.</Comment>
<Name>Pisi Linux Community</Name>
<Email>admin@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2023-10-25</Date>
<Version>115.4.0</Version>
<Comment>First release</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
</History>
</PISI>
@@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>spidermonkey</Name>
<Summary xml:lang="tr">Javascript C Kitaplığı</Summary>
<Description xml:lang="tr">Mozilla'nın Javascript'in C implementasyonu.</Description>
<Description xml:lang="fr">Spidermonkey est l'Implémentation C de Javascript par Mozilla.</Description>
<Description xml:lang="es">Spidermonkey es la implementación de JavaScript con C de Mozilla.</Description>
</Source>
<Package>
<Name>spidermonkey-devel</Name>
<Summary xml:lang="tr">spidermonkey için geliştirme dosyaları</Summary>
</Package>
</PISI>