NetBSD Problem Report #51820

From www@NetBSD.org  Wed Jan 11 07:17:11 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id DB3B07A280
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 11 Jan 2017 07:17:11 +0000 (UTC)
Message-Id: <20170111071710.C49FA7A2AF@mollari.NetBSD.org>
Date: Wed, 11 Jan 2017 07:17:10 +0000 (UTC)
From: santhosh.raju@gmail.com
Reply-To: santhosh.raju@gmail.com
To: gnats-bugs@NetBSD.org
Subject: toolchain build fails in Cygwin due to conflicting prototypes for asnprintf()
X-Send-Pr-Version: www-1.0

>Number:         51820
>Category:       toolchain
>Synopsis:       toolchain build fails in Cygwin due to conflicting prototypes for asnprintf()
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 11 07:20:00 +0000 2017
>Closed-Date:    Sat Dec 09 15:58:17 +0000 2017
>Last-Modified:  Sat Dec 09 15:58:17 +0000 2017
>Originator:     Santhosh Raju
>Release:        NetBSD 7.99.57
>Organization:
>Environment:
CYGWIN_NT-6.1 DELTA 2.6.1(0.305/5/3) 2016-12-16 11:55 x86_64 Cygwin
>Description:
When I tried to build the tool chain using the command

./build.sh -j3 -U -m i386 -u tools

The build failed with an error message saying there were conflicting prototype declaration for the function asnprintf(), the conflict was from the file "/usr/include/stdio.h" the file from Cygwin

The full error message is as follows.

--- basename.lo ---
In file included from ./nbtool_config.h:867:0,
                 from /cygdrive/d/dev/projects/netbsd/src/src-wip/tools/compat/namespace.h:9,
                 from /cygdrive/d/dev/projects/netbsd/src/src-wip/lib/libc/gen/basename.c:37:
/cygdrive/d/dev/projects/netbsd/src/src-wip/tools/compat/compat_defs.h:238:5: error: conflicting types for 'asnprintf'
 int asnprintf(char **, size_t, const char *, ...);
     ^
In file included from /usr/include/sys/types.h:20:0,
                 from /cygdrive/d/dev/projects/netbsd/src/src-wip/tools/compat/compat_defs.h:35,
                 from ./nbtool_config.h:867,
                 from /cygdrive/d/dev/projects/netbsd/src/src-wip/tools/compat/namespace.h:9,
                 from /cygdrive/d/dev/projects/netbsd/src/src-wip/lib/libc/gen/basename.c:37:
/usr/include/stdio.h:288:8: note: previous declaration of 'asnprintf' was here
 char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...)
        ^
*** [basename.lo] Error code 1

In order to make sure it was not some cached files I re-ran the build without the -u switch, but this did not help either.

The toolchain build was working without issues until recently when
after I had updated my Cygwin installation, but I am not sure if this is what is causing the build breakage.
>How-To-Repeat:
1. Install a Cygwin in Windows 7
2. Pull the NetBSD current repository via CVS
3. Run ./build.sh -j3 -U -m i386 -u tools

>Fix:
As a temporary solution I edited the file "/usr/include/stdio.h" commented the lines 288 and 289. 

char *        _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...)
               _ATTRIBUTE ((__format__ (__printf__, 3, 4))));

After this I re-ran ./build.sh -j3 -U -m i386 -u tools which then build the toolchain without issues.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: sevan@NetBSD.org
State-Changed-When: Sat, 09 Dec 2017 15:58:17 +0000
State-Changed-Why:
Should now resolved. 
http://mail-index.netbsd.org/source-changes/2017/12/09/msg090327.html dddd



>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.