From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125779 invoked by alias); 18 Dec 2019 18:57:07 -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 125769 invoked by uid 89); 18 Dec 2019 18:57:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.3 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1730, H*RU:209.85.210.66, HX-Spam-Relays-External:209.85.210.66, enjoy X-HELO: mail-ot1-f66.google.com Received: from mail-ot1-f66.google.com (HELO mail-ot1-f66.google.com) (209.85.210.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2019 18:57:05 +0000 Received: by mail-ot1-f66.google.com with SMTP id h9so1125680otj.11 for ; Wed, 18 Dec 2019 10:57:05 -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=/FXmiys/LqXVyWREWOYwCt/zSLWNbIA90dgX7q+3VWs=; b=PqcBBXgqwCjbHNryp7am52OO98arByOgkKmbk18XzTySJvNHVApUMOml0OkgTezCwe GH87Z6qcIMhjqXR+dEFsxyu3T9AhU84wzWBmX4bxLh4Lp+JmKJHUjf9X+0yMTXbxHYPk AG1exb+NCaeor60GRa7Hip2ltiyH793kq4iG4ixccuML7tPeAs46Mv71JF40G102BG5g 6+4UhXYZyUekae58HYrW0ReCkFZGfuVyfcvPLnk1mQiyKuZebt6BMm5T2zcKh+YkMJfw grs26xfc6tPVQE4ymhMO+Gz1+NkWRwYIIkExGwVPSnTmqYlidnUeEOr31ZgBr3a7b/Or xqzA== MIME-Version: 1.0 References: <20191218181413.128412-1-cbiesinger@google.com> <83h81x323k.fsf@gnu.org> In-Reply-To: <83h81x323k.fsf@gnu.org> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Wed, 18 Dec 2019 18:57:00 -0000 Message-ID: Subject: Re: [PATCH] Link to -lssp when available (fixes mingw build) To: Eli Zaretskii Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00786.txt.bz2 On Wed, Dec 18, 2019 at 12:44 PM Eli Zaretskii wrote: > > > Date: Wed, 18 Dec 2019 12:14:13 -0600 > > From: "Christian Biesinger via gdb-patches" > > Cc: Christian Biesinger > > > > Recent mingw versions require -lssp when using _FORTIFY_SOURCE, which > > gdb does (in common-defs.h) > > https://github.com/msys2/MINGW-packages/issues/5868#issuecomment-544107564 > > > > gdb/ChangeLog: > > > > 2019-12-18 Christian Biesinger > > > > * configure: Regenerate. > > * gdbsupport/common.m4: Look for -lssp to fix mingw. > > This will produce a GDB binary that requires libssp-0.dll to be > present to run, won't it? And since libssp-0.dll is part of GCC, > this will have 2 annoying effects: > > . we could be in "DLL hell" if there's an incompatibility between > libssp against which GDB was linkes and the one actually installed > on the system where we run GDB; > > . if someone wants to distribute MinGW binaries of GDB, they will > have to distribute the GCC sources as well, since DLLs cannot > enjoy the libgcc-type exception That's a good point, I did not think of that. > Is there a way to link against libssp.a statically? If so, it would > be better to do that. Failing that, I'd recommend not to define > _FORTIFY_SOURCE in MinGW builds, because the above annoyances IMO > outweigh its utility. Looks like the way to do that would be -Wl,-Bstatic -lssp -Wl,-Bdynamic However, I'm not sure that all the required autoconf changes are worth it at this point, and maybe we should just not define _FORTIFY_SOURCE on mingw? I'll send a patch for that shortly. Christian