27

LGPL requires that it if a program uses LGPL-ed library, users must be able to re-link the program with a different version of the library:

...

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.

1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.

...

However in some cases, this can pose considerable difficulties. In particular, Haskell programs are almost always statically compiled. Moreover, the compiler does cross-module optimizations so its not possible to take a part of the code out and replace it with another. So it's very hard to satisfy this condition. (See this link at Haskell Wiki.)

Dynamic linking would be a solution, but in many cases, this isn't possible. For example:

  • Some platforms may not have dynamic linking at all.
  • Some languages don't have the possibility of dynamic linking. Or, it's not possible to make modules multi-platform.
  • In some cases dynamic linking would prevent important optimizations. While I'd say this is rarely a serious problem, in languages like Haskell the performance loss could be considerable.

Therefore, I'm looking for a standard LGPL-like license that wouldn't require the possibility of re-linking (and I understand that that removes a bit of freedom given to users). Some projects use their own modification of LGPL, for example wxWidgets. But I'd rather use some standard license that is somewhat more official, perhaps checked by some law experts, and (L)GPL compatible. Is there some like that?

(Also I'd be interested to know if are there some unforeseen consequences of such a modification of LGPL.)

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
Petr
  • 5,507
  • 3
  • 29
  • 46
  • You can't [dynamically link outside libraries](http://www.haskell.org/ghc/docs/7.0.3/html/users_guide/using-shared-libs.html) in Haskell? That must be damned inconvenient. – Robert Harvey Dec 11 '12 at 19:01
  • 2
    If your entire project is FOSS, then this might be a non-issue. Point them at the sources and let *them* sort it out! :-) – Peter Rowell Dec 11 '12 at 19:08
  • 2
    What would distinguish that license from non-copyleft licenses? –  Dec 11 '12 at 19:16
  • 2
    @delnan There are many other things in LGPL that are often desirable. For example, it requires any _modification_ to be (L)GPL, or prohibits [tivoization](http://en.wikipedia.org/wiki/Tivoization). – Petr Dec 11 '12 at 20:15
  • The wxWindows license is about as official as it gets, given that it's [approved by the OSI](http://opensource.org/licenses/wxwindows.php). – Joachim Sauer Dec 12 '12 at 08:27
  • The LGPL(v2) allows this by default (if you supply object files): "... if the work is an executable linked with the Library, [you must supply or offer to supply] the complete machine-readable 'work that uses the Library', as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library" ... so if you provide linkable object files then you can statically link. – porges Jul 09 '13 at 00:30

5 Answers5

16

I'm surprised nobody's mentioned the Mozilla Public License. It's similar to the LGPL except it allows static linking. MPL version 2 is compatible with the GPL/LGPL.

Mozilla Public License (MPL 2.0) vs Lesser GNU General Public License (LGPL 3.0)

bmaupin
  • 269
  • 2
  • 5
  • It's similar but does not protect authors, other developers and end users from tivoization, patent trolling and trademark issues. See: https://en.wikipedia.org/wiki/Free-software_license – Federico Feb 16 '21 at 15:52
13

wxwidgets is licensed under essentially = LGPL + static linking

...essentially the L-GPL (Library General Public Licence), with an exception stating that derived works in binary form may be distributed on the user's own terms. This is a solution that satisfies those who wish to produce GPL'ed software using wxWidgets, and also those producing proprietary software.

wxWidgets is Certified Open Source Software Participants in the discussion that led to this decision include the folk from Abisource, Robert Roebling, Julian Smart, Markus Fleck, Karsten Ballueder, and some advice from Richard Stallman. Richard has confirmed that the new licence is compatible with GPL'ed applications. However, there are no significant restrictions on proprietary applications.

The wxWindows Licence has been approved by the Open Source Initiative, and you can find the licence on their site here...

gnat
  • 21,442
  • 29
  • 112
  • 288
Martin Beckett
  • 15,776
  • 3
  • 42
  • 69
5

IANAL, but I have been led to believe, that one solution is to provide object files for non-LGPL parts. That way user can re-link the program and so is free to change the LGPL part, fulfilling requirements of LGPL.

In other words, you need to have source package, with LGPL sources and compiled object files of non-LGPL code. Obviously you then need to provide object files for every different architecture you release the binaries for, but I don't think this is much of an issue.

From development point of view, simplest might be to just have the build system also build the source package at the same time, when building the binary for distribution.

hyde
  • 3,744
  • 4
  • 25
  • 35
  • do you have any real scenario in which this has has been done? – knocte Sep 04 '13 at 16:15
  • @knocte The LGPL paragraph 4.d.0 (also quoted in the question) describes a pretty real scenario. This also matches what [the FSF has in it's FAQ regarding this topic](https://softwareengineering.stackexchange.com/a/312759/5537). If you are asking for an example of a proprietary software that statically links a LPGL library and distribute object files I currently can't find one. But I vaguely remember coming across such softwares years ago. – maxschlepzig Feb 23 '20 at 09:41
3

I found one with Google: OpenScales license

OpenScales is released under version 3 of the GNU Lesser Public License (LGPL, available here), with an exeption related to static linking exception (see below)...

In addition to the LGPL license text, the exception to the LGPL conditions apply to OpenScales:

As a special exception to the GNU Lesser General Public License version 3, you may convey to a third party an executable file from a Combined Work that links, statically or dynamically, portions of this Library in the executable file, conveying the Minimal Corresponding Source but without the need to convey the Corresponding Application Code under section 4d0 of the GNU Lesser General Public License, so long as you are using an unmodified publicly distributed version of the Library. This exception does not invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License or the GNU General Public License.

It's not standard though, and I don't know if one exists.

gnat
  • 21,442
  • 29
  • 112
  • 288
Minthos
  • 240
  • 1
  • 4
1

How would you continue to guaranty user freedom? I believe the "correct" answer is to statically link a shim that dynamically loads the library.

stonemetal
  • 3,371
  • 16
  • 17
  • Yes, that is the best solution. But in some cases, dynamic linking isn't possible. Some languages don't have this possibility. Or some platforms don't have this possibility. – Petr Dec 12 '12 at 07:23
  • Actually linkers do exactly this, when you dynamically link to library. – Calmarius Sep 23 '15 at 14:46