From f7013f4fcb82a39fb58fa8ac4a3a5c919c52525d Mon Sep 17 00:00:00 2001 From: Alain Kalker Date: Sun, 11 Nov 2012 23:09:53 +0100 Subject: [PATCH] Fix v8dbg_* symbols not being linked in when statically linking v8 When linking static libraries, linkers usually skip objects which they consider not to be used by anything else in the final binary. Fix this by generating a header file instead of a cc file, and including that in a module which is certainly going to be linked. --- deps/v8/src/v8.cc | 4 ++++ deps/v8/tools/gyp/v8.gyp | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/deps/v8/src/v8.cc b/deps/v8/src/v8.cc index 2407037b32fe..0cb24b00a566 100644 --- a/deps/v8/src/v8.cc +++ b/deps/v8/src/v8.cc @@ -44,6 +44,10 @@ #include "serialize.h" #include "store-buffer.h" +#if defined(POSTMORTEM_SUPPORT) +#include +#endif + namespace v8 { namespace internal { diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index 17ced879efff..44cf05466bfa 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -744,8 +744,14 @@ ], }], ['v8_postmortem_support=="true"', { + 'defines': [ + 'POSTMORTEM_SUPPORT' + ], + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)' + ], 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc', + '<(SHARED_INTERMEDIATE_DIR)/debug-support.h', ], 'dependencies': ['postmortem-metadata'] }], @@ -841,7 +847,7 @@ '<@(heapobject_files)', ], 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc', + '<(SHARED_INTERMEDIATE_DIR)/debug-support.h', ], 'action': [ 'python',