Subject: Re: NetBSD 2.0 for non FPU macs
To: None <port-mac68k@netbsd.org>
From: J. MacPhail <jrm@kw.igs.net>
List: port-mac68k
Date: 04/02/2004 18:47:42
On Fri, Apr 02, 2004 at 11:01:51AM +0000, Bruce O'Neel wrote:
> Hi,
> 
> It turns out that libc is the root of many of the crashes.  Printf
> and its relations.
>
> Even with a rebuilt shared libc.so dozens of program (which don't
> use libm) still crash, at least when I did this on 1.5.3.  Anything
> statically linked was a problem, of course.  It's suprising how
> often I type ls -l :-)
>
> You can't really compile anything since gcc randomly crashes, a
> normal boot leaves a half dozen or so core files in /, etc.  It was
> kind of ugly and usable only if you were dedicated since the
> solution to a random crash was try running the command again, and
> again, and again, until it worked.  Or, rebuild it from scratch.
>  
> Oh, and X starts up only once in a while.

So we can expect floating point operations to show up in libm.so,
libc.so, at least one other library (libcrypt.so?), and other programs
that would call these but are statically linked.
 

> My patches consist of two parts.
>
> - Small makefile changes to not have the assembler fpu versions of
> some code.
>
> - The addition of a full gcc fpe library.  NetBSD mac68k as shipped
> won't build (last I checked) anything with -msoft-float since gcc
> then wants a bunch of routines in libc that aren't there.  I just
> took the gcc fpe code from the ARM port (I believe) and used that
> for the extra routines.

I don't understand this.  The info for gcc-3.3.3, M680x0 Options, says

`-msoft-float'
     Generate output containing library calls for floating point.
     *Warning:* the requisite libraries are not available for all m68k
     targets.  Normally the facilities of the machine's usual C
     compiler are used, but this can't be done directly in
     cross-compilation.  You must make your own arrangements to provide
     suitable library functions for cross-compilation.  The embedded
     targets `m68k-*-aout' and `m68k-*-coff' do provide software
     floating point support.

And that still leaves me uncertain whether or not native compilation
with -msoft-float is supposed to just work.


> My patches are *supposed* to be turned on by having MKSOFTFLOAT set
> to "yes" before building.  That said, I've never run the build with
> it unset to make sure that it is unpreturbed.  It should be, but,
> mistakes/typos happen.

And surprises.  Even if all your stuff is perfect, maybe the
-msoftfloat option to gcc has some unexpected side-effect.  (That
could potentially make it hard to list all binaries containing
floating point operations....)


> I'll try to do the diff next time I build it.

Great!

-- 
John