Skip to content

Commit

Permalink
core: update nodejs-mobile v0.1.4
Browse files Browse the repository at this point in the history
Update the libnode binaries to v0.1.4 release. Update the header
files for nodejs-mobile headers.
Change the postlink script to remove the old framework name on iOS.
  • Loading branch information
jaimecbernardo committed Feb 12, 2018
1 parent d478d02 commit 448c9ae
Show file tree
Hide file tree
Showing 24 changed files with 407 additions and 96 deletions.
Empty file.
Binary file modified android/libnode/bin/armeabi-v7a/libnode.so
Binary file not shown.
Empty file.
Binary file modified android/libnode/bin/x86/libnode.so
Binary file not shown.
16 changes: 16 additions & 0 deletions android/libnode/include/node/chakra_ttd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef SRC_CHAKRA_TTD_H_
#define SRC_CHAKRA_TTD_H_

#if defined(NODE_ENGINE_CHAKRACORE)
#define ENABLE_TTD_NODE 1
#else
#define ENABLE_TTD_NODE 0
#endif

#if defined(ENABLE_TTD_NODE) && ENABLE_TTD_NODE
extern bool s_doTTRecord;
extern bool s_doTTReplay;
extern bool s_doTTDebug;
#endif

#endif // SRC_CHAKRA_TTD_H_
168 changes: 161 additions & 7 deletions android/libnode/include/node/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
'component%': 'static_library', # NB. these names match with what V8 expects
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'python%': 'python',
'node_engine%': 'v8',
'msvs_windows_target_platform_version': 'v10.0', # used for node_engine==chakracore

'node_shared%': 'false',
'force_dynamic_crt%': 0,
Expand Down Expand Up @@ -38,9 +40,11 @@
['GENERATOR=="ninja"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
'CHAKRASHIM_BASE': '<(PRODUCT_DIR)/obj/deps/chakrashim/libchakrashim.a',
}, {
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
'CHAKRASHIM_BASE': '<(PRODUCT_DIR)/obj.target/deps/chakrashim/libchakrashim.a',
}],
['OS == "win"', {
'os_posix': 0,
Expand All @@ -51,7 +55,8 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['OS== "mac"', {
['OS== "mac" or OS=="ios"', {
'CHAKRASHIM_BASE': '<(PRODUCT_DIR)/libchakrashim.a',
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}],
Expand All @@ -60,15 +65,51 @@
}, {
'OPENSSL_PRODUCT': 'libopenssl.a',
}],
['OS=="mac"', {
['OS=="mac" or OS=="ios"', {
'clang%': 1,
}, {
'clang%': 0,
}],
],
},

'conditions': [
['node_engine=="v8"', {
'target_defaults': {
'defines': [
'NODE_ENGINE_V8',
],
},
'variables': {
'node_engine_include_dir%': 'deps/v8/include'
},
}],
['node_engine=="chakracore"', {
'target_defaults': {
'defines': [
'NODE_ENGINE_CHAKRACORE',
],
'conditions': [
['target_arch=="arm" or target_arch=="arm64"', {
'msvs_windows_target_platform_version': '<(msvs_windows_target_platform_version)',
}],
],
},
'variables': {
'node_engine_include_dir%': 'deps/chakrashim/include',
'conditions': [
['OS == "win"', {
'node_engine_libs': '-lchakracore.lib',
}, {
'node_engine_libs': '',
}],
],
},
}],
],

'target_defaults': {
'defines': ['NODE_ENGINE="<(node_engine)"'],
'default_configuration': 'Release',
'configurations': {
'Debug': {
Expand All @@ -81,11 +122,17 @@
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
['target_arch=="arm"', {
'msvs_configuration_platform': 'ARM',
}],
['target_arch=="arm64"', {
'msvs_configuration_platform': 'ARM64',
}],
['OS=="aix"', {
'cflags': [ '-gxcoff' ],
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['OS == "android"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -128,14 +175,20 @@
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
['target_arch=="arm"', {
'msvs_configuration_platform': 'ARM',
}],
['target_arch=="arm64"', {
'msvs_configuration_platform': 'ARM64',
}],
['OS=="solaris"', {
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
['OS!="mac" and OS!="win"', {
['OS!="mac" and OS != "ios" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
['OS == "android"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -232,7 +285,7 @@
},
'msvs_disabled_warnings': [4351, 4355, 4800],
'conditions': [
['asan == 1 and OS != "mac"', {
['asan == 1 and OS != "mac" and OS != "ios"', {
'cflags+': [
'-fno-omit-frame-pointer',
'-fsanitize=address',
Expand All @@ -241,7 +294,7 @@
'cflags!': [ '-fomit-frame-pointer' ],
'ldflags': [ '-fsanitize=address' ],
}],
['asan == 1 and OS == "mac"', {
['asan == 1 and ( OS == "mac" or OS == "ios" )', {
'xcode_settings': {
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
Expand Down Expand Up @@ -346,11 +399,112 @@
],
}],
['OS=="android"', {
'conditions': [
[ 'node_shared=="true"', {
'ldflags': [ '-fPIC' ],
}]
],
'target_conditions': [
['_toolset=="target"', {
'defines': [ '_GLIBCXX_USE_C99_MATH' ],
'libraries': [ '-llog' ],
}],
[ '_type=="loadable_module"', {
'ldflags': [ '-fPIC' ],
'conditions': [
# While loading a native node module, Android needs to have a
# (NEEDED) entry for libnode.so, or it won't be able to locate
# referenced symbols.
# We link to the binary libraries that are distributed with the
# nodejs-mobile headers so the (NEEDED) entry is created
[ 'target_arch=="arm"', {
'libraries': ['>(node_root_dir)/bin/armeabi-v7a/libnode.so'],
}],
[ 'target_arch=="arm64"', {
'libraries': ['>(node_root_dir)/bin/arm64-v8a/libnode.so'],
}],
[ 'target_arch=="x86"', {
'libraries': ['>(node_root_dir)/bin/x86/libnode.so'],
}],
[ 'target_arch=="x86_64"', {
'libraries': ['>(node_root_dir)/bin/x86_64/libnode.so'],
}],
],
}],
],
}],
['OS=="ios"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'IPHONEOS_DEPLOYMENT_TARGET': '9.0', # -miphoneos-version-min=9.0
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-no_pie',
'-Wl,-search_paths_first',
],
},
}],
],
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
[ 'target_arch in "arm64 arm armv7s"', {
'xcode_settings': {
'OTHER_CFLAGS': [
'-fembed-bitcode'
],
'OTHER_CPLUSPLUSFLAGS': [
'-fembed-bitcode'
],
}
}],
[ 'target_arch=="arm64"', {
'xcode_settings': {'ARCHS': ['arm64']},
}],
[ 'target_arch=="arm"', {
'xcode_settings': {'ARCHS': ['armv7']},
}],
[ 'target_arch=="armv7s"', {
'xcode_settings': {'ARCHS': ['armv7s']},
}],
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
'CLANG_CXX_LIBRARY': 'libc++',
},
}],
['target_arch=="x64" or target_arch=="ia32"', {
'xcode_settings': { 'SDKROOT': 'iphonesimulator' },
}, {
'xcode_settings': { 'SDKROOT': 'iphoneos', 'ENABLE_BITCODE': 'YES'},
}],
],
}],
['OS=="mac"', {
Expand Down
42 changes: 19 additions & 23 deletions android/libnode/include/node/config.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,55 @@
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'asan': 0,
'variables': { 'OS': 'android',
'arm_float_abi': 'default',
'arm_fpu': 'vfpv3',
'arm_thumb': 0,
'arm_version': '7',
'asan': 0,
'coverage': 'false',
'debug_devtools': 'node',
'debug_http2': 'false',
'debug_nghttp2': 'false',
'force_dynamic_crt': 0,
'force_dynamic_crt': 1,
'host_arch': 'x64',
'icu_data_file': 'icudt59l.dat',
'icu_data_in': '../../deps/icu-small/source/data/in/icudt59l.dat',
'icu_endianness': 'l',
'icu_gyp_path': 'tools/icu/icu-generic.gyp',
'icu_locales': 'en,root',
'icu_path': 'deps/icu-small',
'icu_small': 'true',
'icu_ver_major': '59',
'icu_small': 'false',
'llvm_version': 0,
'node_byteorder': 'little',
'node_enable_d8': 'false',
'node_enable_v8_vtunejit': 'false',
'node_engine': 'v8',
'node_install_npm': 'true',
'node_module_version': 57,
'node_no_browser_globals': 'false',
'node_prefix': '/',
'node_release_urlbase': 'https://nodejs.org/download/release/',
'node_shared': 'false',
'node_release_urlbase': '',
'node_shared': 'true',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_bundled_v8': 'true',
'node_use_dtrace': 'true',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_lttng': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'node_use_v8_platform': 'true',
'node_without_node_options': 'false',
'openssl_fips': '',
'openssl_no_asm': 0,
'shlib_suffix': '57.dylib',
'target_arch': 'x64',
'uv_parent_path': '/deps/uv/',
'uv_use_dtrace': 'true',
'openssl_no_asm': 1,
'shlib_suffix': 'so',
'target_arch': 'arm',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 1,
'v8_enable_inspector': 1,
'v8_enable_i18n_support': 0,
'v8_enable_inspector': 0,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_promise_internal_field_count': 1,
'v8_random_seed': 0,
'v8_trace_maps': 0,
'v8_use_snapshot': 'true',
'want_separate_host_toolset': 0,
'xcode_version': '7.0'}}
'v8_use_snapshot': 'false',
'want_separate_host_toolset': 0}}
4 changes: 3 additions & 1 deletion android/libnode/include/node/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
// Forward-declare libuv loop
struct uv_loop_s;

#include "chakra_ttd.h"

// Forward-declare these functions now to stop MSVS from becoming
// terminally confused when it's done in node_internals.h
namespace node {
Expand Down Expand Up @@ -447,7 +449,7 @@ extern "C" NODE_EXTERN void node_module_register(void* mod);
# define NODE_MODULE_EXPORT __attribute__((visibility("default")))
#endif

#ifdef NODE_SHARED_MODE
#if defined (NODE_SHARED_MODE) || defined (NODE_STATIC_LIBRARY)
# define NODE_CTOR_PREFIX
#else
# define NODE_CTOR_PREFIX static
Expand Down
2 changes: 2 additions & 0 deletions android/libnode/include/node/node_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <stdbool.h>
#include "node_api_types.h"

#define NAPI_VERSION 1

#ifdef _WIN32
#ifdef BUILDING_NODE_EXTENSION
#ifdef EXTERNAL_NAPI
Expand Down
Loading

0 comments on commit 448c9ae

Please sign in to comment.