3

This question revolves around the (unresolved) question in the open source community, whether "dynamic linking" against a GPL-licensed library requires your software to be GPL-licensed, as well. I will first give some background on the GPL / copyleft, and then some technical background. Third, I give a concrete example of a program in which the problem arises. Finally, I try to formulate the actual question. Feel free to skip the first two or three sections.

Since jurisdiction often matters: I live in Germany, but would also be interested in how this plays out in US law.

GPL / Copyleft

One populare software license is the GPL ("General Public License"). The GPL is a copyleft licence, i.e., it contains the passage that any software "based on" the GPL-licensed software must also be GPL-licensed. There seems to be an agreement that this can be reformulated to "any derivative work" (although the term "derivative" does not appear in the license itself). One major open question is when exactly software A is "based on" software B (or a "derivative" of software B).

Technical Background: Dynamic Linking

Almost all programs we use are not written 'in one piece', but rather pull in many reusable pieces of software, so-called libraries. The way these libraries are 'pulled in' is often termed linking. There are two fundamentally different ways of linking: Static and dynamic linking. In static linking, the software library as a whole is copied into the program during translation from source code to an executable program. The software library is thus physically part of the binary program you distribute.

In dynamic linking, the binary programm instead contains a reference to the library. Think of it as a marker in the program that says "at this point in the program, execute function xyz from library abc". When you run the program, your operating system looks up library abc, loads it into memory, and when the main program reaches the marker, program execution jumps to the program code of function xyz in library abc.

A simple, yet complete example

This example constitutes a complete Python program that could be distributed as written (with a few omissions) here. Say I have a file the_program.py containing:

from the_library import some_function

some_function()

This is a complete, runnable python program that does nothing but execute the function some_function from some hypothetic python library the_library. If I send you this (plain text) file via e-mail and you have python and the_library on your computer, you can run it.

Of course, python programs are usually not distributed via e-mail but rather via some central repository (mainly "PyPi"). To do that, I create a second file called setup.py, roughly containing:

setup(
  name="my_program",
  install_requires="the_library"
)

I would then upload these two files (and nothing else) to such a repository. If you wanted to install my program, you would (in some automatic fashion via a packet manager) download the two files, and the setup.py file tells your packet manager that it also needs to download and install the_library for my program to work.

The Free Software Foundation (who created the GPL) and many open source advocates now argue that I need to license my two files above under the GPL (assuming that the_library is a GPL-licensed library), since it is a "derivative" of the_library.

Note that at no point do I myself distribute any part of the_library. All I (resp. my code) does is include a pointer that says "you need the_library to run this". To spin this further: I could have written my program without ever downloading or seeing any part of the_library myself. That I can do that is obvious: I was able to write above code without the hypothetical library the_library even existing, and of course I could also upload this code to a package repository.

The Question

In my understanding, a software license constitutes a contract between the person providing the software and the person accepting the license to download/use the software. However, since I can build my software without ever interacting with (i.e., downloading, installing, using, …) the GPL-licensed library myself, how can I have accepted a contract with the authors of the library? If such a contract has not been closed, how can I be bound by it to license my software in any way?

"But that does never really happen!"

One might argue that in practice, I will never be able to write a software that dynamically links to some library without actually using that library myself to test my program, figure out how the library works, etc. Thus, in practice, I will always have accepted the license of the library while installing it.

However, because of this peculiarity of GPL-licensed libraries, there are replacements for some of them being developed. People try to create other (less restrictively licensed) libraries with the same interface and the same functionality, which can act as a drop-in replacement.

I might now develop my software with such a replacement, but still offer the user of the software the possibility to install the "original" instead of the replacement. Maybe the original is faster, or safer, or just ships with more operating systems. Thus, the case "I never interacted with the GPL-licensed code, but they still require me to abide by their terms" does in fact arise in practice.

2

In the USA, the GPL license is a license, not a contract. It allows you to do certain things that would be copyright infringement if you did them without a license, as long as you follow the license terms. You cannot be sued for breach of contract, but for copyright infringement.

In Germany, the GPL license is considered a contract. The US argument that a one sided contract without considerations is invalid doesn’t apply in Germany, so this is fine. It’s a strange contract because one side doesn’t require any evidence that you agreed to the contract. If a case about GPL licensed software went to court, the judge could ask you “did you accept the license” and the answer would determine whether you are accused of copyright infringement or breach of contract.

In the USA, you don’t “accept” the GPL license. It just tells you what things you are allowed to do under which condition, beyond what copyright law allows you to do anyway. You can be sued for copyright infringement, and the questions then are: did you do something not within the rights you have due to copyright law? If no, you are not guilty. Did the GPL license give you permission? If not, guilty. Did you follow the conditions of the GPL license? Yes, not guilty. No, guilty.

Due to comments: In the USA, "accepting the license" is like "accepting a present", it doesn't give you any obligations to do something. But you can get into a situation where you have the choice between following the terms in the license and committing copyright infringement. Now Microsoft might have three lines of GPL licensed code in Word. They have the choice between publishing all of Word with a GPL license, or paying say $10,000 for copyright infringement - you can guess what they will do. If I used a huge GPL licensed library in my hobby project, I'd publish my hobby project under the GPL license to avoid getting prosecuted. I assume your company is somewhere in between.

3
  • Thanks for the clarification! However, my original point remains, right? Just as I never accepted a (German) contract when writing my software that uses the_library, in the US model, I never did anything that required me to accept a license, right? Mar 8 at 13:36
  • There is an argument that most open source licenses involve non-monetary consideration and are therefore contracts under US law. E.g. Chestek has made such an argument (lwn.net/Articles/747563). That open source license conditions are enforceable in the US is one of the takeaways from the Jacobsen v Katzer case. However, all of this is irrelevant: OP is incorrectly focused on license acceptance, and should instead consider whether the software is a derivative work of the GPL-covered software.
    – amon
    Mar 8 at 23:07
  • I'm not sure that a licenses isn't a form of contract. If someone breaches a licensing agreement that is a breach of contract action, not a statutory copyright violation.
    – ohwilleke
    Mar 9 at 0:56
0

There is some confusion evident in the question, which I will attempt to clear up, before moving on to an actual answer.

Version 2 of the GPL does not refer to linking at all, except in a section titled "How to Apply These Terms to Your New Programs" - which appears after a very prominent "END OF TERMS AND CONDITIONS" header. So version 2 of the GPL does not explicitly impose any conditions on any kind of linking whatsoever.

Version 3 of the GPL does refer to linking a couple of times, but the first reference to linking is in the definition of "Corresponding Source" and the second relates to AGPL compatibility (the third is, like in the GPLv2, not part of the license). If you are not already under the obligation to provide Corresponding Source, then GPLv3 does not explicitly say that linking creates this obligation.

Instead, GPLv2 and GPLv3 both say (more or less) that distributing a derivative work is what creates the obligation to provide source code (under the same license). It is fairly uncontroversial that static linking is this sort of distribution, because you are including a verbatim copy of the original library (in compiled form). So what you are really asking is this: Does my dynamically-linked application form a derivative work of the library to which it is linked?

This is a difficult question, and it's not one which the license could have answered by itself. Every jurisdiction in the world has its own concept of what exactly counts as a "derivative work," so it's unlikely that there is a single, universally-correct answer. To make matters worse, software has only been around for a handful of decades at this point. The law is poorly-developed and the issue has been rarely litigated. In short, nobody really knows the answer to this question.

Nevertheless, here are summaries of the pro and con arguments:

  • Pro: Developers who make intimate, elaborate use of a library, exchange complex data structures with it, and generally integrate it into their core application logic, cannot then claim that the application and the library are wholly independent works. The application would not work without the library, and in some cases it may derive a substantial amount of its market value from the library's capabilities. Moreover, the application incorporates the library's invariants and interfaces, even if only into the negative space of the application's function calls to the library. The application's overall structure and design is closely influenced by the structure and design of the library, and this sort of close creative influence is exactly what the derivative work right is supposed to protect.
  • Con: APIs are not, or should not be, copyrightable (at least, that is the stance of the FSF, and they wrote the GPL in the first place). Even if APIs are copyrightable, their use is likely to be fair (under US law, see Oracle v. Google). The primary common element between the library and the application is an API. Other libraries could be written to the same API, and you could replace one with the other, and still have a functional application at the end of the day. Moreover, some libraries, like GNU Readline, could easily be replaced with an extremely trivial (but less useful) implementation. You could ship this implementation together with the application, and it's hard to see how that would violate copyright or the GPL (even if the user replaced your trivial implementation with the real GNU Readline after the fact - that replacement is not an act of distribution and is not prohibited by the GPL). So why should it become copyright infringement merely because you omit this trivial implementation and allow the operating system to automatically load GNU Readline instead?

To some extent, these arguments are talking past one another. The "pro" argument assumes a library which is deeply and fundamentally integrated into the application, while the "con" side focuses more on incidental or secondary use of a library. It is possible that either argument might succeed under different circumstances. And of course, this all depends heavily on the specific copyright laws of individual jurisdictions.

Finally, we can dispense with the "contract or license?" question altogether, because both versions of the GPL explicitly say that they only restrict activities that would otherwise require a copyright license. If you do something which copyright law would have otherwise allowed, then you have not violated the GPL, so the GPL's status as a contract cannot create liability where none would otherwise have existed. If you do something which violates the GPL, then you necessarily violate the licensor's copyright, regardless of whether the GPL is "valid" or not. This might still affect the remedies that the court is willing or able to order, depending on the vagaries of copyright vs. contract law in your specific jurisdiction, but it would not affect whether or not you are liable for a GPL violation in the first place.

TL;DR: You don't have to accept the GPL, because it only prohibits you from doing things which copyright law would otherwise prohibit anyway. Regardless of whether the GPL applies to you or not, you are prohibited from doing those things without a copyright license (which might be the GPL, or another license altogether). Whether or not dynamic linking is "one of those things" which you are prohibited from doing is very much an open question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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