NetBSD Problem Report #46803

From www@NetBSD.org  Wed Aug 15 19:42:20 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id D5A1563C3D5
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Aug 2012 19:42:19 +0000 (UTC)
Message-Id: <20120815194218.EF6A463B882@www.NetBSD.org>
Date: Wed, 15 Aug 2012 19:42:18 +0000 (UTC)
From: max.khardin@gmail.com
Reply-To: max.khardin@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Building mongodb fails with error message about redeclaration of bpf_filter and bpf_validate
X-Send-Pr-Version: www-1.0

>Number:         46803
>Category:       lib
>Synopsis:       Building mongodb fails with error message about redeclaration of bpf_filter and bpf_validate
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 15 19:45:00 +0000 2012
>Closed-Date:    Fri Sep 30 08:11:21 +0000 2016
>Last-Modified:  Fri Sep 30 08:11:21 +0000 2016
>Originator:     hmax
>Release:        6.0_BETA2
>Organization:
>Environment:
NetBSD none.localdomain 6.0_BETA2 NetBSD 6.0_BETA2 (GENERIC) amd64

>Description:
While trying to build mongodb-2.0.7 from pkgsrc-wip I get following error:

/usr/pkgsrc/wip/mongodb/work/.wrapper/bin/c++ -o tools/sniffer.o -c -Wnon-virtual-dtor -O2 -I/usr/pkg/include -I/usr/include -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -D__netbsd__ -D_FILE_OFFSET_BITS=64 -DXP_UNIX -DNOEXECINFO -DMONGO_EXPOSE_MACROS -I. -I/usr/pkg/include tools/sniffer.cpp
In file included from tools/sniffer.cpp:30:0:
/usr/include/pcap/bpf.h:382:8: error: previous declaration of 'u_int bpf_filter(const bpf_insn*, const u_char*, u_int, u_int)' with 'C++' linkage
/usr/include/pcap.h:354:71: error: conflicts with new declaration with 'C' linkage
/usr/include/pcap/bpf.h:381:6: error: previous declaration of 'int bpf_validate(const bpf_insn*, int)' with 'C++' linkage
/usr/include/pcap.h:355:51: error: conflicts with new declaration with 'C' linkage

Which seems like a problem in NetBSD includes
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/46803: Building mongodb fails with error message about redeclaration of bpf_filter and bpf_validate
Date: Wed, 15 Aug 2012 21:56:32 +0200

 Are you sure your header files are from the beta2?
 In my version, both declarations have C linkage (/usr/include/pcap/bpf.h uses
 __BEGIN_DECLS, /usr/include/pcap.h has it spelled out as extern "C")

 Martin

From: Max Khardin <max.khardin@gmail.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: lib/46803: Building mongodb fails with error message about
 redeclaration of bpf_filter and bpf_validate
Date: Thu, 16 Aug 2012 00:22:23 +0400

 --047d7b2ed3917aa66a04c753b067
 Content-Type: text/plain; charset=UTF-8

 That's system I've just installed using
 http://mirror.corbina.net/pub/NetBSD/iso/6.0_BETA2/NetBSD-6.0_BETA2-amd64.isoimage,
 so I think headers should be from BETA2. Is there any way to check
 their version?

 2012/8/16 Martin Husemann <martin@duskware.de>

 > The following reply was made to PR lib/46803; it has been noted by GNATS.
 >
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: lib/46803: Building mongodb fails with error message about
 > redeclaration of bpf_filter and bpf_validate
 > Date: Wed, 15 Aug 2012 21:56:32 +0200
 >
 >  Are you sure your header files are from the beta2?
 >  In my version, both declarations have C linkage (/usr/include/pcap/bpf.h
 > uses
 >  __BEGIN_DECLS, /usr/include/pcap.h has it spelled out as extern "C")
 >
 >  Martin
 >
 >


 -- 
 Max Khardin

 --047d7b2ed3917aa66a04c753b067
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable

 That&#39;s system I&#39;ve just installed using=C2=A0<a href=3D"http://mirr=
 or.corbina.net/pub/NetBSD/iso/6.0_BETA2/NetBSD-6.0_BETA2-amd64.iso">http://=
 mirror.corbina.net/pub/NetBSD/iso/6.0_BETA2/NetBSD-6.0_BETA2-amd64.iso</a> =
 image, so I think headers should be from BETA2. Is there any way to check t=
 heir version?<br>

 <br><div class=3D"gmail_quote">2012/8/16 Martin Husemann <span dir=3D"ltr">=
 &lt;<a href=3D"mailto:martin@duskware.de" target=3D"_blank">martin@duskware=
 .de</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
  0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

 The following reply was made to PR lib/46803; it has been noted by GNATS.<b=
 r>
 <br>
 From: Martin Husemann &lt;<a href=3D"mailto:martin@duskware.de">martin@dusk=
 ware.de</a>&gt;<br>
 To: gnats-bugs@NetBSD.org<br>
 Cc:<br>
 Subject: Re: lib/46803: Building mongodb fails with error message about red=
 eclaration of bpf_filter and bpf_validate<br>
 Date: Wed, 15 Aug 2012 21:56:32 +0200<br>
 <br>
 =C2=A0Are you sure your header files are from the beta2?<br>
 =C2=A0In my version, both declarations have C linkage (/usr/include/pcap/bp=
 f.h uses<br>
 =C2=A0__BEGIN_DECLS, /usr/include/pcap.h has it spelled out as extern &quot=
 ;C&quot;)<br>
 <span class=3D"HOEnZb"><font color=3D"#888888"><br>
 =C2=A0Martin<br>
 <br>
 </font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
 r>Max Khardin<br>

 --047d7b2ed3917aa66a04c753b067--

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/46803: Building mongodb fails with error message about redeclaration of bpf_filter and bpf_validate
Date: Thu, 16 Aug 2012 14:27:48 +0200

 Can you please verify that the two function declarations the compiler mentions
 are inside __BEGIN_DECLS/__END_DECLS (in bpf.h) or explicitly wrapped in

 #ifdef __cplusplus
 extern "C" {
 #endif

 and a coresponding } (in pcap.h)?

 Martin

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/46803: Building mongodb fails with error message about
 redeclaration of bpf_filter and bpf_validate
Date: Thu, 16 Aug 2012 22:04:33 +0000

 On Wed, Aug 15, 2012 at 08:25:03PM +0000, Max Khardin wrote:
  >  That's system I've just installed using
  >  http://mirror.corbina.net/pub/NetBSD/iso/6.0_BETA2/NetBSD-6.0_BETA2-amd64.isoimage,
  >  so I think headers should be from BETA2. Is there any way to check
  >  their version?

 pcap.h is cleverly missing CVS ID strings, so not all that easily.

 Try this:

 % find /usr/include/ -name '*pcap*.h' -type f -print | xargs md5

 I believe it should give you:

 MD5 (/usr/include/pcap/pcap.h) = def462156a0719cdc243e6c3ac26ff60

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 13 Jul 2014 04:36:52 +0000
State-Changed-Why:
Did you ever figure out what was happening here?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 30 Sep 2016 08:11:21 +0000
State-Changed-Why:
Feedback timeout.


>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.