4

I believe it is fairly well understood that you cannot link proprietary code to code licensed under the GPL because you're creating a derivative work and have to license it all under the GPL. Tangentially discussed here. I was researching FOSS license exceptions and came across the GPL linking exception defined here in FSF's FAQ. At first I misunderstood the direction of this and thought it sounded like LGPL or something like the class path exception.

If you want your program to link against a library not covered by the system library exception, you need to provide permission to do that. Below are two example license notices that you can use to do that; one for GPLv3, and the other for GPLv2. In either case, you should put this text in each file to which you are granting this permission.

Only the copyright holders for the program can legally release their software under these terms. If you wrote the whole program yourself, [...] you are the copyright holder—so you can authorize the exception. But if you want to use parts of other GPL-covered programs by other authors in your code, you cannot authorize the exception for them. You have to get the approval of the copyright holders of those programs.

When other people modify the program, they do not have to make the same exception for their code—it is their choice whether to do so.

Because you can violate your own license and copyrights, let's make a more relevant example. I am not the sole copyright holder of GNU Emacs which is licensed under GPL version 3 or later. Because of this, I cannot distribute a modified version linking to proprietary, closed source libraries because I cannot make the linking exception. But why? Why do I need the exception? Is it just because the concept of linking is not directed and I cannot legally relicense the proprietary, closed source code?

Does this change for "source available" type code at all?

I feel pretty confident about the answer to this but I haven't been able to find a good question about this nor do I have a good context on why.

6
  • 2
    Because "why?" is a fairly broad question word, I want to make sure I've understood the scope of your question. I can imagine an answer along the lines of, "Because the GPL (like all strong copyleft licenses) requires that a derivative work be licensed entirely under the GPL, any components distributed within the same work as a GPL component must be relicensed to the GPL or removed. One solution for GPL-incompatible components is to weaken the GPL to specifically allow a particular proprietary module..." -- Is this at the level you're looking for?
    – apsillers
    Commented Aug 13 at 0:50
  • @apsillers yes, which part of the text of GPL is forbidding it. Not a "why did they choose this" why. Commented Aug 13 at 14:53
  • Nitpick: you can't violate your own license and copyrights, because you're not bound by them in the first place. Commented Aug 13 at 18:47
  • This is not to the core of your question but I'd like to bring it up, just in case: you can link proprietary code against GPLed code... And at that moment you are not forced to release the proprietary code under the GPL.... That is forced if/when you decide to redistribute the derivative to a 3rd party.
    – eftshift0
    Commented Aug 14 at 7:35
  • It's not that you violate your own license.... It's that you own the code (if you are the copyright holder) and can set whatever terms you want on it.... So you can start from GPL and add additional rules you want on it... And then it's not really GPL anymore but a different thing but it's possible.
    – eftshift0
    Commented Aug 14 at 7:38

3 Answers 3

8

The answer to this "why?" basically boils down to "because those are the rules of the GPL". Sometimes the GPL is termed as "restrictive" (as opposed to "permissive" like the BSD and MIT licenses). However, one ought to keep in mind that without any kind of open source license, one would not be authorized to change and/or redistribute the program at all, let alone a version that links to a proprietary library.

The GPL gives you explicit permission to modify the program, including to add entirely new features to it, and then to distribute your resulting new version. But this permission is contingent upon your adherence to the rules of the GPL – and those rules say that you must provide the complete source code (the “Corresponding Source” in the terms of the License) along with any redistribution of the program and its derivatives.

Basically, the authors of the GPL imagined that a distributed program should look something like this when the end user unpacks the archive:

LICENSE.txt
program.exe
source/
    program.c
    program.h
    Makefile
    etc.

A problem arises when adding a proprietary library to this schema because this effectively “hides” the modifications or the new features behind a proprietary binary (for which you are not distributing source code). In effect, the end user who unpacks your program distribution with the proprietary library will see something like this, instead:

LICENSE_program.txt
LICENSE_secret_functions.txt
program.exe
secret_functions.dll
source/
    program.c
    program.h
    Makefile
    etc.

If she wants to see exactly how you added the new features to program.exe, then she will naturally want to look at the source code to secret_functions.dll as well, but there is no source code to that module, or it is provided only under a restrictive license which does not allow modifications and/or redistribution.

This situation goes against the philosophy of the original GPL, so it is not allowed by the vanilla GPL. However, the GPL does allow exceptions in its text in order to be flexible (maybe you want to allow a plug-in system for your program, for example, without requiring that the plug-in authors GPL their plugins). So, such combinations are possible in the case of GPL + linking exception, GPL + classpath exception, or LGPL. In the case of LGPL, additional requirements are specified -- for example, it must be possible for the end user to modify program.c and to still recompile it and link to your proprietary library, as long as she respects the interface of said library.

If you are the copyright holder, you can authorize such an exception or authorize releasing the program under LGPL instead, but if the program was released by someone else or by several people who all opted to use the vanilla GPL, then you would need to get all of their agreements first in order to authorize an exception.

1
  • It is now occurring to me that if closed source modifications were allowed by GPL then it would essentially defeat the purpose of the viral aspect. I've just always viewed this from the other direction. What good would requiring people to share the source of their modifications be if they were allowed to hide them? The whole thing sort of falls apart if that's allowed. Commented Aug 14 at 18:06
13

GPL allows you to create derived works from GPL licensed works. If you don’t distribute your derived work, then GPL puts no obligations on you, so doing this is fine.

Now if you want to distribute your code and have no right to distribute the proprietary library under the GPL, then you cannot distribute your derived code with the proprietary library legally.

However, you can distribute non-operational code under GPL, for example your code without the libraries. If I get this code, I can pay for the proprietary library and produce my own version of the app. Or I can write a compatible replacement and publish it under the GPL license. Or I can convince the producer of the library to offer it with a GPL license, for example by handing them a huge amount of money.

6
  • "no right to distribute the proprietary library" - that refers to the binary (not just the source code), right?
    – Bergi
    Commented Aug 14 at 2:07
  • Most likely you have to pay for a license to use a proprietary library and have no right to distribute its binary or source - completely independent of GPL.
    – gnasher729
    Commented Aug 14 at 6:22
  • Most commonly, yes, but there might be cases where the library source is not available but the binary is freely distributable.
    – Bergi
    Commented Aug 14 at 7:50
  • @Bergi The GPL says you must deliver the entire program under the same terms (copyleft), so if you tried to include some source code with incompatible terms (e.g. "source available" but not redistributable) then that would be seen as a violation. OTOH, if you just post instructions that "oh, by the way, for this to work you have to first install library XYZ yourself" where XYZ happens to be non-GPL, then perhaps that's allowed literally by the license even if it may violate the philosophy of the license.
    – Brandin
    Commented Aug 14 at 8:12
  • I'm not so sure I agree with the last paragraph. If the code won't function without the proprietary lib then you've clearly made a derivative work, no? But if users could remove a poor performing lib and replace it with a proprietary lib (and then not distribute them together) I think that's legal Commented Aug 14 at 18:35
-3

gpl2 allows linking and distribution given you provide the licensed and source code for the given libraries.

You can see many hardware providers (or otbers) doing so by providing the download of all (l)gpl or others software they use on a dedicated section of their sites.

modifications of the libraries is something different.I am only sure the changes have, de facto, to be gpl and follow the same requirements.

lgpl2 is slightly more clear and/or permissive. Why many gpl services have lgpl2 clients libraries.

now. (l)gpl3 is very different afair. I just stay away from it.

3
  • 1
    "gpl2 allows linking and distribution given you provide the licensed and source code for the given libraries" no, that's LGPLv2.1. GPLv2 requires that the entire package, as distributed, be available under GPL (GPLv2 s2b, as invoked by s3) and that source code be available under GPL if distribution was in binary form (GPLv2 s3).
    – MadHatter
    Commented Aug 14 at 14:48
  • correct. GPL spreads to the "package" being distributed, lgpl 2.1 does not
    – Pierre
    Commented Sep 18 at 14:15
  • Do you want to modify your answer, then?
    – MadHatter
    Commented Sep 18 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.