-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Has anyone tried GraalVM on Android? #632
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
Comments
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). |
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. |
Thanks for the clarification Simon. Approximately how much work is it to
get those missing SVN pieces in place? As an alternative (possibly dumb)
idea, would it make any sense at all to run the Java parts on top of the
existing Android JVM. I'm most interested in the polyglot aspects of
GraalVM on Android, as opposed to performance.
One way or the other I'd like to run my polyglot GraalVM applications on
Android. Trying to find the shortest, most sensible route to that goal.
…On Fri, Aug 24, 2018, 23:23 Douglas Simon ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#632 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AJ6NAdih8HFuEBAloJwCmMmyWEzo9my4ks5uUO1ZgaJpZM4WH6mD>
.
|
For reference, similar discussion was done in #373. |
fwiw, I'm taking a task to impl the SubstrateVM on AArch64. (Sponsored FTE work). |
Hi @bobmcwhirter , that's great to hear! @sanzinger is also working on this so it would be good to coordinate to avoid duplicated work. |
Hi @bobmcwhirter, General question since this issue is asking for Android? Are you targeting Android or Linux? |
Starting with LINUX_AARCH64.
IOS would be my next goal but that’s just a personal goal.
Can you push a branch we could collaborate on?
I’ve got my stubs here (started Friday):
https://github.com/bobmcwhirter/graal/tree/aarch64-platform?files=1
…On Mon, Dec 3, 2018 at 5:28 AM Stefan Anzinger ***@***.***> wrote:
Hi @bobmcwhirter <https://github.com/bobmcwhirter>,
I have some changes pending towards getting Substrate for AArch64. I'm
trying to integrate them in the next days.
Then I 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?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#632 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA-T0Ro7Q4U4rS1WBTbbZpg54cYbvkZks5u1Py8gaJpZM4WH6mD>
.
|
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. |
Great thanks.
I’m eager to continue working toward arm so whatever you can share or think
would be a good way to collaborate would be great.
I have signed the Oracle CLA already (via Red Hat).
My big aarch64 hardware should arrive soon to supplant my RPi.
I’d also like to support cross-compilation to aarch64 from x86 platforms at
some point.
Bob
…On Mon, Dec 3, 2018 at 6:56 AM Stefan Anzinger ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#632 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA-T2ogiVIEP42ldATekDjwgora9Eakks5u1RFqgaJpZM4WH6mD>
.
|
Yes, crosscompilation is a thing here since the native image builder requires reasonable amount of memory for real world programs. |
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. |
You rock!
…On Mon, Dec 3, 2018 at 3:04 PM Stefan Anzinger ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#632 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA-TxSsncMgBXo_5feF139EZF4JBqaMks5u1YO0gaJpZM4WH6mD>
.
|
So it cleanly builds here. I know I can I reckon at this point, until we get cross-compilation working, the full builds should occur on an AArch64 host? Is JDK11 JVMCI sufficient on AArch64 with this branch? Should I be building JVMCI directly on the arm host? Thanks! |
Yes, we need to run everything on an AArch64 host, with JDK11, nothing else for the moment. But internally we run it a bit different so I am currently investigating a way to run tests on the this branch without our internal buildsystem. This is what I am doing right now. Give me some time for bringing an update on this. As a possible target JDK we may choose https://adoptopenjdk.net/releases.html#aarch64_linux or a custom built JDK11. |
I'm still awaiting my hardware, so not a super big rush, but any updates? |
I am sorry, I don't have much update so far. I was stuck in running any tests with openjdk 11 so far. Regarding cross compilation: Cross compilation is not simple possible. We have code initialized on the platform we're compiling on (Eg File subsystem, Network subsystem classes for the OS is initialized and compiled into the native image). However, crosscompiling on the same OS with different CPU architectures may work, allthough, we may get all the specifics for the target architecture. (We use c compiler to find out the size and offsets in c datastructures on this platform) I'll continue on this issue probably tomorrow. |
So I got my
This is on Fedora-29 using the F29 openjdk11. |
@bobmcwhirter if you build from the |
Have you had any luck? I just came back to it. I am going to rebase the branch and push it later. |
I have update the branch on my repository. However I could not get it running on AArch64 since |
iOS binary build capability would be a most excellent goal |
@olpaw -- Yah, I'm used to building from @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 |
@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 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. |
We should move the discussion over to an explicit PR which deals with Substrate on AArch64 (PR #910). I hope this answers the original question. |
Looks like #910 has been merged. We seem to be getting closer! |
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... |
Any More updates on this? |
This is plenty helpful, Thankyou. |
is it already possible to compile a native shared library written in java for Android with GraalVM? |
@vjovanov can any of this examples help me create a native executable for running spring boot backend on termux/android? |
I would start at https://github.com/gluonhq/gluon-samples and also ask further questions there. |
If not, is anyone aware of any specific reasons why GraalVM could not be compiled up for Android?
The text was updated successfully, but these errors were encountered: