Native-Image cross-compilation from amd64 to arm64 fails on `gcc -v` check
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 190
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
I want to create native images for both amd64 and arm64, and when I attempt that on my x86 machine (Mac), I start the image ghcr.io/graalvm/native-image:21.3 with --platform=linux/arm64.
Out of the box, this fails during the toolchain-check, as running gcc -v from within the Java process fails.
Adding this resolved the issue for me:
ENV JAVA_TOOL_OPTIONS="-Djdk.lang.Process.launchMechanism=vfork"
Should that be added to the graalvm-ce / native-image Docker images?
Btw, adding gcc variants with different target architectures and the related libs to the Docker image would be awesome - then I could run native-image in my home-architecture while creating native images in the target architecture without having to run the whole thing through qemu (which increases the build time by a factor of 20 for me).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the gcc -v toolchain check in ghcr.io/graalvm/native-image:21.3 with --platform=linux/arm64, then compare behavior with JAVA_TOOL_OPTIONS set to the reported launch mechanism. Review the Docker image definitions for graalvm-ce and native-image; done means the intended cross-compilation workflow completes reliably, with the scope of additional gcc target variants decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- build-system, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100