musl-cross-make cross compiling and specifying "--with-libc=/custom/path/to/libc.so" is dismissed
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
先從 modules/python 中的建置配方和產生的 config.log 開始,然後追蹤 configure 如何在交叉建置路徑中處理 --with-libc。比較有文件記錄的 OpenWrt Python 修補程式和 CircleCI 失敗情況,以確定 host 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 小時
- 30 天內合併 PR
- 558
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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
-
link-check link-check:sphinx-theme
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難度 2/5 1-3 小時 新手友好度 88/100
OpenHands/extensions#626 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 90/100
CSCfi/sd-search-api#39 ·
-
難度 1/5 1 小時以內 新手友好度 90/100