[Top][All Lists]

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

Re: Including static libraries in shared libraries with libtool.

From: Albert Chin
Subject: Re: Including static libraries in shared libraries with libtool.
Date: Sun, 26 Sep 2004 23:16:12 -0500
User-agent: Mutt/1.5.6i

On Sun, Sep 26, 2004 at 03:43:29PM -0700, Howard Chu wrote:
> Bob Friesenhahn wrote:
> >Using recent Automake, I find that I am able to eliminate use of 
> >convenience libraries by using a non-recursive build and referring to 
> >sources in subdirectories.  A simple Automake macro refers to all the 
> >objects which would be equivalent to a convenience "library".  Works 
> >great and avoids the overhead imposed by libtool since libtool must 
> >extract all the objects from the archive file prior to using them.
> One more time, shouting into the senseless void...
> If these so-called "convenience" libraries are meant to be linked in 
> whole, they should not be ar archives at all. You should just link them 
> directly into a relocatable object file:
>    ld -r -o <convenience.obj> *.o

Libtool currently uses this for piecewise linking, when the input
command-line is too long.

I believe this is portable. For sure, the following platforms support
  AIX 4.3.3, 5.x
  HP-UX 10.20, 11.x
  IRIX 6.5
  RH 7.1, 9; RHEL 2.1, 3
  Solaris 2.5.1-9
  Tru64 UNIX 4.0D, 5.x

On IRIX, ld(1) has the following:
     -r        Retains relocation entries in the output file.  Use of this
               option is strongly discouraged.

               Relocation entries must be saved if the output file is to
               become an input file in a subsequent ld run.  This option
               also prevents final definitions from being given to common
               symbols and suppresses the undefined symbol diagnostics.
               This option cannot be specified in conjunction with the
               -non_shared option; do not use them together on the same
               command line.

albert chin (address@hidden)

reply via email to

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