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