Is it safe to use "-shared-libgcc" when building a shared library with gcc ?

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

 



Hi,

gcc allows me to create a shared library and still statically link libgcc but is that a safe thing to do ?

Often, statically linking code into a shared library is unsafe because the code in the static library is not position independent. Does the static version of libgcc contain position independent code ?

My command line is below for reference. Ignore the fact that the output library is also supplied as a -l to the linker, that is a quirk of the makefiles used.

     gcc -static-libgcc -shared -fPIC -Wl,+h -Wl,libdb-4.5.sl -Wl,+b -Wl,/usr/local/BerkeleyDB.4.5/lib -o .libs/libdb-4.5.sl <list of object files> -lpthread -lc


Thanks,

Duncan.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux