source: general/genlib/js91.xml@ 716ab1ac

11.2 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 716ab1ac was 716ab1ac, checked in by Xi Ruoyao <xry111@…>, 20 months ago

js-91: clang is required on 32-bit system

  • Property mode set to 100644
File size: 11.6 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 "8887bf394e4caec1af09e7568cfaed9e">
17 <!ENTITY js91-size "363 MB">
18 <!ENTITY js91-buildsize "3.0 GB (37 MB installed after removing 33MB static lib)">
19 <!ENTITY js91-time "1.7 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 &lfs112_checked;
46
47 <bridgehead renderas="sect3">Package Information</bridgehead>
48 <itemizedlist spacing="compact">
49 <listitem>
50 <para>
51 Download (HTTP): <ulink url="&js91-download-http;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download (FTP): <ulink url="&js91-download-ftp;"/>
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download MD5 sum: &js91-md5sum;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download size: &js91-size;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated disk space required: &js91-buildsize;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Estimated build time: &js91-time;
77 </para>
78 </listitem>
79 </itemizedlist>
80<!--
81 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
82 <itemizedlist spacing="compact">
83 <listitem>
84 <para>
85 Required patch:
86 <ulink url="&patch-root;/js-&JS91-version;-python_3_10-1.patch"/>
87 </para>
88 </listitem>
89 </itemizedlist>
90-->
91 <bridgehead renderas="sect3">JS91 Dependencies</bridgehead>
92
93 <bridgehead renderas="sect4">Required</bridgehead>
94 <para role="required">
95 <xref linkend="icu"/>,
96 <xref linkend="rust"/>, and
97 <xref linkend="which"/>
98 </para>
99
100 <bridgehead renderas="sect4">Recommended</bridgehead>
101 <para role="recommended">
102 <!-- If clang is installed, it will be used instead of gcc.
103 gcc does not work for 32-bit system:
104 https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
105 <xref linkend="llvm"/> (with <application>Clang</application>,
106 required for 32-bit system)
107 </para>
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 <para condition="html" role="usernotes">
116 User Notes: <ulink url="&blfs-wiki;/js91"/>
117 </para>
118 </sect2>
119
120 <sect2 role="installation">
121 <title>Installation of JS</title>
122
123 <note>
124 <para>
125 Unlike most other packages in BLFS, the instructions below require you
126 to untar <filename>firefox-&JS91-version;esr.tar.xz</filename> and
127 change into the <filename>firefox-&JS91-version;</filename> 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 If building on a 32 bit machine, the following sed works around an issue
155 with an incompatible <quote>double</quote> type in one header file:
156 </para>
157
158<screen><userinput>case "$(uname -m)" in
159 i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
160 -i modules/fdlibm/src/math_private.h ;;
161esac</userinput></screen>
162
163 <para>
164 Install <application>JS</application> by running the following
165 commands:
166 </para>
167
168 <note>
169 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
170 href="../../xincludes/mozshm.xml"/>
171
172 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
173 href="../../xincludes/mozconfigure.xml"/>
174
175 <para>
176 Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
177 the rust code will use all processors.
178 </para>
179 </note>
180
181
182<screen><userinput>mkdir obj &amp;&amp;
183cd obj &amp;&amp;
184
185sh ../js/src/configure.in --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 JS 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, more than one hundred tests
201 (out of a total of more than 40,000) are known to fail.
202 </para>
203 <para>
204 To run the JIT test suite, issue:
205 <command>make -C js/src check-jit-test
206 JITTEST_EXTRA_ARGS="--timeout 300"</command>.
207 </para>
208
209 <caution>
210 <para>
211 An issue in the installation process causes any running program which
212 links to JS91 shared library (for example, GNOME Shell) to crash if
213 JS91 is upgraded or reinstalled. To work around this issue, remove
214 the old version of the JS91 shared library before installation:
215 </para>
216
217<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-91.so</userinput></screen>
218 </caution>
219
220 <para>
221 Now, as the <systemitem class="username">root</systemitem> user:
222 </para>
223
224<screen role="root"><userinput>make install &amp;&amp;
225rm -v /usr/lib/libjs_static.ajs &amp;&amp;
226sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</userinput></screen>
227
228 </sect2>
229
230 <!-- Several gjs-1.65.90 tests fail with js91. Not sure why.
231 OTOH an "otherwise" GNOME-3.36 environment works fine. -->
232
233 <sect2 role="commands">
234 <title>Command Explanations</title>
235
236 <para>
237 <command>sh ../js/src/configure.in</command>:
238 <filename>configure.in</filename> is actually a shell script, but
239 the executable bit is not set in its permission mode so it's needed
240 to explicitly run it with <command>sh</command>.
241 </para>
242
243 <para>
244 <parameter>--with-intl-api</parameter>: This enables the
245 internationalization functions required by
246 <application>Gjs</application>.
247 </para>
248
249 <para>
250 <parameter>--with-system-*</parameter>: These parameters allow the build system
251 to use system versions of the above libraries. These are required for
252 stability.
253 </para>
254
255 <para>
256 <parameter>--enable-readline</parameter>: This switch enables Readline
257 support in the JS shell.
258 </para>
259
260 <para>
261 <parameter>--disable-jemalloc</parameter>: This switch disables the
262 internal memory allocator used in JS91. jemalloc is only intended for
263 the Firefox browser environment. For other applications using JS91,
264 if JS91 uses jemalloc, the application may crash as items allocated
265 in jemalloc allocator are freed on system (glibc) allocator.
266 </para>
267
268 <para>
269 <parameter>--disable-debug-symbols</parameter>: Don't generate debug
270 symbols since they are very large and most users won't need it. Remove
271 it if you want to debug JS91.
272 </para>
273
274 <para>
275 <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
276 static library which is not used by any BLFS package.
277 </para>
278
279 <para>
280 <command>sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</command>:
281 Prevent <command>js91-config</command> from using buggy CFLAGS.
282 </para>
283
284 <para>
285 <parameter><envar>CC=gcc CXX=g++</envar></parameter>: BLFS used to
286 prefer to use gcc and g++ instead of upstream's defaults of the
287 <application>clang</application> programs. With the release of
288 gcc-12 the build takes longer with gcc and g++, primarily because
289 of extra warnings, and is bigger. Pass these environment variables
290 to the configure script if you wish to continue to use gcc, g++
291 (by exporting them and unset them after the installation, or simply
292 prepending them before the
293 <command>sh ../js/src/configure.in</command> command).
294 </para>
295
296 </sect2>
297
298 <sect2 role="content">
299 <title>Contents</title>
300
301 <segmentedlist>
302 <segtitle>Installed Programs</segtitle>
303 <segtitle>Installed Libraries</segtitle>
304 <segtitle>Installed Directories</segtitle>
305
306 <seglistitem>
307 <seg>
308 js91 and js91-config
309 </seg>
310 <seg>
311 libmozjs-91.so
312 </seg>
313 <seg>
314 /usr/include/mozjs-91
315 </seg>
316 </seglistitem>
317 </segmentedlist>
318
319 <variablelist>
320 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
321 <?dbfo list-presentation="list"?>
322 <?dbhtml list-presentation="table"?>
323
324 <varlistentry id="js91-js91">
325 <term><command>js91</command></term>
326 <listitem>
327 <para>
328 provides a command line interface to the
329 <application>JavaScript</application> engine
330 </para>
331 <indexterm zone="js91 js91">
332 <primary sortas="b-js91">js91</primary>
333 </indexterm>
334 </listitem>
335 </varlistentry>
336
337 <varlistentry id="js91-config">
338 <term><command>js91-config</command></term>
339 <listitem>
340 <para>
341 is used to find the JS compiler and linker flags
342 </para>
343 <indexterm zone="js91 js91-config">
344 <primary sortas="b-js91-config">js91-config</primary>
345 </indexterm>
346 </listitem>
347 </varlistentry>
348
349 <varlistentry id="libmozjs-91">
350 <term><filename class="libraryfile">libmozjs-91.so</filename></term>
351 <listitem>
352 <para>
353 contains the Mozilla JavaScript API functions
354 </para>
355 <indexterm zone="js91 libmozjs-91">
356 <primary sortas="c-libmozjs91">libmozjs-91.so</primary>
357 </indexterm>
358 </listitem>
359 </varlistentry>
360 </variablelist>
361 </sect2>
362
363</sect1>
Note: See TracBrowser for help on using the repository browser.