Subject: bin/25939: Solaris 10_b54 build of NetBSD fails to generate bin/sh/nodes.c
To: None <gnats-bugs@gnats.NetBSD.org>
From: Chris Ross <cross+netbsd@distal.com>
List: netbsd-bugs
Date: 06/15/2004 17:14:53
>Number:         25939
>Category:       bin
>Synopsis:       Solaris 10_b54 build of NetBSD fails to generate bin/sh/nodes.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 15 21:16:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Chris Ross
>Release:        NetBSD 2.0F (cvs HEAD 20040615)
>Organization:
>Environment:
System: Solaris 10_b54
Architecture: sparc64
Machine: sparc64
>Description:
	When mknodes.sh inputs from nodes.c.pat, the Solaris ksh
(unlike the /bin/sh on i386 NetBSD 2.0F native build) converts the
'\0' into a NUL.
>How-To-Repeat:
	Try to build bin/sh from Solaris, with BSHELL, HOST_SH, and
CONFIG_SH set to /usr/bin/ksh.
>Fix:
	If I apply:

Index: bin/sh/nodes.c.pat
===================================================================
RCS file: /cvsroot/src/bin/sh/nodes.c.pat,v
retrieving revision 1.11
diff -u -r1.11 nodes.c.pat
--- bin/sh/nodes.c.pat	7 Aug 2003 09:05:36 -0000	1.11
+++ bin/sh/nodes.c.pat	15 Jun 2004 21:00:46 -0000
@@ -145,7 +145,7 @@
 	register char *q = funcstring;
 	char   *rtn = funcstring;
 
-	while ((*q++ = *p++) != '\0')
+	while ((*q++ = *p++) != '\\0')
 		continue;
 	funcstring = q;
 	return rtn;

...then the problem goes away on solaris, as expected.  However,
I've confirmed that making this change on an i386 NetBSD 2.0F
system causes the inverse problem.  It does not do the translation
the sparc was doing, and therefore produces an invalid character
constant.

  I'm not sure what the "right" fix for this is, but the above
is what I'm stuck with for now to get it building for me under
solaris.

  Thank you.

>Release-Note:
>Audit-Trail:
>Unformatted: