Subject: Re: cross compile with Linux host fails with nbmake Illegal instruction
To: Jeremy C. Reed <reed@reedmedia.net>
From: James Chacon <jmc@NetBSD.org>
List: tech-toolchain
Date: 02/06/2005 01:59:25
On Sat, Feb 05, 2005 at 11:29:52PM -0800, Jeremy C. Reed wrote:
> On Sun, 6 Feb 2005, James Chacon wrote:
> 
> > On Sat, Feb 05, 2005 at 10:10:25PM -0800, Jeremy C. Reed wrote:
> > > I am trying cross compiling of -current on a Linux host. I have
> > > linux-kernel-headers-2.6.10, gcc3-c-3.3.4, gcc3-c++-3.3.4, bmake-20040220
> > > (no gmake installed), binutils-2.14.0.0, and mk-files-20040214 installed.
> >
> > What kind of linux host? I have no issues with standard redhat builds
> > and I understand debian also works well.
> 
> I have been running my own Linux distributions built from scratch -- all
> components built via pkgsrc infrastructure for a couple years now. You may
> call it "PkgLinux" :)
> 
> > You'll need to fully cross build, but you shouldn't need to set anything
> > provided a compiler is in your path.
> 
> What do I need to do to "fully cross build"? Just add a "-m i386"?

Provided a POSIX sh is /bin/sh and gcc/cc is in your path this is a typical
build.sh on linux for me:

sh build.sh -D /home/jmc/src/netbsd/obj_${m}/build -X /home/jmc/src/netbsd/xsrc -O /home/jmc/src/netbsd/obj_${m}/obj -T /home/jmc/src/netbsd/obj_${m}/tools -R home/jmc/src/netbsd/obj_${m}/release -m $m -U -N0 -x -u -j6 release

(i.e. replace $m with the specific machine you want to build)

You shouldn't need a specific bmake already installed or anything. /bin/sh
should be enough to get make going and then the bootstrapped make can get
the rest going.

If I remember it's dying on make's configure script about creating executables.
That's a pretty standard configure test. Change your build.sh to not nuke
the tmpdir and look in the config.log there to see why it's bailing (or send
me a copy of that config.log)

James