By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

Cross Compile Mips / Linux

P: n/a
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

Jan 10 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ni*********@hotmail.com wrote:
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
Jan 10 '06 #2

P: n/a
Il 10 Jan 2006 15:31:34 -0800, ni*********@hotmail.com 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 <al***************@gmail.com>
-
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
Jan 11 '06 #3

P: n/a

<ni*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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-Filesy...ml/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 ;-)
Jan 11 '06 #4

P: n/a
ni*********@hotmail.com <ni*********@hotmail.com> wrote:
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!

--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Jan 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.