NetBSD Problem Report #42102
From www@NetBSD.org Sun Sep 20 14:05:14 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 4C61563C36B
for <gnats-bugs@gnats.netbsd.org>; Sun, 20 Sep 2009 14:05:14 +0000 (UTC)
Message-Id: <20090920140511.97C0F63C36A@www.NetBSD.org>
Date: Sun, 20 Sep 2009 14:05:11 +0000 (UTC)
From: kordex@gmail.com
Reply-To: kordex@gmail.com
To: gnats-bugs@NetBSD.org
Subject: pkgsrc fails bootstraping on openbsd amd64
X-Send-Pr-Version: www-1.0
>Number: 42102
>Category: pkg
>Synopsis: pkgsrc fails bootstraping on openbsd amd64
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Sep 20 14:10:00 +0000 2009
>Closed-Date: Sat Jan 30 19:36:34 +0000 2010
>Last-Modified: Sat Jan 30 19:36:34 +0000 2010
>Originator: Mikko Kortelainen
>Release: -
>Organization:
-
>Environment:
OpenBSD 4.5 GENERIC#2052 amd64
>Description:
gcc -D__DBINTERFACE_PRIVATE -I. -I. -g -O2 -DHAVE_CONFIG_H -c /home/user/pkgsrc/bootstrap/work/libnbcompat/db/db/db.c
/home/user/pkgsrc/bootstrap/work/libnbcompat/db/db/db.c:52: error: syntax error before "DB"
*** Error code 1
Stop.
bmake: stopped in /home/user/pkgsrc/bootstrap/work/libnbcompat
===> exited with status 1
aborted.
>How-To-Repeat:
cd /home/user/pkgsrc/bootstrap
./bootstrap
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: abs@NetBSD.org
State-Changed-When: Wed, 30 Dec 2009 20:35:11 +0000
State-Changed-Why:
I wonder if this is related to the #ifdef __weak_alias section or an existing
definition of DB...
As a quick test could you try editing pkgsrc/pkgtools/libnbcompat/files/db/db/db.c
and remove the following section around line 48
#ifdef __weak_alias
__weak_alias(dbopen,_dbopen)
#endif
then try rerunning bootstrap?
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/42102 (pkgsrc fails bootstraping on openbsd amd64)
Date: Thu, 31 Dec 2009 11:39:05 +0900
On Thu, 31 Dec 2009 05:35:11 +0900, <abs@netbsd.org> wrote:
> I wonder if this is related to the #ifdef __weak_alias section or an existing
> definition of DB...
> As a quick test could you try editing pkgsrc/pkgtools/libnbcompat/files/db/db/db.c
> and remove the following section around line 48
>
> #ifdef __weak_alias
> __weak_alias(dbopen,_dbopen)
> #endif
>
> then try rerunning bootstrap?
__weak_alias also in db/mpool/mpool.c.
As far as I know, I came from a bug of __weak_alias on OpenBSD
(or you could say that the spec of __weak_alias on OpenBSD is
differ than one on NetBSD).
I think that macros prefixed with "__" are not portable, should not be used in
applications/libraries, or at least, __NetBSD__ macro should be checked first.
From: David Brownlee <abs@netbsd.org>
To: joerg@netbsd.org, gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
kordex@gmail.com
Subject: Re: pkg/42102 - Adjusting __weak_alias in libnbcompat
Date: Thu, 31 Dec 2009 14:00:23 +0000
Joerg - would you be happy with the '#ifdef __weak_alias' being '#if
defined(__NetBSD__) && defined(__weak_alias)', or do we need to handle
more OS variants?
2009/12/31 OBATA Akio <obache@netbsd.org>:
> The following reply was made to PR pkg/42102; it has been noted by GNATS.
>
> From: "OBATA Akio" <obache@netbsd.org>
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: pkg/42102 (pkgsrc fails bootstraping on openbsd amd64)
> Date: Thu, 31 Dec 2009 11:39:05 +0900
>
> =C2=A0On Thu, 31 Dec 2009 05:35:11 +0900, <abs@netbsd.org> wrote:
>
> =C2=A0> I wonder if this is related to the #ifdef __weak_alias section or=
an existing
> =C2=A0> definition of DB...
> =C2=A0> As a quick test could you try editing pkgsrc/pkgtools/libnbcompat=
/files/db/db/db.c
> =C2=A0> and remove the following section around line 48
> =C2=A0>
> =C2=A0> #ifdef __weak_alias
> =C2=A0> __weak_alias(dbopen,_dbopen)
> =C2=A0> #endif
> =C2=A0>
> =C2=A0> then try rerunning bootstrap?
>
> =C2=A0__weak_alias also in db/mpool/mpool.c.
>
> =C2=A0As far as I know, I came from a bug of __weak_alias on OpenBSD
> =C2=A0(or you could say that the spec of __weak_alias on OpenBSD is
> =C2=A0differ than one on NetBSD).
>
> =C2=A0I think that macros prefixed with "__" are not portable, should not=
be used in
> =C2=A0applications/libraries, or at least, __NetBSD__ macro should be che=
cked first.
>
>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: David Brownlee <abs@netbsd.org>
Cc: joerg@netbsd.org, gnats-bugs@netbsd.org, pkg-manager@netbsd.org,
gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, kordex@gmail.com
Subject: Re: pkg/42102 - Adjusting __weak_alias in libnbcompat
Date: Fri, 1 Jan 2010 17:37:16 +0100
On Thu, Dec 31, 2009 at 02:00:23PM +0000, David Brownlee wrote:
> Joerg - would you be happy with the '#ifdef __weak_alias' being '#if
> defined(__NetBSD__) && defined(__weak_alias)', or do we need to handle
> more OS variants?
If OpenBSD provides a broken version, just drop it completely. It's not
really needed, but I wanted to avoid unnecessary changes compared to the
libc version.
Joerg
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/42102 - Adjusting __weak_alias in libnbcompat
Date: Sat, 02 Jan 2010 11:35:24 +0900
On Sat, 02 Jan 2010 01:40:03 +0900, Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
> On Thu, Dec 31, 2009 at 02:00:23PM +0000, David Brownlee wrote:
> > Joerg - would you be happy with the '#ifdef __weak_alias' being '#if
> > defined(__NetBSD__) && defined(__weak_alias)', or do we need to handle
> > more OS variants?
> If OpenBSD provides a broken version, just drop it completely. It's not
> really needed, but I wanted to avoid unnecessary changes compared to the
> libc version.
Ah, about other than db1 part in libnbcompat, __weak_alias is already surrounded by
#if 0 ... #endif (or #ifdef _LIBC), so remains also should be changed same as others?
From: kordex - <kordex@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
abs@netbsd.org
Subject: Re: pkg/42102 (pkgsrc fails bootstraping on openbsd amd64)
Date: Tue, 5 Jan 2010 13:21:28 +0200
2009/12/30 <abs@netbsd.org>:
> Synopsis: pkgsrc fails bootstraping on openbsd amd64
>
> State-Changed-From-To: open->feedback
> State-Changed-By: abs@NetBSD.org
> State-Changed-When: Wed, 30 Dec 2009 20:35:11 +0000
> State-Changed-Why:
> I wonder if this is related to the #ifdef __weak_alias section or an existing
> definition of DB...
> As a quick test could you try editing pkgsrc/pkgtools/libnbcompat/files/db/db/db.c
> and remove the following section around line 48
>
> #ifdef __weak_alias
> __weak_alias(dbopen,_dbopen)
> #endif
>
> then try rerunning bootstrap?
>
>
>
>
I need to install vmware for testing if it runs on that. Access to
OpenBSD machine was dropped due bad maintaince of machine. TODO +1.
From: SM <sm@resistor.net>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/42102 (pkgsrc fails bootstraping on openbsd amd64)
Date: Fri, 15 Jan 2010 08:04:20 -0800
The following fix works:
--- files/db/db/db.c.orig Tue Oct 28 14:01:06 2008
+++ files/db/db/db.c Fri Jan 15 10:40:49 2010
@@ -45,7 +45,7 @@
#include <nbcompat/db.h>
static int __dberr(void);
-#ifdef __weak_alias
+#if defined(__NetBSD__) && defined(__weak_alias)
__weak_alias(dbopen,_dbopen)
#endif
--- files/db/mpool/mpool.c.orig Tue Oct 28 11:06:26 2008
+++ files/db/mpool/mpool.c Fri Jan 15 10:42:58 2010
@@ -53,7 +53,7 @@
#define EFTYPE EINVAL
#endif
-#ifdef __weak_alias
+#if defined(__NetBSD__) && defined(__weak_alias)
__weak_alias(mpool_close,_mpool_close)
__weak_alias(mpool_filter,_mpool_filter)
__weak_alias(mpool_get,_mpool_get)
State-Changed-From-To: feedback->analyzed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Sun, 17 Jan 2010 14:29:35 +0000
State-Changed-Why:
problem analyzed.
From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42102 CVS commit: pkgsrc/pkgtools/libnbcompat/files/db
Date: Sun, 24 Jan 2010 12:29:48 +0000
Module Name: pkgsrc
Committed By: obache
Date: Sun Jan 24 12:29:48 UTC 2010
Modified Files:
pkgsrc/pkgtools/libnbcompat/files/db/db: db.c
pkgsrc/pkgtools/libnbcompat/files/db/mpool: mpool.c
Log Message:
Kill __weak_alias, it break build on OpenBSD as reported in PR#42102.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/libnbcompat/files/db/db/db.c
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/libnbcompat/files/db/mpool/mpool.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: analyzed->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Sun, 24 Jan 2010 13:28:39 +0000
State-Changed-Why:
Fixes should be commited. please confirm it.
From: Aleksey Cheusov <cheusov@tut.by>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
obache@NetBSD.org, kordex@gmail.com
Subject: Re: pkg/42102 (pkgsrc fails bootstraping on openbsd amd64)
Date: Wed, 27 Jan 2010 08:06:54 +0200
> Synopsis: pkgsrc fails bootstraping on openbsd amd64
> State-Changed-From-To: analyzed->feedback
> State-Changed-By: obache@NetBSD.org
> State-Changed-When: Sun, 24 Jan 2010 13:28:39 +0000
> State-Changed-Why:
> Fixes should be commited. please confirm it.
Bootstrap succeeded on OpenBSD-4.5/i386
--
Best regards, Aleksey Cheusov.
State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 30 Jan 2010 19:36:34 +0000
State-Changed-Why:
Confirmed fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.