Subject: Re: "-Ldir -lname" vs. "dir/"
To: Johnny Lam <>
From: Frederick Bruckman <>
List: tech-toolchain
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:
> 	/usr/pkg/lib/
> Is there a difference between the following commands?
> (a) ld -Bshareable -o bar.o -R/usr/pkg -L/usr/pkg -lfoo
> (b) ld -Bshareable -o bar.o -R/usr/pkg /usr/pkg/

On a.out/m68k, if you list "-lfoo -lbaz" on the command line, the
linker fails to resolve symbols in "" which are defined
in "", 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