Cross-compiling dev-lang/python:3.5 fails with "Parser/pgen: Parser/pgen: cannot execute binary file" (CBUILD="x86_64-pc-linux-gnu" and CHOST="armv7a-hardfloat-linux-gnueabi"). Reproducible: Always Steps to Reproduce: 1. "armv7a-hardfloat-linux-gnueabi-emerge -1 =python-3.5.1-r2" or "armv7a-hardfloat-linux-gnueabi-emerge -1 =python-3.5.1-r2" or "armv7a-hardfloat-linux-gnueabi-emerge -1 =python-3.5.0-r2" Actual Results: Parser/pgen: Parser/pgen: cannot execute binary file Expected Results: Successful merge. dev-lang/python:3.5 requires "pgen" and "_freeze_importlib" to be compiled and executed at build time. Otherwise, it fails with "Parser/pgen: Parser/pgen: cannot execute binary file".
Created attachment 432194 [details] armv7a-hardfloat-linux-gnueabi-emerge --info
Created attachment 432196 [details] dev-lang/python-3.5.1-r2 build log
Created attachment 432198 [details, diff] python-3.5-crosscompile.patch This is a patch to successful cross-compile python-3.5.1-r2 and python-3.5.0-r2. It uses the native compiler to build the "pgen" and "_freeze_importlib" make targets.
Thanks for the patch. Has it been submitted for inclusion upstream?
(In reply to Mike Gilbert from comment #4) > Thanks for the patch. Has it been submitted for inclusion upstream? No. If someone wants to submit it though, go ahead.
(In reply to Peter Levine from comment #5) I'm not a big fan of playing middle-man on patch management. I also prefer not to take on maintenance of distro-specific patches. Please submit this upstream, and we can backport it if is accepted.
(In reply to Mike Gilbert from comment #6) > (In reply to Peter Levine from comment #5) > > I'm not a big fan of playing middle-man on patch management. I also prefer > not to take on maintenance of distro-specific patches. > > Please submit this upstream, and we can backport it if is accepted. OK. http://bugs.python.org/issue26886
Apparently neither "pgen" nor "_freeze_importlib" needs to be run during cross-compilation. The issue was reported and resolved: http://bugs.python.org/issue22359 The patch was applied upstream 6 days ago: https://hg.python.org/cpython/raw-rev/66e40df31fac It applies cleanly and works with python-3.5.0-r2 and python-3.5.1-r2. There exist a 2.7 version of the patch: https://hg.python.org/cpython/rev/0f7a299c6d50 It does not apply cleanly, but I have no problem cross-compiling python-2.7.11-r2 anyway.
Nice! I'll try to get this applied this weekend.
commit 3f74e0196b4719fb8f10118c80de15fa823797a6 Author: Mike Gilbert <floppym@gentoo.org> Date: Wed May 11 20:58:45 2016 -0400 dev-lang/python: fix cross-compiles for 3.5.1 Bug: https://bugs.gentoo.org/581304 Package-Manager: portage-2.2.28_p106 dev-lang/python/files/3.5.1-cross-compile.patch | 75 +++++++++++++++++++++++++ dev-lang/python/python-3.5.1-r2.ebuild | 7 +-- 2 files changed, 76 insertions(+), 6 deletions(-)