Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <palves@redhat.com>
Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 0/1] Build GDB as a C++ program by default
Date: Tue, 19 Apr 2016 15:59:00 -0000	[thread overview]
Message-ID: <834max8u8z.fsf@gnu.org> (raw)
In-Reply-To: <5716516E.4020607@redhat.com> (message from Pedro Alves on Tue,	19 Apr 2016 16:40:30 +0100)

> From: Pedro Alves <palves@redhat.com>
> Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org
> Date: Tue, 19 Apr 2016 16:40:30 +0100
> 
> >> 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.

It does, because there's a special clause for that in the L?GPL, whch
only holds for static linking.

> 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

Then there's no problem, and I apologize for the noise.  I thought
your previous message meant that there was a dynamic dependency on
libstdc++ DLL, sorry for my misunderstanding.

> >> 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:

IME, programs that use libtool cannot easily do that, because libtool
removes any switches it doesn't know about from the GCC command line.

> 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.

Good, then the problem I feared doesn't really exist.  Thanks for
clearing that up.

> 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 see too many precompiled binaries out there that depend on libgcc
DLL.  Most people think it is not a problem, so we don't hear any
complaints.  So the fact that GCC builds this way is in itself not an
evidence the problem doesn't exist.  For someone like myself, who
tries to be 100% GPL compatible with the binaries I make available,
having a GCC dependency is a huge downside, so I go an extra mile to
avoid that.

Once again, I'm happy to know there' no such problem with GDB.


  reply	other threads:[~2016-04-19 15:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 17:27 Pedro Alves
2016-04-18 17:27 ` [PATCH 1/1] " Pedro Alves
2016-04-19  7:34   ` Yao Qi
2016-04-19 13:34 ` [PATCH 0/1] " Simon Marchi
2016-04-19 14:18   ` Pedro Alves
2016-04-19 14:48     ` Eli Zaretskii
2016-04-19 15:03       ` Pedro Alves
2016-04-19 15:23         ` Eli Zaretskii
2016-04-19 15:40           ` Pedro Alves
2016-04-19 15:59             ` Eli Zaretskii [this message]
2016-04-19 16:20               ` Pedro Alves
2016-04-19 16:31               ` Eli Zaretskii
2016-04-19 15:41       ` Simon Marchi
2016-04-19 16:32         ` Eli Zaretskii
     [not found]     ` <AC542571535E904D8E8ADAE745D60B19445B1C11@IRSMSX104.ger.corp.intel.com>
     [not found]       ` <5716425B.3050707@intel.com>
     [not found]         ` <57164325.8020408@redhat.com>
2016-04-19 15:20           ` Walfred Tedeschi
2016-04-20 19:56             ` Pedro Alves
2016-04-20 22:16               ` Pedro Alves
2016-04-21 15:18               ` John Baldwin
2016-04-21 16:41                 ` Pedro Alves
2016-04-19 15:47     ` Simon Marchi
2016-04-19 15:50       ` Pedro Alves
2016-04-20 22:27     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834max8u8z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox