From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31891 invoked by alias); 19 Apr 2016 15:40:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31879 invoked by uid 89); 19 Apr 2016 15:40:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2551 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 19 Apr 2016 15:40:33 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2D777D0E0; Tue, 19 Apr 2016 15:40:31 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3JFeUNX013528; Tue, 19 Apr 2016 11:40:31 -0400 From: Pedro Alves Subject: Re: [PATCH 0/1] Build GDB as a C++ program by default To: Eli Zaretskii References: <1461000466-31668-1-git-send-email-palves@redhat.com> <571633C8.4060803@ericsson.com> <57163E3B.50101@redhat.com> <83d1pl8xje.fsf@gnu.org> <571648CD.7070705@redhat.com> <838u098vxk.fsf@gnu.org> Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org Message-ID: <5716516E.4020607@redhat.com> Date: Tue, 19 Apr 2016 15:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <838u098vxk.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00454.txt.bz2 On 04/19/2016 04:23 PM, Eli Zaretskii wrote: >> Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Tue, 19 Apr 2016 16:03:41 +0100 >> >> On 04/19/2016 03:48 PM, Eli Zaretskii wrote: >>>> From: Pedro Alves >>>> Date: Tue, 19 Apr 2016 15:18:35 +0100 >>>> >>>> MinGW (w64) builds and runs cleanly for me too. >>> >>> Did you look at what libraries it depends on? Doesn't it pull in >>> libgcc DLL and libstdc++ DLL? If it does, that'll put a huge damper >>> on those who make precompiled binaries of GDB available for Windows >>> users, because you need to accompany that with the full GCC source >>> tarball, which weighs in at more than 80MB. >> >> GDB links with libgcc even when built as a C program. > > Not here, it doesn't. It is linked statically against libgcc. I don't see how linking statically removes the requirement to provide access to sources. > (I > don't use MinGW64, but I don't think it matters.) Here's what > 'objdump -x | fgrep "DLL Name:"' says about the latest GDB 7.11 I > built: > ... > This is a build that (as you see) supports TUI, Python, and Guile, so > it's as full as it gets. I get, on a C++ gdb build: $ objdump -x gdb.exe | fgrep "DLL Name:" DLL Name: KERNEL32.dll DLL Name: msvcrt.dll DLL Name: libwinpthread-1.dll DLL Name: USER32.dll DLL Name: WS2_32.dll > >> How's C++ any different? > > With C, you can get away by using "CC='gcc -static-libgcc'" at > configure time, but can you do the same with -static-libstdc++? You shouldn't even need that. We already link with -static-libstdc++ -static-libgcc: x86_64-w64-mingw32-g++ -g -O2 -static-libstdc++ -static-libgcc -Wl,--stack,12582912 \ -o gdb.exe gdb.o armbsd-tdep.o arm.o arm-linux.o arm-linux-tdep.o arm-get-next-pcs.o arm-symbian-tdep.o armnbsd-tdep.o ... And we also link that way when building as a C program. We haven't done anything specific to have that on the gdb side, it comes from the top level somewhere, I think originally for GCC, long ago. Since GCC is already building this way for a long time, it should not be a problem for GDB either. Or at least if it is a problem, it's one you would already have with GCC. > I had > bad experience with that in the past (the binary still depended on > libstdc++ DLL), but maybe that was when building shared libraries, not > .exe programs. Thus my question (sorry, didn't yet have time to build > a recent development snapshot of GDB). Thanks, Pedro Alves