Subject: fix? for kernel loading problems on sparc
To: None <,>
From: Simon J. Gerraty <>
List: tech-kern
Date: 09/25/2002 15:24:32
Many sparc users put something like:

COPTS+= -msupersparc

in /etc/mk.conf and provides 
DBG?= -O2 
or whatever.

However sys/conf/ does:

DBG=		# might contain unwanted -Ofoo

the effect of this with the COPTS in mk.conf is that we lose the -O2
which bloats the kernel to the point where loading clobbers the boot
loader (recent thread on port-sparc):

with -O2
2508460 93324   268176  2869960 2bcac8  /netbsd
with -msupersparc
4477616 93324   268176  4839116 49d6cc  /
with -O2 -msupersparc
2521732 93324   268176  2883232 2bfea0  netbsd

The boot loader is at 388000.

Since most of the tree will pickup -O* from
${DBG} it isn't ideal to add -O2 to COPTS in mk.conf.  With the
following in mk.conf

COPTS+= -msupersparc
# for kernel builds
DEFCOPTS= -O2 -msupersparc

and the patch below, things work better.  This is perhaps not ideal
though. Why doesn't the kernel just use DBG?


Index: sys/conf/
RCS file: /cvsroot/syssrc/sys/conf/,v
retrieving revision
diff -u -p -r1.13.4.6
--- sys/conf/	2002/08/17 16:02:38
+++ sys/conf/	2002/09/25 21:08:13
@@ -47,7 +47,7 @@ S!=	cd ../../../..; pwd
 INCLUDES?=	-I. ${EXTRA_INCLUDES} -I$S/arch -I$S -nostdinc
 DBG=		# might contain unwanted -Ofoo
 .if (${DEFWARNINGS} == "yes")