On Wed, 16 Jul 2025 at 15:59, Eli Zaretskii <e...@gnu.org> wrote:
>
> > From: Jonathan Wakely <jwakely....@gmail.com>
> > Date: Wed, 16 Jul 2025 15:08:50 +0100
> > Cc: qifan.z...@xpeedic.com, gcc@gcc.gnu.org
> >
> > > > AFAIU, this is accurate if libgcc and libstdc++ are linked statically,
> > > > but not if the program is linked to their DLL versions (and therefore
> > > > the DLLs must be distributed with the resulting program).  In the
> > > > latter case, the LGPL exception doesn't apply, and distributing these
> > > > DLLs falls under GPL instead.
> > >
> > > Those libraries are not licensed with the LGPL so I don't know what
> > > that has to do with anything.
> >
> > And the GCC runtime exception makes no distinction between static and
> > dynamic linking.
>
> That's not what RMS told me when I asked him some time ago.  He said
> that, since libgcc DLL and libstdc++ DLL are basically separate files
> and thus separate builds of the libraries, the run-time exception you
> pointed to is not applicable to them.  Quoting his response back then:
>
>   There is nothing in this exception that would permit distribution
>   of libgcc itself -- as a separate file -- other than under the GPL.
>
> (By "this exception" he alluded to the libgcc run-time exception.)

Ah right, I thought you were saying that the software compiled with
GCC would be covered by the GPL (and you do seem to be saying that
below?). I agree that distributing the libstdc++ libs themselves
requires following the GPL, but only for those libs. Not the code that
links to them.

So if you distribute libstdc++.so you need to provide the source for
libstdc++ to anybody that asks for it. But that's doesn't affect your
own code, which is unaffected by the GPL whether you link statically
or dynamically.

>
> > Please stop giving bad advice and direct people to read the
> > appropriate documentation.
>
> Why the animosity?  I'm trying to help the OP understand the situation
> about which they asked.

Well they didn't ask about distributing the DLLs :-)

>
> Please respect opinions of others and don't assume that differing
> opinions mean bad advice.  I'm talking from experience of distributing
> many programs built with MinGW and linked against those libraries.
>
> > > > Since linking to these libraries statically is not recommended,
> > > > especially if the program is a C++ program, the above means in
> > > > practice that the two libraries, if a program is linked to them
> > > > dynamically, impose GPL.
> >
> > This is absolutely wrong.
>
> Not AFAIK, see above.

The libraries themselves are licensed under the GPL, not the program
that links to them.

Reply via email to