From jeremyp@gsmx07.alcatel.com.au  Thu Aug  3 14:40:57 2000
Return-Path: <jeremyp@gsmx07.alcatel.com.au>
Received: from alcanet.com.au (mail.alcanet.com.au [203.62.196.10])
	by hub.freebsd.org (Postfix) with SMTP id 0399D37B843
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Aug 2000 14:40:54 -0700 (PDT)
	(envelope-from jeremyp@gsmx07.alcatel.com.au)
Received: by border.alcanet.com.au id <115686>; Fri, 4 Aug 2000 07:40:43 +1000
Message-Id: <00Aug4.074043est.115686@border.alcanet.com.au>
Date: Fri, 04 Aug 2000 07:39:08 +1000 (EST)
From: peter.jeremy@alcatel.com.au
Sender: jeremyp@gsmx07.alcatel.com.au
Reply-To: peter.jeremy@alcatel.com.au
To: FreeBSD-gnats-submit@freebsd.org, bug-gnu-utils@gnu.org
Subject: ld error messages refers to undocumented option --rpath
X-Send-Pr-Version: 3.2

>Number:         20387
>Category:       gnu
>Synopsis:       ld error messages refers to undocumented option --rpath
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 03 14:50:00 PDT 2000
>Closed-Date:    Fri Oct 13 02:33:12 PDT 2000
>Last-Modified:  Fri Oct 13 02:34:02 PDT 2000
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:

	FreeBSD 5.0-CURRENT as of 3rd August (cvs-cur 6576)
	incorporating GNU binutils 2.10.0 targeted to elf_i386

>Description:

	When linking against a shared library that references another
	shared library, if the implicitly referenced library cannot
	be located, ld will report an error like:
/usr/libexec/elf/ld: warning: libfoo.so, needed by ./libbar.so, not found (try using --rpath)

	There is no option `--rpath' documented in either ld.1 or ld.texinfo
	and the message should refer to `-rpath' and/or `-rpath-link'.

	(Note that ld parses `--rpath' the same as `-rpath', along with
	other long options.  I'm not sure whether this is a bug or a feature).

>How-To-Repeat:

echo 'foo() { }' > foo.c
echo 'bar() { foo(); }' > bar.c
echo 'main() { bar(); }' > main.c
cc -c -D_REENTRANT -fpic foo.c
cc -o libfoo.so -shared foo.o
cc -c -D_REENTRANT -fpic bar.c
cc -o libbar.so -shared bar.o -L. -lfoo
cc -o main main.c -L. -lbar
/usr/libexec/elf/ld: warning: libfoo.so, needed by ./libbar.so, not found (try using --rpath)

>Fix:

Index: elf32.em
===================================================================
RCS file: /home/CVSROOT/src/contrib/binutils/ld/emultempl/elf32.em,v
retrieving revision 1.3
diff -u -r1.3 elf32.em
--- elf32.em	2000/05/13 17:51:22	1.3
+++ elf32.em	2000/08/03 20:52:35
@@ -451,7 +451,7 @@
       if (force < 2)
 	continue;
 
-      einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
+      einfo ("%P: warning: %s, needed by %B, not found (try using -rpath or -rpath-link)\n",
 	     l->name, l->by);
     }
 }


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Aug 4 01:58:12 PDT 2000 
Responsible-Changed-Why:  
John's Mr Run-Time-Linker. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20387 
Responsible-Changed-From-To: jdp->freebsd-bugs 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Aug 4 14:22:39 PDT 2000 
Responsible-Changed-Why:  
John doesn't want this.  I should smoke less something-or-other. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20387 
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: johan 
Responsible-Changed-When: Wed Oct 11 12:04:38 PDT 2000 
Responsible-Changed-Why:  
Over to our GCC/binutil maintainer. 

David if I understand things correct this was reported to 
the binutil maintainers at GNU and has according to 
PR 20492 been accepted and included into binutils. 

I guess it will be in the next release. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20387 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Oct 13 02:33:12 PDT 2000 
State-Changed-Why:  
Got patch commited to FSF/Binutils 2.10 release branch. 
FreeBSD will get the change with Binuilts 2.10.1 comes out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20387 
>Unformatted:
