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