NetBSD Problem Report #41865
From www@NetBSD.org Mon Aug 10 09:45:20 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 9715563C277
for <gnats-bugs@gnats.netbsd.org>; Mon, 10 Aug 2009 09:45:20 +0000 (UTC)
Message-Id: <20090810094520.5E70B63C270@www.NetBSD.org>
Date: Mon, 10 Aug 2009 09:45:20 +0000 (UTC)
From: David.Sainty@dtsp.co.nz
Reply-To: David.Sainty@dtsp.co.nz
To: gnats-bugs@NetBSD.org
Subject: Problem building pkg_install on Linux box
X-Send-Pr-Version: www-1.0
>Number: 41865
>Category: pkg
>Synopsis: Problem building pkg_install on Linux box
>Confidential: no
>Severity: critical
>Priority: low
>Responsible: joerg
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 10 09:50:01 +0000 2009
>Closed-Date: Fri Sep 11 18:02:37 +0000 2009
>Last-Modified: Fri Sep 11 18:05:01 +0000 2009
>Originator: David Sainty
>Release: Linux
>Organization:
>Environment:
Linux 2.6.16-gentoo-r7 #6 SMP PREEMPT Wed May 7 20:30:01 NZST 2008 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
>Description:
pkgtools/pkg_install/files/lib/pkgdb.c wants to use dbopen().
pkgtools/pkg_install/files/configure.ac looks for a solution. Snippets follow.
checking for __db185_open in -ldb... no
checking for library containing dbopen... none required
checking db1/db.h usability... yes
checking db1/db.h presence... yes
checking for db1/db.h... yes
checking db_185.h usability... yes
checking db_185.h presence... yes
checking for db_185.h... yes
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
The "checking for library containing dbopen" decides no linking is required, because libnbcompat is providing dbopen, and is linked automatically.
However, there are system installed db*.h files, including /usr/include/db_185.h.
Ultimately, pkgdb.c pulls in db_185.h because HAVE_DB_185_H is installed. But it doesn't link any system installed libdb.
% fgrep dbopen /usr/include/db_185.h
/* Re-define the user's dbopen calls. */
#define dbopen __db185_open_4002
And it all goes wrong:
gcc -L/home/dave/pkgsrc3/pkgtools/pkg_install/work/bzip2 -L/home/dave/pkgsrc3/pkgtools/pkg_install/work/zlib -L/home/dave/pkgsrc3/pkgtools/pkg_install/work/libarchive/.libs -L/home/dave/pkgsrc3/pkgtools/pkg_install/work/libfetch -L/home/da
ve/pkgsrc3/pkgtools/pkg_install/work/libnbcompat -Wl,-R/home/dave/pkgroot3/lib -L../lib -o pkg_add main.o perform.o -linstall -lfetch -larchive -lbz2 -lz -lnbcompat
../lib/libinstall.a(pkgdb.o): In function `pkgdb_open':
pkgdb.c:(.text+0x83): undefined reference to `__db185_open_4002'
collect2: ld returned 1 exit status
*** Error code 1
Stop.
bmake: stopped in /home/dave/pkgsrc3/pkgtools/pkg_install/work/pkg_install-20090806/add
*** Error code 1
Stop.
bmake: stopped in /home/dave/pkgsrc3/pkgtools/pkg_install/work/pkg_install-20090806
*** Error code 1
>How-To-Repeat:
Build any package on this box, which starts with:
===> Trying to handle out-dated pkg_install...
===> Cleaning for pkg_install-20090806
===> Installing dependencies for pkg_install-20090806
>Fix:
There's an air of mystery around the nbcompat features stuff. However, the pkg_install/Makefile suggests that nbcompat db support is unconditionally built, therefore it seems appropriate that the nbcompat db.h is unconditionally included. This does fix the build.
If this is the correct fix, then configure.ac should probably also stop looking for the non-libnbcompat db*.h files.
--- pkgdb.c 2 Aug 2009 17:56:45 -0000 1.34
+++ pkgdb.c 10 Aug 2009 09:40:58 -0000
@@ -38,15 +38,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if HAVE_DB_185_H
-#include <db_185.h>
-#elif HAVE_DB1_DB_H
-#include <db1/db.h>
-#elif HAVE_DB_H
-#include <db.h>
-#else
#include <nbcompat/db.h>
-#endif
#if HAVE_ERR_H
#include <err.h>
#endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Mon, 10 Aug 2009 11:15:10 +0000
Responsible-Changed-Why:
Over to maintainer.
State-Changed-From-To: open->closed
State-Changed-By: joerg@NetBSD.org
State-Changed-When: Fri, 11 Sep 2009 18:02:37 +0000
State-Changed-Why:
A fix was committed. Thanks for the PR.
From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/41865 CVS commit: pkgsrc/pkgtools/pkg_install/files
Date: Fri, 11 Sep 2009 18:00:13 +0000
Module Name: pkgsrc
Committed By: joerg
Date: Fri Sep 11 18:00:13 UTC 2009
Modified Files:
pkgsrc/pkgtools/pkg_install/files: configure configure.ac
pkgsrc/pkgtools/pkg_install/files/add: main.c
pkgsrc/pkgtools/pkg_install/files/info: info.h main.c
pkgsrc/pkgtools/pkg_install/files/lib: config.h.in file.c pkgdb.c
version.h
Log Message:
pkg_install-20090911:
- Cleanup configure.ac to not check for headers and functions not used
- Always use nbcompat/db.h on !NetBSD (PR 41865)
- Don't bother setting termwidth in pkg_info, it is never used.
To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 pkgsrc/pkgtools/pkg_install/files/configure
cvs rdiff -u -r1.30 -r1.31 pkgsrc/pkgtools/pkg_install/files/configure.ac
cvs rdiff -u -r1.20 -r1.21 pkgsrc/pkgtools/pkg_install/files/add/main.c
cvs rdiff -u -r1.20 -r1.21 pkgsrc/pkgtools/pkg_install/files/info/info.h
cvs rdiff -u -r1.27 -r1.28 pkgsrc/pkgtools/pkg_install/files/info/main.c
cvs rdiff -u -r1.18 -r1.19 pkgsrc/pkgtools/pkg_install/files/lib/config.h.in
cvs rdiff -u -r1.28 -r1.29 pkgsrc/pkgtools/pkg_install/files/lib/file.c
cvs rdiff -u -r1.34 -r1.35 pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c
cvs rdiff -u -r1.136 -r1.137 pkgsrc/pkgtools/pkg_install/files/lib/version.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>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.