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