FAQ
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Þtail&aid97850&group_idT70&atid05470

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

Search Discussions

  • Justin T. at Jun 19, 2007 at 11:33 pm

    On Jun 19, 10:49 am, jmtull... at gmail.com wrote:
    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Þtail&aid97850&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
  • Martin v. Löwis at Jun 20, 2007 at 5:20 am

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 19, '07 at 5:49p
activeJun 20, '07 at 5:20a
posts3
users2
websitepython.org

2 users in discussion

Justin T.: 2 posts Martin v. Löwis: 1 post

People

Translate

site design / logo © 2022 Grokbase