Building SpiderMonkey for Windows

I’m trying to build SpiderMonkey (32 bit) for Windows
The command line I used for building is:

PATH=$PATH:"/c/Program Files/LLVM/bin/" JS_STANDALONE=1 ../configure.in --enable-nspr-build --disable-jemalloc --disable-js-shell --disable-tests --target=i686-pc-mingw32 --host=i686-pc-mingw32 --with-libclang-path="C:/Program Files/LLVM/bin"

However, I’m getting various linker errors where SpiderMonkey doesn’t find Rust encoding functions, such as:

lld-link: error: undefined symbol: _encoding_mem_convert_latin1_to_utf8_partial
referenced by c:\firefox_90_0\js\src\vm\CharacterEncoding.cpp:109 
..\Unified_cpp_js_src17.obj:(unsigned int __cdecl JS::DeflateStringToUTF8Buffer(class 
JSLinearString *, class mozilla::Span<char, 4294967295>))

it seems to me that during compilation SpiderMonkey should build jsrust.lib out of Rust bindings. but in fact this doesn’t happen and I get the linker errors. any idea?

This might be an issue with using configure script directly. We’ve been deprecating it, and recommend migrating your setup to use mach / mozconfig. The general instructions are here: https://firefox-source-docs.mozilla.org/js/build.html

You’ll want to add lines like ac_add_options --disable-jemalloc to keep embedding builds working. Additionally, you might want to consider using the Firefox/SpiderMonkey 91 code. It will become the ESR version for the next year and we landed a few fixes to windows embedding builds in it.

1 Like