Subject: Re: kernels built with "-march=..." hang?
To: David Brownlee <abs@NetBSD.org>
From: John D. Baker <jdbaker@mylinuxisp.com>
List: port-i386
Date: 11/07/2005 14:08:53
On Mon, 7 Nov 2005, David Brownlee wrote:

> On Mon, 7 Nov 2005, Martin Husemann wrote:
>
> > On Mon, Nov 07, 2005 at 10:30:46AM -0600, John D. Baker wrote:
> >> When I build a kernel with any CPU-specific optimization flags
> >> (-march=pentium-mmx, -march=pentium or even just -mcpu=pentium-mmx,
> >> -mcpu=pentium which should produce i386-compatible code), the resulting
> >> kernel hangs immediately upon loading.
> >
> > Yeah, the pentium targets do not work, pentium2 does work (on other machines).
> > I think there is a PR about it, it is likely a gcc bug.
>
>  	It may be somewhat non-deterministic based on your situation
>  	(& luck :) - I've been running -march=pentium-mmx kernels for a
>  	pentium 233 MMX laptop under NetBSD 2 & NetBSD 3 without any
>  	problems. Prior to that I've used -march=k6-2 and -march=pentium,
>  	but as the lowest spec i386 machine I have in production use is a
>  	PII most everything is '-march=pentium2 -mcpu=athlon-xp'
>
>  	I would be wary of gcc prior to 3.3.3 - the original poster
>  	doesn't mention what NetBSD or gcc version he was using...

Sorry, I should have specified.  I'm building -current as of last
Thursday or so (3.99.11).  Built fresh tools first and then got caught
in CPU-optimization-flag hell before falling back to defaults.

My only other semi-active i386 machine has a PII-266 and is running
3.99.10 built with "-march=pentium2" and works just fine.  Naturally,
I was dismayed, puzzled, and confused when otherwise appropriate CPU
flags produced a non-working kernel.  Would they likely cause a problem
for userland/packages too?

-- 
John D. Baker, KN5UKS                    NetBSD     Darwin/MacOS X
jdbaker(at)mylinuxisp(dot)com                 OpenBSD            FreeBSD
BSD -- It just sits there and _works_!