libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inter-library linking


From: Ralf Wildenhues
Subject: Re: inter-library linking
Date: Fri, 12 Oct 2007 18:47:00 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

* Joachim Worringen wrote on Fri, Oct 12, 2007 at 06:39:20PM CEST:
> Ralf Wildenhues wrote:
> 
> >Another general remark: convenience libraries don't enter the picture
> >here much; think of them as a short-hand notation for a collection of
> >objects that will all be copied into the final library.
> 
> Yes, I understand. The interesting thing in this context is that I can 
> link the convenience lib into my shared lib (as it has obviously been 
> built as PIC), but the static version of a library to be installed 
> (which thus exists as .a and .so) can *not* be linked into my shared lib 
> as it has obviously not been compiled as PIC. What is the rationale 
> behind not generating PIC for the static version of a library, while the 
> shared one needs this anyway?

Efficiency: non-PIC code executes faster; whether the difference is
marginal or rather noticeable depends a lot on the code in question.

> >1) Explicit linkage of libshared against libfoo should cause the runtime
> >linker to pull it in:
> >   lib_LTLIBRARIES = libfoo.la libshared.la
> >   libshared_la_LIBADD = libfoo.la
> >   libfoo_la_SOURCES = ...
> >   ...
> >
> >If that's what you already did, but it's producing errors anyway, then
> >please post a build log that contains the mode=link and mode=install
> >commands for both of these libraries plus all output they generate,
> >and the error output of the `LD_PRELOAD=...' command.
> 
> I did this - I will re-iterate and post the log.

Good, because I don't yet see why this doesn't work.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]