musl-cross-make cross compiling and specifying "--with-libc=/custom/path/to/libc.so" is dismissed
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
modules/python のビルドレシピと生成された config.log から始め、クロスビルドパスで configure が --with-libc をどのように処理するかを追跡します。文書化されている OpenWrt Python パッチと CircleCI の失敗を比較し、ホストの libc がどこで選択されているかを特定します。指定されたクロスビルド済みの libc が /usr/lib/x86_64-linux-gnu/libc.so の代わりに使用されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug report
Trying to integrate CPython 3.9.2 under Heads firmware (coreboot+linux payload). This is followup of old integration issue at https://github.com/osresearch/heads/issues/689
CPython 3.9.2 (as all other modules under Heads but coreboot) is built by first building musl-cross-make and then having modules being build with musl-cross-make to have reproducible build environment, so that coreboot payload' linux kernel's initrd contains binaries needed in linux embedded environment (recovery shell and associated tools), are reproducible (this is the goal).
Your environment
- CPython versions tested on: 3.9.2 installed to build target 3.9.2 python
- Operating system and architecture: debian-11 host build environement
I'm experimenting with the following build recipe, and did a lot of variation without success https://github.com/osresearch/heads/blob/df50c5f7d242b502fc443157fd592b638da87af0/modules/python#L13-L33.
This results in configure script producing the following config.log output:
config.log
So above build recipe produces:
- a correct ./configure callm specifying
./configure --enable-optimizations --with-cxx-main=/home/user/heads/crossgcc/x86/bin/x86_64-linux-musl-gcc --with-libc=/home/user/heads/crossgcc/x86/x86_64-linux-musl/lib/libc.so --host x86_64-linux-musl --build x86_64 --disable-ipv6 --prefix= --exec-prefix= --with-libc="$(musl-cross_libraries)"translates into config.log, correctly, intoconfigure:14435: result: set LIBC="/home/user/heads/crossgcc/x86/x86_64-linux-musl/lib/libc.so". This is the libc.so we need to rely on- Unfortunately, the build fails (See in CircleCI logs here) with libc being completely dismissed. This results into error :
ImportError: /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header. This is the wrong libc.so of the host, not of the cross built environment.
Expected behavior:
- Specifying
--with-libc=/home/user/heads/crossgcc/x86/x86_64-linux-musl/lib/libc.soshould result in libc.so used from/home/user/heads/crossgcc/x86/x86_64-linux-musl/lib/libc.sonot/usr/lib/x86_64-linux-gnu/libc.so.
Why is the host libc used even when libc is specified and found at configure?
Was gonna investigate and adapt OpenWrt patches at https://github.com/openwrt/packages/tree/master/lang/python/python3/patches but reading about cross build issues it would be better to have this fixed upstream then downstream into all projects trying to cross build for their embedded systems.
Any insight?
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
🐛 Bug 🔔 Pending processing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
jumpserver/jumpserver#17584 ·