Skip to content

Has anyone tried GraalVM on Android? #632

Closed

Description

If not, is anyone aware of any specific reasons why GraalVM could not be compiled up for Android?

Activity

  1. dougxc commented on Aug 24, 2018

    @dougxc
    Member

    I have no experience developing on or for Android but one immediate limitation I can think of is that GraalVM does not have a working ARM backend (yet).

  2. dougxc commented on Aug 25, 2018

    @dougxc
    Member

    Let me clarify a little. The Graal compiler itself has a working ARM backend. However, we don't yet have all the pieces in place in SVM to build a GraalVM binary for ARM.

  3. self-assigned this
    on Aug 27, 2018
  4. sanzinger commented on Aug 27, 2018

    @sanzinger
    Contributor

    For reference, similar discussion was done in #373.

  5. bobmcwhirter commented on Dec 2, 2018

    @bobmcwhirter

    fwiw, I'm taking a task to impl the SubstrateVM on AArch64. (Sponsored FTE work).

  6. dougxc commented on Dec 3, 2018

    @dougxc
    Member

    Hi @bobmcwhirter , that's great to hear! @sanzinger is also working on this so it would be good to coordinate to avoid duplicated work.

  7. sanzinger commented on Dec 3, 2018

    @sanzinger
    Contributor

    Hi @bobmcwhirter,
    I have some changes pending towards getting Substrate for AArch64. I'm trying to integrate them in the next days.
    Then we can discuss the areas where we want to go forward with/what are the missing pieces.

    General question since this issue is asking for Android? Are you targeting Android or Linux?

  8. bobmcwhirter commented on Dec 3, 2018

    @bobmcwhirter
  9. sanzinger commented on Dec 3, 2018

    @sanzinger
    Contributor

    Hi, thank you for sharing. These things are already there on our internal branch. Let me check, if I can share the branch with you.

  10. bobmcwhirter commented on Dec 3, 2018

    @bobmcwhirter
  11. sanzinger commented on Dec 3, 2018

    @sanzinger
    Contributor

    Yes, crosscompilation is a thing here since the native image builder requires reasonable amount of memory for real world programs.
    But for the first go we really want to get a simple hello world program running.
    I am currently working to prepare the branch for sharing. I'll keep you updated later today.

  12. sanzinger commented on Dec 3, 2018

    @sanzinger
    Contributor

    I have pushed the branch with the current state: https://github.com/sanzinger/graal/tree/svm/aarch64

    I'll provide some instructions to it tomorrow.

  13. bobmcwhirter commented on Dec 4, 2018

    @bobmcwhirter
  14. 9 remaining items

  15. bobmcwhirter commented on Jan 2, 2019

    @bobmcwhirter

    @olpaw -- Yah, I'm used to building from vm on my mac. Now I've moved to the substratevm dir and building, with verbose, to find why g++ is unhappy. I've having to add ignore warnings are errors due to deprecations.

    @sanzinger I managed to get ninja installed, but I'm also running Fedora29 on this machine, instead of the Suse or whatever softiron ships on it.

    Also, I'm cherry-picking/copy-pasting from your bits against master#HEAD so that hopefully there's less divergence than from October's commits of yours, and so I understand all the moving parts and deltas.

  16. Prashanth-BC commented on Jan 7, 2019

    @Prashanth-BC

    @bobmcwhirter and @sanzinger : I was able to build the repo on docker (aarch64).But build a native image using mx native-image eventually failed :(.
    I guess graal is using llvm and gcc to build the native image. Cant we just pass the march argument to the compiler specifying the target processor architecture?

  17. sanzinger commented on Jan 11, 2019

    @sanzinger
    Contributor

    I just compiled ninja properly on AArch64.

    I updated my branch mentioned above with the latest state. It is currently failing at:

    fatal error: com.oracle.svm.core.util.VMError$HostedError: currently only implemented on AMD64
    	at com.oracle.svm.core.util.VMError.guarantee(VMError.java:85)
    	at com.oracle.svm.jni.hosted.JNICallTrampolineMethod.lambda$createCustomCompileFunction$1(JNICallTrampolineMethod.java:111)
    	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:883)
    	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:259)
    	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:174)
    	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
    	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

    I am going to continue next week on this.
    @bobmcwhirter do you have any progress?

  18. sanzinger commented on Jan 14, 2019

    @sanzinger
    Contributor

    We should move the discussion over to an explicit PR which deals with Substrate on AArch64 (PR #910).
    This issue was opened to ask for Substrate Support on Android. Current state for Substrate on AArch64 is, that we first want to support Linux on AArch64. Support for Android from us is not decided yet.

    I hope this answers the original question.

  19. divs1210 commented on Sep 18, 2019

    @divs1210

    Looks like #910 has been merged. We seem to be getting closer!

  20. vjovanov commented on Oct 18, 2019

    @vjovanov
    Member

    We have been running on Android with both the LLVM and AArch64 backends. Build tools for deploying apps to iOS and Android are just around the corner. Stay tuned...

  21. metacritical commented on Jun 12, 2020

    @metacritical

    Any More updates on this?

  22. vjovanov commented on Jun 14, 2020

    @vjovanov
    Member

    We support both Android and iOS through the tool called Substrate. We are already running quite big projects on the devices.
    A good example is GraalREPL. You can find many examples here.

  23. metacritical commented on Jun 15, 2020

    @metacritical

    This is plenty helpful, Thankyou.

  24. insinfo commented on May 2, 2022

    @insinfo

    is it already possible to compile a native shared library written in java for Android with GraalVM?

  25. benayat commented on Feb 20, 2023

    @benayat

    @vjovanov can any of this examples help me create a native executable for running spring boot backend on termux/android?

  26. vjovanov commented on Feb 21, 2023

    @vjovanov
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions