source: general/genlib/js91.xml@ 75d38562

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/soup3 xry111/xf86-video-removal
Last change on this file since 75d38562 was 75d38562, checked in by Xi Ruoyao <xry111@…>, 20 months ago

add comments about tagging duktape and/or mozjs

So we won't need to add something like "this package is known to work
with {duktape,mozjs} in polkit page.

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