public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Dave Korn <dave.korn.cygwin@gmail.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	Mike Stump <mikestump@comcast.net>,
	       gcc-patches@gcc.gnu.org
Subject: Re: PATCH RFA: Build system: Check for -static-libstdc++
Date: Wed, 03 Nov 2010 21:52:00 -0000	[thread overview]
Message-ID: <mcr8w1ajcx9.fsf@google.com> (raw)
In-Reply-To: <4CD1D9D4.8010503@gmail.com> (Dave Korn's message of "Wed, 03 Nov	2010 21:53:24 +0000")

Dave Korn <dave.korn.cygwin@gmail.com> writes:

>   Yes, but what about the _usual_ difficulties of having two independent
> copies of a library linked into the same executable?  We may not be using
> new/delete or throwing exceptions in the compiler just yet, but it still looks
> really like an accident waiting to happen to me.
>
>   For example: suppose there's a pair of functions in gmpxx or ppl or cloog,
> called from the middle-end of the go1 executable, that allocate and deallocate
> some object or other; suppose the allocate function is an extern, prototyped
> in the related lib's header file, but the deallocator is inline; go1 calls the
> allocater, which invokes the system libstdc DSO's operator new; then go1 calls
> the deallocater, which gets inlined, and ends up invoking the
> statically-linked libstdc's operator delete.  Couldn't that happen?

I don't think that can happen for libraries explicitly mentioned on the
link line.  The linker will see the reference in the shared library, and
will pull in the function from the statically linked libstdc++.

For what it's worth, on my Ubuntu system I do not see any references to
libstdc++.so from the system libgmp, libmpfr and libmpc libraries.  So
the references are presumably coming from PPL, and we already have
special configure options to handle the difficulties which arise in that
case.  I think it's fine to continue requiring those configure options,
as long as the default works in a way that people find easy to use.

Ian

      reply	other threads:[~2010-11-03 21:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03  4:39 Ian Lance Taylor
2010-11-03  6:12 ` Ralf Wildenhues
2010-11-03 14:31   ` Ian Lance Taylor
2010-11-03 19:26     ` Ralf Wildenhues
2010-11-03 17:36 ` Mike Stump
2010-11-03 17:44   ` Ian Lance Taylor
2010-11-03 18:32     ` H.J. Lu
2010-11-03 18:56       ` Ian Lance Taylor
2010-11-03 21:10         ` Richard Guenther
2010-11-03 21:37           ` Ian Lance Taylor
2010-11-03 21:30         ` Dave Korn
2010-11-03 21:52           ` Ian Lance Taylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcr8w1ajcx9.fsf@google.com \
    --to=iant@google.com \
    --cc=dave.korn.cygwin@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=mikestump@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).