NetBSD Problem Report #54182

From gson@gson.org  Thu May  9 09:40:25 2019
Return-Path: <gson@gson.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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A8DC97A174
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  9 May 2019 09:40:25 +0000 (UTC)
Message-Id: <20190509094022.51091989F84@guava.gson.org>
Date: Thu,  9 May 2019 12:40:22 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: Cross-building on Linux fails in rb.c
X-Send-Pr-Version: 3.95

>Number:         54182
>Category:       misc
>Synopsis:       Cross-building on Linux fails in rb.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 09 09:45:00 +0000 2019
>Closed-Date:    Thu May 09 13:48:59 +0000 2019
>Last-Modified:  Thu May 09 13:48:59 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2019.05.08.19.34.09
>Organization:
>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

Building NetBSD-current/i386 on a Debian 9 amd64 host fails with:

/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c:44:9: error: expected declaration specifiers or '...' before string constant
 __RCSID("$NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $");
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- reallocarr.lo ---
--- rb.lo ---
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c: In function 'rb_tree_insert_node':
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c:208:7: warning: implicit declaration of function '__predict_false' [-Wimplicit-function-declaration]
   if (__predict_false(diff == 0)) {
       ^~~~~~~~~~~~~~~
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c: At top level:
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c:324:37: error: expected ')' before 'struct'
 rb_tree_reparent_nodes(__rbt_unused struct rb_tree *rbt,
                                     ^~~~~~
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c: In function 'rb_tree_insert_rebalance':
--- reallocarr.lo ---
#   compile  compat/reallocarr.lo
cc -O   -I. -I./include -I/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat -I/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/sys  -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D__DBINTERFACE_PRIVATE -c -o reallocarr.lo.o    /bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../lib/libc/stdlib/reallocarr.c
--- rb.lo ---
/bracket/build/2019.05.08.19.34.09-i386/src/tools/compat/../../common/lib/libc/gen/rb.c:465:3: warning: implicit declaration of function 'rb_tree_reparent_nodes' [-Wimplicit-function-declaration]
   rb_tree_reparent_nodes(rbt, father, other);
   ^~~~~~~~~~~~~~~~~~~~~~
*** [rb.lo] Error code 1

nbmake[7]: stopped in /bracket/build/2019.05.08.19.34.09-i386/src/tools/compat

Full log at:

  http://www.gson.org/netbsd/bugs/build/i386-linuxhost/commits-2019.05.html#2019.05.08.19.34.09

Might be related to this commit:

  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_bool.c 1.18
  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_data.c 1.15
  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_number.c 1.31
  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_object_impl.h 1.33
  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_stack.c 1.3
  2019.05.08.02.25.50 thorpej src/common/lib/libprop/prop_string.c 1.13
  2019.05.08.02.25.50 thorpej src/tools/compat/Makefile 1.87
  2019.05.08.02.25.50 thorpej src/tools/compat/sys/rbtree.h 1.1
  2019.05.08.02.25.50 thorpej src/tools/libprop/Makefile 1.2

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: misc-bug-people->thorpej
Responsible-Changed-By: gson@NetBSD.org
Responsible-Changed-When: Thu, 09 May 2019 09:46:24 +0000
Responsible-Changed-Why:
Over to committer.


From: coypu@sdf.org
To: gnats-bugs@netbsd.org, thorpej@netbsd.org
Cc: 
Subject: Re: misc/54182: Cross-building on Linux fails in rb.c
Date: Thu, 9 May 2019 10:51:04 +0000

 I believe this is the magic trick for tool builds.
 (Untested, because I am lazy)

 Index: gen/rb.c
 ===================================================================
 RCS file: /cvsroot/src/common/lib/libc/gen/rb.c,v
 retrieving revision 1.14
 diff -u -r1.14 rb.c
 --- gen/rb.c	8 Mar 2019 09:14:54 -0000	1.14
 +++ gen/rb.c	9 May 2019 10:50:26 -0000
 @@ -29,6 +29,10 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */

 +#if HAVE_NBTOOL_CONFIG_H
 +#include "nbtool_config.h"
 +#endif
 +
  #if !defined(_KERNEL) && !defined(_STANDALONE)
  #include <sys/types.h>
  #include <stddef.h>

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Thu, 09 May 2019 10:58:12 +0000
State-Changed-Why:
Please try common/lib/libc/gen/rb.c:1.15


From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54182 CVS commit: src/common/lib/libc/gen
Date: Thu, 9 May 2019 10:56:24 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Thu May  9 10:56:24 UTC 2019

 Modified Files:
 	src/common/lib/libc/gen: rb.c

 Log Message:
 toolify

 PR/54182: Cross-building on Linux fails in rb.c


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/common/lib/libc/gen/rb.c

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

State-Changed-From-To: feedback->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Thu, 09 May 2019 13:48:59 +0000
State-Changed-Why:
Fixed, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.