Native-Image cross-compilation from amd64 to arm64 fails on `gcc -v` check

オープン
#33 コメント 2 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
docker

調査の方向性

まず、--platform=linux/arm64 を指定して ghcr.io/graalvm/native-image:21.3 内の gcc -v ツールチェーンチェックを再現し、次に、報告された起動メカニズムを JAVA_TOOL_OPTIONS に設定した場合の挙動と比較します。graalvm-ce と native-image の Docker イメージ定義を確認します。想定されるクロスコンパイルワークフローが安定して完了し、追加の gcc ターゲットバリアントの範囲が決定されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
言語のデータがありません
スター
190
フォーク
39
平均マージ
1時間 21分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graalvm/container のほかの issue

graalvm/container の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。