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