This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
- From: "dave dot korn dot cygwin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2009 15:12:26 -0000
- Subject: [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
- References: <bug-24196-7246@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #20 from dave dot korn dot cygwin at gmail dot com 2009-06-29 15:12 -------
I think the best solution to this problem is to enable libstdc++ as a DLL, and
export _S_empty_rep from it. Then every C++ DLL and EXE will link against
libstdc++ and they'll all import the exact same instance. Problem solved *and*
we get to keep the optimisation. The more difficult problem of windows
shared-libraries not allowing undefined references (and how this interacts with
RTTI and COMDATs in particular) is a larger issue which will need to be tackled
separately.
I'm about to test a patch based on this approach.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196