[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cross compiling Ruby for MIPS on Debian



On Fri, Oct 17, 2008 at 03:08:00PM -0400, Malhotra Ruchir-TGXH38 wrote:
> I have installed Ruby version 1.8.5 using apt-get.
> 
> Please guide me on how I can cross-compile this distribution for MIPS
> platform on Debian Linux.

Are you going to be running Debian on the MIPS machine?  Cross-compilation
is a lot more than just spitting out different opcodes for a given line of
C; you've also got to match the ABI of your target platform, make sure you
link against the right sorts of libs, and so on.

If you're not running Debian on the MIPS box, you're probably better off
talking to the people who develop the OS you're targetting, as they'll
probably have cross-building environments available to do the building.

If you are running Debian on the MIPS box, then the first thing I'd ask is:
why can't you build Ruby on the machine itself?  If it's got enough RAM/CPU
to run Debian acceptably, it'll almost certainly have enough grunt to
(eventually) produce a Ruby build.  For that, you don't need any
cross-compilation tools, just a bit of knowledge of basic package building
tools, which you'd be best off getting from the debian-mentors list
(http://lists.debian.org/debian-mentors -- read the FAQ before posting!)

Finally, if you're building for Debian MIPS but really can't bring yourself
to build on the box, take a look at the emdebian project
(http://www.emdebian.org/debian/), they've got cross-compilation toolkits
for all the usual suspects in their pool.  Based on what I had to install to
build a kernel for armel last night, the packages you'd want to install from
that repo, at a minimum, are:

libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.3-mips-linux-gnu

On top of that you'll need the dev versions of the other libraries you want
to link against (libssl, for instance, if you want OpenSSL support in your
Ruby build); I'm not sure how to build all those.  In general, you'll get
more and better info on cross-compiling something from the relevant porter
list than you will here.

- Matt


Reply to: