# Building SpiderMonkey for Windows

**URL:** <https://discourse.mozilla.org/t/building-spidermonkey-for-windows/84060>\
**Category:** SpiderMonkey\
**Created:** [August 3, 2021, 2:40pm UTC](https://discourse.mozilla.org/t/building-spidermonkey-for-windows/84060 "2021-08-03T14:40:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elad-ep](https://avatars.discourse-cdn.com/v4/letter/e/f19dbf/32.png) [@elad-ep](https://discourse.mozilla.org/u/elad-ep)\
**Post date:** [August 3, 2021, 2:40pm UTC](https://discourse.mozilla.org/t/building-spidermonkey-for-windows/84060/1 "2021-08-03T14:40:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tcampbell](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@tcampbell](https://discourse.mozilla.org/u/tcampbell)\
**Post date:** [August 3, 2021, 3:09pm UTC](https://discourse.mozilla.org/t/building-spidermonkey-for-windows/84060/2 "2021-08-03T15:09:11Z")

</div>

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](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.
