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