Subject: port-m68k/9403: Build of debugging kernel fails at "strip -d".
To: None <gnats-bugs@gnats.netbsd.org>
From: Frederick Bruckman <fb@enteract.com>
List: netbsd-bugs
Date: 02/12/2000 12:42:44
>Number:         9403
>Category:       port-m68k
>Synopsis:       Build of debugging kernel fails at "strip -d".
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-m68k-maintainer (NetBSD/m68k Portmasters)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 12 12:42:00 2000
>Last-Modified:
>Originator:     Frederick Bruckman
>Organization:
	
>Release:        NetBSD-1.4.2_ALPHA-2000-02-11
>Environment:
	
System: NetBSD corwin.home 1.4.2_ALPHA
NetBSD 1.4.2_ALPHA (CORWIN) #11:
Mon Feb 7 12:16:59 CST 2000
fredb@corwin.home:/usr/src/sys/arch/mac68k/compile/CORWIN mac68k


>Description:
	
	Attempting to build a kernel with debug symbols fails, as follows.

ld -n -Ttext 0 -e start -X -o netbsd ${SYSTEM_OBJ} vers.o
text	data	bss	dec	hex	filename
1146804	68044  	223852 	1438700	15f3ec 	netbsd
cp netbsd netbsd.gdb
strip -d netbsd

strip: Can not allocate 1146804 bytes after allocating 31515800 bytes
*** Error code 1

Stop.
>How-To-Repeat:
	
	Simply configure and make a kernel with "makeoptions DEBUG=-g",
	as suggested in the GENERIC kernel config.
>Fix:
	
	Invoking ld with "-S" rather than "-X" works better. Doing so via
	"make netbsd DEBUG=" almost works, but it has the side-effect of
	incrementing the version number. So the work around is:
	1) "make build"
	2) "rm netbsd"; "rm st[1-9]*" # clean up after "strip".
	3) "vi version" # decrement version number
	4) "make netbsd DEBUG="

	Whatever's wrong with strip, it would make sense, perhaps, to edit 
	/sys/arch/${arch}/conf/Makefile.${arch} to make the two kernels in
	two link steps (but without incrementing the version number).


>Audit-Trail:
>Unformatted: