Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Aug 2000 07:39:08 +1000 (EST)
From:      peter.jeremy@alcatel.com.au
To:        FreeBSD-gnats-submit@freebsd.org, bug-gnu-utils@gnu.org
Subject:   gnu/20387: ld error messages refers to undocumented option --rpath
Message-ID:  <00Aug4.074043est.115686@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00Aug4.074043est.115686>