source: general/genlib/spidermonkey.xml@ 9744d5a

12.1 12.2 gimp3 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128
Last change on this file since 9744d5a was fa5f6e9, checked in by Xi Ruoyao <xry111@…>, 11 months ago

spidermonkey: Do not hard code python3-majorver

  • Property mode set to 100644
File size: 15.7 KB
Line 
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 "93fb7e0baa3e99209e870f7c032ca513">
10 <!ENTITY spidermonkey-size "482 MB">
11 <!ENTITY spidermonkey-buildsize "3.5 GB (40 MB installed after removing 36MB static lib; additional 29 MB for the main tests and 31 MB for the jit tests with 4 cores online)">
12 <!ENTITY spidermonkey-time "2.5 SBU (with parallelism=4; additional 1.8 SBU for the main test and 4.4 SBU for the jit test)">
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"/>,
88 <xref linkend="six"/>, and
89 <xref linkend="which"/>
90 </para>
91
92 <bridgehead renderas="sect4">Recommended</bridgehead>
93 <para role="recommended">
94 <!-- If clang is installed, it will be used instead of gcc.
95 gcc does not work for 32-bit system w/o -msse2 -mfpmath=sse:
96 https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
97 <xref linkend="llvm"/> (with <application>Clang</application>,
98 required for 32-bit systems without SSE2 capabilities)
99 </para>
100
101 <important>
102 <para>
103 If you are building this package on a 32-bit system, and Clang
104 is not installed or you're overriding the default compiler choice
105 with the environment variable <envar>CXX</envar>, please read the
106 Command Explanations section first.
107 </para>
108 </important>
109
110 <!-- It seems nasm is only used for aarch64-win64. -->
111 <!--bridgehead renderas="sect4">Optional</bridgehead>
112 <para role="optional">
113 <xref linkend="nasm"/>
114 </para-->
115
116 </sect2>
117
118 <sect2 role="installation">
119 <title>Installation of SpiderMonkey</title>
120
121 <note>
122 <para>
123 Unlike most other packages in BLFS, the instructions below require
124 you to untar
125 <filename>firefox-&spidermonkey-version;esr.tar.xz</filename> and
126 change into the <filename>firefox-&spidermonkey-version;</filename>
127 folder.
128 </para>
129
130 <para>
131 Extracting the tarball
132 will reset the permissions of the current directory to 0755 if you
133 have permission to do that. If you do this in a directory where
134 the sticky bit is set, such
135 as <filename class="directory">/tmp</filename> it will end with error
136 messages:
137 </para>
138
139<literallayout>tar: .: Cannot utime: Operation not permitted
140tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
141tar: Exiting with failure status due to previous errors
142</literallayout>
143
144 <para>
145 This does finish with non-zero status, but it does
146 <emphasis>NOT</emphasis> mean there is a real problem.
147 Do not untar as the <systemitem class="username">root</systemitem> user
148 in a directory where the sticky bit is set - that will unset it.
149 </para>
150
151 </note>
152
153 <para>
154 The building system ships several internal copies of the Python 3
155 module <filename>six.py</filename>. The shipped copies are too old
156 to work well with Python 3.12 or later. Replace them with the
157 symlinks to <xref linkend='six'/> already installed on the system:
158 </para>
159
160<screen><userinput>for i in $(find -name six.py); do
161 ln -sfv /usr/lib/python&python3-majorver;/site-packages/six.py $i;
162done</userinput></screen>
163
164 <para>
165 Install <application>SpiderMonkey</application> by running the following
166 commands:
167 </para>
168
169 <note>
170 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
171 href="../../xincludes/mozshm.xml"/>
172
173 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
174 href="../../xincludes/mozconfigure.xml"/>
175
176 <para>
177 Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
178 the rust code will use all processors.
179 </para>
180 </note>
181
182<screen><userinput>mkdir obj &amp;&amp;
183cd obj &amp;&amp;
184
185../js/src/configure --prefix=/usr \
186 --with-intl-api \
187 --with-system-zlib \
188 --with-system-icu \
189 --disable-jemalloc \
190 --disable-debug-symbols \
191 --enable-readline &amp;&amp;
192make</userinput></screen>
193
194 <para>
195 To run the SpiderMonkey test suite, issue:
196 <command>make -C js/src check-jstests
197 JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
198 It's recommended to redirect the output into a log.
199 <!-- recheck when ICU gets upgraded -->
200 Because we are building with system ICU, 8 tests
201 (out of a total of more than 50,000) are known to fail.
202 The test suite is executed with all CPU cores available: even in a
203 cgroup with less cores assigned, it still attempts to spawn as many
204 testing jobs as the number of <emphasis>all</emphasis> cores in the
205 system; fortunately the kernel still won't run these jobs on cores
206 not assigned to the cgroup so the CPU usage is still controlled.
207 </para>
208 <para>
209 To run the JIT test suite, issue: <command>make -C js/src
210 check-jit-test JITTEST_EXTRA_ARGS="--timeout 300"</command>.
211 Like the SpiderMonkey test suite, the number of test jobs is same as
212 the number of all CPU cores in the system even if a cgroup is used. To
213 make things worse, there are six tests each of them will use 3 GB
214 of system memory, so the peak memory usage may be up to 18 GB if the
215 number of cores is six or more. Running the JIT test suite without
216 enough memory may invoke the kernel OOM killer and cause stability
217 issues. If you don't have enough system memory available, append
218 <option>-jN</option> after <option>--timeout 300</option> with N
219 replaced by the number of parallel test jobs you want to start. For
220 example, if you have 16 GB system memory available and 8 CPU cores,
221 issue <command>make -C js/src check-jit-test
222 JITTEST_EXTRA_ARGS="--timeout=300 -j5"</command> to run the test with
223 5 parallel jobs so the memory usage won't exceed 15 GB.
224 <!-- TL;DR: DO NOT REMOVE MEMORY USAGE NOTE W/O MY CONFIRMATION!
225
226 "six tests": bug1782468-ptrdiff-veclen.js, it's ran with 6
227 different configurations.
228
229 "may": this is stochasitic (like all parallelization issue),
230 don't remove the note about memory usage simply because "I cannot
231 reproduce it".
232
233 "peak": the time period using so much memory is very short, so
234 don't just watch the output of "top" or "free" with eyesight.
235 Run the test in a cgroup and read the "memory.peak" psuedo file
236 for a proper measurement.
237
238 Q: Why not just document some test failures?
239 A: This *really* can cause stability issue because the kernel
240 may OOM kill another process if the test is not ran in a
241 cgroup with memory.max set. Even if running it in a cgroup,
242 the kernel may still OOM kill the "main" process controlling
243 the test process instead of a single test job, causing a
244 incomplete test.
245
246 - xry111
247 -->
248 </para>
249
250 <caution>
251 <para>
252 An issue in the installation process causes any running program which
253 links to SpiderMonkey shared library (for example, GNOME Shell) to
254 crash if SpiderMonkey is reinstalled, or upgraded or downgraded
255 without a change of the major version number
256 (&spidermonkey-major; in &spidermonkey-version;). To work around
257 this issue, remove the old version of the SpiderMonkey shared
258 library before installation:
259 </para>
260
261<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-&spidermonkey-major;.so</userinput></screen>
262 </caution>
263
264 <para>
265 Now, as the <systemitem class="username">root</systemitem> user:
266 </para>
267
268<screen role="root"><userinput>make install &amp;&amp;
269rm -v /usr/lib/libjs_static.ajs &amp;&amp;
270sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js&spidermonkey-major;-config</userinput></screen>
271
272 </sect2>
273
274 <sect2 role="commands">
275 <title>Command Explanations</title>
276
277 <para>
278 <parameter>--with-intl-api</parameter>: This enables the
279 internationalization functions required by
280 <application>Gjs</application>.
281 </para>
282
283 <para>
284 <parameter>--with-system-*</parameter>: These parameters allow the build system
285 to use system versions of the above libraries. These are required for
286 stability.
287 </para>
288
289 <para>
290 <parameter>--enable-readline</parameter>: This switch enables Readline
291 support in the SpiderMonkey command line interface.
292 </para>
293
294 <para>
295 <parameter>--disable-jemalloc</parameter>: This switch disables the
296 internal memory allocator used in SpiderMonkey. jemalloc is only
297 intended for the Firefox browser environment. For other applications
298 using SpiderMonkey, the application may crash as items allocated in
299 the jemalloc allocator are freed on the system (glibc) allocator.
300 </para>
301
302 <para>
303 <parameter>--disable-debug-symbols</parameter>: Don't generate debug
304 symbols since they are very large and most users won't need it. Remove
305 it if you want to debug SpiderMonkey.
306 </para>
307
308 <para>
309 <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
310 static library which is not used by any BLFS package.
311 </para>
312
313 <para>
314 <command>sed -i '/@NSPR_CFLAGS@/d'
315 /usr/bin/js&spidermonkey-major;-config</command>:
316 Prevent <command>js&spidermonkey-major;-config</command> from using
317 buggy CFLAGS.
318 </para>
319
320 <para>
321 <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
322 prefer to use gcc and g++ instead of upstream's defaults of the
323 <application>clang</application> programs. With the release of
324 gcc-12 the build takes longer with gcc and g++, primarily because
325 of extra warnings, and is bigger. Pass these environment variables
326 to the configure script if you wish to continue to use gcc, g++
327 (by exporting them and unset them after the installation, or simply
328 prepending them before the
329 <command>../js/src/configure</command> command). If you are
330 building on a 32-bit system, also see below.
331 </para>
332
333 <para>
334 <option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
335 Use SSE2 instead of 387 for double-precision floating-point
336 operations. It's needed by GCC to satisfy the expectations of
337 upstream (Mozilla) developers with floating-point arithmetic.
338 Use it if you are building this package on a 32-bit system with
339 GCC (if Clang is not installed or GCC is explicitly specified).
340 Note that this will cause SpiderMonkey to crash on a processor without
341 SSE2 capability. If you are running the system on such an old
342 processor, Clang is strictly needed. This setting is not needed on
343 64-bit systems because all 64-bit x86 processors support SSE2 and the
344 64-bit compilers (both Clang and GCC) use SSE2 by default.
345 </para>
346 </sect2>
347
348 <sect2 role="content">
349 <title>Contents</title>
350
351 <segmentedlist>
352 <segtitle>Installed Programs</segtitle>
353 <segtitle>Installed Libraries</segtitle>
354 <segtitle>Installed Directories</segtitle>
355
356 <seglistitem>
357 <seg>
358 js&spidermonkey-major; and js&spidermonkey-major;-config
359 </seg>
360 <seg>
361 libmozjs-&spidermonkey-major;.so
362 </seg>
363 <seg>
364 /usr/include/mozjs-&spidermonkey-major;
365 </seg>
366 </seglistitem>
367 </segmentedlist>
368
369 <variablelist>
370 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
371 <?dbfo list-presentation="list"?>
372 <?dbhtml list-presentation="table"?>
373
374 <varlistentry id="js&spidermonkey-major;">
375 <term><command>js&spidermonkey-major;</command></term>
376 <listitem>
377 <para>
378 provides a command line interface to the
379 <application>JavaScript</application> engine
380 </para>
381 <indexterm zone="spidermonkey js&spidermonkey-major;">
382 <primary sortas="b-js&spidermonkey-major;">
383 js&spidermonkey-major;
384 </primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry id="js&spidermonkey-major;-config">
390 <term><command>js&spidermonkey-major;-config</command></term>
391 <listitem>
392 <para>
393 is used to find the SpiderMonkey compiler and linker flags
394 </para>
395 <indexterm zone="spidermonkey js&spidermonkey-major;-config">
396 <primary sortas="b-js&spidermonkey-major;-config">i
397 js&spidermonkey-major;-config
398 </primary>
399 </indexterm>
400 </listitem>
401 </varlistentry>
402
403 <varlistentry id="libmozjs-&spidermonkey-major;">
404 <term>
405 <filename class="libraryfile">
406 libmozjs-&spidermonkey-major;.so
407 </filename>
408 </term>
409 <listitem>
410 <para>
411 contains the Mozilla JavaScript API functions
412 </para>
413 <indexterm zone="spidermonkey libmozjs-&spidermonkey-major;">
414 <primary sortas="c-libmozjs&spidermonkey-major;">
415 libmozjs-&spidermonkey-major;.so
416 </primary>
417 </indexterm>
418 </listitem>
419 </varlistentry>
420 </variablelist>
421 </sect2>
422
423</sect1>
Note: See TracBrowser for help on using the repository browser.