MSVC Debug Build

126 views
Skip to first unread message

Calvin L

unread,
Mar 11, 2020, 4:40:45 PM3/11/20
to v8-users
Hi,

I was wondering if anyone had any luck with the MSVC debug build so far? I successfully built v8 as a static library for release builds with these commands
    
    gn gen out.gn/x64_release --args="is_component_build=false is_debug=false target_cpu=\"x64\" v8_enable_pointer_compression=false is_clang=false"
    call ninja -C out.gn/x64_release

   gn gen out.gn/x86_release --args="is_component_build=false is_debug=false target_cpu=\"x86\" v8_enable_pointer_compression=false is_clang=false"
   call ninja -C out.gn/x86_release

These compile fine with my project. I haven't been able to get the debug build to work on the other hand. Here's some of the args i tried to build with

args: is_component_build=false 
         is_debug=true 
         target_cpu="x64" 
         v8_enable_pointer_compression=false 
         is_clang=false

result: successful build failed linking


args: is_component_build=false 
         is_debug=true 
         symbol_level=2 
         target_cpu="x64" 
         v8_enable_backtrace=true 
         v8_enable_slow_dchecks=true 
         v8_enable_pointer_compression=false 
         is_clang=false"

result: successful build failed linking


args: is_component_build=false
         is_debug=true symbol_level=2 
         target_cpu="x64" 
         v8_enable_backtrace=true 
         v8_enable_slow_dchecks=true 
         v8_optimized_debug=false 
         v8_enable_pointer_compression=false 
         is_clang=false

result: failed build (attached errors in text file)


args: is_component_build=false
         is_debug=true 
         symbol_level=2 
         target_cpu="x64" 
         v8_enable_backtrace=true 
         v8_enable_slow_dchecks=true 
         v8_optimized_debug=false 
         v8_enable_pointer_compression=false 
         is_clang=false
         enable_iterator_debugging=true

result: successful build failed link


In the cases where the build was successful, I received errors while trying to compile with my project
    "mismatch detected for '_ITERATOR_DEBUG_LEVEL':value '0' doesn't match value '2' in {some other .lib in my project}"
    "mismatch detected for "RuntimeLibrary": value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug in {some other .lib in my project}'
does anyone know why this is? Thanks in advanced!

-CL

v8_optimized_debug=false.txt

J Decker

unread,
Mar 11, 2020, 5:32:22 PM3/11/20
to v8-users
https://github.com/nodejs/node/issues/27189  

+          '_ITERATOR_DEBUG_LEVEL=0',

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/e09011e8-a321-4995-bcef-61d109784828%40googlegroups.com.

Ron Prestenback

unread,
Jan 4, 2021, 9:52:35 PM1/4/21
to v8-users
I was able to get the msvc debug config to build using static libs last week (in UnrealJS).  Maybe this will help you.

When you set "is_debug=true", v8 will define _DEBUG and change which args are passed to cl.exe.  It sounds like the other libs you're trying to link with are maybe using the release CRT even in debug builds (UE4 does this, for example).  If that's the case, you'll need to change a couple of things in v8's configuration to make it match the host environment:
- in build\config\win\BUILD.gn on the next line after "# Desktop Windows: static CRT.", change config from :static_crt to :release_crt
- in build\config\BUILD.gn file, remove the _DEBUG define from the "debug" configuration section
- Not sure if this will apply to your version of v8, but I had to fix some compile errors with CSA_ASSERT_ARGS macro.  If that happens, see https://github.com/v8/v8/commit/695c40f08ea

I used the following args when running gn:
v8_use_external_startup_data=false
v8_use_snapshot=false
v8_enable_i18n_support=false
is_debug=true
v8_static_library=true
is_clang=false
is_component_build=false

Hope this helps!
Reply all
Reply to author
Forward
0 new messages