Skip to content
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

Howto compile Node android arm shared with NDK r17 canary and libc++? #14771

Closed
aschrijver opened this issue Aug 11, 2017 · 6 comments
Closed
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.

Comments

@aschrijver
Copy link

I am trying to compile NodeJS as native library for Android (arm) on Ubuntu 16.04 (4.4.0-59-generic) with the latest NDK continuous build

I am using canary NDK because of earlier node-matchers.h error 'nearbyint' is not a member of 'std' with stable r15 ndk and this github issue: android/ndk#82 (comment)

Procedure:

  • git clone --depth=2 -b v8.x https://github.com/nodejs/node.git
  • Edit android-configure: add --force to make_toolchain, add --without-intl --shared to configure
  • ./android-configure /home/arnold/Android/android-ndk-r17-canary arm
  • LDFLAGS=-shared make

And the resulting output was:

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();
                                ^
../deps/v8/src/compiler/node-matchers.h:171:32: note: suggested alternative:
In file included from /home/arnold/Development/misc/node/android-toolchain/include/c++/4.9.x/cmath:44:0,
                 from ../deps/v8/src/utils.h:11,
                 from ../deps/v8/src/conversions.h:11,
                 from ../deps/v8/src/ast/ast-types.h:8,
                 from ../deps/v8/src/ast/ast.h:8,
                 from ../deps/v8/src/compiler/ast-graph-builder.h:8,
                 from ../deps/v8/src/compiler/ast-graph-builder.cc:5:
/home/arnold/Development/misc/node/android-toolchain/sysroot/usr/include/math.h:198:8: note:   'nearbyint'
 double nearbyint(double);
        ^
deps/v8/src/v8_base.target.mk:605: recipe for target '/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/deps/v8/src/compiler/ast-graph-builder.o' failed
make[1]: *** [/home/arnold/Development/misc/node/out/Release/obj.target/v8_base/deps/v8/src/compiler/ast-graph-builder.o] Error 1
rm bb4e5f9676e23c1f654738ad8795159445636c4f.intermediate
Makefile:76: recipe for target 'node' failed
make: *** [node] Error 2

I thought this was fixed in latest NDK. Any ideas?

@aqrln aqrln added the build Issues and PRs related to build files or the CI. label Aug 11, 2017
@mscdex mscdex added the arm Issues and PRs related to the ARM platform. label Aug 11, 2017
@aschrijver
Copy link
Author

@DanAlbert was kind enough to point out I am still using gnustl and not 'libc++ which leads to this error.

The only issue is, I do not know how to configure libc++. There is no Application.mk and I tried adding --stl=libc++ to the toolchain cmd in android-configure but that does not do it. How can I pass this setting?

@aschrijver aschrijver changed the title Compile android arm shared: 'nearbyint' is not a member of 'std' Howto compile Node android arm shared with NDK r17 canary and libc++? Aug 12, 2017
@aschrijver
Copy link
Author

aschrijver commented Aug 12, 2017

FYI:

I've tried many different ways to get NodeJS running on Android and spent yesterday all-day compiling without success.
I am investigating some viable-seeming approaches to use NodeJS in an android project. I have documented my findings on stackoverflow - Viable options to running NodeJS on Android (Aug 2017).

@gibfahn
Copy link
Member

gibfahn commented Aug 12, 2017

Is this a duplicate of #14783? If so we should probably close it so any discussion happens in one place.

@DanAlbert
Copy link

Looks like it.

@gibfahn
Copy link
Member

gibfahn commented Aug 12, 2017

I'll close. @aschrijver I'm happy to reopen this if you think it should be reopened, let me know.

@gibfahn gibfahn closed this as completed Aug 12, 2017
@aschrijver
Copy link
Author

No problem. I will transfer my findings there and add a descriptive title :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

5 participants