Subject: toolchain/18733: Fixes for pax for cross-builds from Linux/glibc
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jldavis+netbsdlist@cs.oberlin.edu>
List: netbsd-bugs
Date: 10/19/2002 20:09:02
>Number:         18733
>Category:       toolchain
>Synopsis:       pax, as a host tool, needs 2 fixes to compile under Linux/glibc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 19 17:10:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jed Davis
>Release:        NetBSD 1.6I  (-CURRENT of ~Oct 19 02:41)
>Organization:
Oberlin College Computer Science
>Environment:
System: NetBSD rubisco 1.6I NetBSD 1.6I (RUBISCO) #0: Wed Oct 16 05:16:35 EDT 2002 jdev@rubisco:/src/syssrc/compile/RUBISCO sparc64
Architecture: sparc64
Machine: sparc64
>Description:
pax(1), being part of the host tools, needs two changes to compile on
a Linux/glibc build host: _PATH_DEFTAPE needs to be defined, and
stderr can't be assumed to be a compile-time constant.
>How-To-Repeat:
build.sh on a Linux box...
>Fix:
Following is a cvs diff -u of the relevant files:

Index: compat_defs.h
===================================================================
RCS file: /cvsroot/basesrc/tools/compat/compat_defs.h,v
retrieving revision 1.21
diff -u -r1.21 compat_defs.h
--- compat_defs.h       2002/10/08 00:28:36     1.21
+++ compat_defs.h       2002/10/17 05:04:02
@@ -371,6 +371,9 @@
 #ifndef _PATH_TMP
 #define _PATH_TMP "/tmp/"
 #endif
+#ifndef _PATH_DEFTAPE
+#define _PATH_DEFTAPE "/dev/nrst0"
+#endif
 
 /* <stdarg.h> */
 
Index: pax.c
===================================================================
RCS file: /cvsroot/basesrc/bin/pax/pax.c,v
retrieving revision 1.21
diff -u -r1.21 pax.c
--- pax.c       2002/10/17 00:42:02     1.21
+++ pax.c       2002/10/19 06:44:24
@@ -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.
>Release-Note:
>Audit-Trail:
>Unformatted: