Licensing problem, caused by static linking on windows
For past year or so, a group of us at ARM having been developing some software in Haskell. We have recently discovered that there may be a licensing problem if we wish to release a Windows version of the software. No doubt others have encountered the same problem, so we would be very grateful for any advice on how to solve it. The problem is that on Windows, GHC statically links the program with the libgmp library, which has an LGPL license. The LGPL license says that we can distribute the executable under our own terms, provided that we do this: Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with 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. Does anyone have any experience of doing this with GHC? Is it relatively straightforward? Or better still, has anyone figured out a way of avoiding the problem by dynamically linking with libgmp on Windows? Any help would be greatly appreciated! Kevin Kevin Backhouse ARM Limited, 110 Fulbourn Road, Cambridge, CB1 9NJ, UK. Tel: +44 1223 400601 This e-mail message is intended for the addressee(s) only and may contain information that is the property of, and/or subject to a confidentiality agreement between the intended recipient(s), their organisation and/or the ARM Group of Companies. If you are not an intended recipient of this e-mail message, you should not read, copy, forward or otherwise distribute or further disclose the information in it; misuse of the contents of this e-mail message may violate various laws in your state, country or jurisdiction. If you have received this e-mail message in error, please contact the originator of this e-mail message via e-mail and delete all copies of this message from your computer or network, thank you.
IANAL but my take on this is:
Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above);
Including a pointer to a GHC tarfile or CVS tree seems like an easy way to accomplish this.
and, if the work is an executable linked with the Library, with 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.
Including a .o file for each module of your program would be one way to accomplish this. -- Alastair Reid
Kevin,
The problem is that on Windows, GHC statically links the program with the libgmp library, which has an LGPL license. The LGPL license says that we can distribute the executable under our own terms, [...]
You could write a C wrapper around a run-time loaded library. Cygwin supports dlopen() and friends so it might even be portable. You would statically link the wrapper code so GHC has the symbols it needs, but the actual functionality would remain in the original .dll / .so. Though, if you've used lots of functions from libgmp it might be a hassle to write the wrappers. Ben. [untested example code] ---- Wrapper.hs foreign import ccall someFunction_Wrapper :: Int -> Int ---- Wrapper.c int (*someFunction_WrapperSym)(int); int someFunction_Wrapper (int x) { return someFunction_WrapperSym (x); } void initWrapper () { void* handle = dlopen("where/is/libgmp.so", RTLD_NOW); someFunction_WrapperSym = dlsym (handle, "someFunction"); }
participants (3)
-
Alastair Reid -
Ben Lippmeier -
Kevin Backhouse