From f169772031f84447461380e734512a566376d66f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 12:21:16 +0800 Subject: [PATCH] Link boringssl and node together in one binary --- atom.gyp | 25 +++---------------------- atom/common/node_bindings.cc | 5 +---- common.gypi | 9 +++------ script/bootstrap.py | 2 +- script/lib/config.py | 2 +- vendor/brightray | 2 +- vendor/node | 2 +- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/atom.gyp b/atom.gyp index 73c13b5..61f4911 100644 --- a/atom.gyp +++ b/atom.gyp @@ -197,6 +197,8 @@ # Defined in Chromium but not exposed in its gyp file. 'V8_USE_EXTERNAL_STARTUP_DATA', 'ENABLE_PLUGINS', + # Needed by Node. + 'NODE_WANT_INTERNALS=1', ], 'sources': [ '<@(lib_sources)', @@ -527,7 +529,7 @@ ['libchromiumcontent_component', { 'copied_libraries': '<(libchromiumcontent_shared_libraries)', }, { - 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'], + 'copied_libraries': [], }], ], }, @@ -535,7 +537,6 @@ 'files': [ '<@(copied_libraries)', '<(libchromiumcontent_dir)/ffmpegsumo.so', - '<(PRODUCT_DIR)/libnode.dylib', ], }, { @@ -548,26 +549,6 @@ ], 'postbuilds': [ { - 'postbuild_name': 'Fix path of libnode', - 'action': [ - 'install_name_tool', - '-change', - '/usr/local/lib/libnode.dylib', - '@rpath/libnode.dylib', - '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', - ], - }, - { - 'postbuild_name': 'Fix path of libboringssl', - 'action': [ - 'install_name_tool', - '-change', - '/usr/local/lib/libboringssl.dylib', - '@rpath/libboringssl.dylib', - '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', - ], - }, - { 'postbuild_name': 'Add symlinks for framework subdirectories', 'action': [ 'tools/mac/create-framework-subdir-symlinks.sh', diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 05cdbe3..a021e92 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -27,9 +27,7 @@ using content::BrowserThread; #define REFERENCE_MODULE(name) \ extern "C" void _register_ ## name(void); \ void (*fp_register_ ## name)(void) = _register_ ## name -#if defined(OS_WIN) -// On Windows Node is built as static_library so we need to reference Node's -// builtin modules. +// Node's builtin modules. REFERENCE_MODULE(cares_wrap); REFERENCE_MODULE(fs_event_wrap); REFERENCE_MODULE(buffer); @@ -52,7 +50,6 @@ REFERENCE_MODULE(tty_wrap); REFERENCE_MODULE(udp_wrap); REFERENCE_MODULE(uv); REFERENCE_MODULE(js_stream); -#endif // defined(OS_WIN) // Atom Shell's builtin modules. REFERENCE_MODULE(atom_browser_app); REFERENCE_MODULE(atom_browser_auto_updater); diff --git a/common.gypi b/common.gypi index c63bcd8..2ca01a1 100644 --- a/common.gypi +++ b/common.gypi @@ -4,7 +4,6 @@ ], 'variables': { 'clang': 0, - 'openssl_no_asm': 1, 'conditions': [ ['OS=="mac" or OS=="linux"', { 'clang': 1, @@ -20,7 +19,7 @@ 'node_shared_cares': 'false', 'node_shared_http_parser': 'false', 'node_shared_libuv': 'false', - 'node_shared_openssl': 'false', + 'node_shared_openssl': 'true', 'node_shared_v8': 'true', 'node_shared_zlib': 'false', 'node_tag': '', @@ -40,7 +39,7 @@ # Settings to compile node under Windows. 'target_defaults': { 'target_conditions': [ - ['_target_name in ["libuv", "http_parser", "cares", "openssl", "openssl-cli", "node", "zlib"]', { + ['_target_name in ["libuv", "http_parser", "cares", "node", "zlib"]', { 'msvs_disabled_warnings': [ 4703, # potentially uninitialized local pointer variable 'req' used 4013, # 'free' undefined; assuming extern returning int @@ -104,6 +103,7 @@ ['_target_name in ["node", "atom_lib"]', { 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include', + '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include', ], }], ['_target_name=="node"', { @@ -114,9 +114,6 @@ 'DYLIB_INSTALL_NAME_BASE': '@rpath' }, }], - ['OS=="win"', { - 'type': 'static_library', - }], ['OS=="linux"', { 'cflags': [ '-fPIC' ], }], diff --git a/script/bootstrap.py b/script/bootstrap.py index fadc7a2..f3b2185 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -26,7 +26,7 @@ def main(): enable_verbose_mode() if sys.platform == 'cygwin': update_win32_python() - update_submodules() + # update_submodules() update_node_modules('.') bootstrap_brightray(args.url) diff --git a/script/lib/config.py b/script/lib/config.py index 48ed65c..e98e5b1 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = 'e0213676879061470efe50720368bce9b99aaa12' +LIBCHROMIUMCONTENT_COMMIT = '2b564074393dcd3dd90e0edfc5a75099c2a72d1d' ARCH = { 'cygwin': '32bit', diff --git a/vendor/brightray b/vendor/brightray index a09b6c7..d4c8ac2 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit a09b6c78b76fbbc019a9be72a0c5f2403f5c0763 +Subproject commit d4c8ac2565a2e257c37215d9b65d6dd0267aad1b diff --git a/vendor/node b/vendor/node index 790c4a3..6a8c1dd 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 790c4a3af36144fcdd5fe39d0cb6cd622f282434 +Subproject commit 6a8c1dda355e67303441afb4bb812b8428362f23 -- 2.7.4