Subject: port-sparc/13036: KGDB kernel build fails since config/files 1.441, since config no longer -D's KGDB in Makefile
To: None <gnats-bugs@gnats.netbsd.org>
From: john heasley <heas@shrubbery.net>
List: netbsd-bugs
Date: 05/24/2001 23:28:14
>Number:         13036
>Category:       port-sparc
>Synopsis:       KGDB kernel build fails since config/files 1.441, since config no longer -D's KGDB in Makefile
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 24 16:27:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     john heasley
>Release:        NetBSD-current
>Organization:
	
>Environment:
	
System: NetBSD guelah 1.5V NetBSD 1.5V (guelah) #5: Thu May 10 03:22:26 GMT 2001 root@guelah:/u5/current/src/sys/arch/sparc/compile/guelah sparc
Architecture: sparc
Machine: sparc
>Description:
	config used to put -DKGDB in IDENT= of a kernel Makefile.  it no
	longer does so, nor do files depending upon the #define include
	opt_kgdb.h, and sparc/dev/zs_kgdb.c fails to compile since
	sparc/dev/cons.h has necessary function prototypes #ifdef KGDB'd
	that are now excluded.

	i did not check other platforms.

	cc -g -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-arith -Wno-uninitialized -Wno-main -mno-fpu -I. -I../../../../arch -I../../../.. -nostdinc -DSUN4M -DRASTERCONSOLE -DKGDBDEV="0xc01" -DKGDBRATE="0x9600" -DMAXUSERS=128 -D_KERNEL  -c ../../../../arch/sparc/dev/zs_kgdb.c
	cc1: warnings being treated as errors
	../../../../arch/sparc/dev/zs_kgdb.c:142: warning: function declaration isn't a prototype
	../../../../arch/sparc/dev/zs_kgdb.c:213: warning: function declaration isn't a prototype
	*** Error code 1

>How-To-Repeat:
	try to build a current sparc kernel with KGDB enabled.
>Fix:
	need to include "opt_kgdb.h" in sparc/{dev,sparc} files.  i am not
	sure if this is complete, but my kernel build completes.

	Index: dev/zs.c
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/dev/zs.c,v
	retrieving revision 1.81
	diff -c -r1.81 zs.c
	*** zs.c	2000/10/18 23:55:11	1.81
	--- zs.c	2001/05/24 23:27:03
	***************
	*** 45,50 ****
	--- 45,51 ----
	   */
	  
	  #include "opt_ddb.h"
	+ #include "opt_kgdb.h"
	  
	  #include <sys/param.h>
	  #include <sys/systm.h>
	Index: dev/zs_kgdb.c
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/dev/zs_kgdb.c,v
	retrieving revision 1.5
	diff -c -r1.5 zs_kgdb.c
	*** zs_kgdb.c	2000/03/21 12:48:45	1.5
	--- zs_kgdb.c	2001/05/24 23:27:03
	***************
	*** 47,52 ****
	--- 47,54 ----
	   *   (gdb) target remote /dev/ttyb
	   */
	  
	+ #include "opt_kgdb.h"
	+ 
	  #include <sys/param.h>
	  #include <sys/systm.h>
	  #include <sys/proc.h>
	Index: sparc/kgdb_machdep.c
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/kgdb_machdep.c,v
	retrieving revision 1.7
	diff -c -r1.7 kgdb_machdep.c
	*** kgdb_machdep.c	2000/06/29 07:40:10	1.7
	--- kgdb_machdep.c	2001/05/24 23:27:03
	***************
	*** 86,91 ****
	--- 86,93 ----
	  /*
	   * Machine dependent routines needed by kern/kgdb_stub.c
	   */
	+ #include "opt_kgdb.h"
	+ 
	  #ifdef KGDB
	  
	  #include <sys/param.h>
	Index: sparc/locore.s
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/locore.s,v
	retrieving revision 1.139
	diff -c -r1.139 locore.s
	*** locore.s	2001/04/09 18:18:48	1.139
	--- locore.s	2001/05/24 23:27:04
	***************
	*** 51,56 ****
	--- 51,57 ----
	   */
	  
	  #include "opt_ddb.h"
	+ #include "opt_kgdb.h"
	  #include "opt_compat_svr4.h"
	  #include "opt_compat_sunos.h"
	  #include "opt_multiprocessor.h"
	Index: sparc/pmap.c
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/pmap.c,v
	retrieving revision 1.191
	diff -c -r1.191 pmap.c
	*** pmap.c	2001/04/24 04:31:11	1.191
	--- pmap.c	2001/05/24 23:27:05
	***************
	*** 57,62 ****
	--- 57,63 ----
	   */
	  
	  #include "opt_ddb.h"
	+ #include "opt_kgdb.h"
	  #include "opt_multiprocessor.h"
	  
	  #include <sys/param.h>
	Index: sparc/svr4_machdep.c
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/svr4_machdep.c,v
	retrieving revision 1.40
	diff -c -r1.40 svr4_machdep.c
	*** svr4_machdep.c	2000/12/22 22:58:56	1.40
	--- svr4_machdep.c	2001/05/24 23:27:06
	***************
	*** 36,41 ****
	--- 36,43 ----
	   * POSSIBILITY OF SUCH DAMAGE.
	   */
	  
	+ #include "opt_kgdb.h"
	+ 
	  #include <sys/param.h>
	  #include <sys/systm.h>
	  #include <sys/namei.h>
>Release-Note:
>Audit-Trail:
>Unformatted: