Skip to content

Missing static JDK libraries compiled against musl #4645

@spockz

Description

@spockz

Describe the issue
I am trying to make a static image which, as per instructions, needs musl as the libc implementation. When doing this native-image fails, unable to find the static jdk libraries it needs in $JAVA_HOME/lib/static/linux-aarch64/musl. This directory is missing, only a glibc directory exists.

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. **native-image -cp --verbose -H:+PrintClassInitialization --trace-class-initialization=io.netty.buffer,io.netty.handler.ssl --trace-class-initialization=io.netty.buffer.ByteBufUtil --trace-class-initialization=io.netty.handler.ssl.ReferenceCountedOpenSslContext --trace-object-instantiation=io.netty.handler.ssl.ReferenceCountedOpenSslContext -H:Optimize=3 --initialize-at-build-time=org.slf4j --initialize-at-build-time=ch.qos.logback --enable-https --enable-http --static --libc=musl --target=linux-aarch64 --native-compiler-path=/home/alessandro/Downloads/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc -H:Name=sidecar

Describe GraalVM and your environment:

  • GraalVM version: 22.1.0
  • JDK major version: 11,17
  • OS: Fedora 35
  • Architecture: AMD64 (cross-compiling for aarch64)
  • musl : 8695ff86979cdf30fbbcd33061711f5b1ebc3c48a87822b9ca56cde6d3a22abd4dab30fdcd1789ac27c6febbaeb9e5bde59d79d66552fae53d54cc1377a19272 aarch64-linux-musl-cross.tgz
  • zlib: 1.2.12
[1/7] Initializing...                                                                                    (0.0s @ 0.70GB)
Error: Building images for org.graalvm.nativeimage.Platform$LINUX_AARCH64 (target libc: musl) requires static JDK libraries.
Use most recent JDK from https://github.com/graalvm/labs-openjdk-*/releases
Missing libraries: java, nio, net, zip
(search path: /home/alessandro/.sdkman/candidates/java/22.1.0.r11-grl/lib/static/linux-aarch64/musl)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions