Subject: Re: NetBSD 2.0 for non FPU macs
To: None <port-mac68k@NetBSD.org>
From: Bruce O'Neel <edoneel@sdf.lonestar.org>
List: port-mac68k
Date: 04/02/2004 11:01:51
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.

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.

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.

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

cheers

bruce


On Fri, Apr 02, 2004 at 02:06:03AM -0500, J. MacPhail wrote:
> On Thu, Apr 01, 2004 at 02:35:10PM +0000, Bruce O'Neel wrote:
> > Hi,
> > 
> > Thanks.  The problem with my fixes is that one builds two sets of
> > binaries.
> >
> > In one case you build the normal binaries with inline f
> > instructions.  In the other case you build them using -msoft-float
> > to gcc and you have no f instructions.
> >
> > This allows netbsd to work well on lc040 macs, but, of course, is
> > slower on macs with fpus.
> > 
> > I'd be happy if the changes were picked up and put in, but, I suspect,
> > there needs to be some more discussion especially since my changes
> > aren't really mac68k specific, but rather m68k specific, and the
> > current users who have real FPUs don't want to give up any 
> > performance given that 68k systems aren't that fast to begin with :-)
> 
> 
> Hypothesis: the actual floating point instructions only appear in a
> very few files (such as the main math library, "libm" or whatever it
> is called).
> 
> If this is true (or can easily be made true), then the distribution
> can come with a small list of files needing replacement on machines
> with no FPU.  In the other direction, there could be a list of files
> making a lot of calls to libm: users with FPUs might consider
> recompiling to inline those calls, and users without FPUs might
> consider avoiding those programs.
> 
> 
> Requested experiment: compile the whole distribution on the same
> system, with and without -msoftfloat.  Run diff on the whole thing, to
> see which files vary.  Would you be willing to do this?
> 
> -- 
> John
> 

-- 
edoneel@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org