%general-entities; ]> $Date$ JS-&JS91-version; js91 Introduction to JS JS (also referred as SpiderMonkey) is Mozilla's JavaScript and WebAssembly Engine, written in C++ and Rust. In BLFS, the source code of JS is taken from Firefox. &lfs111_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &js91-md5sum; Download size: &js91-size; Estimated disk space required: &js91-buildsize; Estimated build time: &js91-time; JS91 Dependencies Required , , and User Notes: Installation of JS Unlike most other packages in BLFS, the instructions below require you to untar firefox-&JS91-version;esr.tar.xz and change into the firefox-&JS91-version; folder. Extracting the tarball will reset the permissions of the current directory to 0755 if you have permission to do that. If you do this in a directory where the sticky bit is set, such as /tmp it will end with error messages: tar: .: Cannot utime: Operation not permitted tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted tar: Exiting with failure status due to previous errors This does finish with non-zero status, but it does NOT mean there is a real problem. Do not untar as the root user in a directory where the sticky bit is set - that will unset it. If building on a 32 bit machine, the following sed works around an issue with an incompatible double type in one header file: case "$(uname -m)" in i?86) sed -e '/typedef[ ]*double/s/double/long double/' \ -i modules/fdlibm/src/math_private.h ;; esac Install JS by running the following commands: Compiling the C++ code respects $MAKEFLAGS and defaults to 'j1', the rust code will use all processors. mkdir obj && cd obj && CC=gcc CXX=g++ \ sh ../js/src/configure.in --prefix=/usr \ --with-intl-api \ --with-system-zlib \ --with-system-icu \ --disable-jemalloc \ --disable-debug-symbols \ --enable-readline && make To run the JS test suite, issue: make -C js/src check-jstests JSTESTS_EXTRA_ARGS="--timeout 300 --wpt=disabled". It's recommended to redirect the output into a log. Because we are building with system ICU, more than one hundred tests (out of a total of more than 40,000) are known to fail. To run the JIT test suite, issue: make -C js/src check-jit-test JITTEST_EXTRA_ARGS="--timeout 300". An issue in the installation process causes any running program which links to JS91 shared library (for example, GNOME Shell) to crash if JS91 is upgraded or reinstalled. To work around this issue, remove the old version of the JS91 shared library before installation: rm -fv /usr/lib/libmozjs-91.so Now, as the root user: make install && rm -v /usr/lib/libjs_static.ajs && sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config Command Explanations CC=gcc CXX=g++: Upstream now prefers clang, override it like other Mozilla packages in BLFS book. sh ../js/src/configure.in: configure.in is actually a shell script, but the executable bit is not set in its permission mode so it's needed to explicitly run it with sh. --with-intl-api: This enables the internationalization functions required by Gjs. --with-system-*: These parameters allow the build system to use system versions of the above libraries. These are required for stability. --enable-readline: This switch enables Readline support in the JS shell. --disable-jemalloc: This switch disables the internal memory allocator used in JS91. jemalloc is only intended for the Firefox browser environment. For other applications using JS91, if JS91 uses jemalloc, the application may crash as items allocated in jemalloc allocator are freed on system (glibc) allocator. --disable-debug-symbols: Don't generate debug symbols since they are very large and most users won't need it. Remove it if you want to debug JS91. rm -v /usr/lib/libjs_static.ajs: Remove a large static library which is not used by any BLFS package. sed -i '/@NSPR_CFLAGS@/d' /usr/bin/js91-config: Prevent js91-config from using buggy CFLAGS. Contents Installed Programs Installed Libraries Installed Directories js91 and js91-config libmozjs-91.so /usr/include/mozjs-91 Short Descriptions js91 provides a command line interface to the JavaScript engine js91 js91-config is used to find the JS compiler and linker flags js91-config libmozjs-91.so contains the Mozilla JavaScript API functions libmozjs-91.so