Does the GPL allow proprietary code and GPL code happily co-exist? Do we want it to?

Disclaimer: I am not a lawyer, my analysis below may be incorrect. The use of the term GPL in this article refers to the GNU Public License version 2. I am aware that the technique presented in this article will be controversial, so let me prefix the article by stating that I am in fact an OSS supporter, contribute to and maintain OSS projects, some under GPL. It is not my intention to circumvent the GPL, but to make others aware of the problem, in the hope that it may be fixed in the next version of the GPL.

It is a common understanding by anyone who has been involved in OSS development that proprietary code and GPL code do not mix, they curdle. As soon as GPL code is used within proprietary code, when the combined code the resulting binaries are distributed then they must be distributed under the terms of the GPL.

This is a good situation for GPL developers and exactly the intention of the license. It’s not so good for the developers of the proprietary code, if their hope is to retain their IP (methods and techniques) that exist within that code, without the protection of software patents (patenting software is another discussion for another day).

The developers of the proprietary code have the option of not using GPL code, but the purpose of this article is to detail how they can legally use it, whilst not releasing their proprietary code under GPL.

The situation that I’ll be covering in this article is that the proprietary code produces a library or executable (hereafter referred to as a ‘proprietary binary’) and it re-uses GPL code in some form.

There are two types of code re-use that are applicable in this situation: re-use via copy-paste; re-use via headers/libraries. In both cases the proprietary development team can create a wrapper that will form a shared (aka dynamic) library and shield the proprietary code from the GPL code.

There are three components to consider:
a. The proprietary code
b. The wrapper
c. The GPL code

The proprietary code uses the wrapper code and the wrapper code uses the GPL code. No GPL code exists within or is exposed to the proprietary code.

The proprietary development team then distributes the proprietary binary produced by the proprietary code, but not the wrapper shared library, code or the GPL code. The proprietary binary is useless by itself, but still the company may distribute it and the important point is they can distribute it under any license they wish.

Now some of you may be clamouring to argue that the wrapper code is GPL, hence the proprietary code is also GPL; This is not so. The GPL does not place restrictions on the code’s use, just it’s distribution. In the scenario above, the wrapper is not distributed, hence it is not bound by the GPL.

The proprietary development team then distributes the wrapper as a shared library under GPL, providing free access to the wrapper code and GPL code. Can they still continue to distribute the proprietary binary under non-GPL terms? From my analysis, the answer is yes; They may still distribute the proprietary binary as it does not (under the terms of the GPL) use GPL code.

Now the obvious counter argument is that is does use GPL code, because the wrapper is distributed under GPL. Unfortunately, this misses an important point. Distributed copies of the wrapper are covered by the GPL, but copies of the wrapper within the proprietary development team are not. While it may be the exact same code and shared libraries, it is only copies that exist outside of the proprietary development team that are bound by the GPL. The proprietary development team produces their proprietary binary using an undistributed, non-GPL copy of the wrapper, hence their proprietary binary is not bound by the GPL.

I will finish this article by reiterating that I am not a lawyer and that there may be issues that I have overlooked or misinterpreted. Assuming my analysis is correct, I unfortunately don’t know how to fix this problem with the GPL. Hopefully those smarter than me working on the GPL version 3 will find a resolution and I wish them the very best of luck.