public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Re: Shared library without dependence on libgcc_s.so
@ 2008-06-06 15:09 Arne Steinarson
  0 siblings, 0 replies; only message in thread
From: Arne Steinarson @ 2008-06-06 15:09 UTC (permalink / raw)
  To: gcc

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

I tried inserting this into my make command (see below). Still I get
libgcc_s.so dependency (after rebuiling whole project).

We  really have this situation:

  EXE links to (lib_wx_base.so and lib_wx_net.so)
  lib_wx_net.so links to lib_wx_base.so

  lib_wx_base.so does _not_ depend on libgcc_s.so
  lib_wx_net.so does depend on libgcc_s.so

For some reason, when linking one shared library to another one, it
seems GCC throws in this dependency (contradictory to compiler
options). It doesn't understand that both of the shared libraries are
built against static libgcc.

Maybe I'll have to build the app 100% static...

Regards
// ATS.

Linker command:
g++ -shared -fPIC -o
/usr/src/wxSVN/wxWidgets/build-fwb-debug/lib/libwx_baseud_fwb_net-2.9.so.0.0.0
 netdll_fs_inet.o netdll_ftp.o netdll_http.o netdll_protocol.o
netdll_sckaddr.o netdll_sckfile.o netdll_sckipc.o netdll_sckstrm.o
netdll_socket.o netdll_url.o netdll_gsocket.o
-L/usr/src/wxSVN/wxWidgets/build-fwb-debug/lib -nodefaultlibs
-static-libgcc -lpthread -lgcc_eh -lgcc -lsupc++ -lc
-L/usr/src/wxSVN/wxWidgets/build-fwb-debug/lib
-Wl,-soname,libwx_baseud_fwb_net-2.9.so.0   -lz -ldl -lm
-lwxregexud_fwb-2.9  -pthread
-Wl,--version-script,/usr/src/wxSVN/wxWidgets/build-fwb-debug/version-script
-lz -ldl -lm  -lwx_baseud_fwb-2.9

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-06 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-06 15:09 Re: Shared library without dependence on libgcc_s.so Arne Steinarson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).