NetBSD Problem Report #47104
From kretschm@cs.uni-bonn.de Mon Oct 22 08:24:29 2012
Return-Path: <kretschm@cs.uni-bonn.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id A07DE63CA81
for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Oct 2012 08:24:29 +0000 (UTC)
Message-Id: <1350894266.096649.1113.nullmailer@jaguar-alpha.cs.uni-bonn.de>
Date: Mon, 22 Oct 2012 10:24:26 +0200
From: kretschm@cs.uni-bonn.de
Reply-To: kretschm@cs.uni-bonn.de
To: gnats-bugs@gnats.NetBSD.org
Subject: -pg -lpthread warns about xdr symbols and __findenv
X-Send-Pr-Version: 3.95
>Number: 47104
>Category: toolchain
>Synopsis: -pg -lpthread warns about xdr symbols and __findenv
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 22 08:25:00 +0000 2012
>Last-Modified: Mon Feb 25 08:45:03 +0000 2013
>Originator: Matthias Kretschmer
>Release: NetBSD 6.0_POST_RC1
>Organization:
>Environment:
System: NetBSD jaguar-gamma 6.0_POST_RC1 NetBSD 6.0_POST_RC1 (XEN3PAE_DOMU) #7: Mon Sep 10 10:53:12 CEST 2012 ignatios@random84.cs.uni-bonn.de:/var/itch/sources/6.0/oi386/sys/arch/i386/compile/XEN3PAE_DOMU i386
Architecture: i386
Machine: i386
>Description:
Linking with -pg -lpthread warns about deprecated and buggy symbols:
- xdr_peername()
- xdr_mapname()
- xdr_domainname()
Furthermore is warns about __findenv being internal and obsolete.
I tested "long" running code by calculating the ackermann function
for some input in two threads. Works fine. gprof gives reasonable
output.
>How-To-Repeat:
jaguar-gamma$ cat test.c
#include <pthread.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
return EXIT_SUCCESS;
}
jaguar-gamma$ gcc -g -pg test.c -lpthread
/usr/lib/libc.so.12: warning: warning: this program uses xdr_peername(), which is deprecated and buggy.
/usr/lib/libc.so.12: warning: warning: __findenv is an internal obsolete function.
/usr/lib/libc.so.12: warning: warning: this program uses xdr_mapname(), which is deprecated and buggy.
/usr/lib/libc.so.12: warning: warning: this program uses xdr_domainname(), which is deprecated and buggy.
>Fix:
>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc:
Subject: Re: toolchain/47104: -pg -lpthread warns about xdr symbols and __findenv
Date: Mon, 22 Oct 2012 10:38:22 -0400
On Oct 22, 8:25am, kretschm@cs.uni-bonn.de (kretschm@cs.uni-bonn.de) wrote:
-- Subject: toolchain/47104: -pg -lpthread warns about xdr symbols and __find
Although what you are doing should work, it is better to use:
$ gcc -pthread -g -pg test.c
or the equivalent and less portable:
$ gcc -g -pg test.c -lpthread_p
What's happening is that you are picking a static libc and a dynamic
libpthread which can cause sphincter issues :-), and does not profile
libpthread.
christos
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, kretschm@cs.uni-bonn.de
Cc:
Subject: Re: toolchain/47104: -pg -lpthread warns about xdr symbols and __findenv
Date: Mon, 22 Oct 2012 11:16:36 -0400
On Oct 22, 2:40pm, christos@zoulas.com (Christos Zoulas) wrote:
-- Subject: Re: toolchain/47104: -pg -lpthread warns about xdr symbols and __
To be more precise:
-lpthread causes the dynamically linked libpthread to be fetched which
has a dependency to the dynamic libc, which is then brought in. Then
the compiler adds -lc_p which brings the profiled libc to be linked in
too. The two copies of the libc (the dynamic and the profiled one)
conflict and cause the errors.
christos
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/47104: -pg -lpthread warns about xdr symbols and __findenv
Date: Mon, 22 Oct 2012 18:49:48 +0100
On Mon, Oct 22, 2012 at 03:20:06PM +0000, Christos Zoulas wrote:
>
> To be more precise:
>
> -lpthread causes the dynamically linked libpthread to be fetched which
> has a dependency to the dynamic libc, which is then brought in. Then
> the compiler adds -lc_p which brings the profiled libc to be linked in
> too. The two copies of the libc (the dynamic and the profiled one)
> conflict and cause the errors.
Doesn't that make the recent change to link all libraries with -lc
rather fubar?
Perhaps the profiled version of libc ought to be requested by adding
an RPATH entry?
David
--
David Laight: david@l8s.co.uk
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: toolchain/47104: -pg -lpthread warns about xdr symbols and
__findenv
Date: Mon, 25 Feb 2013 08:43:36 +0000
On Mon, Oct 22, 2012 at 11:16:36AM -0400, Christos Zoulas wrote:
> To be more precise:
>
> -lpthread causes the dynamically linked libpthread to be fetched which
> has a dependency to the dynamic libc, which is then brought in. Then
> the compiler adds -lc_p which brings the profiled libc to be linked in
> too. The two copies of the libc (the dynamic and the profiled one)
> conflict and cause the errors.
I'm not sure that's what's going on. See 47545, which is probably the
same issue.
--
David A. Holland
dholland@netbsd.org
>Unformatted:
(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-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.