Subject: "-Ldir -lname" vs. "dir/libname.so"
To: None <tech-toolchain@netbsd.org>
From: Johnny Lam <jlam@jgrind.org>
List: tech-toolchain
Date: 03/12/2002 15:04:02
On an ELF system, suppose I have the following files:

	/usr/pkg/lib/libfoo.so
	/usr/pkg/lib/libfoo.so.0
	/usr/pkg/lib/libfoo.so.0.0

Is there a difference between the following commands?

(a) cc -o libbar.so.0.0 bar.o -Wl,-R/usr/pkg -L/usr/pkg -lfoo
(b) cc -o libbar.so.0.0 bar.o -Wl,-R/usr/pkg /usr/pkg/libfoo.so

Similarly, on an a.out system, suppose I have the following files:

	/usr/pkg/lib/libfoo.so.0.0

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

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.  So will (b) always work when using GCC, or only when
using NetBSD?  I've tried querying the libtool mailing list, but I've not
heard any response yet.

	Thanks,

	-- Johnny Lam <jlam@jgrind.org>