Closed MikeTheSnowman closed 1 week ago
Linux aarch64 static builds break going from GraalVM 21 to 23
I've also noticed that native image builds with GraalVM 21 on x86_64 are about 10MB smaller than native image builds with GraamVM 23. Any ideas why.
Hey @linghengqian. Thanks for your reply.
always need to install musl from source, or simply build the graalvm native image in a docker image
, are you implying that it may be possible to produce static native images for aarch64 Linux if I do this?One last question is, do you know if it's on the roadmap to add support for static images for aarch64 Linux?
It sounds like you never actually generated a fully statically linked graalvm native image on graalvm ce for jdk 21 before. The --libc=musl
argument is always required, feel free to consult the graalvm documentation.
I don't encourage running x86_64 docker images on aarch64, doing so will incur performance penalties.
Is this on the graalvm roadmap? I'm not a graalvm committer, but it's not on the roadmap at the moment.
Hey @linghengqian . Thanks again for the speedy reply.
It sounds like you never actually generated a fully statically linked graalvm native image on graalvm ce for jdk 21 before. The --libc=musl argument is always required, feel free to consult the graalvm documentation.
--libc=musl
option, and GraalVM still productd a fully static native image. I was able to confirm this by sucessfully running my (aarch64) native image from the docker scratch image. 😅I don't encourage running x86_64 docker images on aarch64, doing so will incur performance penalties.
Sorry, but I think I worded my question poorly. My question was: If I compile/install musl from source, as you suggested, on aarch64 Linux, will this allow me to generate a native image with GraalVM 23?
This is not possible at the moment. The code that interacts with musl is in the current git, and that code is hard-coded with x86_64 specific stuff.
Understood. Thanks for the clarification.
This is expected behavior, using --static
requires using --libc=musl
, and both are only supported in x86_64
(amd64) architecture
Hey @oubidar-Abderrahim , but do you have any ideas as to why in GraalVM 21, using only --static
was able to produce a static native binary on aarch64 Linux?
I'm just trying to understand what changed between GraalVM 21 and 23.
Describe the issue Below is the command that I use with GraalVM 21, on aarch64 Linux, to product static native binaries:
This command that works with GraalVM 21, will not work on GraalVM 23. When trying to use this command with GraalVM 23, I'm presented with the following error:
Error: Invalid option '--static'. Building static executable images is only supported with musl libc. Remove the '--static' option or add the '--libc=musl' option.
I've tried adding the '--libc=musl' option, but Graal still produces the exact same error, even after providing the '--libc=musl' option.
Any idea as to why this was working in GraalVM 21 but not 23?
Steps to reproduce the issue Please include both build steps as well as run steps
--static --libc=glibc
Describe GraalVM and your environment:
More details I've also noticed that native image builds with GraalVM 21 on x86_64 are about 10MB smaller than native image builds with GraamVM 23. Any ideas why.