Re: libgcc_s dependency when linking with -shared

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

 



ejohanson <epj@xxxxxxxxxxxxxxxx> writes:

> I have a 3rd party library that doesn't want to play nice with libgcc_s.so. 
> My problem is that I need to link my application as a shared .so module, but
> as soon as you do that with "gcc -shared", the resulting .so becomes
> dependent on libgcc_s.so (as revealed by ldd).
> 
> I am currently using gcc 3.3.2 on Solaris 8 X86 Intel machine.  I have tried
> gcc 3.4.2 with the same results.  I tried gcc 2.95.3 but the third party
> library uses C++ STL and it won't link at all when using gcc 2.95.
> 
> Is there a way I can get gcc to create a shared library .so module that does
> NOT depend on libgcc_s.so?

Use the -static-libgcc option.

Note that this will have certain consequences: you won't be able to
throw exceptions across shared library boundaries.  In particular, you
won't be able to catch an exception thrown in -lstdc++ in your main
application.

Ian

[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