From owner-freebsd-bugs  Thu Aug  3 14:50: 7 2000
Delivered-To: freebsd-bugs@freebsd.org
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21])
	by hub.freebsd.org (Postfix) with ESMTP id 004A637B85B
	for <freebsd-bugs@FreeBSD.org>; Thu,  3 Aug 2000 14:50:00 -0700 (PDT)
	(envelope-from gnats@FreeBSD.org)
Received: (from gnats@localhost)
	by freefall.freebsd.org (8.9.3/8.9.2) id OAA46399;
	Thu, 3 Aug 2000 14:50:00 -0700 (PDT)
	(envelope-from gnats@FreeBSD.org)
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
Reply-To: peter.jeremy@alcatel.com.au
To: FreeBSD-gnats-submit@freebsd.org, bug-gnu-utils@gnu.org
X-Send-Pr-Version: 3.2
Subject: gnu/20387: ld error messages refers to undocumented option --rpath
Sender: owner-freebsd-bugs@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.org


>Number:         20387
>Category:       gnu
>Synopsis:       ld error messages refers to undocumented option --rpath
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 03 14:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message