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]

egcs & Dynamic Libraries


I would like to migrate our project from SparcWorks compiler to
egcs-1.1b.

For that, I have to create some dynamic libraries (.so).
I do the following compilation command:

g++ -c -g -fpic foo.cc

1°/ Should I prefer -fPIC to -fpic ? What are the differents meanings ?

[generating the library]

g++ -g -shared -o foo.so foo.o

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 ?!

3°/ How can I write the compilation command to produce the desired
executable.
     Using the foo.so library.
     For Solaris, I would like, of course, to only set the
LD_LIBRARY_PATH.
     For Linux, a new entry in /etc/ld.conf.

g++ -o foo ......????


--
Jean-Michel Paris - Software Engineer
SITA Group http://www.sita.int
Internetworking Products & Services Program
Bât Héraklion - 1041 Route des Dolines
Sophia Antipolis
06560 VALBONNE - FRANCE
mailto:Jean-Michel.Paris@pt.nce.sita.int





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