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