source: general/genlib/js102.xml@ cefe20d

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since cefe20d was cefe20d, checked in by Douglas R. Reno <renodr@…>, 11 months ago

js102: Fix building on i686 again.

The default build configuration in 102.13 appears to have moved back to
GCC. Rather than change it, let's just modify math_private.h again with
a simpler tweak to allow it to build properly again (wrapped in a case
statement).

This particular problem resurfacing is quite odd. I can confirm that
js-102.12.0 does work though, but updated due to the JS CVE.

Firefox 115.x works well on i686 and builds without any tweaks, so
whenever we move to js115, this should not be a problem anymore.

  • 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 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 "42b9a73626ed8281b86222f6f0a96c73">
17 <!ENTITY js102-md5sum "">
18 <!ENTITY js102-size "464 MB">
19 <!ENTITY js102-buildsize "3.3 GB (38 MB installed after removing 34MB static lib)">
20 <!ENTITY js102-time "1.7 SBU (with parallelism=4)">
21]>
22
23<sect1 id="js102" xreflabel="JS-&JS102-version;">
24 <?dbhtml filename="js102.html"?>
25
26
27 <title>JS-&JS102-version;</title>
28
29 <indexterm zone="js102">
30 <primary sortas="a-js102">js102</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to JS</title>
35
36 <para>
37 <application>JS</application> (also referred as
38 <application>SpiderMonkey</application>) is Mozilla's JavaScript and
39 WebAssembly Engine, written in C++ and Rust.
40 In BLFS, the source code of JS is taken from Firefox.
41 </para>
42
43 <!-- To editors: make sure polkit work with mozjs before
44 tagging mozjs. -->
45 &lfs113_checked;
46
47 <bridgehead renderas="sect3">Package Information</bridgehead>
48 <itemizedlist spacing="compact">
49 <listitem>
50 <para>
51 Download (HTTP): <ulink url="&js102-download-http;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download (FTP): <ulink url="&js102-download-ftp;"/>
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download MD5 sum: &js102-md5sum;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download size: &js102-size;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated disk space required: &js102-buildsize;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Estimated build time: &js102-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">JS102 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 w/o -msse2 -mfpmath=sse:
104 https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
105 <xref linkend="llvm"/> (with <application>Clang</application>,
106 required for 32-bit systems without SSE2 capabilities)
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 </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-&JS102-version;esr.tar.xz</filename> and
124 change into the <filename>firefox-&JS102-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<!-- not needed when using clang. Upstream bug at
150 https://bugzilla.mozilla.org/show_bug.cgi?id=1729459.
151 07-21-2023: Issue has resurfaced again when using the default build
152 instructions for JS (which uses GCC). The problem is not present
153 in Firefox 115 though (which works OK on i686). -renodr
154-->
155
156 <para>
157 If building on a 32 bit machine, the following sed works around an issue
158 with an incompatible <quote>double</quote> type in one header file:
159 </para>
160
161<screen><userinput>case "$(uname -m)" in
162 i?86) sed -e 's/typedef double/typedef long double/' \
163 -i modules/fdlibm/src/math_private.h ;;
164esac</userinput></screen>
165
166 <para>
167 Install <application>JS</application> by running the following
168 commands:
169 </para>
170
171 <note>
172 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
173 href="../../xincludes/mozshm.xml"/>
174
175 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
176 href="../../xincludes/mozconfigure.xml"/>
177
178 <para>
179 Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
180 the rust code will use all processors.
181 </para>
182 </note>
183
184<screen><userinput>mkdir obj &amp;&amp;
185cd obj &amp;&amp;
186
187sh ../js/src/configure.in --prefix=/usr \
188 --with-intl-api \
189 --with-system-zlib \
190 --with-system-icu \
191 --disable-jemalloc \
192 --disable-debug-symbols \
193 --enable-readline &amp;&amp;
194make</userinput></screen>
195
196 <para>
197 To run the JS test suite, issue:
198 <command>make -C js/src check-jstests
199 JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
200 It's recommended to redirect the output into a log.
201 <!-- recheck when ICU gets upgraded -->
202 <!-- Still true with 102 -renodr -->
203 Because we are building with system ICU, more than one hundred tests
204 (out of a total of more than 50,000) are known to fail.
205 </para>
206 <para>
207 To run the JIT test suite, issue:
208 <command>make -C js/src check-jit-test
209 JITTEST_EXTRA_ARGS="--timeout 300"</command>.
210 </para>
211
212 <caution>
213 <para>
214 An issue in the installation process causes any running program which
215 links to JS102 shared library (for example, GNOME Shell) to crash if
216 JS102 is upgraded or reinstalled. To work around this issue, remove
217 the old version of the JS102 shared library before installation:
218 </para>
219
220<screen role="root"><userinput>rm -fv /usr/lib/libmozjs-102.so</userinput></screen>
221 </caution>
222
223 <para>
224 Now, as the <systemitem class="username">root</systemitem> user:
225 </para>
226
227<screen role="root"><userinput>make install &amp;&amp;
228rm -v /usr/lib/libjs_static.ajs &amp;&amp;
229sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js102-config</userinput></screen>
230
231 </sect2>
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 JS102. jemalloc is only intended for
263 the Firefox browser environment. For other applications using JS102,
264 the application may crash as items allocated in the jemalloc allocator
265 are freed on the 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 JS102.
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/js102-config</command>:
281 Prevent <command>js102-config</command> from using buggy CFLAGS.
282 </para>
283
284 <para>
285 <option><envar>CC=gcc CXX=g++</envar></option>: 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). If you are
294 building on a 32-bit system, also see below.
295 </para>
296
297 <para>
298 <option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
299 Use SSE2 instead of 387 for double-precision floating-point
300 operations. It's needed by GCC to satisfy the expectations of
301 upstream (Mozilla) developers with floating-point arithmetic.
302 Use it if you are building this package on a 32-bit system with
303 GCC (if Clang is not installed or GCC is explicitly specified).
304 Note that this will cause JS to crash on a processor without SSE2
305 capability. If you are running the system on such an old processor,
306 Clang is strictly needed. This setting is not needed on 64-bit
307 systems because all 64-bit x86 processors support SSE2 and the 64-bit
308 compilers (both Clang and GCC) use SSE2 by default.
309 </para>
310 </sect2>
311
312 <sect2 role="content">
313 <title>Contents</title>
314
315 <segmentedlist>
316 <segtitle>Installed Programs</segtitle>
317 <segtitle>Installed Libraries</segtitle>
318 <segtitle>Installed Directories</segtitle>
319
320 <seglistitem>
321 <seg>
322 js102 and js102-config
323 </seg>
324 <seg>
325 libmozjs-102.so
326 </seg>
327 <seg>
328 /usr/include/mozjs-102
329 </seg>
330 </seglistitem>
331 </segmentedlist>
332
333 <variablelist>
334 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
335 <?dbfo list-presentation="list"?>
336 <?dbhtml list-presentation="table"?>
337
338 <varlistentry id="js102-js102">
339 <term><command>js102</command></term>
340 <listitem>
341 <para>
342 provides a command line interface to the
343 <application>JavaScript</application> engine
344 </para>
345 <indexterm zone="js102 js102">
346 <primary sortas="b-js102">js102</primary>
347 </indexterm>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry id="js102-config">
352 <term><command>js102-config</command></term>
353 <listitem>
354 <para>
355 is used to find the JS compiler and linker flags
356 </para>
357 <indexterm zone="js102 js102-config">
358 <primary sortas="b-js102-config">js102-config</primary>
359 </indexterm>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry id="libmozjs-102">
364 <term><filename class="libraryfile">libmozjs-102.so</filename></term>
365 <listitem>
366 <para>
367 contains the Mozilla JavaScript API functions
368 </para>
369 <indexterm zone="js102 libmozjs-102">
370 <primary sortas="c-libmozjs102">libmozjs-102.so</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374 </variablelist>
375 </sect2>
376
377</sect1>
Note: See TracBrowser for help on using the repository browser.