Subject: Crossbuilding -current on alien OSen
To: NetBSD Current Users <current-users@netbsd.org>
From: Barry Bouwsma <freebsd-misuser@remove-NOSPAM-to-reply.NOSPAM.dyndns.dk>
List: current-users
Date: 06/14/2004 17:50:19
[keep replies on the list, not to me, to avoid bounces, thanks]

Hi.

I just thought I'd let you know that I've done a crossbuild of
NetBSD-current for i386 under FreeBSD4 i386, and it seems like
I needed to make a couple hacks to make the compiler happy.

(I also crossbuilt for NetBSD-sparc -current, but I don't
remember having any problems.  Anyway, I think these hacks
were because of my i386 build.)

The right fixes may not be below.  They may lie elsewhere
(compiler, wherever).  This is just what I needed to do to
make the crossbuild complete, without knowing what I'm doing.
The source I used for this is a few weeks old, for whatever
it's worth.

Three source files appeared to give the compiler fits, claiming
a value was used uninitialized.  So, I did the following:


--- /stand/NetBSD-src/source-hacks/sys/ufs/ext2fs/ext2fs_readwrite.c-ORIG	Mon Mar 22 20:23:08 2004
+++ /stand/NetBSD-src/source-hacks/sys/ufs/ext2fs/ext2fs_readwrite.c	Thu May 13 14:20:24 2004
@@ -237,7 +237,8 @@
 	int blkoffset, error, flags, ioflag, resid, xfersize;
 	vsize_t bytelen;
 	void *win;
-	off_t oldoff;
+	/* XXX HACK off_t oldoff; */
+	off_t oldoff=0;
 	boolean_t async;
 	int extended=0;
 


--- /stand/NetBSD-src/source-hacks/sys/dev/i2o/dpti.c-NEW	Thu May 27 04:07:59 2004
+++ /stand/NetBSD-src/source-hacks/sys/dev/i2o/dpti.c	Fri Jun 11 20:18:54 2004
@@ -454,7 +454,8 @@
 	struct dpti_ptbuf bufs[IOP_MAX_MSG_XFERS];
 	u_int32_t mbtmp[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
 	u_int32_t rbtmp[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
-	int rv, msgsize, repsize, sgoff, i, mapped, nbuf, nfrag, j, sz;
+	/* XXX FOO.  HACK int rv, msgsize, repsize, sgoff, i, mapped, nbuf, nfrag, j, sz; */
+	int rv, msgsize, repsize, sgoff, i, mapped=0, nbuf, nfrag, j, sz;
 	u_int32_t *p, *pmax;
 
 	iop = (struct iop_softc *)sc->sc_dv.dv_parent;


--- /stand/NetBSD-src/source-hacks/sys/dev/ic/icp.c-ORIG	Wed Oct 29 01:48:15 2003
+++ /stand/NetBSD-src/source-hacks/sys/dev/ic/icp.c	Thu May 13 12:53:45 2004
@@ -137,7 +137,8 @@
 	struct icp_binfo binfo;
 	struct icp_ccb *ic;
 	u_int16_t cdev_cnt;
-	int i, j, state, feat, nsegs, rv;
+	/* XXX FOO. HACK int i, j, state, feat, nsegs, rv; */
+	int i=0, j, state, feat, nsegs, rv;
 
 	state = 0;
 

Apologies if this is a known issue and/or fixed already.  Me, I
blame the compiler.


barry bouwsma