1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY spidermonkey-download-http "&mozilla-http;/firefox/releases/&spidermonkey-version;esr/source/firefox-&spidermonkey-version;esr.source.tar.xz">
|
---|
8 | <!ENTITY spidermonkey-download-ftp " ">
|
---|
9 | <!ENTITY spidermonkey-md5sum "c8deec3a0e558a1882f11bbea2fbd462">
|
---|
10 | <!ENTITY spidermonkey-size "484 MB">
|
---|
11 | <!ENTITY spidermonkey-buildsize "3.3 GB (39 MB installed after removing 36MB static lib; additional 0.4 GB for the tests)">
|
---|
12 | <!ENTITY spidermonkey-time "2.0 SBU (with parallelism=4; additional 3.8 SBU for the tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="spidermonkey" xreflabel="SpiderMonkey from Firefox-&spidermonkey-version;">
|
---|
16 | <?dbhtml filename="spidermonkey.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>SpiderMonkey from Firefox-&spidermonkey-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="spidermonkey">
|
---|
22 | <primary sortas="a-spidermonkey">SpiderMonkey</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to SpiderMonkey</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | <application>SpiderMonkey</application> is Mozilla's JavaScript and
|
---|
30 | WebAssembly Engine, written in C++ and Rust.
|
---|
31 | In BLFS, the source code of SpiderMonkey is taken from Firefox.
|
---|
32 | </para>
|
---|
33 |
|
---|
34 | <!-- To editors: make sure polkit works with mozjs when
|
---|
35 | tagging SpiderMonkey or upgrading it to a new major version. -->
|
---|
36 | &lfs120_checked;
|
---|
37 |
|
---|
38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
39 | <itemizedlist spacing="compact">
|
---|
40 | <listitem>
|
---|
41 | <para>
|
---|
42 | Download (HTTP): <ulink url="&spidermonkey-download-http;"/>
|
---|
43 | </para>
|
---|
44 | </listitem>
|
---|
45 | <listitem>
|
---|
46 | <para>
|
---|
47 | Download (FTP): <ulink url="&spidermonkey-download-ftp;"/>
|
---|
48 | </para>
|
---|
49 | </listitem>
|
---|
50 | <listitem>
|
---|
51 | <para>
|
---|
52 | Download MD5 sum: &spidermonkey-md5sum;
|
---|
53 | </para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>
|
---|
57 | Download size: &spidermonkey-size;
|
---|
58 | </para>
|
---|
59 | </listitem>
|
---|
60 | <listitem>
|
---|
61 | <para>
|
---|
62 | Estimated disk space required: &spidermonkey-buildsize;
|
---|
63 | </para>
|
---|
64 | </listitem>
|
---|
65 | <listitem>
|
---|
66 | <para>
|
---|
67 | Estimated build time: &spidermonkey-time;
|
---|
68 | </para>
|
---|
69 | </listitem>
|
---|
70 | </itemizedlist>
|
---|
71 | <!--
|
---|
72 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
73 | <itemizedlist spacing="compact">
|
---|
74 | <listitem>
|
---|
75 | <para>
|
---|
76 | Required patch:
|
---|
77 | <ulink url="&patch-root;/js-&JS91-version;-python_3_10-1.patch"/>
|
---|
78 | </para>
|
---|
79 | </listitem>
|
---|
80 | </itemizedlist>
|
---|
81 | -->
|
---|
82 | <bridgehead renderas="sect3">SpiderMonkey Dependencies</bridgehead>
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
85 | <para role="required">
|
---|
86 | <xref linkend="icu"/>,
|
---|
87 | <xref linkend="rust"/>, and
|
---|
88 | <xref linkend="which"/>
|
---|
89 | </para>
|
---|
90 |
|
---|
91 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
92 | <para role="recommended">
|
---|
93 | <!-- If clang is installed, it will be used instead of gcc.
|
---|
94 | gcc does not work for 32-bit system w/o -msse2 -mfpmath=sse:
|
---|
95 | https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
|
---|
96 | <xref linkend="llvm"/> (with <application>Clang</application>,
|
---|
97 | required for 32-bit systems without SSE2 capabilities)
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <important>
|
---|
101 | <para>
|
---|
102 | If you are building this package on a 32-bit system, and Clang
|
---|
103 | is not installed or you're overriding the default compiler choice
|
---|
104 | with the environment variable <envar>CXX</envar>, please read the
|
---|
105 | Command Explanations section first.
|
---|
106 | </para>
|
---|
107 | </important>
|
---|
108 |
|
---|
109 | <!-- It seems nasm is only used for aarch64-win64. -->
|
---|
110 | <!--bridgehead renderas="sect4">Optional</bridgehead>
|
---|
111 | <para role="optional">
|
---|
112 | <xref linkend="nasm"/>
|
---|
113 | </para-->
|
---|
114 |
|
---|
115 | </sect2>
|
---|
116 |
|
---|
117 | <sect2 role="installation">
|
---|
118 | <title>Installation of SpiderMonkey</title>
|
---|
119 |
|
---|
120 | <note>
|
---|
121 | <para>
|
---|
122 | Unlike most other packages in BLFS, the instructions below require
|
---|
123 | you to untar
|
---|
124 | <filename>firefox-&spidermonkey-version;esr.tar.xz</filename> and
|
---|
125 | change into the <filename>firefox-&spidermonkey-version;</filename>
|
---|
126 | folder.
|
---|
127 | </para>
|
---|
128 |
|
---|
129 | <para>
|
---|
130 | Extracting the tarball
|
---|
131 | will reset the permissions of the current directory to 0755 if you
|
---|
132 | have permission to do that. If you do this in a directory where
|
---|
133 | the sticky bit is set, such
|
---|
134 | as <filename class="directory">/tmp</filename> it will end with error
|
---|
135 | messages:
|
---|
136 | </para>
|
---|
137 |
|
---|
138 | <literallayout>tar: .: Cannot utime: Operation not permitted
|
---|
139 | tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
|
---|
140 | tar: Exiting with failure status due to previous errors
|
---|
141 | </literallayout>
|
---|
142 |
|
---|
143 | <para>
|
---|
144 | This does finish with non-zero status, but it does
|
---|
145 | <emphasis>NOT</emphasis> mean there is a real problem.
|
---|
146 | Do not untar as the <systemitem class="username">root</systemitem> user
|
---|
147 | in a directory where the sticky bit is set - that will unset it.
|
---|
148 | </para>
|
---|
149 |
|
---|
150 | </note>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | Install <application>SpiderMonkey</application> by running the following
|
---|
154 | commands:
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | <note>
|
---|
158 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
159 | href="../../xincludes/mozshm.xml"/>
|
---|
160 |
|
---|
161 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
162 | href="../../xincludes/mozconfigure.xml"/>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
|
---|
166 | the rust code will use all processors.
|
---|
167 | </para>
|
---|
168 | </note>
|
---|
169 |
|
---|
170 | <screen><userinput>mkdir obj &&
|
---|
171 | cd obj &&
|
---|
172 |
|
---|
173 | ../js/src/configure --prefix=/usr \
|
---|
174 | --with-intl-api \
|
---|
175 | --with-system-zlib \
|
---|
176 | --with-system-icu \
|
---|
177 | --disable-jemalloc \
|
---|
178 | --disable-debug-symbols \
|
---|
179 | --enable-readline &&
|
---|
180 | make</userinput></screen>
|
---|
181 |
|
---|
182 | <para>
|
---|
183 | To run the SpiderMonkey test suite, issue:
|
---|
184 | <command>make -C js/src check-jstests
|
---|
185 | JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
|
---|
186 | It's recommended to redirect the output into a log.
|
---|
187 | <!-- recheck when ICU gets upgraded -->
|
---|
188 | Because we are building with system ICU, 8 tests
|
---|
189 | (out of a total of more than 50,000) are known to fail.
|
---|
190 | </para>
|
---|
191 | <para>
|
---|
192 | The JIT test suite can use a large amount of system memory.
|
---|
193 | Running the JIT test suite without enough memory may invoke the
|
---|
194 | the kernel OOM killer and causes stability issues. To run the JIT test
|
---|
195 | suite, ensure the amount of available system memory is at least 16 GB,
|
---|
196 | <!-- When I run it within a cgroup with 8 GB memory assigned, the test
|
---|
197 | is OOM killed. Increasing the assigned memory to 16 GB makes
|
---|
198 | all tests pass. -->
|
---|
199 | then issue: <command>make -C js/src check-jit-test
|
---|
200 | JITTEST_EXTRA_ARGS="--timeout 300"</command>.
|
---|
201 | </para>
|
---|
202 |
|
---|
203 | <caution>
|
---|
204 | <para>
|
---|
205 | An issue in the installation process causes any running program which
|
---|
206 | links to SpiderMonkey shared library (for example, GNOME Shell) to
|
---|
207 | crash if SpiderMonkey is reinstalled, or upgraded or downgraded
|
---|
208 | without a change of the the major version number
|
---|
209 | (&spidermonkey-major; in &spidermonkey-version;). To work around
|
---|
210 | this issue, remove the old version of the SpiderMonkey shared
|
---|
211 | library before installation:
|
---|
212 | </para>
|
---|
213 |
|
---|
214 | <screen role="root"><userinput>rm -fv /usr/lib/libmozjs-&spidermonkey-major;.so</userinput></screen>
|
---|
215 | </caution>
|
---|
216 |
|
---|
217 | <para>
|
---|
218 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
219 | </para>
|
---|
220 |
|
---|
221 | <screen role="root"><userinput>make install &&
|
---|
222 | rm -v /usr/lib/libjs_static.ajs &&
|
---|
223 | sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js&spidermonkey-major;-config</userinput></screen>
|
---|
224 |
|
---|
225 | </sect2>
|
---|
226 |
|
---|
227 | <sect2 role="commands">
|
---|
228 | <title>Command Explanations</title>
|
---|
229 |
|
---|
230 | <para>
|
---|
231 | <parameter>--with-intl-api</parameter>: This enables the
|
---|
232 | internationalization functions required by
|
---|
233 | <application>Gjs</application>.
|
---|
234 | </para>
|
---|
235 |
|
---|
236 | <para>
|
---|
237 | <parameter>--with-system-*</parameter>: These parameters allow the build system
|
---|
238 | to use system versions of the above libraries. These are required for
|
---|
239 | stability.
|
---|
240 | </para>
|
---|
241 |
|
---|
242 | <para>
|
---|
243 | <parameter>--enable-readline</parameter>: This switch enables Readline
|
---|
244 | support in the SpiderMonkey command line interface.
|
---|
245 | </para>
|
---|
246 |
|
---|
247 | <para>
|
---|
248 | <parameter>--disable-jemalloc</parameter>: This switch disables the
|
---|
249 | internal memory allocator used in SpiderMonkey. jemalloc is only
|
---|
250 | intended for the Firefox browser environment. For other applications
|
---|
251 | using SpiderMonkey, the application may crash as items allocated in
|
---|
252 | the jemalloc allocator are freed on the system (glibc) allocator.
|
---|
253 | </para>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | <parameter>--disable-debug-symbols</parameter>: Don't generate debug
|
---|
257 | symbols since they are very large and most users won't need it. Remove
|
---|
258 | it if you want to debug SpiderMonkey.
|
---|
259 | </para>
|
---|
260 |
|
---|
261 | <para>
|
---|
262 | <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
|
---|
263 | static library which is not used by any BLFS package.
|
---|
264 | </para>
|
---|
265 |
|
---|
266 | <para>
|
---|
267 | <command>sed -i '/@NSPR_CFLAGS@/d'
|
---|
268 | /usr/bin/js&spidermonkey-major;-config</command>:
|
---|
269 | Prevent <command>js&spidermonkey-major;-config</command> from using
|
---|
270 | buggy CFLAGS.
|
---|
271 | </para>
|
---|
272 |
|
---|
273 | <para>
|
---|
274 | <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
|
---|
275 | prefer to use gcc and g++ instead of upstream's defaults of the
|
---|
276 | <application>clang</application> programs. With the release of
|
---|
277 | gcc-12 the build takes longer with gcc and g++, primarily because
|
---|
278 | of extra warnings, and is bigger. Pass these environment variables
|
---|
279 | to the configure script if you wish to continue to use gcc, g++
|
---|
280 | (by exporting them and unset them after the installation, or simply
|
---|
281 | prepending them before the
|
---|
282 | <command>../js/src/configure</command> command). If you are
|
---|
283 | building on a 32-bit system, also see below.
|
---|
284 | </para>
|
---|
285 |
|
---|
286 | <para>
|
---|
287 | <option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
|
---|
288 | Use SSE2 instead of 387 for double-precision floating-point
|
---|
289 | operations. It's needed by GCC to satisfy the expectations of
|
---|
290 | upstream (Mozilla) developers with floating-point arithmetic.
|
---|
291 | Use it if you are building this package on a 32-bit system with
|
---|
292 | GCC (if Clang is not installed or GCC is explicitly specified).
|
---|
293 | Note that this will cause SpiderMonkey to crash on a processor without
|
---|
294 | SSE2 capability. If you are running the system on such an old
|
---|
295 | processor, Clang is strictly needed. This setting is not needed on
|
---|
296 | 64-bit systems because all 64-bit x86 processors support SSE2 and the
|
---|
297 | 64-bit compilers (both Clang and GCC) use SSE2 by default.
|
---|
298 | </para>
|
---|
299 | </sect2>
|
---|
300 |
|
---|
301 | <sect2 role="content">
|
---|
302 | <title>Contents</title>
|
---|
303 |
|
---|
304 | <segmentedlist>
|
---|
305 | <segtitle>Installed Programs</segtitle>
|
---|
306 | <segtitle>Installed Libraries</segtitle>
|
---|
307 | <segtitle>Installed Directories</segtitle>
|
---|
308 |
|
---|
309 | <seglistitem>
|
---|
310 | <seg>
|
---|
311 | js&spidermonkey-major; and js&spidermonkey-major;-config
|
---|
312 | </seg>
|
---|
313 | <seg>
|
---|
314 | libmozjs-&spidermonkey-major;.so
|
---|
315 | </seg>
|
---|
316 | <seg>
|
---|
317 | /usr/include/mozjs-&spidermonkey-major;
|
---|
318 | </seg>
|
---|
319 | </seglistitem>
|
---|
320 | </segmentedlist>
|
---|
321 |
|
---|
322 | <variablelist>
|
---|
323 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
324 | <?dbfo list-presentation="list"?>
|
---|
325 | <?dbhtml list-presentation="table"?>
|
---|
326 |
|
---|
327 | <varlistentry id="js&spidermonkey-major;">
|
---|
328 | <term><command>js&spidermonkey-major;</command></term>
|
---|
329 | <listitem>
|
---|
330 | <para>
|
---|
331 | provides a command line interface to the
|
---|
332 | <application>JavaScript</application> engine
|
---|
333 | </para>
|
---|
334 | <indexterm zone="spidermonkey js&spidermonkey-major;">
|
---|
335 | <primary sortas="b-js&spidermonkey-major;">
|
---|
336 | js&spidermonkey-major;
|
---|
337 | </primary>
|
---|
338 | </indexterm>
|
---|
339 | </listitem>
|
---|
340 | </varlistentry>
|
---|
341 |
|
---|
342 | <varlistentry id="js&spidermonkey-major;-config">
|
---|
343 | <term><command>js&spidermonkey-major;-config</command></term>
|
---|
344 | <listitem>
|
---|
345 | <para>
|
---|
346 | is used to find the SpiderMonkey compiler and linker flags
|
---|
347 | </para>
|
---|
348 | <indexterm zone="spidermonkey js&spidermonkey-major;-config">
|
---|
349 | <primary sortas="b-js&spidermonkey-major;-config">i
|
---|
350 | js&spidermonkey-major;-config
|
---|
351 | </primary>
|
---|
352 | </indexterm>
|
---|
353 | </listitem>
|
---|
354 | </varlistentry>
|
---|
355 |
|
---|
356 | <varlistentry id="libmozjs-&spidermonkey-major;">
|
---|
357 | <term>
|
---|
358 | <filename class="libraryfile">
|
---|
359 | libmozjs-&spidermonkey-major;.so
|
---|
360 | </filename>
|
---|
361 | </term>
|
---|
362 | <listitem>
|
---|
363 | <para>
|
---|
364 | contains the Mozilla JavaScript API functions
|
---|
365 | </para>
|
---|
366 | <indexterm zone="spidermonkey libmozjs-&spidermonkey-major;">
|
---|
367 | <primary sortas="c-libmozjs&spidermonkey-major;">
|
---|
368 | libmozjs-&spidermonkey-major;.so
|
---|
369 | </primary>
|
---|
370 | </indexterm>
|
---|
371 | </listitem>
|
---|
372 | </varlistentry>
|
---|
373 | </variablelist>
|
---|
374 | </sect2>
|
---|
375 |
|
---|
376 | </sect1>
|
---|