NetBSD Problem Report #47545

From dholland@macaran.localdomain  Fri Feb  8 21:09:11 2013
Return-Path: <dholland@macaran.localdomain>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 5804763E520
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  8 Feb 2013 21:09:11 +0000 (UTC)
Message-Id: <20130208211038.853586E23C@macaran.localdomain>
Date: Fri,  8 Feb 2013 16:10:38 -0500 (EST)
From: dholland@eecs.harvard.edu
Reply-To: dholland@eecs.harvard.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: librt + static libc triggers linker warning
X-Send-Pr-Version: 3.95

>Number:         47545
>Category:       lib
>Synopsis:       librt + static libc triggers linker warning
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 08 21:10:00 +0000 2013
>Last-Modified:  Fri Feb 08 23:20:03 +0000 2013
>Originator:     David A. Holland
>Release:        NetBSD 6.99.11 (20120906)
>Organization:
>Environment:
System: NetBSD macaran 6.99.11 NetBSD 6.99.11 (MACARAN) #15: Mon Oct 15 21:24:31 EDT 2012 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

It seems that linking librt.so against libc_p.a (or for that matter,
libc.a) causes this message:
/usr/lib/libc.so.12: warning: warning: __findenv is an internal obsolete function.

The easiest way to test is:
   ld -o /dev/null /usr/lib/librt.so /usr/lib/libc.a"

The way this comes up in real life is:
   gcc -pg $(OBJS) -lrt -o $(PROG)

as this pulls in librt.so and uses libc_p.a. (I would have expected it
to implicitly pull in librt_p.a instead, but apparently it doesn't.)

I don't see where this is coming from; there is no reference to
__findenv in /usr/lib/librt.*, and no obvious chain of undefined
symbols that seems to be related.

>How-To-Repeat:

>Fix:

Dunno.

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/47545: librt + static libc triggers linker warning
Date: Sat, 9 Feb 2013 03:02:11 +0400

 On Fri, Feb 08, 2013 at 21:10:01 +0000, dholland@eecs.harvard.edu wrote:

 > It seems that linking librt.so against libc_p.a (or for that matter,
 > libc.a) causes this message:
 > /usr/lib/libc.so.12: warning: warning: __findenv is an internal obsolete function.
 > 
 > The easiest way to test is:
 >    ld -o /dev/null /usr/lib/librt.so /usr/lib/libc.a"
 > 
 > The way this comes up in real life is:
 >    gcc -pg $(OBJS) -lrt -o $(PROG)
 > 
 > as this pulls in librt.so and uses libc_p.a. (I would have expected it
 > to implicitly pull in librt_p.a instead, but apparently it doesn't.)
 > 
 > I don't see where this is coming from; there is no reference to
 > __findenv in /usr/lib/librt.*, and no obvious chain of undefined
 > symbols that seems to be related.

 Check "FIXME" at src/external/gpl3/binutils/dist/bfd/elflink.c:3453

 Looks like for normal objects .gnu.warning.SYMBOL is handled as
 uncodintional .gnu.warning

 We should probably move the symbol to the file of its own.

 -uwe

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/47545: librt + static libc triggers linker warning
Date: Fri, 8 Feb 2013 23:19:52 +0000

 On Fri, Feb 08, 2013 at 11:05:03PM +0000, Valeriy E. Ushakov wrote:
  >  > I don't see where this is coming from; there is no reference to
  >  > __findenv in /usr/lib/librt.*, and no obvious chain of undefined
  >  > symbols that seems to be related.
  >  
  >  Check "FIXME" at src/external/gpl3/binutils/dist/bfd/elflink.c:3453
  >  
  >  Looks like for normal objects .gnu.warning.SYMBOL is handled as
  >  uncodintional .gnu.warning

 Figures.

  >  We should probably move the symbol to the file of its own.

 Yeah, guess so.

 -- 
 David A. Holland
 dholland@netbsd.org

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.