ARM cross compile - one last problem

J

jmtulloss

Hello all,

I've been trying to get Python to cross compile to linux running on an
ARM. I've been fiddling with the cross compile patches here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1597850&group_id=5470&atid=305470

and I've had some success. Python compiles and now all of the
extensions do too, but when I try to import some of them (time,
socket, etc.), they have trouble finding certain symbols.
Py_Exc_IOError and _Py_NoneStruct are the two I remember seeing. It
would appear that they are exported by libpython, which I believe is
statically linked into the python executable? That's where I start to
get confused. What part of python is breaking? Where should I be
looking for problems?

Thanks a lot!

Justin
 
J

Justin T.

Hello all,

I've been trying to get Python to cross compile to linux running on an
ARM. I've been fiddling with the cross compile patches here:http://sourceforge.net/tracker/index.php?func=detail&aid=1597850&grou...

and I've had some success. Python compiles and now all of the
extensions do too, but when I try to import some of them (time,
socket, etc.), they have trouble finding certain symbols.
Py_Exc_IOError and _Py_NoneStruct are the two I remember seeing. It
would appear that they are exported by libpython, which I believe is
statically linked into the python executable? That's where I start to
get confused. What part of python is breaking? Where should I be
looking for problems?

Thanks a lot!

Justin

Alright, I looked into this a little more, and those symbols
definitely exist in my compiled python executable. How are extensions
linked to the python interpreter?

Justin
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Alright, I looked into this a little more, and those symbols
definitely exist in my compiled python executable. How are extensions
linked to the python interpreter?

Python assumes that extension modules can be linked against the
executable, i.e. that *at run-time* those symbols will get
resolved. This works fine for the Unix ELF binary format, but
may require certain linker flags, such as --export-dynamic.
It doesn't work for Windows PE32, therefore, on Windows,
Python compiles the run-time as a DLL (pythonXY.dll), and
extension modules link to that.

I would expect that Linux on ARM also uses ELF, so dynamic
lookup of symbols from the executable should be possible.
Do "nm -D --defined-only python" to see whether the symbols
are in the *dynamic* symbol table. If not, use the proper
linker flag to make them so.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top