From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3369 invoked by alias); 20 Feb 2003 16:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3354 invoked by uid 71); 20 Feb 2003 16:46:01 -0000 Date: Thu, 20 Feb 2003 16:46:00 -0000 Message-ID: <20030220164601.3352.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: libstdc++/9776: -static-libgcc does not produce a static link to libstdc++, instead always dynamic Reply-To: Phil Edwards X-SW-Source: 2003-02/txt/msg00997.txt.bz2 List-Id: The following reply was made to PR libstdc++/9776; it has been noted by GNATS. From: Phil Edwards To: stew@tenbox.com Cc: gcc-gnats@gcc.gnu.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@tenbox.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