Subject: Fixes for acorn32 build after GCC4 upgrade
To: None <current-users@netbsd.org>
From: Mike Pumford <mpumford@black-star.demon.co.uk>
List: current-users
Date: 06/25/2006 19:20:33
This is a multi-part message in MIME format.
--------------080706000503070806030200
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Attached is a patch that fixes all the build failures for current acorn32.

None of these have been run yet but it at least makes everything build. 
I'll report back once I've actually updated the system on how things work.

Mike


--------------080706000503070806030200
Content-Type: text/plain;
 name="gcc4acorn32.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gcc4acorn32.patch"

Index: distrib/utils/sysinst/arch/acorn32/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/acorn32/md.c,v
retrieving revision 1.20
diff -u -r1.20 md.c
--- distrib/utils/sysinst/arch/acorn32/md.c	5 Apr 2006 16:55:05 -0000	1.20
+++ distrib/utils/sysinst/arch/acorn32/md.c	25 Jun 2006 18:08:50 -0000
@@ -133,7 +133,7 @@
 	struct disklabel disklabel;
 	int fd;
 	char dev_name[100];
-	static char bb[DEV_BSIZE];
+	static unsigned char bb[DEV_BSIZE];
 	struct filecore_bootblock *fcbb = (struct filecore_bootblock *)bb;
 	int offset = 0;
 
@@ -201,9 +201,9 @@
 			/* Break out as soon as we find a suitable partition */
 			for (loop = 0; loop < NRISCIX_PARTITIONS; ++loop) {
 				part = &riscix_part->partitions[loop];
-				if (strcmp(part->rp_name, "RiscBSD") == 0
-				    || strcmp(part->rp_name, "NetBSD") == 0
-				    || strcmp(part->rp_name, "Empty:") == 0) {
+				if (strcmp((char *)part->rp_name, "RiscBSD") == 0
+				    || strcmp((char *)part->rp_name, "NetBSD") == 0
+				    || strcmp((char *)part->rp_name, "Empty:") == 0) {
 					offset = part->rp_start;
 					break;
 				}
Index: sbin/disklabel/main.c
===================================================================
RCS file: /cvsroot/src/sbin/disklabel/main.c,v
retrieving revision 1.11
diff -u -r1.11 main.c
--- sbin/disklabel/main.c	11 Jun 2006 15:51:31 -0000	1.11
+++ sbin/disklabel/main.c	25 Jun 2006 18:09:52 -0000
@@ -723,7 +723,7 @@
 get_filecore_partition(int f)
 {
 	struct filecore_bootblock	*fcbb;
-	static char	bb[DEV_BSIZE];
+	static u_char	bb[DEV_BSIZE];
 	u_int		offset;
 	struct riscix_partition_table	*riscix_part;
 	int		loop;
@@ -761,11 +761,11 @@
 		riscix_part = (struct riscix_partition_table *)bb;
 
 		for (loop = 0; loop < NRISCIX_PARTITIONS; ++loop) {
-			if (strcmp(riscix_part->partitions[loop].rp_name,
+			if (strcmp((char *)riscix_part->partitions[loop].rp_name,
 				    "RiscBSD") == 0 ||
-			    strcmp(riscix_part->partitions[loop].rp_name,
+			    strcmp((char *)riscix_part->partitions[loop].rp_name,
 				    "NetBSD") == 0 ||
-			    strcmp(riscix_part->partitions[loop].rp_name,
+			    strcmp((char *)riscix_part->partitions[loop].rp_name,
 				    "Empty:") == 0) {
 				return riscix_part->partitions[loop].rp_start;
 				break;
Index: sys/arch/acorn32/acorn32/rpc_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/acorn32/rpc_machdep.c,v
retrieving revision 1.61
diff -u -r1.61 rpc_machdep.c
--- sys/arch/acorn32/acorn32/rpc_machdep.c	11 Dec 2005 12:16:05 -0000	1.61
+++ sys/arch/acorn32/acorn32/rpc_machdep.c	25 Jun 2006 18:09:55 -0000
@@ -444,7 +444,7 @@
 	u_int kerneldatasize;
 	u_int l1pagetable;
 	struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
-	pv_addr_t kernel_l1pt;
+	pv_addr_t kernel_l1pt = { {0} };
 
 	/*
 	 * Heads up ... Setup the CPU / MMU / TLB functions
Index: sys/arch/acorn32/stand/boot32/boot32.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/stand/boot32/boot32.c,v
retrieving revision 1.27
diff -u -r1.27 boot32.c
--- sys/arch/acorn32/stand/boot32/boot32.c	25 Mar 2006 15:09:00 -0000	1.27
+++ sys/arch/acorn32/stand/boot32/boot32.c	25 Jun 2006 18:09:56 -0000
@@ -709,10 +709,10 @@
 	kernel_free_vm_start += nbpp;
 
 	/* get some miscelanious info for the bootblock */
-	os_readsysinfo_monitor_info(NULL, &monitor_type, &monitor_sync);
-	os_readsysinfo_chip_presence(&ioeb_flags, &superio_flags, &lcd_flags);
-	os_readsysinfo_superio_features(&superio_flags_basic,
-	    &superio_flags_extra);
+	os_readsysinfo_monitor_info(NULL, (int *)&monitor_type, (int *)&monitor_sync);
+	os_readsysinfo_chip_presence((int *)&ioeb_flags, (int *)&superio_flags, (int *)&lcd_flags);
+	os_readsysinfo_superio_features((int *)&superio_flags_basic,
+	    (int *)&superio_flags_extra);
 	os_readsysinfo_unique_id(&id_low, &id_high);
 
 	/* fill in the bootconfig *bconfig structure : generic version II */
Index: sys/arch/acorn32/stand/lib/riscospart.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/stand/lib/riscospart.c,v
retrieving revision 1.1
diff -u -r1.1 riscospart.c
--- sys/arch/acorn32/stand/lib/riscospart.c	1 Apr 2006 19:08:08 -0000	1.1
+++ sys/arch/acorn32/stand/lib/riscospart.c	25 Jun 2006 18:09:56 -0000
@@ -148,7 +148,7 @@
 {
 	size_t rsize;
 	int err;
-	unsigned char *buf;
+	char *buf;
 	struct filecore_bootblock *bb;
 	daddr_t labelsect;
 	char *msg;
Index: sys/arch/acorn32/stand/lib/rmreloc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/stand/lib/rmreloc.c,v
retrieving revision 1.1
diff -u -r1.1 rmreloc.c
--- sys/arch/acorn32/stand/lib/rmreloc.c	28 Mar 2006 20:45:46 -0000	1.1
+++ sys/arch/acorn32/stand/lib/rmreloc.c	25 Jun 2006 18:09:56 -0000
@@ -106,7 +106,8 @@
 relocate_self(Elf_Dyn *dynamic, caddr_t oldbase, caddr_t newbase)
 {
 	Elf_Dyn *dynp;
-	Obj_Entry o, *obj; 
+	Obj_Entry o = { 0 };
+	Obj_Entry *obj; 
 	const Elf_Rel *rel;
 	Elf_Addr        relsz = 0;
 

--------------080706000503070806030200--