NetBSD Problem Report #40317

From martin@duskware.de  Fri Jan  2 10:00:27 2009
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9709563B884
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 Jan 2009 10:00:27 +0000 (UTC)
Message-Id: <20090102100024.82A6333A9B@mail.duskware.de>
Date: Fri,  2 Jan 2009 11:00:19 +0100 (CET)
From: martin
Reply-To: martin
To: gnats-bugs@gnats.NetBSD.org
Subject: current (after recent locale changes) can't be built on netbsd-4 host
X-Send-Pr-Version: 3.95

>Number:         40317
>Category:       lib
>Synopsis:       current (after recent locale changes) can't be built on netbsd-4 host
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 02 10:05:00 +0000 2009
>Closed-Date:    Sun May 17 23:07:13 +0000 2009
>Last-Modified:  Sun May 17 23:07:13 +0000 2009
>Originator:     Martin Husemann
>Release:        NetBSD 5.0_BETA
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-porter.duskware.de 5.0_BETA NetBSD 5.0_BETA (PORTER) #1: Sun Dec 14 18:14:45 CET 2008 martin@night-porter.duskware.de:/usr/src-5/sys/arch/i386/compile/PORTER i386
Architecture: i386
Machine: i386
>Description:

When cross building -current from a netbsd-4 host, the new "mklocale" fails
to convert any .src into .out files. The problem is a bug in the fparseln()
function (already fixed in -current and on the netbsd-5 branch) that mishandles
disabled escape characters:

RCS file: /cvsroot/src/lib/libc/stdio/fparseln.c,v
Working file: fparseln.c
head: 1.7
----------------------------
revision 1.6
date: 2007/03/07 15:12:01;  author: drochner;  state: Exp;  lines: +4 -4
-fix a condition so that fparseln() doesn't report spurious empty lines
 eg after 2 comment lines, or on EOF after a single comment line
-no escape character means no escaped characters
----------------------------

Without this, the mklocale usage of fparseln() returns lots of comment-only
lines, which the application does not realy like (it lateron fails trying
to convert "#" to a numeric value). And of course storing all those comments
"as string" in the ouptut is not correct either.

>How-To-Repeat:

Try to build -current src/share/locale/monetary on a netbsd-4 host

>Fix:
Probably the easiest fix is:
pullup rev. 1.6 (and, while there, 1.7 too?) of fparseln.c
Another workaround is to use a more modern build host (netbsd-5 is good enough)

>Release-Note:

>Audit-Trail:
From: Takehiko NOZAKI <tnozaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40317 CVS commit: src/usr.bin/mklocale
Date: Fri,  2 Jan 2009 22:08:19 +0000 (UTC)

 Module Name:	src
 Committed By:	tnozaki
 Date:		Fri Jan  2 22:08:19 UTC 2009

 Modified Files:
 	src/usr.bin/mklocale: Makefile lex.l yacc.y

 Log Message:
 1. fixes PR lib/40317, don't use libc's fparseln(3).
 it is non-portable function, toolchain should link it yourself.

 2. fixes crossbuild breakage reported by Chiristoph Egger on current-user,
 FreeBSD and MacOS X still make Rune* as public API in their ctype.h.
 so added namespace protection NB* by including src/lib/libc/locale/rune.h
 instead of src/lib/libc/locale/runetype.h.


 To generate a diff of this commit:
 cvs rdiff -r1.12 -r1.13 src/usr.bin/mklocale/Makefile
 cvs rdiff -r1.14 -r1.15 src/usr.bin/mklocale/lex.l
 cvs rdiff -r1.25 -r1.26 src/usr.bin/mklocale/yacc.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: tnozaki@NetBSD.org
State-Changed-When: Fri, 02 Jan 2009 22:28:43 +0000
State-Changed-Why:
patch submitted.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/40317 CVS commit: src/usr.bin/mklocale
Date: Sun, 4 Jan 2009 14:32:05 +0100

 Unfortunately it does not seem to work for the tool variant (I have no idea
 why, the fparseln.lo is generated and linked):

 # nm ${TOOLDIR}/bin/nbmklocale | fgrep fparseln
          U fparseln


 Martin

From: Takehiko NOZAKI <tnozaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40317 CVS commit: src
Date: Mon,  5 Jan 2009 06:11:43 +0000 (UTC)

 Module Name:	src
 Committed By:	tnozaki
 Date:		Mon Jan  5 06:11:43 UTC 2009

 Modified Files:
 	src/lib/libc/locale: fix_grouping.c iswctype_sb.c rune.h
 	src/lib/libc/stdio: fparseln.c
 	src/lib/libc/string: wcscmp.c wcsncmp.c wmemcmp.c
 	src/tools/compat: configure configure.ac nbtool_config.h.in
 	src/usr.bin/mklocale: Makefile lex.l yacc.y
 Added Files:
 	src/lib/libc/locale: runetype_local.h
 Removed Files:
 	src/lib/libc/locale: runetype.h

 Log Message:
 1. reworking PR lib/40317:
 libnbcompat already contains empty fparseln.lo
 so previous fix doesn't work correctly.
 i've just added broken fparseln check to configure script.

 2. reworking cross build breakage under FreeBSD/MacOS X.
 FreeBSD/MacOS X still have public /usr/include/runetype.h
 derived from 4.4BSD-Lite.  so i renamed out private header from
 src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
 to solve this problems.

 3. fix build breakage when CITRUS=no was set.


 To generate a diff of this commit:
 cvs rdiff -r1.2 -r1.3 src/lib/libc/locale/fix_grouping.c
 cvs rdiff -r1.6 -r1.7 src/lib/libc/locale/iswctype_sb.c
 cvs rdiff -r1.13 -r1.14 src/lib/libc/locale/rune.h
 cvs rdiff -r1.21 -r0 src/lib/libc/locale/runetype.h
 cvs rdiff -r0 -r1.1 src/lib/libc/locale/runetype_local.h
 cvs rdiff -r1.7 -r1.8 src/lib/libc/stdio/fparseln.c
 cvs rdiff -r1.6 -r1.7 src/lib/libc/string/wcscmp.c \
     src/lib/libc/string/wcsncmp.c
 cvs rdiff -r1.4 -r1.5 src/lib/libc/string/wmemcmp.c
 cvs rdiff -r1.67 -r1.68 src/tools/compat/configure \
     src/tools/compat/configure.ac
 cvs rdiff -r1.21 -r1.22 src/tools/compat/nbtool_config.h.in
 cvs rdiff -r1.14 -r1.15 src/usr.bin/mklocale/Makefile
 cvs rdiff -r1.15 -r1.16 src/usr.bin/mklocale/lex.l
 cvs rdiff -r1.26 -r1.27 src/usr.bin/mklocale/yacc.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40317 CVS commit: [netbsd-5] src/usr.bin/mklocale
Date: Thu, 15 Jan 2009 03:52:23 +0000 (UTC)

 Module Name:	src
 Committed By:	snj
 Date:		Thu Jan 15 03:52:23 UTC 2009

 Modified Files:
 	src/usr.bin/mklocale [netbsd-5]: Makefile lex.l yacc.y

 Log Message:
 Pull up following revision(s) (requested by jmcneill in ticket #270):
 	usr.bin/mklocale/Makefile: revision 1.13
 	usr.bin/mklocale/lex.l: revision 1.15
 	usr.bin/mklocale/yacc.y: revision 1.26
 1. fixes PR lib/40317, don't use libc's fparseln(3).
 it is non-portable function, toolchain should link it yourself.
 2. fixes crossbuild breakage reported by Chiristoph Egger on current-user,
 FreeBSD and MacOS X still make Rune* as public API in their ctype.h.
 so added namespace protection NB* by including src/lib/libc/locale/rune.h
 instead of src/lib/libc/locale/runetype.h.


 To generate a diff of this commit:
 cvs rdiff -r1.11.40.1 -r1.11.40.2 src/usr.bin/mklocale/Makefile
 cvs rdiff -r1.13.40.1 -r1.13.40.2 src/usr.bin/mklocale/lex.l
 cvs rdiff -r1.24.40.1 -r1.24.40.2 src/usr.bin/mklocale/yacc.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40317 CVS commit: [netbsd-5] src
Date: Thu, 15 Jan 2009 04:21:26 +0000 (UTC)

 Module Name:	src
 Committed By:	snj
 Date:		Thu Jan 15 04:21:26 UTC 2009

 Modified Files:
 	src/lib/libc/locale [netbsd-5]: fix_grouping.c iswctype_sb.c rune.h
 	src/lib/libc/stdio [netbsd-5]: fparseln.c
 	src/lib/libc/string [netbsd-5]: wcscmp.c wcsncmp.c wmemcmp.c
 	src/tools/compat [netbsd-5]: configure.ac
 	src/usr.bin/mklocale [netbsd-5]: Makefile lex.l yacc.y
 Added Files:
 	src/lib/libc/locale [netbsd-5]: runetype_local.h
 Removed Files:
 	src/lib/libc/locale [netbsd-5]: runetype.h

 Log Message:
 Pull up following revision(s) (requested by jmcneill in ticket #270):
 	lib/libc/locale/fix_grouping.c: revision 1.3
 	lib/libc/locale/iswctype_sb.c: revision 1.7
 	lib/libc/locale/rune.h: revision 1.14
 	lib/libc/locale/runetype.h: file removal
 	lib/libc/locale/runetype_local.h: revision 1.1
 	lib/libc/stdio/fparseln.c: revision 1.8
 	lib/libc/string/wcscmp.c: revision 1.7
 	lib/libc/string/wcsncmp.c: revision 1.7
 	lib/libc/string/wmemcmp.c: revision 1.5
 	tools/compat/configure: regen
 	tools/compat/configure.ac: revision 1.68
 	tools/compat/nbtool_config.h.in: regen
 	usr.bin/mklocale/Makefile: revision 1.15
 	usr.bin/mklocale/lex.l: revision 1.16
 	usr.bin/mklocale/yacc.y: revision 1.27
 1. reworking PR lib/40317:
 libnbcompat already contains empty fparseln.lo
 so previous fix doesn't work correctly.
 i've just added broken fparseln check to configure script.
 2. reworking cross build breakage under FreeBSD/MacOS X.
 FreeBSD/MacOS X still have public /usr/include/runetype.h
 derived from 4.4BSD-Lite.  so i renamed out private header from
 src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
 to solve this problems.
 3. fix build breakage when CITRUS=no was set.


 To generate a diff of this commit:
 cvs rdiff -r1.4.2.3 -r1.4.2.4 src/lib/libc/locale/fix_grouping.c
 cvs rdiff -r1.5.4.1 -r1.5.4.2 src/lib/libc/locale/iswctype_sb.c
 cvs rdiff -r1.12.12.1 -r1.12.12.2 src/lib/libc/locale/rune.h
 cvs rdiff -r1.21 -r0 src/lib/libc/locale/runetype.h
 cvs rdiff -r0 -r1.2.2.2 src/lib/libc/locale/runetype_local.h
 cvs rdiff -r1.7 -r1.7.18.1 src/lib/libc/stdio/fparseln.c
 cvs rdiff -r1.5.38.1 -r1.5.38.2 src/lib/libc/string/wcscmp.c \
     src/lib/libc/string/wcsncmp.c
 cvs rdiff -r1.3.38.1 -r1.3.38.2 src/lib/libc/string/wmemcmp.c
 cvs rdiff -r1.67 -r1.67.2.1 src/tools/compat/configure.ac
 cvs rdiff -r1.11.40.3 -r1.11.40.4 src/usr.bin/mklocale/Makefile
 cvs rdiff -r1.13.40.2 -r1.13.40.3 src/usr.bin/mklocale/lex.l
 cvs rdiff -r1.24.40.2 -r1.24.40.3 src/usr.bin/mklocale/yacc.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 15 Jan 2009 09:48:05 +0000
State-Changed-Why:
First fix didn't work...


State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 15 Jan 2009 09:48:22 +0000
State-Changed-Why:
...second fix is in. All ok now?


State-Changed-From-To: feedback->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Sun, 17 May 2009 23:07:13 +0000
State-Changed-Why:
All fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.