Subject: Re: "-Ldir -lname" vs. "dir/libname.so"
To: Johnny Lam <firstname.lastname@example.org>
From: Frederick Bruckman <email@example.com>
Date: 03/12/2002 18:21:33
On Tue, 12 Mar 2002, Johnny Lam wrote:
> Similarly, on an a.out system, suppose I have the following files:
> Is there a difference between the following commands?
> (a) ld -Bshareable -o libbar.so.0.0 bar.o -R/usr/pkg -L/usr/pkg -lfoo
> (b) ld -Bshareable -o libbar.so.0.0 bar.o -R/usr/pkg /usr/pkg/libfoo.so.0.0
On a.out/m68k, if you list "-lfoo -lbaz" on the command line, the
linker fails to resolve symbols in "libbaz.so.?.?" which are defined
in "libfoo.so.?.?", so in that case, you're evidently supposed to do
"-lfoo -lbaz -lfoo". Software designed on ELF platforms never bothers
to do that, so it must not be a problem for them. "(b)" on the other
hand, seems to just work on all platforms.
> I am trying to solve a problem involving the use of libtool in pkgsrc.
> It's unclear to me if directly naming the shared library in (b) will always
> work while the use of "-Ldir -lname" in (a) is generally accepted across
> most compilers.
Try building "devel/oaf" on a.out. There's an open PR on that