Subject: Re: Cross compiling
To: tech-ports@NetBSD.ORG, Warner Losh <imp@village.org>
From: Andrew Cagney <cagney@highland.com.au>
List: tech-ports
Date: 04/11/1996 17:04:51
Hello,
Excerpts from mail: 6-Apr-96 Cross compiling Warner Losh@village.org (641)
> What support, if any, is present to build a system on a i386 machine
> for a MIPS machine? More generally, cross compilation doesn't appear
> to be supported at all in the .mk files that I've taken a look at.
> Have I missed it somewhere?
It is supported, just not obvious (I and a couple of others cross
compile for a different host all the time).
> I want to be able to do the moral equivalent of
> ./configure --target mips-dec-netbsd
> and then type make and have it work. The kernel has a couple of
> programs that it builds and executes to generate some files, for
> example, that make this excersize harder than it would appear at first
> blush.
Moral? You'll be telling me that I have the right to bare arms and a
hairy chest next :-)
An approach that has been shown to work is to create a replacement make
script (see ftp://ftp.ci.com.au/pub/clayton/clayton.make.sh for an
example) that forces the .mk files to use the cross compilation version
of each command.
> If this is well documented somewhere I've overlooked, a simple pointer
> would suffice.
No. There was talk of a `howto' but I don't know far that got. There
are notes, however, for a different target that I've made and put into:
ftp://ftp.ci.com.au/pub/psim/RUN
that explain the process of cross compiling all of libc. The method
also worked for a kernel although I've not tried it for a while.
Perhaps those notes could make a good starting point for cross compiling
for the MIPS.
Good luck, you have my moral support.
enjoy, Andrew
PS: The task isn't hard just tedious.