GCC 3.3.2 kernel

Craig Dooley cd5697 at albany.edu
Tue Oct 28 20:37:36 PST 2003


Heres a patch that gets the kernel closer to being built with gcc 3.3.2 from 
ports.  The kernel compiles and runs with gcc 2.95 also as of now, but there 
are changes to drivers I cannot test (if_ray and if_wx that i can think of) 
but I think all the changes deal with either string tokenization or multiline 
strings, so I dont think there should be any problems.  The kernel still 
cannot be built with gcc 3.3.2 though.  When using buildkernel, it gets to 
linking kernel.debug and dies with MANY undefined references to puts and 
putchar.  When using config; make depend; make it dies in make depend.  The 
first pass in aic7xxx/aicasm goes fine, but the second pass dies with missing 
headers and sure enough the headers it wants are not in compile/TRAGEDY/usr/
src/sys/...  I'm looking into those.

-Craig
-- 
Craig Dooley											cd5697 at xxxxxxxxxx
Index: dev/misc/syscons/syscons.h
===================================================================
RCS file: /home/dcvs/src/sys/dev/misc/syscons/syscons.h,v
retrieving revision 1.3
diff -u -r1.3 syscons.h
--- dev/misc/syscons/syscons.h	23 Jun 2003 17:55:35 -0000	1.3
+++ dev/misc/syscons/syscons.h	28 Oct 2003 21:44:43 -0000
@@ -418,11 +418,11 @@
 extern struct linker_set scrndr_set;
 
 #define RENDERER(name, mode, sw, set)				\
-	static struct sc_renderer scrndr_##name##_##mode## = {	\
+	static struct sc_renderer scrndr_##name##_##mode = {	\
 		#name, mode, &sw				\
 	};							\
-	DATA_SET(scrndr_set, scrndr_##name##_##mode##);		\
-	DATA_SET(set, scrndr_##name##_##mode##)
+	DATA_SET(scrndr_set, scrndr_##name##_##mode);		\
+	DATA_SET(set, scrndr_##name##_##mode)
 
 #define RENDERER_MODULE(name, set)				\
 	static int						\
@@ -458,7 +458,7 @@
 		scrndr_##name##_event,				\
 		NULL,						\
 	};							\
-	DECLARE_MODULE(scrndr_##name##, scrndr_##name##_mod, 	\
+	DECLARE_MODULE(scrndr_##name, scrndr_##name##_mod, 	\
 		       SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
 
 typedef struct {
Index: dev/netif/ray/if_ray.c
===================================================================
RCS file: /home/dcvs/src/sys/dev/netif/ray/if_ray.c,v
retrieving revision 1.4
diff -u -r1.4 if_ray.c
--- dev/netif/ray/if_ray.c	7 Aug 2003 21:17:04 -0000	1.4
+++ dev/netif/ray/if_ray.c	28 Oct 2003 22:13:39 -0000
@@ -903,7 +903,7 @@
 	RAY_DPRINTF(sc, RAY_DBG_SUBR | RAY_DBG_STARTJOIN, "");
 	RAY_MAP_CM(sc);
 
-#define MIB4(m)		ray_mib_4_default.##m
+#define MIB4(m)		ray_mib_4_default.m
 
 	MIB4(mib_net_type)		= com->c_desired.np_net_type;
 	MIB4(mib_ap_status)		= com->c_desired.np_ap_status;
@@ -967,7 +967,7 @@
 	RAY_DPRINTF(sc, RAY_DBG_SUBR | RAY_DBG_STARTJOIN, "");
 	RAY_MAP_CM(sc);
 
-#define MIB5(m)		ray_mib_5_default.##m
+#define MIB5(m)		ray_mib_5_default.m
 	MIB5(mib_net_type)		= com->c_desired.np_net_type;
 	MIB5(mib_ap_status)		= com->c_desired.np_ap_status;
 	bcopy(com->c_desired.np_ssid, MIB5(mib_ssid), IEEE80211_NWID_LEN);
Index: dev/netif/wx/if_wx.c
===================================================================
RCS file: /home/dcvs/src/sys/dev/netif/wx/if_wx.c,v
retrieving revision 1.3
diff -u -r1.3 if_wx.c
--- dev/netif/wx/if_wx.c	7 Aug 2003 21:17:06 -0000	1.3
+++ dev/netif/wx/if_wx.c	28 Oct 2003 22:16:48 -0000
@@ -1403,8 +1403,8 @@
  * and, more importantly, garbage collect completed transmissions
  * and to handle link status changes.
  */
-#define	WX_PRT_STATS(sc, y)	printf("\t" # y " = %u\n", (sc)-> ## y )
-#define	WX_CLR_STATS(sc, y)	(sc)-> ## y  = 0
+#define	WX_PRT_STATS(sc, y)	printf("\t" # y " = %u\n", ((sc)->y))
+#define	WX_CLR_STATS(sc, y)	((sc)->y  = 0)
 
 static void
 wx_watchdog(void *arg)
Index: i386/i386/identcpu.c
===================================================================
RCS file: /home/dcvs/src/sys/i386/i386/identcpu.c,v
retrieving revision 1.6
diff -u -r1.6 identcpu.c
--- i386/i386/identcpu.c	29 Sep 2003 15:56:42 -0000	1.6
+++ i386/i386/identcpu.c	28 Oct 2003 16:38:45 -0000
@@ -734,15 +734,14 @@
  */
 inthand_t	bluetrap6;
 __asm
-("
-	.text
-	.p2align 2,0x90
-	.type	" __XSTRING(CNAME(bluetrap6)) ", at function
-" __XSTRING(CNAME(bluetrap6)) ":
-	ss
-	movl	$0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) "
-	addl	$2, (%esp)		  # I know rdmsr is a 2-bytes instruction.
-	iret
+("  .text																\n\
+	.p2align 2,0x90														\n\
+	.type	" __XSTRING(CNAME(bluetrap6)) ", at function					\n\
+" __XSTRING(CNAME(bluetrap6)) ":										\n\
+	ss																	\n\
+	movl	$0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) "				\n\
+	addl	$2, (%esp)		  # I know rdmsr is a 2-bytes instruction.	\n\
+	iret																\n\
 ");
 
 /*
@@ -751,16 +750,15 @@
  */
 inthand_t	bluetrap13;
 __asm
-("
-	.text
-	.p2align 2,0x90
-	.type " __XSTRING(CNAME(bluetrap13)) ", at function
-" __XSTRING(CNAME(bluetrap13)) ":
-	ss
-	movl	$0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) "
-	popl	%eax				# discard errorcode.
-	addl	$2, (%esp)			# I know rdmsr is a 2-bytes instruction.
-	iret
+("  .text																\n\
+	.p2align 2,0x90														\n\
+	.type " __XSTRING(CNAME(bluetrap13)) ", at function					\n\
+" __XSTRING(CNAME(bluetrap13)) ":										\n\
+	ss																	\n\
+	movl	$0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) "				\n\
+	popl	%eax			# discard errorcode.						\n\
+	addl	$2, (%esp)		# I know rdmsr is a 2-bytes instruction.	\n\
+	iret																\n\
 ");
 
 /*
Index: i386/i386/locore.s
===================================================================
RCS file: /home/dcvs/src/sys/i386/i386/locore.s,v
retrieving revision 1.8
diff -u -r1.8 locore.s
--- i386/i386/locore.s	24 Oct 2003 14:10:45 -0000	1.8
+++ i386/i386/locore.s	28 Oct 2003 21:48:24 -0000
@@ -96,9 +96,9 @@
 	.data
 	ALIGN_DATA		/* just to be sure */
 
-	.globl	HIDENAME(tmpstk)
+	.globl	.tmpstk
 	.space	0x2000		/* space for tmpstk - temporary stack */
-HIDENAME(tmpstk):
+.tmpstk:
 
 	.globl	boothowto,bootdev
 
@@ -274,7 +274,7 @@
  * the old stack, but it need not be, since recover_bootinfo actually
  * returns via the old frame.
  */
-	movl	$R(HIDENAME(tmpstk)),%esp
+	movl	$R(.tmpstk),%esp
 
 #ifdef PC98
 	/* pc98_machine_type & M_EPSON_PC98 */
Index: kern/kern_lock.c
===================================================================
RCS file: /home/dcvs/src/sys/kern/kern_lock.c,v
retrieving revision 1.8
diff -u -r1.8 kern_lock.c
--- kern/kern_lock.c	2 Oct 2003 22:27:00 -0000	1.8
+++ kern/kern_lock.c	28 Oct 2003 16:53:32 -0000
@@ -186,13 +186,13 @@
 #else
 		    if (lockmgr_from_int == 2) {
 			    didpanic = 1;
-			    panic("
-				lockmgr %s from %s:%d: called from interrupt",
+			    panic(
+				"lockmgr %s from %s:%d: called from interrupt",
 				lkp->lk_wmesg, file, line);
 			    didpanic = 0;
 		    } else {
-			    printf("
-				lockmgr %s from %s:%d: called from interrupt\n",
+			    printf(
+				"lockmgr %s from %s:%d: called from interrupt\n",
 				lkp->lk_wmesg, file, line);
 		    }
 #endif
Index: vfs/coda/coda_subr.c
===================================================================
RCS file: /home/dcvs/src/sys/vfs/coda/coda_subr.c,v
retrieving revision 1.4
diff -u -r1.4 coda_subr.c
--- vfs/coda/coda_subr.c	7 Aug 2003 21:17:40 -0000	1.4
+++ vfs/coda/coda_subr.c	28 Oct 2003 22:31:31 -0000
@@ -417,12 +417,12 @@
 	      cp->c_flags &= ~C_VATTR;
 	      if (CTOV(cp)->v_flag & VTEXT)
 		  error = coda_vmflush(cp);
-	      CODADEBUG(CODA_ZAPFILE, myprintf(("zapfile: fid = (%lx.%lx.%lx), 
-                                              refcnt = %d, error = %d\n",
-					      cp->c_fid.Volume, 
-					      cp->c_fid.Vnode, 
-					      cp->c_fid.Unique, 
-					      CTOV(cp)->v_usecount - 1, error)););
+	      CODADEBUG(CODA_ZAPFILE, 
+		  	myprintf(("zapfile: fid = (%lx.%lx.%lx), refcnt = %d, error = %d\n",
+		    	cp->c_fid.Volume, 
+			    cp->c_fid.Vnode, 
+			    cp->c_fid.Unique, 
+			    CTOV(cp)->v_usecount - 1, error)););
 	      if (CTOV(cp)->v_usecount == 1) {
 		  cp->c_flags |= C_PURGING;
 	      }
@@ -445,11 +445,12 @@
 	      cp->c_flags &= ~C_VATTR;
 	      coda_nc_zapParentfid(&out->coda_zapdir.CodaFid, IS_DOWNCALL);     
 	      
-	      CODADEBUG(CODA_ZAPDIR, myprintf(("zapdir: fid = (%lx.%lx.%lx), 
-                                          refcnt = %d\n",cp->c_fid.Volume, 
-					     cp->c_fid.Vnode, 
-					     cp->c_fid.Unique, 
-					     CTOV(cp)->v_usecount - 1)););
+	      CODADEBUG(CODA_ZAPDIR, 
+		  	myprintf(("zapdir: fid = (%lx.%lx.%lx), refcnt = %d\n",
+				cp->c_fid.Volume, 
+				cp->c_fid.Vnode, 
+				cp->c_fid.Unique, 
+				CTOV(cp)->v_usecount - 1)););
 	      if (CTOV(cp)->v_usecount == 1) {
 		  cp->c_flags |= C_PURGING;
 	      }
Attachment:
pgp00006.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00006.pgp
Type: application/octet-stream
Size: 187 bytes
Desc: "Description: signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20031028/299c5691/attachment-0013.obj>


More information about the Submit mailing list