From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9806 invoked by alias); 29 Jun 2009 15:12:40 -0000 Received: (qmail 9746 invoked by uid 48); 29 Jun 2009 15:12:26 -0000 Date: Mon, 29 Jun 2009 15:12:00 -0000 Message-ID: <20090629151226.9745.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dave dot korn dot cygwin at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg02107.txt.bz2 ------- 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