-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working build script for Android ARM Node 7.x or 8.x shared library #14783
Comments
FYI: I've tried many different ways to get NodeJS running on Android and spent yesterday all-day compiling without success. |
Hi @aschrijver, I as well spent a lot of time with the node build system trying to get a shared lib for android. My work is here: https://github.com/gardner/ssband You may be more interested in some work by @staltz that wraps the node binary in an Android service as showcased here: https://github.com/staltz/mmmmm-mobile André definitely has a great working example of running a node server from and Android app. If you need the tight coupling that comes with shared modules and in-process communication then maybe check out the aging ssband. Keep up the good work |
Thank you @gardner I will look at ssband. I have included @stalz in my evaluation. He also created I've also tried mmmm-mobile (not completely done yet, it has some nice things, but I don't need the deeper integration with scuttlebot). Because the Update: I've looked at ssband, but is basically what I have tried already ( |
Since the Lines 489 to 493 in 89d9cc7
Ideally It'd also be good to get some testing of our Shared Library node build options. |
@gibfahn Thanks. I've tried this shared option for ARM on android, but it fails (have tried for |
Node v8.3.0 for ARM with latest NDK r17 canary build: FailsStatus: Fails at end of build when creating Compiling NodeJS as native library for Android ( I am using canary NDK because of earlier Procedure:
And the resulting output was:
BTW this is the same error I get when running the fantastic build system being PR'ed for J2V8 (kudos @drywolf ). See full details or: In file included from ../deps/v8/src/compiler/ast-graph-builder.cc:16:0:
../deps/v8/src/compiler/node-matchers.h: In member function 'bool v8::internal::compiler::FloatMatcher<T, kOpcode>::IsInteger() const':
../deps/v8/src/compiler/node-matchers.h:171:32: error: 'nearbyint' is not a member of 'std'
return this->HasValue() && std::nearbyint(this->Value()) == this->Value(); @DanAlbert was kind enough to point out I am still using The only issue is, I do not know how to configure libc++. Added Then, working from C++ STL Support I added first Console output: touch /home/arnold/Development/misc/node/out/Release/obj.target/deps/v8/src/inspector/inspector_debugger_script.stamp
/home/arnold/Development/misc/node/android-toolchain/bin/arm-linux-androideabi-g++ '-DV8_GYP_BUILD' '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DCAN_USE_VFP3_INSTRUCTIONS' '-DCAN_USE_VFP32DREGS' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT' '-Dv8_promise_internal_field_count' '-D_GLIBCXX_USE_C99_MATH' -I../deps/v8 -I../. -I/home/arnold/Development/misc/node/out/Release/obj/gen -I../deps/v8/include -Wall -Wextra -Wno-unused-parameter -fPIC -march=armv7-a -mfpu=vfpv3 -marm -fdata-sections -ffunction-sections -O2 -fno-omit-frame-pointer -fPIE -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/arnold/Development/misc/node/out/Release/.deps//home/arnold/Development/misc/node/out/Release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o.d.raw -c -o /home/arnold/Development/misc/node/out/Release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o /home/arnold/Development/misc/node/out/Release/obj/gen/src/inspector/protocol/Protocol.cpp
In file included from /home/arnold/Development/misc/node/android-toolchain/include/c++/4.9.x/type_traits:390:0,
from /home/arnold/Development/misc/node/android-toolchain/include/c++/4.9.x/memory:643,
from ../deps/v8/src/inspector/string-util.h:8,
from /home/arnold/Development/misc/node/out/Release/obj/gen/src/inspector/protocol/Forward.h:8,
from /home/arnold/Development/misc/node/out/Release/obj/gen/src/inspector/protocol/Protocol.h:8,
from /home/arnold/Development/misc/node/out/Release/obj/gen/src/inspector/protocol/Protocol.cpp:7:
/home/arnold/Development/misc/node/android-toolchain/include/c++/4.9.x/cstddef:44:25: fatal error: stddef.h: No such file or directory
#include_next <stddef.h>
^
compilation terminated.
deps/v8/src/v8_base.target.mk:622: recipe for target '/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o' failed
make[1]: *** [/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o] Error 1
rm bb4e5f9676e23c1f654738ad8795159445636c4f.intermediate
Makefile:76: recipe for target 'node' failed
make: *** [node] Error 2
How can I pass this setting / configure this? |
NodeJS v7.10.1 for ARM with dna2oslab build script, built on NDK r15 latest: FailsStatus: Fails at end of build when creating Built with dna2oslab build script. This because it solves the first /home/arnold/Development/misc/node/android-toolchain/bin/arm-linux-androideabi-g++ -rdynamic -fPIE -pie -shared -o /home/arnold/Development/misc/node/out/Release/mkpeephole -Wl,--start-group /home/arnold/Development/misc/node/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/bytecode-operands.o /home/arnold/Development/misc/node/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/bytecodes.o /home/arnold/Development/misc/node/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/mkpeephole.o /home/arnold/Development/misc/node/out/Release/obj.target/deps/v8/src/libv8_libbase.a -Wl,--end-group -llog
LD_LIBRARY_PATH=/home/arnold/Development/misc/node/out/Release/lib.host:/home/arnold/Development/misc/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /home/arnold/Development/misc/node/out/Release/obj.target/v8_base/geni; "/home/arnold/Development/misc/node/out/Release/mkpeephole" "/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc"
/home/arnold/Development/misc/node/out/Release/mkpeephole: 1: /home/arnold/Development/misc/node/out/Release/mkpeephole: Syntax error: word unexpected (expecting ")")
deps/v8/src/v8_base.target.mk:13: recipe for target '/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc' failed
make[1]: *** [/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc] Error 2
make[1]: Leaving directory '/home/arnold/Development/misc/node/out'
Makefile:75: recipe for target 'node' failed
make: *** [node] Error 2 Building with dna2oslab resulted in following mkpeephole-related error: /home/arnold/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr -I/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/include -L/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/lib '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DCAN_USE_VFP3_INSTRUCTIONS' '-DCAN_USE_VFP32DREGS' '-DENABLE_DISASSEMBLER' '-D_GLIBCXX_USE_C99_MATH' -I../deps/v8 -I../. -I/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj/gen -I../deps/v8/include -Wall -Wextra -Wno-unused-parameter -fPIC -march=armv7-a -mfpu=vfpv3 -marm -fdata-sections -ffunction-sections -O2 -fno-omit-frame-pointer -fPIE -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/.deps//home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.o.d.raw -I/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -I/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -L/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -fPIE -pie -I/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -I/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -L/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -fPIE -pie -c -o /home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.o /home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc
/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:13:68: error: conflicting declaration 'const v8::internal::interpreter::PeepholeActionAndData v8::internal::interpreter::PeepholeActionTable::row_data_ [129][129]'
const PeepholeActionAndData PeepholeActionTable::row_data_[129][129] = {
^
In file included from /home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:7:0:
../deps/v8/src/interpreter/bytecode-peephole-table.h:64:38: note: previous declaration as 'const v8::internal::interpreter::PeepholeActionAndData v8::internal::interpreter::PeepholeActionTable::row_data_ [][133]'
static const PeepholeActionAndData row_data_[][kNumberOfBytecodes];
^
/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:13:68: error: declaration of 'const v8::internal::interpreter::PeepholeActionAndData v8::internal::interpreter::PeepholeActionTable::row_data_ [][133]' outside of class is not definition [-fpermissive]
const PeepholeActionAndData PeepholeActionTable::row_data_[129][129] = {
^
/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:16915:65: error: conflicting declaration 'const v8::internal::interpreter::PeepholeActionAndData* const v8::internal::interpreter::PeepholeActionTable::row_ [129]'
const PeepholeActionAndData* const PeepholeActionTable::row_[129] = {
^
In file included from /home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:7:0:
../deps/v8/src/interpreter/bytecode-peephole-table.h:65:45: note: previous declaration as 'const v8::internal::interpreter::PeepholeActionAndData* const v8::internal::interpreter::PeepholeActionTable::row_ [133]'
static const PeepholeActionAndData* const row_[kNumberOfBytecodes];
^
/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc:16915:65: error: declaration of 'const v8::internal::interpreter::PeepholeActionAndData* const v8::internal::interpreter::PeepholeActionTable::row_ [133]' outside of class is not definition [-fpermissive]
const PeepholeActionAndData* const PeepholeActionTable::row_[129] = {
^
Makefile:313: recipe for target '/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.o' failed
make[1]: *** [/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.o] Error 1
make[1]: Leaving directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.10.1/out'
Makefile:75: recipe for target 'node' failed
make: *** [node] Error 2 |
NodeJS v7.1.0 for ARM with dna2oslab build script, built on NDK r15 latest: FailsStatus: Fails at end of build when creating Built with dna2oslab build script. This because it solves the first It leads to similar issue as earlier reported error by @gardner (with NDK r14-beta1 and Node v6.9.1). Also tried with /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/zlib/libzlib.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/http_parser/libhttp_parser.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/cares/libcares.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/uv/libuv.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/v8/src/libv8_base.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/v8/src/libv8_libbase.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/v8/src/libv8_libsampler.a /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/v8/src/libv8_nosnapshot.a -Wl,--no-whole-archive -lgnustl_static -lm -ldl -llog
/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/lib/crtbegin_dynamic.o:crtbegin.c:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
node.target.mk:193: recipe for target '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/libnode.so.51' failed
make[1]: *** [/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/libnode.so.51] Error 1
make[1]: Leaving directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out'
Makefile:68: recipe for target 'node' failed
make: *** [node] Error 2 But this build almost made it to its successful conclusion! Compiling with added /home/arnold/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr -I/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/include -L/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/lib -rdynamic -fPIE -pie --sysroot=/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr -L/home/arnold/Android/Sdk/ndk-bundle/platforms/android-23/arch-arm/usr/lib -fPIE -pie -L/home/arnold/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -fPIE -pie -o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/openssl-cli -Wl,--start-group /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/app_rand.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/apps.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/asn1pars.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ca.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ciphers.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/cms.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl2p7.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dgst.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dh.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dhparam.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsa.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsaparam.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ec.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ecparam.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/enc.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/engine.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/errstr.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendh.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendsa.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genpkey.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genrsa.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/nseq.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ocsp.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/openssl.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/passwd.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs12.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs7.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs8.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkey.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyparam.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyutl.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/prime.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rand.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/req.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsa.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsautl.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_cb.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_client.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_server.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_socket.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_time.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/sess_id.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/smime.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/speed.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/spkac.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/srp.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ts.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/verify.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/version.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/x509.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a -Wl,--end-group -static -ldl -llog
/home/arnold/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
/home/arnold/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -llog
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: undefined reference to 'dlopen'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: undefined reference to 'dlsym'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: undefined reference to 'dlclose'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_func: error: undefined reference to 'dlsym'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_func: error: undefined reference to 'dlerror'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_var: error: undefined reference to 'dlsym'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_var: error: undefined reference to 'dlerror'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined reference to 'dlopen'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined reference to 'dlclose'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined reference to 'dlerror'
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/deps/openssl/libopenssl.a(/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/dso/dso_dlfcn.o):dso_dlfcn.c:function dlfcn_unload: error: undefined reference to 'dlclose'
collect2: error: ld returned 1 exit status
deps/openssl/openssl-cli.target.mk:195: recipe for target '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/openssl-cli' failed
make[1]: *** [/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/openssl-cli] Error 1
make[1]: Leaving directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out'
Makefile:68: recipe for target 'node' failed
make: *** [node] Error 2 This probably due to statically linked executable limitations, specifically:
Compiled instead with rm -f /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/libnode.so.51 && /home/arnold/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar crsT /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/libnode.so.51 /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/debug-agent.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/async-wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/env.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/fs_event_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/cares_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/connection_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/connect_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/handle_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/js_stream.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_buffer.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_config.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_constants.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_contextify.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_file.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_http_parser.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_javascript.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_os.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_revert.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_url.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_util.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_v8.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_stat_watcher.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_watchdog.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_zlib.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_i18n.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/pipe_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/signal_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/spawn_sync.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/string_bytes.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/stream_base.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/stream_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/tcp_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/timer_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/tty_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/process_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/udp_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/uv.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/util.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/string_search.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_crypto.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_crypto_bio.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/node_crypto_clienthello.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/tls_wrap.o /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node/src/backtrace_posix.o
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node_dtrace_header.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node_dtrace_provider.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node_dtrace_ustack.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node_etw.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/node_perfctr.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/specialize_node_d.stamp
touch /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.host/v8_inspector_compress_protocol_json.stamp
make[1]: Leaving directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out'
ln -fs out/Release/node node
++ mkdir /home/arnold/Development/misc/dna2oslab/android/build/../node-v7.1.0/dist/bin
++ cp out/Release/mkpeephole /home/arnold/Development/misc/dna2oslab/android/build/../node-v7.1.0/dist/bin/v8_mkpeephole
++ make_install node-v7.1.0
++ make install
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out'
LD_LIBRARY_PATH=/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/lib.host:/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/v8_base/geni; echo "/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc"
/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc
make[1]: Leaving directory '/home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/out'
ln -fs out/Release/node node
/usr/bin/python tools/install.py install '' '/home/arnold/Development/misc/dna2oslab/android/build/../node-v7.1.0/dist/'
installing /home/arnold/Development/misc/dna2oslab/android/node-v7.1.0/dist/bin/libnode.so.51
Traceback (most recent call last):
File "tools/install.py", line 212, in <module>
run(sys.argv[:])
File "tools/install.py", line 206, in run
if cmd == 'install': return files(install)
File "tools/install.py", line 127, in files
action([output_prefix + output_file], 'bin/' + output_file)
File "tools/install.py", line 75, in install
def install(paths, dst): map(lambda path: try_copy(path, dst), paths)
File "tools/install.py", line 75, in <lambda>
def install(paths, dst): map(lambda path: try_copy(path, dst), paths)
File "tools/install.py", line 67, in try_copy
return shutil.copy2(source_path, target_path)
File "/usr/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: u'out/Release/lib.target/libnode.so.51'
Makefile:85: recipe for target 'install' failed
make: *** [install] Error 1 |
@aschrijver I have also created https://github.com/eclipsesource/static-node-build. I use that to build node for J2V8. |
Thanks @irbull I updated the link in the overview. 👍 |
@aschrijver did you try https://github.com/janeasystems/nodejs-mobile? It has ARM builds of Node v8.6.0. |
@orangemocha thanks! I looked at the project, but it is a fork of chakra-core which is discontinued. I am looking into compiling the actual nodejs codebase for android. And currently I can get working builds using the J2V8 project. It is quite nice, and has a very cool build script. This issue is still open for people with similar use cases to share experience.. |
https://github.com/nodejs/node-chakracore is definitely not discontinued (perhaps you meant JXcore?). It is actively maintained by Microsoft, and it's under the Node.js Foundation umbrella. In any case, we are only using node-chakracore for iOS. For Android, we are using the Node.js codebase (which is passed through the node-chakracore fork without significant modifications). We are providing a build script and pre-built binaries for the armeabi-v7a, x86, arm64-v8a and x86_64 architectures. |
you are absolutely correct. sorry for my confusion :) |
For the time as now, is there any new update regarding the nodejs official build for android platform? |
As far as I know we don't have a champion for this in the project so I don't think there is any progress. @rvagg can correct me if I'm wrong. |
@aschrijver I build node.js for Android via https://github.com/sjitech/build-nodejs-for-android. |
Thank you! I added the successful build in the table at the top :) |
ping @aschrijver Should we move this to the docs instead of keeping it as an open issue? |
That may be better, yes, as I am currently not maintaining further build successes in the list. |
Patches to help build node as a shared library for Android is landed through #29388 So I guess this can be closed? |
Closing as suggested. Please leave a comment or open a PR in case there's more left to do than #29388. |
I spend the full day yesterday trying many variations of
android-configure
and other build scripts, with different versions of Node to create a shared librarylibnode.so
for ARM.An overview of build options that were tried so far (some successes):
7.1.0
r15 latest
--shared
7.4.0
up to7.9.0
r13b
libnode.a
linked inlibj2v8.so
using PR#327 [1]7.10.1
r15 latest
--shared
8.3.0
r17 canary
android-configure
+--shared
8.x
python configure
8.x master
+ #14837r13b
libnode.a
linked inlibj2v8.so
using PR#3278.x
r17 canary
libnode.a
linked inlibj2v8.so
usingClang
andlibc++
[2][3]
v8.11.4
r17b
[1] Or build only the static library with https://github.com/eclipsesource/static-node-build
[2] Clang + libc++ are the way to go for 8.x builds
[3] Looks promising, needs compiling with
libandroid_support
headersAre there any more build script configurations known to work in creating Node shared libraries?
Many thanks to @gardner @DanAlbert @drywolf @matiwinnetou @irbull @mafintosh @gibfahn for all their great efforts in helping to figure this out! 👍
The text was updated successfully, but these errors were encountered: