mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-12 07:04:46 +08:00
The default build configuration in 102.13 appears to have moved back to GCC. Rather than change it, let's just modify math_private.h again with a simpler tweak to allow it to build properly again (wrapped in a case statement). This particular problem resurfacing is quite odd. I can confirm that js-102.12.0 does work though, but updated due to the JS CVE. Firefox 115.x works well on i686 and builds without any tweaks, so whenever we move to js115, this should not be a problem anymore.
378 lines
13 KiB
XML
378 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 ff102-version "&firefox-version;">-->
|
|
<!ENTITY js102-download-http "&mozilla-http;/firefox/releases/&JS102-version;esr/source/firefox-&JS102-version;esr.source.tar.xz">
|
|
<!ENTITY js102-download-ftp " ">
|
|
<!ENTITY js102-md5sum "42b9a73626ed8281b86222f6f0a96c73">
|
|
<!ENTITY js102-md5sum "">
|
|
<!ENTITY js102-size "464 MB">
|
|
<!ENTITY js102-buildsize "3.3 GB (38 MB installed after removing 34MB static lib)">
|
|
<!ENTITY js102-time "1.7 SBU (with parallelism=4)">
|
|
]>
|
|
|
|
<sect1 id="js102" xreflabel="JS-&JS102-version;">
|
|
<?dbhtml filename="js102.html"?>
|
|
|
|
|
|
<title>JS-&JS102-version;</title>
|
|
|
|
<indexterm zone="js102">
|
|
<primary sortas="a-js102">js102</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. -->
|
|
&lfs113_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Download (HTTP): <ulink url="&js102-download-http;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download (FTP): <ulink url="&js102-download-ftp;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download MD5 sum: &js102-md5sum;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download size: &js102-size;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated disk space required: &js102-buildsize;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated build time: &js102-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">JS102 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 systems without SSE2 capabilities)
|
|
</para>
|
|
|
|
<!-- It seems nasm is only used for aarch64-win64. -->
|
|
<!--bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="nasm"/>
|
|
</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-&JS102-version;esr.tar.xz</filename> and
|
|
change into the <filename>firefox-&JS102-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.
|
|
07-21-2023: Issue has resurfaced again when using the default build
|
|
instructions for JS (which uses GCC). The problem is not present
|
|
in Firefox 115 though (which works OK on i686). -renodr
|
|
-->
|
|
|
|
<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 's/typedef double/typedef 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>
|
|
|
|
<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 -->
|
|
<!-- Still true with 102 -renodr -->
|
|
Because we are building with system ICU, more than one hundred tests
|
|
(out of a total of more than 50,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 JS102 shared library (for example, GNOME Shell) to crash if
|
|
JS102 is upgraded or reinstalled. To work around this issue, remove
|
|
the old version of the JS102 shared library before installation:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-102.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/js102-config</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<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 JS102. jemalloc is only intended for
|
|
the Firefox browser environment. For other applications using JS102,
|
|
the application may crash as items allocated in the jemalloc allocator
|
|
are freed on the 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 JS102.
|
|
</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/js102-config</command>:
|
|
Prevent <command>js102-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>
|
|
js102 and js102-config
|
|
</seg>
|
|
<seg>
|
|
libmozjs-102.so
|
|
</seg>
|
|
<seg>
|
|
/usr/include/mozjs-102
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="js102-js102">
|
|
<term><command>js102</command></term>
|
|
<listitem>
|
|
<para>
|
|
provides a command line interface to the
|
|
<application>JavaScript</application> engine
|
|
</para>
|
|
<indexterm zone="js102 js102">
|
|
<primary sortas="b-js102">js102</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="js102-config">
|
|
<term><command>js102-config</command></term>
|
|
<listitem>
|
|
<para>
|
|
is used to find the JS compiler and linker flags
|
|
</para>
|
|
<indexterm zone="js102 js102-config">
|
|
<primary sortas="b-js102-config">js102-config</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libmozjs-102">
|
|
<term><filename class="libraryfile">libmozjs-102.so</filename></term>
|
|
<listitem>
|
|
<para>
|
|
contains the Mozilla JavaScript API functions
|
|
</para>
|
|
<indexterm zone="js102 libmozjs-102">
|
|
<primary sortas="c-libmozjs102">libmozjs-102.so</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</sect2>
|
|
|
|
</sect1>
|