Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions android-configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# 'npm config set arch=<arch>'


if [ -z "$2" ]; then
if [ -z "$1" ]; then
ARCH=arm64
else
ARCH="$2"
fi
else
ARCH="$1"
fi

CC_VER="4.9"
case $ARCH in
Expand All @@ -22,20 +22,36 @@ case $ARCH in
SUFFIX="aarch64-linux-android"
TOOLCHAIN_NAME="$SUFFIX"
;;

arm)
DEST_CPU="$ARCH"
SUFFIX="$ARCH-linux-androideabi"
TOOLCHAIN_NAME="$SUFFIX"
;;
x86)
DEST_CPU="ia32"
SUFFIX="i686-linux-android"
TOOLCHAIN_NAME="$ARCH"
;;
x86_64)
DEST_CPU="ia32"
SUFFIX="$ARCH-linux-android"
TOOLCHAIN_NAME="$ARCH"
;;
*)
echo "Unsupported architecture provided: $ARCH"
exit 1
;;
esac

NDK_PATH=$1
NDK_PATH=$ANDROID_NDK
function make_toolchain {
$NDK_PATH/build/tools/make-standalone-toolchain.sh \
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
--arch=arm64 \
--arch=$ARCH \
--install-dir=$TOOLCHAIN \
--stl=libc++ \
--platform=android-23
--platform=android-27 \
# --stl=libc++
}

export TOOLCHAIN=$PWD/android-toolchain
Expand Down Expand Up @@ -63,11 +79,11 @@ export GYP_DEFINES

if [ -f "configure" ]; then
./configure \
--cross-compiling \
--dest-cpu=$DEST_CPU \
--dest-os=android \
--shared \
--cross-compiling \
--without-snapshot \
--without-intl \
--openssl-no-asm \
--shared
--without-intl \
--openssl-no-asm
fi
2 changes: 2 additions & 0 deletions build-android
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
LDFLAGS="-llog" make
4 changes: 2 additions & 2 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
}],
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++1y' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=c++0x' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
# The 1990s toolchain on SmartOS can't handle thin archives.
Expand Down Expand Up @@ -481,7 +481,7 @@
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++1y', # -std=gnu++1y
'CLANG_CXX_LANGUAGE_STANDARD': 'c++0x', # -std=gnu++1y
'CLANG_CXX_LIBRARY': 'libc++',
},
}],
Expand Down
5 changes: 3 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,10 @@ def configure_node(o):
elif sys.platform.startswith('aix'):
shlib_suffix = '%s.a'
else:
shlib_suffix = 'so.%s'
shlib_suffix = 'so'
# shlib_suffix = 'so.%s'

shlib_suffix %= node_module_version
# shlib_suffix %= node_module_version
o['variables']['node_module_version'] = int(node_module_version)
o['variables']['shlib_suffix'] = shlib_suffix

Expand Down
4 changes: 2 additions & 2 deletions deps/v8/gypfiles/standalone.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,8 @@
['target_arch=="arm" and arm_version==7', {
'cflags': [
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfpu=vfp3',
# '-mtune=cortex-a8',
# '-mfpu=vfp3',
],
'ldflags': [
'-L<(android_libcpp_libs)/armeabi-v7a',
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
[ 'arm_fpu!="default"', {
'cflags': ['-mfpu=<(arm_fpu)',],
# 'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
}],
Expand All @@ -219,7 +219,7 @@
'cflags': ['-mthumb',],
}],
[ 'arm_thumb==0', {
'cflags': ['-marm',],
# 'cflags': ['-marm',],
}],
],
}, {
Expand Down Expand Up @@ -251,7 +251,7 @@
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
[ 'arm_fpu!="default"', {
'cflags': ['-mfpu=<(arm_fpu)',],
# 'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
}],
Expand All @@ -262,7 +262,7 @@
'cflags': ['-mthumb',],
}],
[ 'arm_thumb==0', {
'cflags': ['-marm',],
# 'cflags': ['-marm',],
}],
],
}, {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/inspector/string-16.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int64_t charactersToInteger(const UChar* characters, size_t length,

char* endptr;
int64_t result =
static_cast<int64_t>(std::strtoll(buffer.data(), &endptr, 10));
static_cast<int64_t>(strtoll(buffer.data(), &endptr, 10));
if (ok) *ok = !(*endptr);
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/inspector/v8-runtime-agent-impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ Response V8RuntimeAgentImpl::globalLexicalScopeNames(

Response V8RuntimeAgentImpl::getIsolateId(String16* outIsolateId) {
char buf[40];
std::snprintf(buf, sizeof(buf), "%" PRIx64, m_inspector->isolateId());
snprintf(buf, sizeof(buf), "%" PRIx64, m_inspector->isolateId());
*outIsolateId = buf;
return Response::OK();
}
Expand Down
25 changes: 18 additions & 7 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3893,6 +3893,8 @@ NodeService::NodeService(int argc, char** argv, void (*initEnv)(NodeService *ser
// Part 2
Isolate::CreateParams params;
ArrayBufferAllocator *allocator = new ArrayBufferAllocator();
//std::unique_ptr<ArrayBufferAllocator, decltype(&FreeArrayBufferAllocator)>
// allocator(CreateArrayBufferAllocator(), &FreeArrayBufferAllocator);
params.array_buffer_allocator = allocator;
#ifdef NODE_ENABLE_VTUNE_PROFILING
params.code_event_handler = vTune::GetVtuneCodeEventHandler();
Expand All @@ -3918,13 +3920,22 @@ NodeService::NodeService(int argc, char** argv, void (*initEnv)(NodeService *ser
Locker locker(isolate);
Isolate::Scope isolate_scope(isolate);
HandleScope handle_scope(isolate);

/*
std::unique_ptr<IsolateData, decltype(&FreeIsolateData)> isolate_data(
CreateIsolateData(
isolate,
event_loop,
v8_platform.Platform(),
allocator.get()),
allocator->zero_fill_field()),
&FreeIsolateData);
*/
IsolateData *isolate_data = new IsolateData(
isolate,
event_loop,
v8_platform.Platform(),
allocator->zero_fill_field());

if (track_heap_objects) {
isolate->GetHeapProfiler()->StartTrackingHeapObjects(true);
}
Expand All @@ -3937,9 +3948,9 @@ NodeService::NodeService(int argc, char** argv, void (*initEnv)(NodeService *ser
Local<Context> localContext = NewContext(isolate);
context.Set(isolate, localContext);
Context::Scope context_scope(localContext);
env = new Environment(isolate_data, localContext);
auto env = new Environment(isolate_data, context,
v8_platform.GetTracingAgent());
// env = new Environment(isolate_data, localContext);
env = new Environment(isolate_data, localContext, v8_platform.GetTracingAgent());

env->Start(argc, argv, exec_argc, exec_argv, v8_is_profiling);

const char* path = argc > 1 ? argv[1] : nullptr;
Expand Down Expand Up @@ -3968,7 +3979,7 @@ NodeService::NodeService(int argc, char** argv, void (*initEnv)(NodeService *ser
SealHandleScope seal(isolate);
bool more;
// might be wrong
env.performance_state()->Mark(
env->performance_state()->Mark(
node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_START);
// might be wrong
// PERFORMANCE_MARK(env, LOOP_START);
Expand All @@ -3986,7 +3997,7 @@ NodeService::~NodeService() {

{
SealHandleScope seal(isolate);
env.performance_state()->Mark(
env->performance_state()->Mark(
node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_EXIT);
//PERFORMANCE_MARK(env, LOOP_EXIT);
}
Expand Down Expand Up @@ -4123,7 +4134,7 @@ void RegisterBuiltinModules() {
#undef V
}

} // namespace node


#if !HAVE_INSPECTOR
void Initialize() {}
Expand Down
4 changes: 2 additions & 2 deletions tools/icu/icu-generic.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
'defines': [
'U_COMMON_IMPLEMENTATION=1',
],
'cflags_c': ['-std=c99'],
'cflags_c': ['-std=c++0x'],
'export_dependent_settings': [ 'icu_uconfig', 'icu_uconfig_target' ],
'direct_dependent_settings': {
'include_dirs': [
Expand Down Expand Up @@ -490,7 +490,7 @@
'U_TOOLUTIL_IMPLEMENTATION=1',
#'DEBUG=0', # http://bugs.icu-project.org/trac/ticket/10977
],
'cflags_c': ['-std=c99'],
'cflags_c': ['-std=c++0x'],
'conditions': [
['OS == "solaris"', {
'defines': [ '_XOPEN_SOURCE_EXTENDED=0' ]
Expand Down