[gjs/mozjs91] README.MSVC.md: Update info on SpiderMonkey builds



commit b8370cae0520affb683a33ca98e9cd69f053b9b2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Aug 13 16:38:16 2021 +0800

    README.MSVC.md: Update info on SpiderMonkey builds
    
    Apparently I was wrong about the '--enable-debug' option, so tell people that
    only one of '--enable-debug' or '--enable-optimize' should be explicitly used
    and the other should be explicitly disabled using '--disable-xxx'.
    
    Also add info to the items that people should check in their SpiderMonkey's
    'js-config.h' so that it contains the right entries for the build.

 README.MSVC.md | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/README.MSVC.md b/README.MSVC.md
index fb8ed554..c705fdf2 100644
--- a/README.MSVC.md
+++ b/README.MSVC.md
@@ -64,7 +64,7 @@ ac_add_options --target=x86_64-pc-mingw32
 ac_add_options --host=x86_64-pc-mingw32
 ac_add_options --disable-tests
 ac_add_options --enable-optimize
-ac_add_options --enable-debug
+ac_add_options --disable-debug
 ac_add_options --disable-jemalloc
 ac_add_options --prefix=c:/software.b/mozjs91.bin
 ```
@@ -76,8 +76,8 @@ An explanation of the lines above:
 *  `ac_add_options --target=x86_64-pc-mingw32`: Target architecture, replace `x86_64` with `aarch64` for 
ARM64 builds, and with `i686` for 32-bit x86 builds.
 *  `ac_add_options --host=x86_64-pc-mingw32`: Use this as-is, unless building on a 32-bit compiler (replace 
`x86_64` with `i686`; not recommended)
 *  `ac_add_options --disable-tests`: Save some build time
-*  `ac_add_options --enable-optimize`: Use for release builds of SpiderMonkey
-*  `ac_add_options --enable-debug`: Include debugging functions and symbols, recommended.
+*  `ac_add_options --enable-optimize`: Use for release builds of SpiderMonkey.  Use `--disable-optimize` 
instead if building with `--enable-debug`
+*  `ac_add_options --enable-debug`: Include debugging functions.  Use `--disable-debug` instead if building 
with `--enable-optimize`
 *  `ac_add_options --disable-jemalloc`: This is absolutely needed, otherwise GJS will not build and run 
correctly
 *  `ac_add_options --prefix=c:/software.b/mozjs91.bin`: Some installation path, change as needed
 
@@ -87,6 +87,21 @@ link with missing arena_malloc() and friends symbols, you have built SpiderMoney
 incorrectly and will need to rebuild SpiderMonkey (with the build options as
 noted above) and retry the build.
 
+Please also check that `--enable-optimize` is *not* used with `--enable-debug`.
+You should explicitly enable one and disable the other, as `--enable-debug`
+will make the resulting build depend on the debug CRT, and mixing between
+the release and debug CRT in the same DLL is often a sign of trouble when using
+with GJS, meaning that you will need to rebuild SpiderMonkey with the appropriate
+options set in your `.mozconfig` file.  Please note that for SpiderMonkey builds, 
+PDB files are generated even if `--disable-debug` is used.
+
+You will need to check that `js-config.h` has the correct entries that correspond
+to your SpiderMonkey build, especially the following items:
+
+*  `JS_64BIT`, `JS_PUNBOX64`: Should be defined for 64-bit builds, not 32-bit builds
+*  `JS_NUNBOX32`: Should be defined for 32-bit builds, not 64-bit builds
+*  `JS_DEBUG`, `JS_GC_ZEAL`: Should only be defined if `--enable-debug` is used
+
 Note in particular that a mozglue.dll should *not* be in $(builddir)/dist/bin,
 although there will be a mozglue.lib somewhere in the build tree (which, you can
 safely delete after building SpiderMonkey).  The --host=... and --target=...


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]