[fcce89bc] | 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 |
|
---|
[5028839f] | 7 | <!ENTITY spidermonkey-download-http "&mozilla-http;/firefox/releases/&spidermonkey-version;esr/source/firefox-&spidermonkey-version;esr.source.tar.xz">
|
---|
| 8 | <!ENTITY spidermonkey-download-ftp " ">
|
---|
[3ce2d0c] | 9 | <!ENTITY spidermonkey-md5sum "c8deec3a0e558a1882f11bbea2fbd462">
|
---|
| 10 | <!ENTITY spidermonkey-size "484 MB">
|
---|
| 11 | <!ENTITY spidermonkey-buildsize "3.3 GB (39 MB installed after removing 36MB static lib; additional 0.4 GB for the tests)">
|
---|
| 12 | <!ENTITY spidermonkey-time "2.0 SBU (with parallelism=4; additional 3.8 SBU for the tests)">
|
---|
[fcce89bc] | 13 | ]>
|
---|
| 14 |
|
---|
[5028839f] | 15 | <sect1 id="spidermonkey" xreflabel="SpiderMonkey from Firefox-&spidermonkey-version;">
|
---|
| 16 | <?dbhtml filename="spidermonkey.html"?>
|
---|
[fcce89bc] | 17 |
|
---|
| 18 |
|
---|
[5028839f] | 19 | <title>SpiderMonkey from Firefox-&spidermonkey-version;</title>
|
---|
[fcce89bc] | 20 |
|
---|
[5028839f] | 21 | <indexterm zone="spidermonkey">
|
---|
| 22 | <primary sortas="a-spidermonkey">SpiderMonkey</primary>
|
---|
[fcce89bc] | 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
[5028839f] | 26 | <title>Introduction to SpiderMonkey</title>
|
---|
[fcce89bc] | 27 |
|
---|
| 28 | <para>
|
---|
[5028839f] | 29 | <application>SpiderMonkey</application> is Mozilla's JavaScript and
|
---|
[6c122387] | 30 | WebAssembly Engine, written in C++ and Rust.
|
---|
[5028839f] | 31 | In BLFS, the source code of SpiderMonkey is taken from Firefox.
|
---|
[fcce89bc] | 32 | </para>
|
---|
| 33 |
|
---|
[3ce2d0c] | 34 | <!-- To editors: make sure polkit works with mozjs when
|
---|
| 35 | tagging SpiderMonkey or upgrading it to a new major version. -->
|
---|
[6aa631b] | 36 | &lfs120_checked;
|
---|
[6b063cc3] | 37 |
|
---|
[fcce89bc] | 38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 39 | <itemizedlist spacing="compact">
|
---|
| 40 | <listitem>
|
---|
| 41 | <para>
|
---|
[5028839f] | 42 | Download (HTTP): <ulink url="&spidermonkey-download-http;"/>
|
---|
[fcce89bc] | 43 | </para>
|
---|
| 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>
|
---|
[5028839f] | 47 | Download (FTP): <ulink url="&spidermonkey-download-ftp;"/>
|
---|
[fcce89bc] | 48 | </para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>
|
---|
[5028839f] | 52 | Download MD5 sum: &spidermonkey-md5sum;
|
---|
[fcce89bc] | 53 | </para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>
|
---|
[5028839f] | 57 | Download size: &spidermonkey-size;
|
---|
[fcce89bc] | 58 | </para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>
|
---|
[5028839f] | 62 | Estimated disk space required: &spidermonkey-buildsize;
|
---|
[fcce89bc] | 63 | </para>
|
---|
| 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
| 66 | <para>
|
---|
[5028839f] | 67 | Estimated build time: &spidermonkey-time;
|
---|
[fcce89bc] | 68 | </para>
|
---|
| 69 | </listitem>
|
---|
| 70 | </itemizedlist>
|
---|
[b5b1af68] | 71 | <!--
|
---|
[fcce89bc] | 72 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 73 | <itemizedlist spacing="compact">
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>
|
---|
| 76 | Required patch:
|
---|
[b5b1af68] | 77 | <ulink url="&patch-root;/js-&JS91-version;-python_3_10-1.patch"/>
|
---|
[fcce89bc] | 78 | </para>
|
---|
| 79 | </listitem>
|
---|
| 80 | </itemizedlist>
|
---|
[b5b1af68] | 81 | -->
|
---|
[5028839f] | 82 | <bridgehead renderas="sect3">SpiderMonkey Dependencies</bridgehead>
|
---|
[fcce89bc] | 83 |
|
---|
| 84 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 85 | <para role="required">
|
---|
| 86 | <xref linkend="icu"/>,
|
---|
| 87 | <xref linkend="rust"/>, and
|
---|
| 88 | <xref linkend="which"/>
|
---|
| 89 | </para>
|
---|
| 90 |
|
---|
[e603046] | 91 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 92 | <para role="recommended">
|
---|
[716ab1ac] | 93 | <!-- If clang is installed, it will be used instead of gcc.
|
---|
[0fe09b09] | 94 | gcc does not work for 32-bit system w/o -msse2 -mfpmath=sse:
|
---|
[716ab1ac] | 95 | https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 -->
|
---|
| 96 | <xref linkend="llvm"/> (with <application>Clang</application>,
|
---|
[14bd41d] | 97 | required for 32-bit systems without SSE2 capabilities)
|
---|
[e603046] | 98 | </para>
|
---|
| 99 |
|
---|
[ac465d6c] | 100 | <important>
|
---|
| 101 | <para>
|
---|
| 102 | If you are building this package on a 32-bit system, and Clang
|
---|
| 103 | is not installed or you're overriding the default compiler choice
|
---|
| 104 | with the environment variable <envar>CXX</envar>, please read the
|
---|
| 105 | Command Explanations section first.
|
---|
| 106 | </para>
|
---|
| 107 | </important>
|
---|
| 108 |
|
---|
[fcce89bc] | 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">
|
---|
[5028839f] | 118 | <title>Installation of SpiderMonkey</title>
|
---|
[fcce89bc] | 119 |
|
---|
| 120 | <note>
|
---|
| 121 | <para>
|
---|
[5028839f] | 122 | Unlike most other packages in BLFS, the instructions below require
|
---|
| 123 | you to untar
|
---|
| 124 | <filename>firefox-&spidermonkey-version;esr.tar.xz</filename> and
|
---|
| 125 | change into the <filename>firefox-&spidermonkey-version;</filename>
|
---|
| 126 | folder.
|
---|
[fcce89bc] | 127 | </para>
|
---|
| 128 |
|
---|
| 129 | <para>
|
---|
| 130 | Extracting the tarball
|
---|
| 131 | will reset the permissions of the current directory to 0755 if you
|
---|
| 132 | have permission to do that. If you do this in a directory where
|
---|
| 133 | the sticky bit is set, such
|
---|
| 134 | as <filename class="directory">/tmp</filename> it will end with error
|
---|
| 135 | messages:
|
---|
| 136 | </para>
|
---|
| 137 |
|
---|
| 138 | <literallayout>tar: .: Cannot utime: Operation not permitted
|
---|
| 139 | tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
|
---|
| 140 | tar: Exiting with failure status due to previous errors
|
---|
| 141 | </literallayout>
|
---|
| 142 |
|
---|
| 143 | <para>
|
---|
| 144 | This does finish with non-zero status, but it does
|
---|
| 145 | <emphasis>NOT</emphasis> mean there is a real problem.
|
---|
| 146 | Do not untar as the <systemitem class="username">root</systemitem> user
|
---|
| 147 | in a directory where the sticky bit is set - that will unset it.
|
---|
| 148 | </para>
|
---|
| 149 |
|
---|
| 150 | </note>
|
---|
[cefe20d] | 151 |
|
---|
[fcce89bc] | 152 | <para>
|
---|
[5028839f] | 153 | Install <application>SpiderMonkey</application> by running the following
|
---|
[fcce89bc] | 154 | commands:
|
---|
| 155 | </para>
|
---|
| 156 |
|
---|
[16218efb] | 157 | <note>
|
---|
| 158 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[fcce89bc] | 159 | href="../../xincludes/mozshm.xml"/>
|
---|
| 160 |
|
---|
[16218efb] | 161 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[fcce89bc] | 162 | href="../../xincludes/mozconfigure.xml"/>
|
---|
[ca73053a] | 163 |
|
---|
[16218efb] | 164 | <para>
|
---|
| 165 | Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1',
|
---|
| 166 | the rust code will use all processors.
|
---|
| 167 | </para>
|
---|
| 168 | </note>
|
---|
[fcce89bc] | 169 |
|
---|
| 170 | <screen><userinput>mkdir obj &&
|
---|
| 171 | cd obj &&
|
---|
| 172 |
|
---|
[3ce2d0c] | 173 | ../js/src/configure --prefix=/usr \
|
---|
| 174 | --with-intl-api \
|
---|
| 175 | --with-system-zlib \
|
---|
| 176 | --with-system-icu \
|
---|
| 177 | --disable-jemalloc \
|
---|
| 178 | --disable-debug-symbols \
|
---|
| 179 | --enable-readline &&
|
---|
[fcce89bc] | 180 | make</userinput></screen>
|
---|
| 181 |
|
---|
| 182 | <para>
|
---|
[5028839f] | 183 | To run the SpiderMonkey test suite, issue:
|
---|
[6a5717b] | 184 | <command>make -C js/src check-jstests
|
---|
| 185 | JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled"</command>.
|
---|
| 186 | It's recommended to redirect the output into a log.
|
---|
| 187 | <!-- recheck when ICU gets upgraded -->
|
---|
[3ce2d0c] | 188 | Because we are building with system ICU, 8 tests
|
---|
[8d219de] | 189 | (out of a total of more than 50,000) are known to fail.
|
---|
[0d4a7b68] | 190 | </para>
|
---|
| 191 | <para>
|
---|
[3ce2d0c] | 192 | The JIT test suite can use a large amount of system memory.
|
---|
| 193 | Running the JIT test suite without enough memory may invoke the
|
---|
[4490fe8b] | 194 | the kernel OOM killer and causes stability issues. To run the JIT test
|
---|
[3ce2d0c] | 195 | suite, ensure the amount of available system memory is at least 16 GB,
|
---|
| 196 | <!-- When I run it within a cgroup with 8 GB memory assigned, the test
|
---|
| 197 | is OOM killed. Increasing the assigned memory to 16 GB makes
|
---|
| 198 | all tests pass. -->
|
---|
| 199 | then issue: <command>make -C js/src check-jit-test
|
---|
[b5b1af68] | 200 | JITTEST_EXTRA_ARGS="--timeout 300"</command>.
|
---|
[fcce89bc] | 201 | </para>
|
---|
| 202 |
|
---|
[55a63862] | 203 | <caution>
|
---|
| 204 | <para>
|
---|
| 205 | An issue in the installation process causes any running program which
|
---|
[5028839f] | 206 | links to SpiderMonkey shared library (for example, GNOME Shell) to
|
---|
| 207 | crash if SpiderMonkey is reinstalled, or upgraded or downgraded
|
---|
| 208 | without a change of the the major version number
|
---|
| 209 | (&spidermonkey-major; in &spidermonkey-version;). To work around
|
---|
| 210 | this issue, remove the old version of the SpiderMonkey shared
|
---|
| 211 | library before installation:
|
---|
[55a63862] | 212 | </para>
|
---|
[4af651f7] | 213 |
|
---|
[5028839f] | 214 | <screen role="root"><userinput>rm -fv /usr/lib/libmozjs-&spidermonkey-major;.so</userinput></screen>
|
---|
[55a63862] | 215 | </caution>
|
---|
[4af651f7] | 216 |
|
---|
[fcce89bc] | 217 | <para>
|
---|
| 218 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 219 | </para>
|
---|
| 220 |
|
---|
| 221 | <screen role="root"><userinput>make install &&
|
---|
| 222 | rm -v /usr/lib/libjs_static.ajs &&
|
---|
[5028839f] | 223 | sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js&spidermonkey-major;-config</userinput></screen>
|
---|
[fcce89bc] | 224 |
|
---|
| 225 | </sect2>
|
---|
| 226 |
|
---|
| 227 | <sect2 role="commands">
|
---|
| 228 | <title>Command Explanations</title>
|
---|
| 229 |
|
---|
[b5b1af68] | 230 | <para>
|
---|
| 231 | <parameter>--with-intl-api</parameter>: This enables the
|
---|
| 232 | internationalization functions required by
|
---|
| 233 | <application>Gjs</application>.
|
---|
| 234 | </para>
|
---|
| 235 |
|
---|
| 236 | <para>
|
---|
| 237 | <parameter>--with-system-*</parameter>: These parameters allow the build system
|
---|
[fcce89bc] | 238 | to use system versions of the above libraries. These are required for
|
---|
| 239 | stability.
|
---|
| 240 | </para>
|
---|
| 241 |
|
---|
| 242 | <para>
|
---|
| 243 | <parameter>--enable-readline</parameter>: This switch enables Readline
|
---|
[5028839f] | 244 | support in the SpiderMonkey command line interface.
|
---|
[fcce89bc] | 245 | </para>
|
---|
[8558044] | 246 |
|
---|
[fcce89bc] | 247 | <para>
|
---|
| 248 | <parameter>--disable-jemalloc</parameter>: This switch disables the
|
---|
[5028839f] | 249 | internal memory allocator used in SpiderMonkey. jemalloc is only
|
---|
| 250 | intended for the Firefox browser environment. For other applications
|
---|
| 251 | using SpiderMonkey, the application may crash as items allocated in
|
---|
| 252 | the jemalloc allocator are freed on the system (glibc) allocator.
|
---|
[fcce89bc] | 253 | </para>
|
---|
| 254 |
|
---|
| 255 | <para>
|
---|
| 256 | <parameter>--disable-debug-symbols</parameter>: Don't generate debug
|
---|
| 257 | symbols since they are very large and most users won't need it. Remove
|
---|
[5028839f] | 258 | it if you want to debug SpiderMonkey.
|
---|
[fcce89bc] | 259 | </para>
|
---|
| 260 |
|
---|
| 261 | <para>
|
---|
| 262 | <command>rm -v /usr/lib/libjs_static.ajs</command>: Remove a large
|
---|
| 263 | static library which is not used by any BLFS package.
|
---|
| 264 | </para>
|
---|
| 265 |
|
---|
| 266 | <para>
|
---|
[5028839f] | 267 | <command>sed -i '/@NSPR_CFLAGS@/d'
|
---|
| 268 | /usr/bin/js&spidermonkey-major;-config</command>:
|
---|
| 269 | Prevent <command>js&spidermonkey-major;-config</command> from using
|
---|
| 270 | buggy CFLAGS.
|
---|
[fcce89bc] | 271 | </para>
|
---|
| 272 |
|
---|
[e603046] | 273 | <para>
|
---|
[f572dbb] | 274 | <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
|
---|
[e603046] | 275 | prefer to use gcc and g++ instead of upstream's defaults of the
|
---|
| 276 | <application>clang</application> programs. With the release of
|
---|
| 277 | gcc-12 the build takes longer with gcc and g++, primarily because
|
---|
[8e637fc] | 278 | of extra warnings, and is bigger. Pass these environment variables
|
---|
| 279 | to the configure script if you wish to continue to use gcc, g++
|
---|
| 280 | (by exporting them and unset them after the installation, or simply
|
---|
| 281 | prepending them before the
|
---|
[30d8de9b] | 282 | <command>../js/src/configure</command> command). If you are
|
---|
[0fe09b09] | 283 | building on a 32-bit system, also see below.
|
---|
[e603046] | 284 | </para>
|
---|
| 285 |
|
---|
[0fe09b09] | 286 | <para>
|
---|
| 287 | <option><envar>CXXFLAGS="-msse2 -mfpmath=sse"</envar></option>:
|
---|
| 288 | Use SSE2 instead of 387 for double-precision floating-point
|
---|
[f31e7938] | 289 | operations. It's needed by GCC to satisfy the expectations of
|
---|
[67cd226] | 290 | upstream (Mozilla) developers with floating-point arithmetic.
|
---|
[0fe09b09] | 291 | Use it if you are building this package on a 32-bit system with
|
---|
| 292 | GCC (if Clang is not installed or GCC is explicitly specified).
|
---|
[5028839f] | 293 | Note that this will cause SpiderMonkey to crash on a processor without
|
---|
| 294 | SSE2 capability. If you are running the system on such an old
|
---|
| 295 | processor, Clang is strictly needed. This setting is not needed on
|
---|
| 296 | 64-bit systems because all 64-bit x86 processors support SSE2 and the
|
---|
| 297 | 64-bit compilers (both Clang and GCC) use SSE2 by default.
|
---|
[0fe09b09] | 298 | </para>
|
---|
[fcce89bc] | 299 | </sect2>
|
---|
| 300 |
|
---|
| 301 | <sect2 role="content">
|
---|
| 302 | <title>Contents</title>
|
---|
| 303 |
|
---|
| 304 | <segmentedlist>
|
---|
| 305 | <segtitle>Installed Programs</segtitle>
|
---|
| 306 | <segtitle>Installed Libraries</segtitle>
|
---|
| 307 | <segtitle>Installed Directories</segtitle>
|
---|
| 308 |
|
---|
| 309 | <seglistitem>
|
---|
| 310 | <seg>
|
---|
[5028839f] | 311 | js&spidermonkey-major; and js&spidermonkey-major;-config
|
---|
[fcce89bc] | 312 | </seg>
|
---|
| 313 | <seg>
|
---|
[5028839f] | 314 | libmozjs-&spidermonkey-major;.so
|
---|
[fcce89bc] | 315 | </seg>
|
---|
| 316 | <seg>
|
---|
[5028839f] | 317 | /usr/include/mozjs-&spidermonkey-major;
|
---|
[fcce89bc] | 318 | </seg>
|
---|
| 319 | </seglistitem>
|
---|
| 320 | </segmentedlist>
|
---|
| 321 |
|
---|
| 322 | <variablelist>
|
---|
| 323 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 324 | <?dbfo list-presentation="list"?>
|
---|
| 325 | <?dbhtml list-presentation="table"?>
|
---|
| 326 |
|
---|
[5028839f] | 327 | <varlistentry id="js&spidermonkey-major;">
|
---|
| 328 | <term><command>js&spidermonkey-major;</command></term>
|
---|
[fcce89bc] | 329 | <listitem>
|
---|
| 330 | <para>
|
---|
| 331 | provides a command line interface to the
|
---|
[4c24eb0a] | 332 | <application>JavaScript</application> engine
|
---|
[fcce89bc] | 333 | </para>
|
---|
[5028839f] | 334 | <indexterm zone="spidermonkey js&spidermonkey-major;">
|
---|
| 335 | <primary sortas="b-js&spidermonkey-major;">
|
---|
| 336 | js&spidermonkey-major;
|
---|
| 337 | </primary>
|
---|
[fcce89bc] | 338 | </indexterm>
|
---|
| 339 | </listitem>
|
---|
| 340 | </varlistentry>
|
---|
| 341 |
|
---|
[5028839f] | 342 | <varlistentry id="js&spidermonkey-major;-config">
|
---|
| 343 | <term><command>js&spidermonkey-major;-config</command></term>
|
---|
[fcce89bc] | 344 | <listitem>
|
---|
| 345 | <para>
|
---|
[5028839f] | 346 | is used to find the SpiderMonkey compiler and linker flags
|
---|
[fcce89bc] | 347 | </para>
|
---|
[5028839f] | 348 | <indexterm zone="spidermonkey js&spidermonkey-major;-config">
|
---|
| 349 | <primary sortas="b-js&spidermonkey-major;-config">i
|
---|
| 350 | js&spidermonkey-major;-config
|
---|
| 351 | </primary>
|
---|
[fcce89bc] | 352 | </indexterm>
|
---|
| 353 | </listitem>
|
---|
| 354 | </varlistentry>
|
---|
| 355 |
|
---|
[5028839f] | 356 | <varlistentry id="libmozjs-&spidermonkey-major;">
|
---|
| 357 | <term>
|
---|
| 358 | <filename class="libraryfile">
|
---|
| 359 | libmozjs-&spidermonkey-major;.so
|
---|
| 360 | </filename>
|
---|
| 361 | </term>
|
---|
[fcce89bc] | 362 | <listitem>
|
---|
| 363 | <para>
|
---|
[4c24eb0a] | 364 | contains the Mozilla JavaScript API functions
|
---|
[fcce89bc] | 365 | </para>
|
---|
[5028839f] | 366 | <indexterm zone="spidermonkey libmozjs-&spidermonkey-major;">
|
---|
| 367 | <primary sortas="c-libmozjs&spidermonkey-major;">
|
---|
| 368 | libmozjs-&spidermonkey-major;.so
|
---|
| 369 | </primary>
|
---|
[fcce89bc] | 370 | </indexterm>
|
---|
| 371 | </listitem>
|
---|
| 372 | </varlistentry>
|
---|
| 373 | </variablelist>
|
---|
| 374 | </sect2>
|
---|
[4c24eb0a] | 375 |
|
---|
[fcce89bc] | 376 | </sect1>
|
---|