Subject: Re: Cross compiling under MkLinux
To: None <mrz5149@cs.rit.edu>
From: Scott Ellis <scotte@warped.com>
List: port-mac68k
Date: 03/30/1997 12:30:26
In "Cross compiling under MkLinux", mrz5149@cs.rit.edu (Michael R. Zucca)
wrote: 
> While setting up a cross-compiler with 2.7.2.2 I've been having trouble
> compiling the kernel. I don't know if this is a 2.7.2.2 problem but I couldn't
> get gas to assemble the output of asm2gas .s files. I'm not sure if this is
> a problem with asm2gas or what but it seems to choke on labels like:
> 
> 1:
> (I found this in m68k/fpsp/netbsd.s)
> 
> and it also seems to have a problem with the floating point notation:
> 
> #:xxxxxx
> 
> I can't understand this since we're obviously using gnu binutils and gcc
> under NetBSD but the silly thing won't go under my 2.7.2.2 compile!

NetBSD's GCC is 2.7.2 with a number of 'modifications'..such as teaching
gcc about the 68060, and making it learn a few weird syntax items.

> 
> Does anybody know if there have been signifigant changes to gas since the
> 2.7.2 release? (Well, I suppose binutuils and gcc use different versions but
> you get the idea)

gas is in binutils, which is currently at 2.7.  The NetBSD gas and ld are
MUCH older, and pretty funky.

I'm attaching some diff's to NetBSD's gas and ld that make them work in
a cross-compile environment.  I didn't do them (Ian Dall did), but they
work well.

Also make note that the binutil's "strip" command does NOT work on
NetBSD/m68k
binaries.  It pretends to, but the resultant bin is just plain wrong.  I've
got a 'strip-m68k' that works if you need it.

> 
> The makefile also has difficulty compiling genassym. First of all, it tries to
> link it with the cross-linker using $(CC) instead of $(HOSTED-CC). Second
> of all it tries to do as using the cross tools because even though HOST-CC
> is absolute pathed out to the local compiler the main PATH points to the cross
> tools. I had to compile the silly thing by hand. Can't we make this a shell
> script?

Some ports have this as a script (i.e., Sun3), and it works VERY well.  I
wish
all ports would move to this.

Otherwise, the workaround is to do the config and depend with the native
tools, and then use the cross-compiler for the actual build.

NetBSD needs to be taught about being on a host which is different from
the target.  I've made most of the m68k ports build on NetBSD/i386, with
just a few minor changes to the tree, and some weird scripting..but it's
not
ideal.  Specifically, 'games' and 'groff' have problems which I'm not
eager to try and fix. ;-)  For now I just don't build them.

Anyhow, please let me know if you run into any more problems....just
setting
up a cross-compile environment for a kernel only wasn't hard at all..it's
userland that sucks. ;-)

    Scott

-- 
   //////////////////////////////////////////////////////////////////////
  //    Scott Ellis     //   scotte@warped.com   //   sellis@gi.com   //
 //////////////////////////////////////////////////////////////////////
// WARNING: This signature warps  time and space in its vicinity    //