> Date: Wed, 16 Jul 2025 11:12:44 +0100
> Cc: gcc <gcc@gcc.gnu.org>, gcc-help <gcc-h...@gcc.gnu.org>
> From: Jonathan Wakely via Gcc <gcc@gcc.gnu.org>
> 
> On Wed, 16 Jul 2025 at 10:06, Qifan.Zhou via Gcc <gcc@gcc.gnu.org> wrote:
> >
> > Dear GCC Team,
> 
> Please don't email both gcc@gcc.gnu.org and gcc-h...@gcc.gnu.org, pick
> the appropriate one. You're not discussing development of GCC so this
> belongs on the gcc-help list.
> 
> Anyway ...
> 
> > I hope this message finds you well. I'm writing to seek official 
> > clarification regarding the use of GCC compilers in our proprietary, 
> > closed-source commercial software development.
> > Our specific use case involves:
> >
> >   1.
> > Using GCC executables (gcc.exe<https://gcc.exe/>, g++.exe, etc.) to compile 
> > and link our C/C++ source code
> >   2.
> > Dynamically linking to GCC runtime libraries (libstdc++, libgcc, etc.)
> >   3.
> > Potential distribution of our compiled binaries to customers without source 
> > code
> >
> > Based on our understanding of the GPL and LGPL licenses:
> >
> >   *
> > We believe that simply using GCC to compile our software doesn't require us 
> > to open-source our code
> >   *
> > Dynamic linking to LGPL-licensed runtime libraries appears permissible for 
> > proprietary software
> >   *
> > However, we want to ensure full compliance with all licensing requirements
> 
> Nobody on this list is going to give you legal advice. You should read
> https://www.gnu.org/licenses/gcc-exception-3.1-faq.html
> 
> Quoting from that document:
> "However, the FSF decided long ago to allow developers to use GCC's
> libraries to compile any program, regardless of its license."
> "Therefore, these libraries have always had license exceptions that
> allow people to distribute the object code GCC produces under any
> license."

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.

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.  Whether this means the source code of the
compiled program must also be made available, I don't know.

Reply via email to