Hello,
A user of GBDK-2020 has posed a question about licensing which may apply to both the SDCC and GBDK sources in the (GBDK) libraries.
For simplicity, lets focus on the SDCC library sources.
If a SDCC library source is modified, then compiled and linked in to an executable, how does the Linking Exception apply to those changes?
(This year we have harmonized the GBDK library source license to follow SDCC's use of GPLv2 + LE, which is why the question is relevant to both.)
For convenience I've pasted the excerpts of SDCC's (hopefully current) use of GPLv2 + LE:
The great majority of sdcc run-time libraries are licensed under the GPLv2+LE which allows linking of sdcc run time libraries with proprietary (closed source) applications.
As a special exception, if you link this library with other files, to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public
License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.
The modified library source still has the GPLv2+LE license and thus this modified source must be distributed with the linked binary. The other source files need not be disclosed.
Hi,
I'm the person who asked the original question. Thanks for the clarification, Maarten.
One of the things I haven't been able to understand so far is why making local changes to the library affects the terms of distributing the final executable.
In scenario A, I download a source distribution of GBDK, compile it on my computer, and make executables by linking my code with the library code. It seems like everyone agrees that in this case, the linking exception means that I don't need to provide a GBDK or SDCC copyright notice or source code to people who receive my compiled ROM.
In scenario B, I download a source distribution of GBDK, change one line, compile, link to it, etc.
But now, even with the linking exception, I do need to provide library sources to end users of the executable.
I think that this distinction is one of the main sources of my confusion. It seemed to me that either I should always have to provide the library source code, or never, irrespective of whether or not the library was compiled from official or publicly available source code. Since in both scenarios I have a library on my computer with the same licence.
A second point I wouldn't mind clarifying is exactly what conditions attach themselves to the ROM derived from my changed library. Is it every condition of the GPLv2 except a requirement to provide source code for the non-GPL object files I linked? Or some weaker set of conditions?
However, in scenario B, you technically have two separate actions:
1) You modify the library
2) You use the (modified) library
If you publish the result of 1) right away, it looks like you are essentially back in scenario A by the time you reach 2).
I'm afraid you misunderstood the license. By distributing a compiled and linked copy of the GPLv2+LE licensed source code you are also obliged to provide that source itself. So scenario A is no different from B and you cannot place the burden of distributing the original library source on anyone else (e.g. SDCC developers) either. You can maybe get away with it when no one asks for these sources, but by distributing the linked ROM you agree to this obligation.
AFAIK there is no weaker set of conditions.
Final note: IANAL (I am not a lawyer).
Last edit: Maarten Brock 2022-12-20
Even without the linking exception, that would be a rather interesting reading of section 3 of the GPLv2, though.
What is more, with the linking exception, the resulting executable explicitly does not have to be GPL-licensed, according to and within the boundaries defined by the exact wording.
Thank you both for the feedback.
I had a similar perspective as Benedikt, though the idea about publishing changes before shipping hadn't occurred to me - it seems reasonable and practical.
What are you afraid of? You do not have to publish the source files you wrote yourself, only the (modified) source of the GPLv2+LE licensed library. E.g.:
Your binary consists of three linked objects that come from three source files:
A: main.c which you wrote completely yourself, no GPL-like license
B: abs.c which comes unmodified from the SDCC library under GPLv2+LE
C: myisgraph.c which you copied from SDCC library isgraph.c and modified, still under GPLv2+LE
When you distribute/copy/publish the linked binary you are obliged to also provide the sources of B and C, but you can keep the source of A undisclosed.
No fear involved. :) :) Personally I release all my works as open source anyway.
The question only arises from what is actually required and therefore defines the practical minimum expected for all users.
So far there is not a uniform response from SDCC contributors. It would be helpful if it could be determined with consensus.
For convenience here are some related links
SDCC Wiki backup of the license page:
https://github.com/roybaer/sdcc-wiki/wiki/Library-License-Selection
The file the wiki links to for the license origin is no longer there, but a likely closest version for libstdc++ is at:
https://github.com/gcc-mirror/gcc/blob/bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e/libstdc%2B%2B-v3/src/compatibility.cc#L22
The Licensing FAQ from that version:
https://github.com/gcc-mirror/gcc/blob/bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e/libstdc%2B%2B-v3/doc/html/faq.html#L215
And the licensing page:
https://github.com/gcc-mirror/gcc/blob/bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e/libstdc%2B%2B-v3/doc/html/manual/bk01pt01ch01s02.html#L14
And lastly, this was the most direct description I could find of the effect of GPLV2 + LE (aka Runtime Exception, it seems at least for libstdc++) when source is compiled into libraries and then linked.
https://spdx.org/licenses/GPL-2.0-with-GCC-exception.html
Last edit: bbbbbr 2022-12-27