Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can SpiderMonkey build without NSPR on Windows?

58 views
Skip to first unread message

Josh Matthews

unread,
Jun 3, 2019, 6:52:16 PM6/3/19
to JS Internals list
If I remember correctly, there were at least attempts to remove NSPR from
the build on some platforms. Is that still possible on Windows in
particular?

Cheers,
Josh

Jan de Mooij

unread,
Jun 4, 2019, 4:18:53 AM6/4/19
to Josh Matthews, JS Internals list
It's possible to build SpiderMonkey without depending on NSPR with
--enable-posix-nspr-emulation, this uses the implementation in
js/src/vm/PosixNSPR.{h,cpp} However these days we only depend on NSPR for
memory mapped files in Wasm code (note that the PosixNSPR versions just
crash because this API, JS::DeserializeWasmModule, is only used in the
browser). We should either just remove the NSPR dependency completely or
allow using PosixNSPR on all platforms.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1556646 for this.

Thanks,
Jan
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> dev-tech-js-en...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>

Jan de Mooij

unread,
Jun 4, 2019, 4:34:36 AM6/4/19
to Josh Matthews, JS Internals list
Oh I forgot about the PR_LoadLibraryWithFlags call in JS shell code. We
should make that optional too...

Jan

Steve Fink

unread,
Jun 4, 2019, 11:48:40 AM6/4/19
to Jan de Mooij, Josh Matthews, JS Internals list
The library loading stuff is used for ctypes as well, which is used by
Firefox. It was the last difficult piece to remove.

Jan de Mooij

unread,
Jun 4, 2019, 1:23:18 PM6/4/19
to Steve Fink, Josh Matthews, JS Internals list
On Tue, Jun 4, 2019 at 5:48 PM Steve Fink <sf...@mozilla.com> wrote:

> The library loading stuff is used for ctypes as well, which is used by
> Firefox. It was the last difficult piece to remove.
>

True, but most shell and SpiderMonkey builds don't use --enable-ctypes so I
think it would still be a win to drop NSPR support for typical shell and
mozjs builds.

Jan

Jan de Mooij

unread,
Jun 8, 2019, 9:28:58 AM6/8/19
to Steve Fink, Josh Matthews, JS Internals list
Update: I landed some NSPR changes this week for stand-alone JS (shell)
builds:

- Only if you want to use CTypes (--enable-ctypes configure flag) or the JS
shell's --dll flag you'll need NSPR, so use one of --enable-nspr-build,
--with-system-nspr etc. Else don't pass any NSPR flags to configure and
you'll get a build that doesn't depend on NSPR.

- The --enable-posix-nspr-emulation configure flag and vm/PosixNSPR.* have
been removed.

This means Windows builds also no longer require NSPR.

Jan
0 new messages