Cross Compile Mips / Linux

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nickpreiser@hotmail.com

    #1

    Cross Compile Mips / Linux

    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

  • Martin v. Löwis

    #2
    Re: Cross Compile Mips / Linux

    nickpreiser@hot mail.com wrote:[color=blue]
    > Has anyone successfully built for Mips/Linux using a PC for the
    > build??,[/color]

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

    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

    Comment

    • Alan Franzoni

      #3
      Re: Cross Compile Mips / Linux

      Il 10 Jan 2006 15:31:34 -0800, nickpreiser@hot mail.com ha scritto:
      [color=blue]
      > Hi Everyone,
      >
      > I trying to get a build of Python together to run on an Embedded Linux
      > / Mips machine.[/color]

      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 <alan.franzoni. xyz@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

      Comment

      • Frithiof Andreas Jensen

        #4
        Re: Cross Compile Mips / Linux


        <nickpreiser@ho tmail.com> wrote in message
        news:1136935894 .936264.246810@ g44g2000cwa.goo glegroups.com.. .[color=blue]
        > Hi Everyone,[/color]
        [color=blue]
        > Should I try using a Linux based machine for the build, would that
        > help??[/color]

        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+applicati ons 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 ;-)


        Comment

        • Nick Craig-Wood

          #5
          Re: Cross Compile Mips / Linux

          nickpreiser@hot mail.com <nickpreiser@ho tmail.com> wrote:[color=blue]
          > 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??[/color]

          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.




          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 <nick@craig-wood.com> -- http://www.craig-wood.com/nick

          Comment

          Working...