Open mvrhov opened 6 years ago
LGPL is just fine to link to any program regardless of its license. Wolframs's Mathematica uses GMP as well, IIRC.
@mvrhov by default the go toolchain will link dynamically so the LGPL terms should apply.
My reading about LGPL leads me to think that @cznic is correct - using a dynamically loaded LGPL module is fine even in proprietary software.
That is fine if it will be dynamically linked. I explicitly stated that this applies to static linking. And by default go links statically, but I might be wrong. ldd on the final executable should tell.
Alternatively, a statically linked library is allowed if either source code or linkable object files are provided.2
I don't think that's easy to convince (or even possible) go to just link .a files together, to produce the final executable. So For all practical purposes statically linking (L)GPL code in proprietary executable that you distribute you need to also distribute your sources.
Here is the test binary on my machine showing the dynamic linking
$ ldd gmp.test
linux-vdso.so.1 => (0x00007ffe8d5ab000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f8f0fc50000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8f0fa31000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8f0f651000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8f0fed0000)
Excellent. Then Just add to readme, that the gmp lib must be dynamically linked due to LGPL license if one wants to use it in commercial projects. Many are not aware of this. That's the reason I'm advocating this whenever I have a chance.
@mvrhov that sounds like a good plan. Fancy sending a pull request?
Except it's not correct. LGLP does not forbid static linking. It just states particular conditions for that. Warning otherwise amounts to only spreading FUD.
OSS vs commercial SW is a false dichotomy. SW can be non-free and open source at the same time.
IMO you should put the warning into the readme.
The GMP license is GPL/LGPL however you are statically linking the library into the final executable, As the GPL is viral license all your code is also GPL and if you distribute the executable you must also distribute all the source code of you application!