New submission from Ed Schouten:

For CloudABI 
(https://mail.python.org/pipermail/python-dev/2016-July/145708.html) we're 
providing packages containing a precompiled copy of Python. As we had to make 
some changes to importlib (namely to deal with directory file descriptors), we 
have to do a rebuild of importlib.h during the cross compilation process, using 
Programs/_freeze_importlib.

We've run into a couple of issues that require us to patch up the build system 
to make this work:

- First of all, Programs/_freeze_importlib is built using the compiler for the 
target. There is no way to override this. The OpenWRT folks have also run into 
this issue and have patched up the Makefile to add a $FREEZE_IMPORTLIB that 
allows you to use a different executable:

https://github.com/openwrt/packages/blob/master/lang/python3/patches/013-make-freeze-import-lib-into-an-override-able-var.patch

This patch is almost correct; it doesn't prevent _freeze_importlib from being 
built, which is needed in our case as it doesn't build cleanly on CloudABI.

- Second, if an out-of-tree build is performed, we need to make sure that 
Python/frozen.c imports the right copy of importlib.h. We must add -IPython to 
the compiler flags to realise.

Attached is a patch that contains the modifications that we've made to 
Makefile.pre.in to make cross compilation work for us.

----------
components: Interpreter Core
files: patch-freeze-importlib
messages: 275674
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] Fix the ability to cross compile Python when doing a rebuild of 
importlib.h
versions: Python 3.7
Added file: http://bugs.python.org/file44536/patch-freeze-importlib

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28066>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to