source: general/genlib/js91.xml@ 8e637fc

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 8e637fc was 8e637fc, checked in by Xi Ruoyao <xry111@…>, 22 months ago

js: reword CC=gcc CXX=g++ description

Note than only "setting" CC=gcc CXX=g++ will not work:

CC=gcc
CXX=g++
sh ../js/src/configure.in ...

will not pass CC=gcc and CXX=g++ to sh. It's needed to export CC and
CXX:

CC=gcc
CXX=g++
export CC CXX
sh ../js/src/configure.in ...

Or, explicitly pass them:

CC=gcc CXX=g++ h ../js/src/configure.in ...

  • Property mode set to 100644
File size: 11.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 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 "34e1d9a3347bccb1010491d3789aa77e">
17 <!ENTITY js91-size "367 MB">
18 <!ENTITY js91-buildsize "3.1 GB (37 MB installed after removing 36MB static lib)">
19 <!ENTITY js91-time "2.2 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 &lfs111_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 <!-- Should we list llvm here? -->
99 </para>
100
101 <bridgehead renderas="sect4">Recommended</bridgehead>
102 <para role="recommended">
103 <xref linkend="llvm"/> (with <application>Clang</application>)
104 </para>
105
106 <!-- It seems nasm is only used for aarch64-win64. -->
107 <!--bridgehead renderas="sect4">Optional</bridgehead>
108 <para role="optional">
109 <xref linkend="nasm"/>
110 </para-->
111
112 <para condition="html" role="usernotes">
113 User Notes: <ulink url="&blfs-wiki;/js91"/>
114 </para>
115 </sect2>
116
117 <sect2 role="installation">
118 <title>Installation of JS</title>
119
120 <note>
121 <para>
122 Unlike most other packages in BLFS, the instructions below require you
123 to untar <filename>firefox-&JS91-version;esr.tar.xz</filename> and
124 change into the <filename>firefox-&JS91-version;</filename> folder.
125 </para>
126
127 <para>
128 Extracting the tarball
129 will reset the permissions of the current directory to 0755 if you
130 have permission to do that. If you do this in a directory where
131 the sticky bit is set, such
132 as <filename class="directory">/tmp</filename> it will end with error
133 messages:
134 </para>
135
136<literallayout>tar: .: Cannot utime: Operation not permitted
137tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
138tar: Exiting with failure status due to previous errors
139</literallayout>
140
141 <para>
142 This does finish with non-zero status, but it does
143 <emphasis>NOT</emphasis> mean there is a real problem.
144 Do not untar as the <systemitem class="username">root</systemitem> user
145 in a directory where the sticky bit is set - that will unset it.
146 </para>
147
148 </note>
149
150 <para>
151 If building on a 32 bit machine, the following sed works around an issue
152 with an incompatible <quote>double</quote> type in one header file:
153 </para>
154
155<screen><userinput>case "$(uname -m)" in
156 i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
157 -i modules/fdlibm/src/math_private.h ;;
158esac</userinput></screen>
159
160 <para>
161 Install <application>JS</application> by running the following
162 commands:
163 </para>
164
165 <note>
166 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
167 href="../../xincludes/mozshm.xml"/>
168
169 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
170 href="../../xincludes/mozconfigure.xml"/>
171
172 <para>
173 Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
174 the rust code will use all processors.
175 </para>
176 </note>
177
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 Because we are building with system ICU, more than one hundred tests
198 (out of a total of more than 40,000) are known to fail.
199 </para>
200 <para>
201 To run the JIT test suite, issue:
202 <command>make -C js/src check-jit-test
203 JITTEST_EXTRA_ARGS="--timeout 300"</command>.
204 </para>
205
206 <caution>
207 <para>
208 An issue in the installation process causes any running program which
209 links to JS91 shared library (for example, GNOME Shell) to crash if
210 JS91 is upgraded or reinstalled. To work around this issue, remove
211 the old version of the JS91 shared library before installation:
212 </para>
213
214<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-91.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 &amp;&amp;
222rm -v /usr/lib/libjs_static.ajs &amp;&amp;
223sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</userinput></screen>
224
225 </sect2>
226
227 <!-- Several gjs-1.65.90 tests fail with js91. Not sure why.
228 OTOH an "otherwise" GNOME-3.36 environment works fine. -->
229
230 <sect2 role="commands">
231 <title>Command Explanations</title>
232
233 <para>
234 <command>sh ../js/src/configure.in</command>:
235 <filename>configure.in</filename> is actually a shell script, but
236 the executable bit is not set in its permission mode so it's needed
237 to explicitly run it with <command>sh</command>.
238 </para>
239
240 <para>
241 <parameter>--with-intl-api</parameter>: This enables the
242 internationalization functions required by
243 <application>Gjs</application>.
244 </para>
245
246 <para>
247 <parameter>--with-system-*</parameter>: These parameters allow the build system
248 to use system versions of the above libraries. These are required for
249 stability.
250 </para>
251
252 <para>
253 <parameter>--enable-readline</parameter>: This switch enables Readline
254 support in the JS shell.
255 </para>
256
257 <para>
258 <parameter>--disable-jemalloc</parameter>: This switch disables the
259 internal memory allocator used in JS91. jemalloc is only intended for
260 the Firefox browser environment. For other applications using JS91,
261 if JS91 uses jemalloc, the application may crash as items allocated
262 in jemalloc allocator are freed on system (glibc) allocator.
263 </para>
264
265 <para>
266 <parameter>--disable-debug-symbols</parameter>: Don't generate debug
267 symbols since they are very large and most users won't need it. Remove
268 it if you want to debug JS91.
269 </para>
270
271 <para>
272 <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
273 static library which is not used by any BLFS package.
274 </para>
275
276 <para>
277 <command>sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config</command>:
278 Prevent <command>js91-config</command> from using buggy CFLAGS.
279 </para>
280
281 <para>
282 <parameter><envar>CC=gcc CXX=g++</envar></parameter>: BLFS used to
283 prefer to use gcc and g++ instead of upstream's defaults of the
284 <application>clang</application> programs. With the release of
285 gcc-12 the build takes longer with gcc and g++, primarily because
286 of extra warnings, and is bigger. Pass these environment variables
287 to the configure script if you wish to continue to use gcc, g++
288 (by exporting them and unset them after the installation, or simply
289 prepending them before the
290 <command>sh ../js/src/configure.in</command> command).
291 </para>
292
293 </sect2>
294
295 <sect2 role="content">
296 <title>Contents</title>
297
298 <segmentedlist>
299 <segtitle>Installed Programs</segtitle>
300 <segtitle>Installed Libraries</segtitle>
301 <segtitle>Installed Directories</segtitle>
302
303 <seglistitem>
304 <seg>
305 js91 and js91-config
306 </seg>
307 <seg>
308 libmozjs-91.so
309 </seg>
310 <seg>
311 /usr/include/mozjs-91
312 </seg>
313 </seglistitem>
314 </segmentedlist>
315
316 <variablelist>
317 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
318 <?dbfo list-presentation="list"?>
319 <?dbhtml list-presentation="table"?>
320
321 <varlistentry id="js91-js91">
322 <term><command>js91</command></term>
323 <listitem>
324 <para>
325 provides a command line interface to the
326 <application>JavaScript</application> engine
327 </para>
328 <indexterm zone="js91 js91">
329 <primary sortas="b-js91">js91</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="js91-config">
335 <term><command>js91-config</command></term>
336 <listitem>
337 <para>
338 is used to find the JS compiler and linker flags
339 </para>
340 <indexterm zone="js91 js91-config">
341 <primary sortas="b-js91-config">js91-config</primary>
342 </indexterm>
343 </listitem>
344 </varlistentry>
345
346 <varlistentry id="libmozjs-91">
347 <term><filename class="libraryfile">libmozjs-91.so</filename></term>
348 <listitem>
349 <para>
350 contains the Mozilla JavaScript API functions
351 </para>
352 <indexterm zone="js91 libmozjs-91">
353 <primary sortas="c-libmozjs91">libmozjs-91.so</primary>
354 </indexterm>
355 </listitem>
356 </varlistentry>
357 </variablelist>
358 </sect2>
359
360</sect1>
Note: See TracBrowser for help on using the repository browser.