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

Build failure when cross-compiling for ARM/Android #4860

Closed
camz opened this issue Jan 25, 2016 · 9 comments
Closed

Build failure when cross-compiling for ARM/Android #4860

camz opened this issue Jan 25, 2016 · 9 comments
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.

Comments

@camz
Copy link

camz commented Jan 25, 2016

Changes introduced with v4.2.4 broke the ARM/Android build. The following error occurs:

./out/Release/mksnapshot: 1: ./out/Release/mksnapshot: Syntax error: word unexpected (expecting ")")

The issue is that mksnapshot has been compiled for the ARM/Android target, but is then being executed on the Linux (x86) host. Building and compiling node for Linux in a separate directory then copying over the mksnapshot utility to the cross-compile folder and re-running make allows the build to finish properly.

The error is misleading, attempting to run the mksnapshot ARM/Android binary without any options gives a different error message that properly describes the issue.

bash: ./out/Release/mksnapshot: cannot execute binary file: Exec format error

I'm not sure why error message from the build script gives a syntax error instead.

Cheers,
Camz.

@MylesBorins
Copy link
Member

@camz did v4.2.3 work as expected?

@camz
Copy link
Author

camz commented Jan 25, 2016

Yes, v.4.2.3 builds as expected. Using the following commands:

./android-configure /opt/android-ndk-r10e
make

@MylesBorins MylesBorins added v4.x build Issues and PRs related to build files or the CI. labels Jan 25, 2016
@MylesBorins
Copy link
Member

/cc @nodejs/build @jasnell

@mscdex mscdex added the arm Issues and PRs related to the ARM platform. label Jan 25, 2016
@richardlau
Copy link
Member

v4.2.4 was the first release where snapshots were properly enabled (49b3c3b).

@richardlau
Copy link
Member

See also nodejs/build#266

@joaocgreis
Copy link
Member

This has been noticed in the comments starting at nodejs/build#266 (comment) .

I fixed cross compilation for ARM with snapshots, but haven't been able to try Android. I do not know any reason why it should not work, should be just adapting the android-configure script. CFLAGS can be a problem, though.

@rvagg
Copy link
Member

rvagg commented Mar 22, 2016

I'm seeking some feedback about how Node.js is used on Android if anyone watching this thread would like to tell us about it: nodejs/build#359

@bnoordhuis
Copy link
Member

android-configure passes --without-snapshot to configure as of 271201f so I don't think there is anything left to do. Closing.

@fornwall
Copy link

fornwall commented May 2, 2016

@bnoordhuis Is there an open issue about not being able to build with snapshots on Android, or should one be created?

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

8 participants