Subject: Re: sparc kernel (2.0_RCn) doesn't like -mcpu=v8?
To: None <port-sparc@netbsd.org>
From: Joachim Thiemann <jthiem@tsp.ece.mcgill.ca>
List: port-sparc
Date: 11/22/2004 22:34:30
On Monday 22 November 2004 09:34, Joachim Thiemann wrote:
> CPUFLAGS+=-mcpu=v8 -mtune=v8
> COPTS+=-pipe

Ok, I'v tried various combinations of this, using CPUFLAGS or CFLAGS with 
-mcpu=v8, -mv8, and always COPTS+=-pipe, based on Lubomir, Tobias and 
Martins suggestions.

All kernels hung at the same place.  I also noted that every time, the 
kernel was being build without -O2 present on the command line. (And yes, I 
_always_ use "+=") Commenting the COPTS line brings -O2 back...

I've compiled a new kernel under the hypothesis that some part of the kernel 
_needs_ the -O2.  Thus, all there is in my mk.conf file was

CPUFLAGS+=-mv8 -mtune=supersparc -pipe

getting a typical compile command line of
cc -mno-fpu -mv8 -mtune=supersparc -pipe -ffreestanding -mv8 
-mtune=supersparc -pipe -O2 -Werror -Wall -Wno-main -Wno-format-zero-length 
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare 
-fno-zero-initialized-in-bss -I. -I../../../../arch -I../../../.. -nostdinc 
etc...

This kernel boots.  Thus, there is some part of code that needs -O2.  I 
personally suspect the power code, since I have at some other point 
compiled a kernel without the floppy driver (which is probed right after 
power) that also crashed, but I'd need some more testing for that...

Joe.