mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-24 15:12:11 +08:00
3f2db3a638
They only contain a date tag that is nowhere used.
389 lines
13 KiB
XML
389 lines
13 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!-- for when firefox and js91 use same version
|
|
<!ENTITY ff91-version "&firefox-version;">
|
|
and when they are on different versions - keep this for when
|
|
we have moved to next firefox-esr (ff-91) and JS has not moved
|
|
<!ENTITY ff91-version "&JS91-version;"> -->
|
|
|
|
<!-- <!ENTITY ff91-version "&firefox-version;">-->
|
|
<!ENTITY js91-download-http "&mozilla-http;/firefox/releases/&JS91-version;esr/source/firefox-&JS91-version;esr.source.tar.xz">
|
|
<!ENTITY js91-download-ftp " ">
|
|
<!ENTITY js91-md5sum "63f84a77e8266256428c77895ecfb481">
|
|
<!ENTITY js91-size "362 MB">
|
|
<!ENTITY js91-buildsize "3.0 GB (38 MB installed after removing 33MB static lib)">
|
|
<!ENTITY js91-time "2.1 SBU (with parallelism=4)">
|
|
]>
|
|
|
|
<sect1 id="js91" xreflabel="JS-&JS91-version;">
|
|
<?dbhtml filename="js91.html"?>
|
|
|
|
|
|
<title>JS-&JS91-version;</title>
|
|
|
|
<indexterm zone="js91">
|
|
<primary sortas="a-js91">js91</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to JS</title>
|
|
|
|
<para>
|
|
<application>JS</application> (also referred as
|
|
<application>SpiderMonkey</application>) is Mozilla's JavaScript and
|
|
WebAssembly Engine, written in C++ and Rust.
|
|
In BLFS, the source code of JS is taken from Firefox.
|
|
</para>
|
|
|
|
<!-- To editors: make sure polkit work with mozjs before
|
|
tagging mozjs. -->
|
|
&lfs112_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Download (HTTP): <ulink url="&js91-download-http;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download (FTP): <ulink url="&js91-download-ftp;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download MD5 sum: &js91-md5sum;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download size: &js91-size;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated disk space required: &js91-buildsize;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated build time: &js91-time;
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<!--
|
|
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Required patch:
|
|
<ulink url="&patch-root;/js-&JS91-version;-python_3_10-1.patch"/>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
-->
|
|
<bridgehead renderas="sect3">JS91 Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="icu"/>,
|
|
<xref linkend="rust"/>, and
|
|
<xref linkend="which"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Recommended</bridgehead>
|
|
<para role="recommended">
|
|
<!-- If clang is installed, it will be used instead of gcc.
|
|
gcc does not work for 32-bit system w/o -msse2 -mfpmath=sse:
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
|
|
<xref linkend="llvm"/> (with <application>Clang</application>,
|
|
required for 32-bit system without SSE2 capability)
|
|
</para>
|
|
|
|
<!-- It seems nasm is only used for aarch64-win64. -->
|
|
<!--bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="nasm"/>
|
|
</para-->
|
|
|
|
<para condition="html" role="usernotes">
|
|
User Notes: <ulink url="&blfs-wiki;/js91"/>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of JS</title>
|
|
|
|
<note>
|
|
<para>
|
|
Unlike most other packages in BLFS, the instructions below require you
|
|
to untar <filename>firefox-&JS91-version;esr.tar.xz</filename> and
|
|
change into the <filename>firefox-&JS91-version;</filename> folder.
|
|
</para>
|
|
|
|
<para>
|
|
Extracting the tarball
|
|
will reset the permissions of the current directory to 0755 if you
|
|
have permission to do that. If you do this in a directory where
|
|
the sticky bit is set, such
|
|
as <filename class="directory">/tmp</filename> it will end with error
|
|
messages:
|
|
</para>
|
|
|
|
<literallayout>tar: .: Cannot utime: Operation not permitted
|
|
tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
|
|
tar: Exiting with failure status due to previous errors
|
|
</literallayout>
|
|
|
|
<para>
|
|
This does finish with non-zero status, but it does
|
|
<emphasis>NOT</emphasis> mean there is a real problem.
|
|
Do not untar as the <systemitem class="username">root</systemitem> user
|
|
in a directory where the sticky bit is set - that will unset it.
|
|
</para>
|
|
|
|
</note>
|
|
<!-- not needed when using clang. Upstream bug at
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
|
|
|
|
<para>
|
|
If building on a 32 bit machine, the following sed works around an issue
|
|
with an incompatible <quote>double</quote> type in one header file:
|
|
</para>
|
|
|
|
<screen><userinput>case "$(uname -m)" in
|
|
i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
|
|
-i modules/fdlibm/src/math_private.h ;;
|
|
esac</userinput></screen>
|
|
-->
|
|
<para>
|
|
Install <application>JS</application> by running the following
|
|
commands:
|
|
</para>
|
|
|
|
<note>
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
href="../../xincludes/mozshm.xml"/>
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
href="../../xincludes/mozconfigure.xml"/>
|
|
|
|
<para>
|
|
Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
|
|
the rust code will use all processors.
|
|
</para>
|
|
</note>
|
|
|
|
<para>
|
|
First remove an obsolete flag in python code, that has been removed
|
|
in python-3.11:
|
|
</para>
|
|
|
|
<screen><userinput>grep -rl \"rU\" | xargs sed -i 's/"rU"/"r"/'</userinput></screen>
|
|
|
|
<para>
|
|
Then run:
|
|
</para>
|
|
|
|
<screen><userinput>mkdir obj &&
|
|
cd obj &&
|
|
|
|
sh ../js/src/configure.in --prefix=/usr \
|
|
--with-intl-api \
|
|
--with-system-zlib \
|
|
--with-system-icu \
|
|
--disable-jemalloc \
|
|
--disable-debug-symbols \
|
|
--enable-readline &&
|
|
make</userinput></screen>
|
|
|
|
<para>
|
|
To run the JS test suite, issue:
|
|
<command>make -C js/src check-jstests
|
|
JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
|
|
It's recommended to redirect the output into a log.
|
|
<!-- recheck when ICU gets upgraded -->
|
|
Because we are building with system ICU, more than one hundred tests
|
|
(out of a total of more than 40,000) are known to fail.
|
|
</para>
|
|
<para>
|
|
To run the JIT test suite, issue:
|
|
<command>make -C js/src check-jit-test
|
|
JITTEST_EXTRA_ARGS="--timeout 300"</command>.
|
|
</para>
|
|
|
|
<caution>
|
|
<para>
|
|
An issue in the installation process causes any running program which
|
|
links to JS91 shared library (for example, GNOME Shell) to crash if
|
|
JS91 is upgraded or reinstalled. To work around this issue, remove
|
|
the old version of the JS91 shared library before installation:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-91.so</userinput></screen>
|
|
</caution>
|
|
|
|
<para>
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>make install &&
|
|
rm -v /usr/lib/libjs_static.ajs &&
|
|
sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<!-- Several gjs-1.65.90 tests fail with js91. Not sure why.
|
|
OTOH an "otherwise" GNOME-3.36 environment works fine. -->
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para>
|
|
<command>sh ../js/src/configure.in</command>:
|
|
<filename>configure.in</filename> is actually a shell script, but
|
|
the executable bit is not set in its permission mode so it's needed
|
|
to explicitly run it with <command>sh</command>.
|
|
</para>
|
|
|
|
<para>
|
|
<parameter>--with-intl-api</parameter>: This enables the
|
|
internationalization functions required by
|
|
<application>Gjs</application>.
|
|
</para>
|
|
|
|
<para>
|
|
<parameter>--with-system-*</parameter>: These parameters allow the build system
|
|
to use system versions of the above libraries. These are required for
|
|
stability.
|
|
</para>
|
|
|
|
<para>
|
|
<parameter>--enable-readline</parameter>: This switch enables Readline
|
|
support in the JS shell.
|
|
</para>
|
|
|
|
<para>
|
|
<parameter>--disable-jemalloc</parameter>: This switch disables the
|
|
internal memory allocator used in JS91. jemalloc is only intended for
|
|
the Firefox browser environment. For other applications using JS91,
|
|
if JS91 uses jemalloc, the application may crash as items allocated
|
|
in jemalloc allocator are freed on system (glibc) allocator.
|
|
</para>
|
|
|
|
<para>
|
|
<parameter>--disable-debug-symbols</parameter>: Don't generate debug
|
|
symbols since they are very large and most users won't need it. Remove
|
|
it if you want to debug JS91.
|
|
</para>
|
|
|
|
<para>
|
|
<command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
|
|
static library which is not used by any BLFS package.
|
|
</para>
|
|
|
|
<para>
|
|
<command>sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</command>:
|
|
Prevent <command>js91-config</command> from using buggy CFLAGS.
|
|
</para>
|
|
|
|
<para>
|
|
<option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
|
|
prefer to use gcc and g++ instead of upstream's defaults of the
|
|
<application>clang</application> programs. With the release of
|
|
gcc-12 the build takes longer with gcc and g++, primarily because
|
|
of extra warnings, and is bigger. Pass these environment variables
|
|
to the configure script if you wish to continue to use gcc, g++
|
|
(by exporting them and unset them after the installation, or simply
|
|
prepending them before the
|
|
<command>sh ../js/src/configure.in</command> command). If you are
|
|
building on a 32-bit system, also see below.
|
|
</para>
|
|
|
|
<para>
|
|
<option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
|
|
Use SSE2 instead of 387 for double-precision floating-point
|
|
operations. It's needed by GCC to satisfy the expectations of
|
|
upstream (Mozilla) developers with floating-point arithmetic.
|
|
Use it if you are building this package on a 32-bit system with
|
|
GCC (if Clang is not installed or GCC is explicitly specified).
|
|
Note that this will cause JS to crash on a processor without SSE2
|
|
capability. If you are running the system on such an old processor,
|
|
Clang is strictly needed. This setting is not needed on 64-bit
|
|
systems because all 64-bit x86 processors support SSE2 and the 64-bit
|
|
compilers (both Clang and GCC) use SSE2 by default.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
js91 and js91-config
|
|
</seg>
|
|
<seg>
|
|
libmozjs-91.so
|
|
</seg>
|
|
<seg>
|
|
/usr/include/mozjs-91
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="js91-js91">
|
|
<term><command>js91</command></term>
|
|
<listitem>
|
|
<para>
|
|
provides a command line interface to the
|
|
<application>JavaScript</application> engine
|
|
</para>
|
|
<indexterm zone="js91 js91">
|
|
<primary sortas="b-js91">js91</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="js91-config">
|
|
<term><command>js91-config</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to find the JS compiler and linker flags
|
|
</para>
|
|
<indexterm zone="js91 js91-config">
|
|
<primary sortas="b-js91-config">js91-config</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libmozjs-91">
|
|
<term><filename class="libraryfile">libmozjs-91.so</filename></term>
|
|
<listitem>
|
|
<para>
|
|
contains the Mozilla JavaScript API functions
|
|
</para>
|
|
<indexterm zone="js91 libmozjs-91">
|
|
<primary sortas="c-libmozjs91">libmozjs-91.so</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</sect2>
|
|
|
|
</sect1>
|