This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Shared library without dependence on libgcc_s.so
- From: "Paweł Sikora" <pluto at agmk dot net>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 06 Jun 2008 13:32:01 +0200
- Subject: Re: Shared library without dependence on libgcc_s.so
- Bounce-to: "Paweł Sikora" <pluto@agmk.net>
6/6/2008, "Arne Steinarson" <asteinarson@gmail.com> napisał/a:
>The shared libraries themselves still
>have a dependency on libgcc_s.so:
>
> $ ldd libwx_gtk2ud_fwb_core-2.9.so.0 | grep gcc
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6ee8000)
you can use the -nodefaultlibs and manually add what you want.
e.g. you can link a static stlport with static gcc stuff by:
(...) -nodefaultlibs -lstlport -lpthread -lgcc_eh -lgcc -lsupc++ -lc
and get e.g.:
$ ldd libExample.so
linux-vdso.so.1 => (0x00007fff775fe000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b3933a4e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b3933c53000)
libm.so.6 => /lib64/libm.so.6 (0x00002b3933e6e000)
libc.so.6 => /lib64/libc.so.6 (0x00002b39340ed000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
as you can see there're only deps to the core system libraries
and all these things related to the stl/gcc are linked in statically.
ps).
i'm using the stlport becuase libstdc++.a can't be linked
statically into shared libs -> http://gcc.gnu.org/PR28811