GNU bug report logs - #8503
Multiple definition errors when statically linking libstdc++

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: libtool; Reported by: Nathan Sharp <nsharp@HIDDEN>; dated Fri, 15 Apr 2011 00:24:01 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Apr 2011 00:23:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 14 20:23:04 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QAWoR-0007KJ-Bp
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2011 20:23:04 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnt-0007Iz-GS
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2011 20:22:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnn-0004K6-I6
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2011 20:22:24 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
	autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:52310)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnn-0004K2-GT
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2011 20:22:23 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56024)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnm-0005gP-Nf
	for bug-libtool@HIDDEN; Thu, 14 Apr 2011 20:22:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnl-0004Js-MJ
	for bug-libtool@HIDDEN; Thu, 14 Apr 2011 20:22:22 -0400
Received: from blacksburg.phoenix-int.com ([216.252.204.129]:35822
	helo=spyder.phoenix-int.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nsharp@HIDDEN>) id 1QAWnl-0004Jl-Jy
	for bug-libtool@HIDDEN; Thu, 14 Apr 2011 20:22:21 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by spyder.phoenix-int.com (Postfix) with ESMTP id 618D18CF8050
	for <bug-libtool@HIDDEN>; Thu, 14 Apr 2011 20:22:20 -0400 (EDT)
X-Virus-Scanned: amavisd-new at spyder.phoenix-int.com
Received: from spyder.phoenix-int.com ([127.0.0.1])
	by localhost (spyder.phoenix-int.com [127.0.0.1]) (amavisd-new,
	port 10024) with ESMTP id VBZo1r1cujHo for <bug-libtool@HIDDEN>;
	Thu, 14 Apr 2011 20:22:19 -0400 (EDT)
Received: from spyder.phoenix-int.com (spyder.phoenix-int.com [10.10.10.25])
	by spyder.phoenix-int.com (Postfix) with ESMTP id 5017A8CF8042
	for <bug-libtool@HIDDEN>; Thu, 14 Apr 2011 20:22:19 -0400 (EDT)
Date: Thu, 14 Apr 2011 20:22:19 -0400 (EDT)
From: Nathan Sharp <nsharp@HIDDEN>
To: bug-libtool@HIDDEN
Message-ID: <1003573595.106584.1302826939236.JavaMail.root@HIDDEN>
In-Reply-To: <126862491.106574.1302825724358.JavaMail.root@HIDDEN>
Subject: Multiple definition errors when statically linking libstdc++
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.10.10.50]
X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0
	(Linux)/6.0.10_GA_2692)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -6.6 (------)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 14 Apr 2011 20:23:01 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.6 (------)

Libtool is adding on libstdc++.dll.a, even when -static-libstdc++ option is specified.

We are building a DLL on Windows XP using MinGW.  Due to what appears to be a performance bug in MinGW, we'd like to statically link libstdc++.  Attempting to use CXXFLAGS="-static-libstdc++" seems to get very close to working, but libtool tries to link on libstdc++.dll.a even with this flag set and we end up getting errors such as:

C:/MinGW/lib/gcc/mingw32/4.5.2\libstdc++.a(sstream-inst.o):(.text$_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev[std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()]+0x0): multiple definition of `std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
C:/MinGW/lib/gcc/mingw32/4.5.2/libstdc++.dll.a(d002250.o):(.text+0x0): first defined here

I found that passing -all-static to libtool fixes the problem.  However, -all-static is not a valid g++ option, and I can't figure out how to pass an option just to libtool and not to g++ from configure.  I'm currently working around this (incorrectly) by adding the option to Makefile.am under progname_LDFLAGS.

Why shouldn't libtool drop libstdc++.dll.a from the arguments to the linker when -static-libstdc++ is present, though?  

libtool 2.4
g++ 4.5.2

Thanks!
  Nathan


------------------------------------------------ 
Nathan Sharp 
Phoenix Integration Inc 
www.phoenix-int.com 







Acknowledgement sent to Nathan Sharp <nsharp@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-libtool@HIDDEN:
bug#8503; Package libtool. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.