Fix missing of symbols issue on Release build
authorCheng Zhao <zcbenz@gmail.com>
Fri, 27 Jan 2017 09:51:20 +0000 (18:51 +0900)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 6 Feb 2017 18:34:29 +0000 (10:34 -0800)
atom/node/osfhandle.cc
atom/node/osfhandle.h
common.gypi
script/lib/config.py
vendor/brightray

index 33403dc..022acf1 100644 (file)
@@ -6,6 +6,9 @@
 
 #include <io.h>
 
+#include "v8-profiler.h"
+#include "v8-inspector.h"
+
 namespace node {
 
 int open_osfhandle(intptr_t osfhandle, int flags) {
@@ -16,4 +19,12 @@ int close(int fd) {
   return _close(fd);
 }
 
+void ReferenceSymbols() {
+  // Following symbols are used by electron.exe but got stripped by compiler,
+  // for some reason, adding them to ForceSymbolReferences does not work,
+  // probably because of VC++ bugs.
+  v8::TracingCpuProfiler::Create(nullptr);
+  reinterpret_cast<v8_inspector::V8InspectorClient*>(nullptr)->unmuteMetrics(0);
+}
+
 }  // namespace node
index 3933236..1427bb8 100644 (file)
@@ -21,6 +21,9 @@ namespace node {
 __declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags);
 __declspec(dllexport) int close(int fd);
 
+// A trick to force referencing symbols.
+__declspec(dllexport) void ReferenceSymbols();
+
 }  // namespace node
 
 #endif  // ATOM_NODE_OSFHANDLE_H_
index 7bd2df8..ca143b1 100644 (file)
               '-ldbghelp.lib',
               '-lshlwapi.lib',
             ],
-            # Fix the linking error with icu.
+            # Force referencing symbols of ICU and v8_inspector to make sure
+            # they are included in the final DLL.
             'conditions': [
               ['libchromiumcontent_component==0', {
                 'variables': {
                   'conditions': [
                     ['target_arch=="ia32"', {
                       'reference_symbols': [
+                        # ICU symbols:
                         '_u_errorName_58',
                         '_ubidi_setPara_58',
                         '_ucsdet_getName_58',
                       ],
                     }, {
                       'reference_symbols': [
+                        # ICU symbols:
                         'u_errorName_58',
                         'ubidi_setPara_58',
                         'ucsdet_getName_58',
                         'usearch_setPattern_58',
                         '?createInstance@Transliterator@icu_58@@SAPEAV12@AEBVUnicodeString@2@W4UTransDirection@@AEAW4UErrorCode@@@Z',
                         '??0MeasureFormat@icu_58@@QEAA@AEBVLocale@1@W4UMeasureFormatWidth@@AEAW4UErrorCode@@@Z',
+                        # v8_inspector symbols:
+                        '?DOM@ReasonEnum@Paused@API@Debugger@protocol@v8_inspector@@3PEBDEB',
+                        '?canDispatchMethod@V8InspectorSession@v8_inspector@@SA_NAEBVStringView@2@@Z',
                       ],
                     }],
                   ],
index 68536a7..161295d 100644 (file)
@@ -9,7 +9,7 @@ import sys
 BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
     'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
 LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
-    '0360b49dc59dcaad80bc056c9c9678273d4200e6'
+    '628ae34823d133842faf8f45c2b2741e4ca74e53'
 
 PLATFORM = {
   'cygwin': 'win32',
index e7ef0ea..2804925 160000 (submodule)
@@ -1 +1 @@
-Subproject commit e7ef0ea4e7d45549128d6304c2faf732daedca2d
+Subproject commit 280492556cfcdf56274d18bccb4f9560f43a2a91