This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/9776: -static-libgcc does not produce a static link to libstdc++, instead always dynamic
- From: Phil Edwards <phil at jaj dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 20 Feb 2003 16:46:01 -0000
- Subject: Re: libstdc++/9776: -static-libgcc does not produce a static link to libstdc++, instead always dynamic
- Reply-to: Phil Edwards <phil at jaj dot com>
The following reply was made to PR libstdc++/9776; it has been noted by GNATS.
From: Phil Edwards <phil at jaj dot com>
To: stew at tenbox dot com
Cc: gcc-gnats at gcc dot gnu dot org
Subject: Re: libstdc++/9776: -static-libgcc does not produce a static link to libstdc++, instead always dynamic
Date: Thu, 20 Feb 2003 11:44:39 -0500
On Thu, Feb 20, 2003 at 04:30:56PM -0000, stew at tenbox dot com wrote:
>
> I worry that maybe I am confused about what -static-libgcc does; maybe it
> is not supposed to make the link to libstdc++ static.
It isn't. If you'll look at your ldd output, you'll see that no dependency
on libgcc_s.so was recorded. That's why the option is called -static-libgcc,
not -static-libstdc++.
> If not, then I
> would suggest that such an option is very needed - it is not often
> reasonable that the user have the precise same version of the C++ runtime
> library as you.
There doesn't need to be a special switch for this. The way to override
the choice of libraries is somewhat linker-specific, but something like
g++ .... -lfoo -lbar -Wl,-static -lstdc++ -lquux -Wl,-dynamic -lbaz
will (assuming dynamic libs are the default choice) use libfoo.so, libbar.so,
and libbaz.so, but libstdc++.a and libquux.a. The spellings of "-static"
and "-dynamic" are up to the linker you're using, so "man ld". On Solaris
it's something like -Bstatic and -Bdynamic.
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002