[issue22625] When cross-compiling, don’t try to execute binaries

Martin Panter report at bugs.python.org
Sun Mar 13 22:03:00 EDT 2016


Martin Panter added the comment:

Thanks Robert. Russell also pointed out on python-dev that the patches at Issue 23670 show how he is doing cross compilation, via a new high-level iOS/Makefile file. Here is a cut-down version of the parts that I find relevant:

# Build for the native build host
host/bin/python*:
	make -C .. distclean
	cd .. && ./configure --prefix=host ...
	make -C .. Programs/_freeze_importlib
	# Main makefile is patched to use this copy (3.5+ only):
	cp ../Programs/_freeze_importlib .
	make -C .. install
	tar czf host.tar.gz host && rm -rf host

# Build for a foreign target host
ios-%.tar.gz: host/bin/python*
	make -C .. distclean
	tar xzf host.tar.gz
	cd .. && PATH=host/bin:$(PATH) ./configure \
	    --host=%-apple-ios --build=$(BUILD_OS_ID) CC=% LD=% \
	    --prefix=$* ...
	PATH=host/bin:$(PATH) make -C .. install
	tar czf $*.tar.gz $* && rm -rf $*

Something I just realized is that the output of pgen is actually committed to the Mercurial repository. It seems that Russell’s cross-compilation was relying on this to avoid rerunning pgen. Same with the output of _freeze_importlib, except Russell is working around that differently. It does not seem right to have files in the repository that are also generated by the normal build process.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22625>
_______________________________________


More information about the Python-bugs-list mailing list