"Linux Gazette...making Linux just a little more fun!"

Why you might want to use the Library GPL for your next library

By Eric Kidd

Richard Stallman, the founder of the GNU Project, recently wrote an article titled Why you shouldn't use the Library GPL for your next library. He argued that placing new libraries under the regular GPL would give an advantage to free software authors. If you haven't read this article yet, you should. Stallman knows a lot about free software, and he makes several important points.

I disagree with Stallman, however. His article omitted several reasons against using the GPL for libraries, and some of these are pretty important. First, GPL'd libraries can't be used in all free software. Second, US law probably allows proprietary software to use GPL'd libraries anyway. Third, GPL'd libraries may discourage people from using GNU/Linux systems.

GPL'd libraries can't be used by all free software

I'm really lucky--I write free software for a living. When I decided to stop writing proprietary software, my paycheck got cut in half. (Don't worry; I'll find a way to earn it all back.) My new employer pays me to enhance a mail server used by several colleges. I also do consulting work, since it pays well. All the code I write can be used in GPL'd programs, but very little of it is released under the GPL itself.

Even though I write nothing but free software, my programs can't link against a GPL'd library. A GPL'd library can only be used in a GPL'd program. Programs using the X11, BSD, Netscape, Mozilla or Artistic Licenses cannot use GPL'd libraries. (Several of these licenses are flawed, but that's another topic.)

My employer's mail server uses a BSD-style license. I don't have the necessary influence to make them use the GPL. Unfortunately, this means that I can't use GPL'd libraries to make the program better. Instead of doing something useful for the free software community, I waste time reimplementing broken versions of pre-existing libraries. My time would be better spent adding new features to the mail server, or even enhancing an LGPL'd library.

So in this case, using the GPL for libraries can actually hurt free software. It's not a simple issue.

Update: RMS posted the following message to the gnome-list:

This exception would be redundant, because simple non-copyleft
licenses such as X11 and BSD are compatible with the GPL already.

So if you want to write a non-copylefted application, release it under
the X11 license, and link it with a GPL-covered library, that is
allowed. The linked executable would be covered by the GPL, of
course, but the app source code would be covered by the X11 license

So XFree86-licensed code can use GPL'd libraries. The BSD license might conflict with the GPL until the advertising clause is removed, but this is a good thing to do anyway. However, code using the NPL, MPL or a similar license would still have problems. Thanks to gsv for pointing this out to me.

Proprietary applications may be able to use GPL'd libraries anyway

The GPL is well-written, and most of it would stand up in court. (The GPL has never been tested, probably because Stallman's legal volunteers have convinced violators to settle out of court.) For better or for worse, however, there's a good chance that proprietary software can use GPL'd libraries even though the license forbids this.

The GPL is enforced using copyright law. The United States (and many other countries) have exceptions to copyright law for "fair use". Two important kinds of fair use involve compatibility and reverse engineering.

Imagine that you want to write a program for Windows, but that you need to use an undocumented API. Microsoft won't give you the information, so you'll have to find it on your own. US law normally allows you to disassemble parts of Windows and call secret functions, even if Microsoft says you can't. Similarly, Microsoft can't prevent the Samba team from reverse-engineering Windows file sharing.

Imagine that you sell proprietary software for Linux. You want to use the Readline library if it's present on a user's system, but the Readline library is GPL'd. So you decide not to ship Readline yourself. Instead, you fix your program to look for Readline and ask your users to install it on their own. (RedHat 5.2, for example, installs Readline by default.)

Have you broken the law? You haven't made copies of Readline for anyone, and the GPL doesn't stop you from copying your own program. You used Readline yourself, but the GPL doesn't forbid this. (Even if the GPL did try to forbid this, it would probably fall under the "fair use" exemption.) Your users might choose link your program against Readline, but US law probably allows them to do so (and the GPL doesn't even try to stop them).

So what prevents Readline from being used by proprietary software? Is your program a "derivate work" of Readline, and therefore covered by the GPL? Not likely, since it doesn't include any Readline code. Does #including the Readline headers subject your program to the GPL? Probably not--a good lawyer would claim that this is the same as "reverse engineering for the purposes of interoperability". Maybe you'd have to retype the headers in a cleanroom environment, but that's not too hard for a small library.

So can a proprietary application dynamically link to a GPL'd library? Maybe. But if a proprietary application can't used a GPL'd library, then Microsoft may be able to cause trouble for WINE and Samba. This knife cuts both ways.

Please remember--I am not a lawyer, and you shouldn't take anything I say as legal advice. Hire a professional.

GPL'd libraries may discourage people from using GNU/Linux

In the past twelve months, lots of people have started to look at Linux. It's cheap, it's free (speech, not beer) and it runs all their Unix applications. Really, there aren't many reasons against using Linux.

But let's pretend that most libraries for Linux are GPL'd. All of a sudden, you need to write GPL'd programs, or choose a different operating system. Unix vendors don't tell you what license to use. Not even Microsoft tries to tell you what license to use for your software.

As much as I love Linux, the choice is easy. Everybody I know would throw out their Linux servers, and migrate to Solaris or Windows NT. Not good. Saying "to use our product, you must use our license" is pushy, and not many people would agree.

So I'm a free software author? Which license should I use?

It's your library. Think about the issues, and do whatever you want.

Note about the BSD License: The BSD license contains an "advertising" clause, which can cause all sorts of stupid problems. If all goes well, my employers will drop this clause from their license soon.

Copyright © 1999, Eric Kidd
Published in Issue 38 of Linux Gazette, March 1999