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