Browse Source

linux: Fix linking with node and v8

Cheng Zhao 10 years ago
parent
commit
5f2fe27b65
6 changed files with 23 additions and 11 deletions
  1. 4 6
      atom.gyp
  2. 14 1
      common.gypi
  3. 2 1
      script/dump-symbols.py
  4. 1 1
      script/lib/config.py
  5. 1 1
      vendor/brightray
  6. 1 1
      vendor/node

+ 4 - 6
atom.gyp

@@ -121,14 +121,12 @@
                 'conditions': [
                   ['libchromiumcontent_component', {
                     'copied_libraries': [
-                      '<(PRODUCT_DIR)/node.dll'
                       '<@(libchromiumcontent_shared_libraries)',
                       '<@(libchromiumcontent_shared_v8_libraries)',
                     ],
                   }, {
                     'copied_libraries': [
-                      '<(PRODUCT_DIR)/node.dll'
-                      '<(libchromiumcontent_dir)/boringssl.dll'
+                      '<(libchromiumcontent_dir)/boringssl.dll',
                     ],
                   }],
                 ],
@@ -167,14 +165,14 @@
                 'conditions': [
                   ['libchromiumcontent_component', {
                     'copied_libraries': [
-                      '<(PRODUCT_DIR)/libnode.so'
+                      '<(PRODUCT_DIR)/lib/libnode.so',
                       '<@(libchromiumcontent_shared_libraries)',
                       '<@(libchromiumcontent_shared_v8_libraries)',
                     ],
                   }, {
                     'copied_libraries': [
-                      '<(PRODUCT_DIR)/libnode.so'
-                      '<(libchromiumcontent_dir)/libboringssl.so'
+                      '<(PRODUCT_DIR)/lib/libnode.so',
+                      '<(libchromiumcontent_dir)/libboringssl.so',
                     ],
                   }],
                 ],

+ 14 - 1
common.gypi

@@ -92,13 +92,26 @@
               '-Wno-unused-value',
               '-Wno-deprecated-declarations',
               '-Wno-return-type',
+              # Required when building as shared library.
+              '-fPIC',
             ],
           }],
         ],
       }],
       ['_target_name=="node"', {
         'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ],
-        'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
+        'conditions': [
+          ['OS=="linux" and libchromiumcontent_component==0', {
+            # Prevent the linker to strip symbols.
+            'ldflags': [
+              '-Wl,--whole-archive',
+              '<@(libchromiumcontent_v8_libraries)',
+              '-Wl,--no-whole-archive',
+            ],
+          }, {
+            'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
+          }],
+        ],
       }],
       ['_target_name=="libuv"', {
         'conditions': [

+ 2 - 1
script/dump-symbols.py

@@ -15,7 +15,8 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
 
 
 def main(destination):
-  register_required_dll()
+  if TARGET_PLATFORM == 'win32':
+    register_required_dll()
 
   rm_rf(destination)
   (project_name, product_name) = get_names_from_gyp()

+ 1 - 1
script/lib/config.py

@@ -4,7 +4,7 @@ import platform
 import sys
 
 BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
-LIBCHROMIUMCONTENT_COMMIT = '60350899df1f7058c9026a239820d0519edb19cc'
+LIBCHROMIUMCONTENT_COMMIT = '0718fa8b44e004a39ee2511858abbef1dae89cef'
 
 ARCH = {
     'cygwin': '32bit',

+ 1 - 1
vendor/brightray

@@ -1 +1 @@
-Subproject commit 1b62aab98e1e79f6357bd156fc2a43068d4a3f49
+Subproject commit 0f37e5fa4d5273f80c91d485e0ce6edef683a26e

+ 1 - 1
vendor/node

@@ -1 +1 @@
-Subproject commit bf5162b9042ff3e626a1adbd56b547801fda8cbf
+Subproject commit 561969a65ff36c2df94326664813f46b7c5803b1