From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121623 invoked by alias); 18 Dec 2019 20:41:22 -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 121613 invoked by uid 89); 18 Dec 2019 20:41:22 -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,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Google-Smtp-Source:APXvYqwB, H*RU:209.85.210.65, HX-Spam-Relays-External:209.85.210.65, HX-HELO:sk:mail-ot 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; Wed, 18 Dec 2019 20:41:20 +0000 Received: by mail-ot1-f65.google.com with SMTP id h20so4060728otn.5 for ; Wed, 18 Dec 2019 12:41:20 -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=+94cd5wWkbbrsSbeA6LhA/XyE1ZTmMHz+9QOzKl32yo=; b=N62iWtRwv69iAiP9AyH9xR0XZVki1SKc+6f9btAgIHvN3ALJLj7s4z7gg8mEOnpDp5 QSTAi5/nUaBEaZ3MV4bQvj/zXYkywn7hjONGDtLi3HKP08EEjsGKv5FG7rvlbzvX/Y0H cM4BgctEA01Y2KF3biW0CTEg0G8XVNxqLLuwmSgIiPG86SAJMr7JOuFlHayjcZHOy/aJ IZtbcYqAGYhxMK+FpUHPm/jHVYI5SuQkiql+wDXMXf7KurnD/ewY16wj7Wtpk2w2RcgC mq/1cQk02FUxRNMfB0adD7Ec3M/H30J19JDunY8ikXbaTIImc+uxOhCxet0ScJQlcCIO ZdEw== 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> In-Reply-To: <83d0cl2yqd.fsf@gnu.org> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Wed, 18 Dec 2019 20:41: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/msg00795.txt.bz2 On Wed, Dec 18, 2019 at 1:57 PM Eli Zaretskii wrote: > > > From: Christian Biesinger > > Date: Wed, 18 Dec 2019 13:50:00 -0600 > > Cc: gdb-patches > > > > Hmm, yeah, you are right. But it doesn't work! > > $ g++ test.cc -O2 -lssp_nonshared > > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: > > C:\msys64\tmp\ccmAuUCu.o:test.cc:(.text.startup+0x1f): undefined > > reference to `__strcpy_chk' > > collect2.exe: error: ld returned 1 exit status > > AFAIK, you need to link with -lssp_nonshared -lssp. My GCC's specs > have this: > > *link_ssp: > %{fstack-protector|fstack-protector-all|fstack-protector-strong|fstack-protector-explicit:-lssp_nonshared -lssp} Ah ok, so that doesn't help us. > > So I guess that's actually for something else? I think > > https://sourceware.org/ml/gdb-patches/2019-12/msg00787.html is the > > best option. > > I agree, FWIW. OK, sounds good. 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? My msys2/mingw64 gcc depends on these DLLs outside of SYSTEM32: libpython3.8.dll => /mingw64/bin/libpython3.8.dll (0x70840000) libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x64940000) libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x61440000) libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x6fc40000) Christian