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

Re: maserver: Dynamic libraries inside a program package



On Sun, Feb 06, 2005 at 05:15:07PM +0100, Miriam Ruiz wrote:
>  --- Justin Pryzby <justinpryzby@users.sourceforge.net> escribió: 
> > On Sun, Feb 06, 2005 at 07:36:42AM +0100, Miriam Ruiz wrote:
> > > Yep, you were right, I had to link all the
> > objects.
> > > Thanks for the clue!! :)
> > Cool; can you give us a comparison of the relative sizes of the
> > packages?  Compiling statically, dynamically, and
> >
> static-for-the-exe-but-nothing-else-linked-to-the-library?
> > 
> > Cheers, -- Justin Pryzby
> 
> Of course, there goes the numbers:
Good you saved a 10k:).  Really, though, you saved yourself a few
files, which is nice.

You might be interested in the --whole-archive option to ld (see its
manpage for details).  It is often used to make a shared library from
a static one, and this use is discouraged (read: "forbidden").  But I
think you might have a legitimate use for it; if the upstream build
system likes to create a library, you can modify just the creation of
the executable to include the entire library (instead of what would
potentially be a messy hack to include all of the files inside it,
since linking to it as a library only includes the necessary symbols).

Note also that if you are not making a shared library, you should not
be compiling with -fPIC.  That means all of the code included into the
executable.  The .so plugins *must* be compiled -fPIC.  See policy for
details.

Cherio,
Justin



Reply to: