From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76639 invoked by alias); 19 Dec 2019 20:41:15 -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 76630 invoked by uid 89); 19 Dec 2019 20:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.2 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Received:sk:x12mr10 X-HELO: mail-ot1-f65.google.com Received: from mail-ot1-f65.google.com (HELO mail-ot1-f65.google.com) (209.85.210.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Dec 2019 20:41:13 +0000 Received: by mail-ot1-f65.google.com with SMTP id p8so8754715oth.10 for ; Thu, 19 Dec 2019 12:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lmnuUbgL0TS3BiixVVLXs8c/14m6mOph6JAnZjR+boQ=; b=Ivf6a8pjQw9H6KLRh6LwrVtPiSHom8LY41SoO3w1P88glGWRgn4d44jqraMmajj4rQ u2YlsiRGh0aKGSAdSBGTSoK078vry5xEm77J97ralHuZCcECpz/Is7r2s6xQNV9PywAZ 16fg5Vzo8MNSHLIBu0dkaaT7KWmaCNrntzcot/Zb5zjg4VfWGdhwVP3PRi73gBqxqf7X SqOAf2U8p9Bb6aT+6uMi7nfNygwfxWxqBd6JubXApws8lQZT3i/FF9kWbIdb4uw/tcNt 6kig7PqDKQu22G7ziO3zb2OxbApO6mINGqkhSxoMt9wZgmHN69CyRHIbW7ULZ5IVLEt8 BWgw== MIME-Version: 1.0 References: <20191218181413.128412-1-cbiesinger@google.com> <83h81x323k.fsf@gnu.org> <83fthh310d.fsf@gnu.org> <83eex12zj1.fsf@gnu.org> <83d0cl2yqd.fsf@gnu.org> <83bls52w6e.fsf@gnu.org> <6f19911a-405e-77b5-e543-4fbb8ee80d8a@redhat.com> In-Reply-To: <6f19911a-405e-77b5-e543-4fbb8ee80d8a@redhat.com> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Thu, 19 Dec 2019 20:41:00 -0000 Message-ID: Subject: Re: [PATCH] Link to -lssp when available (fixes mingw build) To: Pedro Alves Cc: Eli Zaretskii , gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00840.txt.bz2 On Thu, Dec 19, 2019 at 8:19 AM Pedro Alves wrote: > > On 12/18/19 11:23 PM, Christian Biesinger via gdb-patches wrote: > > On Wed, Dec 18, 2019 at 5:12 PM Eli Zaretskii wrote: > >> > >>> From: "Christian Biesinger via gdb-patches" > >>> Date: Wed, 18 Dec 2019 14:40:42 -0600 > >>> Cc: gdb-patches a lot of > >>> > >>> BTW -- you mentioned a licensing issue with depending on DLLs. Doesn't > >>> libstdc++ and perhaps others have the same issue? Or does mingw.org > >>> link it statically? > >> > >> libstdc++ and libgcc DLLs indeed have the same problem. Which is why > >> I mentioned the fact that the binary of GDB 9.0.90 produced by the > >> MinGW build had dependencies on these two. I solved that locally by > >> linking with "CXX='g++ -static-libstdc++ -static-libgcc'", but I > >> thought Pedro once said these dependencies shouldn't happen, and I > >> still hope we could understand why they suddenly appeared. > > > > Hm, I wonder why Pedro said that. GDB uses good amounts of the C++ > > standard library, so I would totally expect libstdc++ to appear. > > There's some confusion going on here. We must certainly link with > libstdc++ somehow. The only question is whether we link to the > dynamic or static version. What I've said in the past is that GDB > inherited the -static-libstdc++ and -static-libgcc from GCC, due to > the shared top level configure: > > https://sourceware.org/ml/gdb-patches/2019-07/msg00040.html > > Linking with static versions of the runtime is problematic if we also link > with some other library that is itself linked with a different libstdc++. > Multiple versions of libstc++/libgcc in a program is a recipe for disaster, > such as for example C++ exceptions not working properly. Discussions about > this started a few years ago when we switched to C++. E.g.: > > https://sourceware.org/ml/gdb-patches/2017-02/msg00705.html > > That is why the top level configure was recently changed to avoid the > -static-libstc++/-static-libgcc: > > https://gcc.gnu.org/ml/gcc-patches/2019-08/msg00287.html > > Note that the patch added a new --with-static-standard-libraries > configure switch which you can use to get back the previous behavior > of linking with the static versions of the standard libraries. > > I think a NEWS entry for that switch would be helpful, though. > > > I don't really know what libgcc is used for. > > libgcc is GCC's low-level runtime library. It's an essential part > of any program compiled by GCC: > https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html Thanks for the detailed explanation! Christian