This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Enable PIC for mips*-*-*


On Mon, 19 Nov 2001, H . J . Lu wrote:

> libtool should do whatever ld does. When I do
> 
> # gcc -shared -o libfoo.so foo.o -lbar
> 
> and there is only libbar.a, no libar.so, ld won't put references to
> libbar.a in libfoo.so. I don't want libtool to put any references to
> libbar.a in libfoo.la either, at least not under Linux.

 You need a libbar.a reference in libfoo.la since the file serves for both
libfoo.so and libfoo.a.  While the in case of ELF/Linux the former does
record shared objects it depends on in its dynamic section, the latter
definitely does not and libbar.a must be linked against explicitly when
linking programs statically.

 And libbfd.a is built as a part of binutils compilation process and may
get installed, so what I wrote above is not necessarily irrelevant.  There
is another problem, actually, namely the dependency for libbfd looks as
follows in "/usr/lib/libbfd.la" (on my system): 

# Libraries that this one depends upon.
dependency_libs=' -L/home/macro/src/redhat/BUILD/binutils/libiberty/pic 
-liberty'

which is ugly as "/home/macro/src/redhat/BUILD/binutils/libiberty/pic" is
not going to exist anymore once compilation finished.  Accidentally this
isn't fatal, as I have "/usr/lib/libiberty.a" installed so programs will
link, but it isn't guaranteed to work either. 

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]