Subject: Re: cross-compile question
To: None <port-amiga@netbsd.org>
From: Aymeric Vincent <Aymeric.Vincent@crans.ens-cachan.fr>
List: port-amiga
Date: 01/06/2000 20:21:53
Ignatios Souvatzis <is@jocelyn.rhein.de> writes:

> On Thu, Jan 06, 2000 at 03:45:37PM +0100, John Vrolijk wrote:
> > What do I need to do that if it is at all possible ?
> 
> Currently, not. We still use an ancient gas on /m68k, which can't be turned
> (by easy manipulation) into a cross-assembler.

Actually, it's possible to use a newer version of gas as long as you
don't compile PIC code. I.e. it works for the kernel.

For the binutils (incl. gas), get version 2.9.1 for example and:

mkdir build && cd build && ../configure --target=m68k-netbsd && make \
   && sudo make install

Then you need to compile egcs (this is trickier, you have to use
the version in the NetBSD's source tree); you'll have to go to the
/usr/src/gnu/dist/gcc dir, and do

mkdir build && cd build && ../configure --target=m68k-netbsd
vi Makefile
change BFD stuff to where it actually is
make
vi Makefile
until it works... :( (sorry, but I don't remember all the steps, I
eventually got a compiler that worked).

And finally, you have to tell NetBSD to use these cross utils:

here is a stupid script I did (/sys/arch/amiga/compile/compile_it)

--8< -----

#! /bin/sh

cd A1200
MACHINE=amiga MACHINE_ARCH=m68k AR=m68k-netbsd-ar AS=m68k-netbsd-as CC=m68k-netbsd-gcc LD=m68k-netbsd-ld NM=m68k-netbsd-nm RANLIB=m68k-netbsd-ranlib SIZE=m68k-netbsd-size STRIP=m68k-netbsd-strip make $*


--8< -----

and then, instead of:

config A1200
cd ../compile/A1200
make depend
make

you can do

config A1200
cd ../compile
./compile_it depend
./compile_it


Or you can export all the variables once and for all, at your option...

HTH,
 Aymeric