Cross Compile Mips / Linux

N

nickpreiser

Hi Everyone,

I trying to get a build of Python together to run on an Embedded Linux
/ Mips machine.
I run the ./configure --host= XXXmips(my mips proc) --build=XXX x86(my
pc). and the
configure runs perfectly. I then run "make" and it fails .
I have also tried appling some patches, and running autoconf , but I
end up with the
same compile errrors.
Has anyone successfully built for Mips/Linux using a PC for the
build??,
Should I try using a Linux based machine for the build, would that
help??

Any and all suggestions welcome,

Thanks

Nick P
 
?

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

Has anyone successfully built for Mips/Linux using a PC for the
build??,

I doubt anybody has done that out of the box. Cross-compilation
is not supported.
Should I try using a Linux based machine for the build, would that
help??

No. Instead, you should edit pyconfig.h to your needs (manually,
without running configure - or perhaps after running configure),
and you should edit Makefile.pre manually from Makefile.pre.in.

Regards,
Martin
 
A

Alan Franzoni

Il 10 Jan 2006 15:31:34 -0800, (e-mail address removed) ha scritto:
Hi Everyone,

I trying to get a build of Python together to run on an Embedded Linux
/ Mips machine.

You can't do that out of the box. The main reason is that the Python
interpreter is run during the compilation process, and if you compile it
for mips it won't, of course, run on your pc.

I had found a page explaining a way of cross-compiling python, but it's
old, you'll need some kind of manual work to adapt it to 2.4 (unless you're
satisfied with 2.2, of course):

http://www.ailis.de/~k/docs/crosscompiling/python.php

Or you could try surfing debian-mips package to see if you're lucky and
find a compatible package.

Best of all would be to host-compile python natively on the machine. Or you
could first compile a version on your PC, and then rename the executables
and edit the scripts...

If you're trying to compile it for an highly-embedded machine (something
like Linksys WRT series or any of the AR7-based routers around) I must tell
you I've tried something like that before, and I just partly succeeded: I
got what I think was a working python interpreter, but those machines are
so memory-limited (mine had 8MB I think) I couldn't have it work.

--
Alan Franzoni <[email protected]>
-
Togli .xyz dalla mia email per contattarmi.
To contact me, remove .xyz from my email address.
-
GPG Key Fingerprint:
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E
 
F

Frithiof Andreas Jensen

Hi Everyone,
Should I try using a Linux based machine for the build, would that
help??

YES -

The problem is that the Linux build tools generally assume that they are
sitting in the target environment and therefore tries to use facilites
discovered by the tools and discoveries about "endianess" and such; This is
a general problem with the design of the Linux build system - the "I am on
the target" assumptions are likely to be "smeared" over many applications.

WindRiver (an embedded Linux provider) f.ex. makes a living off - amongst
other things - providing an environment enabling Linux+applications to be
reliably cross compiled!

What we prefer to do is to use a "King-Size" version of the target hardware
with a full set of tools and libraries to build on and then pack a file
system with just the built Kernel + Application(s) for the target into an
"initrd image" (
http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/initrd.html ) and
have the real target download & boot that.

This is because we are often doing tricky stuff with "new" CPU's where the
Kernel is barely ready so we like to be sure that the bugs are in the code
and not freebies provided by the cross compiler tools.

... and the latest embedded target happens to be an 8-Way Opteron card with
16 GB RAM that does not take eons to compile ;-)
 
N

Nick Craig-Wood

Has anyone successfully built for Mips/Linux using a PC for the
build??, Should I try using a Linux based machine for the build,
would that help??

One thing you could try is to build a linux/mips file system image
(say debian which support mips) and run it with quemu on your PC.

http://fabrice.bellard.free.fr/qemu/
http://www.debian.org/ports/mips/

MIPS R4K target Emulation
Operating System State Tested QEMU version
GNU/Linux 2.6.14 Debian OK 0.8.0

I've used a similar technique to cross build stuff for ARM. I found
the debian ARM python quite sufficient for my needs so I didn't have
to build that!
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top