Subject: Adventures in Cross-Building
To: None <current-users@netbsd.org>
From: Jed Davis <jldavis+netbsdlist@cs.oberlin.edu>
List: current-users
Date: 10/19/2002 02:57:27
I've once again successfully built NetBSD/sparc64 on a Linux/i386 host,
with recent -CURRENT source (but with boot/miniroot images and the INSTALL
kernel disabled by edits to etc/etc.sparc64/Makefile.inc).  I had to make
two changes because of the recent inclusion of pax in the host tools:
tools/compat/compat_defs.h needs a _PATH_DEFTAPE, and bin/pax/pax.c assumes
that stderr is a compile-time constant (!).  (And I also had to adjust an
flist, but that's been fixed in CVS since then.)

Here's a cvs diff -u of what I changed:

Index: tools/compat/compat_defs.h
===================================================================
RCS file: /cvsroot/basesrc/tools/compat/compat_defs.h,v
retrieving revision 1.21
diff -u -r1.21 compat_defs.h
--- tools/compat/compat_defs.h  2002/10/08 00:28:36     1.21
+++ tools/compat/compat_defs.h  2002/10/19 06:48:29
@@ -371,6 +371,9 @@
 #ifndef _PATH_TMP
 #define _PATH_TMP "/tmp/"
 #endif
+#ifndef _PATH_DEFTAPE
+#define _PATH_DEFTAPE "/dev/nrst0"
+#endif
 
 /* <stdarg.h> */
 
Index: bin/pax/pax.c
===================================================================
RCS file: /cvsroot/basesrc/bin/pax/pax.c,v
retrieving revision 1.21
diff -u -r1.21 pax.c
--- bin/pax/pax.c       2002/10/17 00:42:02     1.21
+++ bin/pax/pax.c       2002/10/19 06:48:29
@@ -110,7 +110,7 @@
 char   *ltmfrmt;               /* -v locale time format (if any) */
 char   *argv0;                 /* root of argv[0] */
 sigset_t s_mask;               /* signal mask for cleanup critical sect */
-FILE   *listf = stderr;        /* file pointer to print file list to */
+FILE   *listf;                 /* file pointer to print file list to */
 char   *tempfile;              /* tempfile to use for mkstemp(3) */
 char   *tempbase;              /* basename of tempfile to use for mkstemp(3) */
 int    forcelocal;             /* force local operation even if the name 
@@ -243,6 +243,12 @@
 {
        char *tmpdir;
        size_t tdlen;
+
+       /*
+        * Initialize listf here, in case stderr isn't constant.
+        */
+       listf = stderr;
+
 
        /*
         * Keep a reference to cwd, so we can always come back home.




--Jed

-- 
<?xml version="1.0"?>  <?xml-stylesheet href="http://panix.com/~jdev/xs/txt.xsl"
type="text/xsl"?>   <sig name="Jed Davis">  <id dom="oberlin.edu" lp="sjld8197">
Student, 4th-Year</id><id dom="cs.oberlin.edu" lp="jldavis">CS Major and Student
SysAdmin</id><id dom="panix.com" lp="jdev">Panixer</id> <q href="bin.q"/> </sig>