libtool
[Top][All Lists]
Advanced

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

Re: Convenieve libraries and applications.


From: Joe Orton
Subject: Re: Convenieve libraries and applications.
Date: Thu, 12 Aug 2004 10:13:53 +0100
User-agent: Mutt/1.4.1i

On Thu, Aug 12, 2004 at 12:09:10PM +0900, Peter O'Gorman wrote:
> There is no way to do what you want, at the moment, using libtool (to my 
> knowledge). "convenience" libraries are just treated as ordinary libraries 
> when creating an executable. I suggest that you reference the symbols in 
> the executable so that your linker will keep them around. If you want to 
> add this feature to libtool (it sounds like it may be useful)... send 
> patches.

I looked into this a while back: we need the same feature for Apache
httpd, and currently solve it by creating long list of dummy references
to symbols in convenience libraries to ensure they are all pulled in. 
(this bloats the executable significantly and it's really hacky to
create the lists)

A good solution I found seemed to be to use partial linking rather than
convenience libraries, which libtool was happy to do if you use:

libtool --mode=link gcc -o libpart.o some.lo random.lo objs.lo

But I don't know how portable ld -r is.  

(I don't know if it's actually OK/portable to assume that objects with
symbols not referenced from main MUST get pulled into an executable if
that object is passed on the link line, but we rely on that already)

joe







reply via email to

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