This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/21277] Runtime error with C++ shared library and --disable-shared
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2005 09:54:38 -0000
- Subject: [Bug target/21277] Runtime error with C++ shared library and --disable-shared
- References: <20050429073316.21277.info@yourkit.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ebotcazou at gcc dot gnu dot org 2005-05-02 09:54 -------
> There's absolutely nothing illegal in static linking with a shared library
> other libraries that it uses. The intention is to make resulting shared
> library loadable on every target machine with no regard to availablity of
> shared libraries, and make the library as small as possible.
Indeed, except that if the static libraries are not compiled with -fPIC, your
shared library is only shared on disk, not in memory.
> The approach works fine for 32 bit on Solaris. And it is definetely a bug that
> it doesn't do so for 64 bit.
It works only by accident in 32-bit mode; it would fail if the R_SPARC_WDISP30
relocation was slightly different. And, again, not using a shared libgcc on
Solaris means that exceptions cannot be propagated across shared libraries;
that's why g++ automatically passes -shared-libgcc on Solaris.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21277