Skip to content

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

Description

@camz

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.

Activity

  1. MylesBorins commented on Jan 25, 2016

    @MylesBorins
    Contributor

    @camz did v4.2.3 work as expected?

  2. camz commented on Jan 25, 2016

    @camz
    Author

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

    ./android-configure /opt/android-ndk-r10e
    make
    
  3. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Jan 25, 2016
  4. MylesBorins commented on Jan 25, 2016

    @MylesBorins
    Contributor

    /cc @nodejs/build @jasnell

  5. added
    armIssues and PRs related to the ARM architecture.
    on Jan 25, 2016
  6. richardlau commented on Jan 25, 2016

    @richardlau
    Member

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

  7. richardlau commented on Jan 25, 2016

    @richardlau
    Member
  8. joaocgreis commented on Jan 25, 2016

    @joaocgreis
    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.

  9. rvagg commented on Mar 22, 2016

    @rvagg
    Member

    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

  10. bnoordhuis commented on May 2, 2016

    @bnoordhuis
    Member

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

  11. fornwall commented on May 2, 2016

    @fornwall

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues and PRs related to the ARM architecture.buildIssues and PRs related to Node.js builds or CI infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions