[issue5404] Cross-compiling Python
Joshua Kinard
report at bugs.python.org
Tue Mar 3 09:28:01 CET 2009
Joshua Kinard <kumba at gentoo.org> added the comment:
Making progress!
Adapted the cross-2.5.1.patch from Issue #1597850, integrated the %zd
printf fixup patch, and added another cross-compiler check for the
libffi configure bits in setup.py (it'd pass libffi's configure no
--host options, so libffi would compile for the build system, and that's
not good).
Now I'm just trying to figure out why for each extension module, why
CFLAGS gets passed, as far as I can tell, to both the CC and the LD
tools? I see in the code that distutils doesn't allow one to separate
CC and CXX. Is the same for CC and LD? binutils' ld doesn't understand
the same range of flags that gcc does, so for a mips cross-compile case,
you may have the -mabi flag passed. Gcc understands this, but -m on ld
is to select the output binary, of which 'abi' isn't (obviously) a valid
output type.
Is this to me a distutils limitation I'm hitting? I've already dug
through the generated Makefile at Python's root and can't pin down
precisely where it invokes ld for each extension, so I'm assuming
setup.py handles this. However, I don't read python 100%, and some of
the tricks you can do with classes and def's seems weird to me.
PyBuildExt seems like some of its internal functions call themselves in
a recursive fashion -- right? I'm also not sure which function is the
actual function call that executes the compiler or the linker.
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5404>
_______________________________________
More information about the Python-bugs-list
mailing list