source: general/genlib/js102.xml@ 274ac683

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 274ac683 was cb594b6c, checked in by Xi Ruoyao <xry111@…>, 12 months ago

general: Remove non-exist User Notes link

Part of User Notes removal by
https://www.linuxfromscratch.org/~xry111/remove-nonexist-usernote.sh

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