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