This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: egcs & Dynamic Libraries


On Tue, Oct 13, 1998 at 05:07:56PM +0200, Jean-Michel Paris wrote:
> 1°/ Should I prefer -fPIC to -fpic ? What are the differents meanings ?

-fpic assumes that a small number of dynamic symbols (for some machine-
dependant definition of small) will be required in the resulting library.
-fPIC does not.  This may affect the number of instructions needed to load
a symbol's address.  In the case of Sparc this is 3 insns for -fPIC and
1 for -fpic.

Generally you can use -fpic until your library grows large enough that
you get relocation overflow errors from the linker.

> 2°/ Doing that on a little example, the library size go from 15kb
> (static .a) to 350Kb. I suppose this
> overhead is due to some dynamic resolution ?!

Configuring egcs with --enable-shared will build libstdc++ shared,
so that it does not get included in your library image.

> 3°/ How can I write the compilation command to produce the desired
> executable.

Um, like using any other library?  What are you asking?


r~


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