source: general/genlib/js102.xml@ b932ddad

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/xf86-video-removal
Last change on this file since b932ddad was b932ddad, checked in by Ken Moffat <ken@…>, 18 months ago

Update to JS102-102.5.0 (mozjs).

Note that at the moment the version does not have to align with
the firefox-esr version, but this one does fix a js vulnerability.

  • Property mode set to 100644
File size: 12.9 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 "3b3e610898ccda554519f744e634c50c">
17 <!ENTITY js102-size "457 MB">
18 <!ENTITY js102-buildsize "3.4 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 <sect1info>
26 <date>$Date$</date>
27 </sect1info>
28
29 <title>JS-&JS102-version;</title>
30
31 <indexterm zone="js102">
32 <primary sortas="a-js102">js102</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="&js102-download-http;"/>
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download (FTP): <ulink url="&js102-download-ftp;"/>
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download MD5 sum: &js102-md5sum;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Download size: &js102-size;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Estimated disk space required: &js102-buildsize;
74 </para>
75 </listitem>
76 <listitem>
77 <para>
78 Estimated build time: &js102-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">JS102 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 systems without SSE2 capabilities)
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;/js102"/>
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-&JS102-version;esr.tar.xz</filename> and
129 change into the <filename>firefox-&JS102-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 <para>
186 First remove an obsolete flag in python code, that has been removed
187 in python-3.11:
188 </para>
189
190<screen><userinput>grep -rl \"rU\" | xargs sed -i 's/"rU"/"r"/'</userinput></screen>
191
192 <para>
193 Then run:
194 </para>
195
196<screen><userinput>mkdir obj &amp;&amp;
197cd obj &amp;&amp;
198
199sh ../js/src/configure.in --prefix=/usr \
200 --with-intl-api \
201 --with-system-zlib \
202 --with-system-icu \
203 --disable-jemalloc \
204 --disable-debug-symbols \
205 --enable-readline &amp;&amp;
206make</userinput></screen>
207
208 <para>
209 To run the JS test suite, issue:
210 <command>make -C js/src check-jstests
211 JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
212 It's recommended to redirect the output into a log.
213 <!-- recheck when ICU gets upgraded -->
214 <!-- Still true with 102 -renodr -->
215 Because we are building with system ICU, more than one hundred tests
216 (out of a total of more than 40,000) are known to fail.
217 </para>
218 <para>
219 To run the JIT test suite, issue:
220 <command>make -C js/src check-jit-test
221 JITTEST_EXTRA_ARGS="--timeout 300"</command>.
222 </para>
223
224 <caution>
225 <para>
226 An issue in the installation process causes any running program which
227 links to JS102 shared library (for example, GNOME Shell) to crash if
228 JS102 is upgraded or reinstalled. To work around this issue, remove
229 the old version of the JS102 shared library before installation:
230 </para>
231
232<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-102.so</userinput></screen>
233 </caution>
234
235 <para>
236 Now, as the <systemitem class="username">root</systemitem> user:
237 </para>
238
239<screen role="root"><userinput>make install &amp;&amp;
240rm -v /usr/lib/libjs_static.ajs &amp;&amp;
241sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js102-config</userinput></screen>
242
243 </sect2>
244
245 <sect2 role="commands">
246 <title>Command Explanations</title>
247
248 <para>
249 <command>sh ../js/src/configure.in</command>:
250 <filename>configure.in</filename> is actually a shell script, but
251 the executable bit is not set in its permission mode so it's needed
252 to explicitly run it with <command>sh</command>.
253 </para>
254
255 <para>
256 <parameter>--with-intl-api</parameter>: This enables the
257 internationalization functions required by
258 <application>Gjs</application>.
259 </para>
260
261 <para>
262 <parameter>--with-system-*</parameter>: These parameters allow the build system
263 to use system versions of the above libraries. These are required for
264 stability.
265 </para>
266
267 <para>
268 <parameter>--enable-readline</parameter>: This switch enables Readline
269 support in the JS shell.
270 </para>
271
272 <para>
273 <parameter>--disable-jemalloc</parameter>: This switch disables the
274 internal memory allocator used in JS102. jemalloc is only intended for
275 the Firefox browser environment. For other applications using JS102,
276 the application may crash as items allocated in the jemalloc allocator
277 are freed on the system (glibc) allocator.
278 </para>
279
280 <para>
281 <parameter>--disable-debug-symbols</parameter>: Don't generate debug
282 symbols since they are very large and most users won't need it. Remove
283 it if you want to debug JS102.
284 </para>
285
286 <para>
287 <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
288 static library which is not used by any BLFS package.
289 </para>
290
291 <para>
292 <command>sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js102-config</command>:
293 Prevent <command>js102-config</command> from using buggy CFLAGS.
294 </para>
295
296 <para>
297 <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
298 prefer to use gcc and g++ instead of upstream's defaults of the
299 <application>clang</application> programs. With the release of
300 gcc-12 the build takes longer with gcc and g++, primarily because
301 of extra warnings, and is bigger. Pass these environment variables
302 to the configure script if you wish to continue to use gcc, g++
303 (by exporting them and unset them after the installation, or simply
304 prepending them before the
305 <command>sh ../js/src/configure.in</command> command). If you are
306 building on a 32-bit system, also see below.
307 </para>
308
309 <para>
310 <option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
311 Use SSE2 instead of 387 for double-precision floating-point
312 operations. It's needed by GCC to satisfy the expectations of
313 upstream (Mozilla) developers with floating-point arithmetic.
314 Use it if you are building this package on a 32-bit system with
315 GCC (if Clang is not installed or GCC is explicitly specified).
316 Note that this will cause JS to crash on a processor without SSE2
317 capability. If you are running the system on such an old processor,
318 Clang is strictly needed. This setting is not needed on 64-bit
319 systems because all 64-bit x86 processors support SSE2 and the 64-bit
320 compilers (both Clang and GCC) use SSE2 by default.
321 </para>
322 </sect2>
323
324 <sect2 role="content">
325 <title>Contents</title>
326
327 <segmentedlist>
328 <segtitle>Installed Programs</segtitle>
329 <segtitle>Installed Libraries</segtitle>
330 <segtitle>Installed Directories</segtitle>
331
332 <seglistitem>
333 <seg>
334 js102 and js102-config
335 </seg>
336 <seg>
337 libmozjs-102.so
338 </seg>
339 <seg>
340 /usr/include/mozjs-102
341 </seg>
342 </seglistitem>
343 </segmentedlist>
344
345 <variablelist>
346 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
347 <?dbfo list-presentation="list"?>
348 <?dbhtml list-presentation="table"?>
349
350 <varlistentry id="js102-js102">
351 <term><command>js102</command></term>
352 <listitem>
353 <para>
354 provides a command line interface to the
355 <application>JavaScript</application> engine
356 </para>
357 <indexterm zone="js102 js102">
358 <primary sortas="b-js102">js102</primary>
359 </indexterm>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry id="js102-config">
364 <term><command>js102-config</command></term>
365 <listitem>
366 <para>
367 is used to find the JS compiler and linker flags
368 </para>
369 <indexterm zone="js102 js102-config">
370 <primary sortas="b-js102-config">js102-config</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="libmozjs-102">
376 <term><filename class="libraryfile">libmozjs-102.so</filename></term>
377 <listitem>
378 <para>
379 contains the Mozilla JavaScript API functions
380 </para>
381 <indexterm zone="js102 libmozjs-102">
382 <primary sortas="c-libmozjs102">libmozjs-102.so</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386 </variablelist>
387 </sect2>
388
389</sect1>
Note: See TracBrowser for help on using the repository browser.