Subject: Stock i386 kernels with GCC4 (patches included)
To: None <current-users@NetBSD.org>
From: Sergey Lungu <sergey.lungu@gmail.com>
List: current-users
Date: 05/30/2006 00:46:00
--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

I've been compiling stock -current i386 kernels using GCC4 with -O3
today. The following are patches I've made to fix issues caught by GCC4.

- `i4b_capi.h.diff' fixes:

/home/sebl/netbsd/src/sys/netisdn/i4b_capi_l4if.c:60: error: static
declaration of 'ncapi' follows non-static declaration
/home/sebl/netbsd/src/sys/netisdn/i4b_capi.h:110: error: previous
declaration of 'ncapi' was here

I've simply removed extern declaration of `ncapi' from `i4b_capi.h',
'cause it is used in `i4b_capi_l4if.c' only.

- `pmap.c.diff' fixes:

/home/sebl/netbsd/src/sys/arch/xen/i386/pmap.c: In function 'pmap_pdp_ctor':
/home/sebl/netbsd/src/sys/arch/xen/i386/pmap.c:1762: warning: 'pdirpa' may
be used uninitialized in this function

- `twe.c.diff' fixes:

/home/sebl/netbsd/src/sys/dev/pci/twe.c: In function 'twe_attach':
/home/sebl/netbsd/src/sys/dev/pci/twe.c:1926: warning: 'ports' may be used
uninitialized in this function

- `vfs_subr.c.diff' fixes:

/home/sebl/netbsd/src/sys/kern/vfs_subr.c: In function 'vdevgone':
/home/sebl/netbsd/src/sys/kern/vfs_subr.c:1791: warning: 'vp' may be used
uninitialized in this function

- NET4501, XEN0, XENU and XEN3_U do not build at all, because of the
  makeoptions with -mcpu option, wich is not recognized by GCC4 anymore.
  Don't know how fix this without breaking GCC3 builds, 'cause `config'
  has no `if' statements (Am I right?:). BTW, should they be in configs
  at all?

Hope this will help!

-- 
Sergey Lungu

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="i4b_capi.h.diff"

--- i4b_capi.h.orig	2006-05-29 17:41:47.000000000 +0400
+++ i4b_capi.h	2006-05-29 17:41:59.000000000 +0400
@@ -107,8 +107,6 @@
     int (*send)(struct capi_softc *, struct mbuf *);
 } capi_softc_t;
 
-extern int ncapi;
-
 #define CARD_TYPEC_CAPI_UNK	0
 #define CARD_TYPEC_AVM_T1_PCI	1
 #define CARD_TYPEC_AVM_B1_PCI	2

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pmap.c.diff"

--- pmap.c.orig	2006-05-29 19:27:22.000000000 +0400
+++ pmap.c	2006-05-29 19:40:03.000000000 +0400
@@ -1762,6 +1762,8 @@
 	paddr_t pdirpa;
 	int s;
 
+	pdirpa = 0;	/* XXX gcc */
+
 	/*
 	 * NOTE: The `pmap_lock' is held when the PDP is allocated.
 	 * WE MUST NOT BLOCK!

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="twe.c.diff"

--- twe.c.orig	2006-05-29 14:15:10.000000000 +0400
+++ twe.c	2006-05-29 14:35:50.000000000 +0400
@@ -1925,6 +1925,8 @@
 	uint32_t dsize;
 	uint8_t ports;
 
+	ports = 0;	/* XXX gcc */
+
 	/* get the port count */
 	rv |= twe_param_get_1(sc, TWE_PARAM_CONTROLLER,
 		TWE_PARAM_CONTROLLER_PortCount, &ports);

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vfs_subr.c.diff"

--- vfs_subr.c.orig	2006-05-29 15:36:42.000000000 +0400
+++ vfs_subr.c	2006-05-29 15:37:54.000000000 +0400
@@ -1791,6 +1791,8 @@
 	struct vnode *vp;
 	int mn;
 
+	vp = NULL;	/* XXX gcc */
+
 	for (mn = minl; mn <= minh; mn++)
 		if (vfinddev(makedev(maj, mn), type, &vp))
 			VOP_REVOKE(vp, REVOKEALL);

--AqsLC8rIMeq19msA--