NetBSD Problem Report #38838

From martin@duskware.de  Mon Jun  2 22:28:44 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id C471363BA89
	for <gnats-bugs@gnats.netbsd.org>; Mon,  2 Jun 2008 22:28:44 +0000 (UTC)
Message-Id: <20080602221826.B7F8863BA89@narn.NetBSD.org>
Date: Mon,  2 Jun 2008 22:18:26 +0000 (UTC)
From: alnsn@yandex.ru
Reply-To: alnsn@yandex.ru
To: netbsd-bugs-owner@NetBSD.org
Subject: pkg_info -Q REQUIRES is blank on OpenBSD
X-Send-Pr-Version: www-1.0

>Number:         38838
>Category:       pkg
>Synopsis:       pkg_info -Q REQUIRES is blank on OpenBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 22:30:00 +0000 2008
>Closed-Date:    Sun May 13 08:20:30 +0000 2012
>Last-Modified:  Sun May 13 08:20:30 +0000 2012
>Originator:     Alexander Nasonov
>Release:        
>Organization:
>Environment:
OpenBSD obx1000 4.3 GENERIC#853 i386
>Description:
The ldd program in OpenBSD prints dependencies in a different format which pkgsrc does not understand:

 $ ldd /usr/bin/ldd 
/usr/bin/ldd:
        Start    End      Type Open Ref GrpRef Name
        00000000 00000000 exe  1    0   0      /usr/bin/ldd
        0089a000 208ce000 rlib 0    1   0      /usr/lib/libc.so.45.0
        01bd5000 01bd5000 rtld 0    1   0      /usr/libexec/ld.so

Thids can be fixed by appending a new pattern to the awk script in mk/flavor/pkg/metadata.mk:
${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }; $$3 == "rlib" || $$3 == "rtld" { print $$NF };'
>How-To-Repeat:
/usr/pkg/sbin/pkg_info -Q REQUIRES '*'
>Fix:
Index: mk/flavor/pkg/metadata.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/metadata.mk,v
retrieving revision 1.30
diff -u -r1.30 metadata.mk
--- mk/flavor/pkg/metadata.mk   21 May 2008 20:39:52 -0000      1.30
+++ mk/flavor/pkg/metadata.mk   2 Jun 2008 22:15:39 -0000
@@ -60,7 +60,7 @@
        ELF)                                                            \
                libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
                if ${TEST} -n "$$bins" -o -n "$$libs"; then             \
-                       requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \
+                       requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }; $$3 == "rlib" || $$3 == "rtld" { print $$NF };' | ${SORT} -u`; \
                fi;                                                     \
                linklibs=`${AWK} '/.*\.so\.[0-9\.]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \
                for i in $$linklibs; do         

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/38838: pkg_info -Q REQUIRES is blank on OpenBSD
Date: Thu, 18 Feb 2010 20:18:04 +0900

 This issue also will occur even on NetBSD if users are using custom LD_TRACE_LOADED_OBJECTS_FMT{1,2}.
 So those values should be set exactly as expected.

 Moreover, objdump, readelf, elfdump or something else should be used instead of ldd,
 because ldd list not only direct but also indirect depending shared libraries.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/38838: pkg_info -Q REQUIRES is blank on OpenBSD
Date: Sun, 13 May 2012 07:18:08 +0000

 On Mon, Jun 02, 2008 at 10:30:00PM +0000, alnsn@yandex.ru wrote:
  > >Description:
  > The ldd program in OpenBSD prints dependencies in a different format which pkgsrc does not understand:
  > 
  >  $ ldd /usr/bin/ldd 
  > /usr/bin/ldd:
  >         Start    End      Type Open Ref GrpRef Name
  >         00000000 00000000 exe  1    0   0      /usr/bin/ldd
  >         0089a000 208ce000 rlib 0    1   0      /usr/lib/libc.so.45.0
  >         01bd5000 01bd5000 rtld 0    1   0      /usr/libexec/ld.so

 Didn't this just get fixed a couple weeks ago? Or am I thinking of something else?

 -- 
 David A. Holland
 dholland@netbsd.org

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38838 CVS commit: pkgsrc/mk
Date: Sun, 13 May 2012 08:20:11 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sun May 13 08:20:11 UTC 2012

 Modified Files:
 	pkgsrc/mk/pkgformat/pkg: metadata.mk
 	pkgsrc/mk/platform: OpenBSD.mk

 Log Message:
 Set LD_TRACE_LOADED_OBJECTS_FMT{1,2} for OpenBSD so that output of ldd will be
 expected format.

 workaround of PR 38838.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/metadata.mk
 cvs rdiff -u -r1.34 -r1.35 pkgsrc/mk/platform/OpenBSD.mk

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

State-Changed-From-To: open->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Sun, 13 May 2012 08:20:30 +0000
State-Changed-Why:
commited workaround.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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