diff --git a/node.gyp b/node.gyp index 3d7c29c6bdb..4fa8acbbbe0 100644 --- a/node.gyp +++ b/node.gyp @@ -1099,6 +1099,15 @@ ], 'conditions': [ + # node_snapshot.cc (generated) is compiled in this target and includes + # node_options.h; without HAVE_INSPECTOR here EnvironmentOptions lacks the + # inspector members (ODR violation with node_base, -Wodr; with LTO node + # crashed on exit with "free(): invalid pointer"). Same as node_base. + [ 'v8_enable_inspector==1', { + 'defines': [ 'HAVE_INSPECTOR=1' ], + }, { + 'defines': [ 'HAVE_INSPECTOR=0' ], + }], [ 'node_builtin_modules_path!=""', { # When loading builtins from disk, JS source files do not need to # trigger rebuilds since the binary reads them at runtime.