NetBSD Problem Report #56120

From cjep@netbsd.org  Wed Apr 21 11:29:37 2021
Return-Path: <cjep@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C08221A9253
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 21 Apr 2021 11:29:37 +0000 (UTC)
Message-Id: <20210421112935.EF1791A9254@mollari.NetBSD.org>
Date: Wed, 21 Apr 2021 11:29:35 +0000 (UTC)
From: cjep@netbsd.org
Reply-To: cjep@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: build.sh (-m alpha) release fails on current on Darwin in libc compilation
X-Send-Pr-Version: 3.95

>Number:         56120
>Category:       toolchain
>Synopsis:       build.sh (-m alpha) release fails on current on Darwin in libc compilation
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 21 11:30:01 +0000 2021
>Closed-Date:    Thu Apr 22 20:48:49 +0000 2021
>Last-Modified:  Thu Apr 22 20:48:49 +0000 2021
>Originator:     Chris Pinnock
>Release:        NetBSD-current sources as of approx 24 hours
>Organization:
>Environment:
Darwin MacMini-7390 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
chris@MacMini-7390% gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0

>Description:

Build.sh cross-compiling on Darwin seems to be broken using a checkout from yesterday. The target machine was alpha but it could be more widespread. Due to a redefinition on wint_t

#   compile  compat/regcomp.lo
cc -O   -no-cpp-precomp -I. -I./include -I/Volumes/TimeMachine/Chris/NetBSD/src/tools/compat -I/Volumes/TimeMachine/Chris/NetBSD/src/tools/compat/sys  -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D__DBINTERFACE_PRIVATE -c -o regcomp.lo.o    /Volumes/TimeMachine/Chris/NetBSD/src/tools/compat/../../lib/libc/regex/regcomp.c
In file included from /Volumes/TimeMachine/Chris/NetBSD/src/tools/compat/../../lib/libc/regex/regcomp.c:80:
/Volumes/TimeMachine/Chris/NetBSD/src/tools/compat/../../lib/libc/regex/utils.h:46:15: error: 
      typedef redefinition with different types ('short' vs '__darwin_wint_t'
      (aka 'int'))
typedef short wint_t;
              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h:32:25: note: 
      previous definition is here
typedef __darwin_wint_t wint_t;
                        ^
1 error generated.



>How-To-Repeat:
Get current sources on a Big Sur Intel machine.
./build.sh -U -m alpha release

>Fix:

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: toolchain/56120: build.sh (-m alpha) release fails on current on
 Darwin in libc compilation
Date: Thu, 22 Apr 2021 10:43:09 -0400

 --Apple-Mail=_8E828FBC-36ED-45DF-A481-831C3258D32E
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Can you try this?

 christos

 --- utils.h     25 Feb 2021 21:28:40 -0000      1.8
 +++ utils.h     22 Apr 2021 14:42:36 -0000
 @@ -43,6 +43,9 @@
  #include <wctype.h>
  #else
  #include <ctype.h>
 +#define wint_t regex_wint_t
 +#define mbstate_t regex_mbstate_t
 +#define wctype_t regex_wctype_t
  typedef short wint_t;
  typedef char mbstate_t;
  typedef short wctype_t;


 --Apple-Mail=_8E828FBC-36ED-45DF-A481-831C3258D32E
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYIGLfQAKCRBxESqxbLM7
 Ot2AAJ9f+dhpoiqI7c3vwR2XMC+pnGH/ggCglPIBzyDZoxb+MoNcYW6rtX9R5Fk=
 =vBMt
 -----END PGP SIGNATURE-----

 --Apple-Mail=_8E828FBC-36ED-45DF-A481-831C3258D32E--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56120 CVS commit: src/lib/libc/regex
Date: Thu, 22 Apr 2021 15:20:25 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Thu Apr 22 19:20:25 UTC 2021

 Modified Files:
 	src/lib/libc/regex: utils.h

 Log Message:
 PR/56120: Chris Pinnock: build.sh (-m alpha) release fails on current on
 Darwin in libc compilation
 We build the regex code in tools without nls. We don't include any nls headers
 for that, but on Darwin wint_t gets defined, so we end up with a compilation
 error. The cleaner fix would have been to always use regex_foo_t types, but
 the minimal fix is to only do this for the tools build, using cpp.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/lib/libc/regex/utils.h

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

From: Chris Pinnock <chris_pinnock@mac.com>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 cjep@netbsd.org
Subject: Re: toolchain/56120: build.sh (-m alpha) release fails on current on
 Darwin in libc compilation
Date: Thu, 22 Apr 2021 20:09:12 +0100

 On 22 Apr 2021, at 15:45, Christos Zoulas <christos@zoulas.com> wrote:
 > 
 > Can you try this?
 > 
 > christos
 > 
 > --- utils.h     25 Feb 2021 21:28:40 -0000      1.8
 > +++ utils.h     22 Apr 2021 14:42:36 -0000
 > @@ -43,6 +43,9 @@
 >  #include <wctype.h>
 >  #else
 >  #include <ctype.h>
 > +#define wint_t regex_wint_t
 > +#define mbstate_t regex_mbstate_t
 > +#define wctype_t regex_wctype_t
 >  typedef short wint_t;
 >  typedef char mbstate_t;
 >  typedef short wctype_t;
 > 

 Hi Christos - this fixes it. Many thanks. Rgds, Chris

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Thu, 22 Apr 2021 20:48:49 +0000
State-Changed-Why:
Fixed by christos.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.