On Tuesday 22 January 2008, Mike Auty wrote: > I've got some existing code for tying python to some system libraries, > and I was hoping to port it onto an embedded device, specifically an > ipod. I've managed to source myself three old ipods (one 3rd Gen > and two 4th gen). I've got ipodlinux happily running on one of them, > installed python, rebuilt the kernel using ipodlinux's pre-packaged > toolchain (which they seem to call arm-uclinux-elf/arm-elf). > > I went to build the system libraries I needed and noticed the toolchain > didn't seem able to support shared objects, and hence the python > C-extension modules probably wouldn't compile either. Attempting to > compile python natively also failed, so building the extension right in > to python looks difficult.
i'm pretty sure the ipod lacks an mmu which means you can only use FLAT
binaries. which means no shared libraries. the arm-elf toolchain is to
build up code that will run without an operating system (like the kernel or a
bootloader or a standalone app) while the arm-uclinux toolchain is used to
build FLAT binaries which will run under Linux (with the mmu disabled).
what this means is that you only get static libraries and when producing the
final executable, you have to link with -elf2flt which will produce a FLAT
binary from the statically linked ELF.
you can test this theory by making a simple hello world app:
$ cat <<EOF > hello.c
#include <stdio.h>
int main(){printf("hello\n");}
EOF
$ arm-uclinux-elf-gcc hello.c -elf2flt -o hello
now get the "hello" binary onto the target and run it ... if it runs, it means
what i said above is true.
ive run python on a Blackfin as FLAT, but no dynamic extensions obviously.
> So, I started investigating building the toolchain on Gentoo using
> crossdev. So far I've successfully built arm-elf, but ipodlinux seems
> to mention uclinux a lot and I haven't been able to build an
> arm-unknown-uclinux target successfully. Also, there seemed to be a few
> posts about the gentoo arm-elf toolchain not supporting elf2flt (which
> seemed necessary to reuse any existing ipodlinux applications). I'm
> also not certain if the arm-elf toolchain built on gentoo will let me
> build shared objects or not.
by default, elf2flt is not enabled in any toolchain. it's trivial to add:
- roll a snapshot of the upstream elf2flt cvs
- set ELF2FLT_VER in the binutils ebuild
but i dont have any toolchains integrated into Gentoo where i care about FLAT
binaries, so i havent done any work beyond the infrastructure
-mike
signature.asc
Description: This is a digitally signed message part.
