gmp icon indicating copy to clipboard operation
gmp copied to clipboard

License warning

Open mvrhov opened this issue 7 years ago • 9 comments

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!

mvrhov avatar Jun 22 '18 07:06 mvrhov

LGPL is just fine to link to any program regardless of its license. Wolframs's Mathematica uses GMP as well, IIRC.

cznic avatar Jun 22 '18 07:06 cznic

@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.

ncw avatar Jun 22 '18 09:06 ncw

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.

mvrhov avatar Jun 22 '18 09:06 mvrhov

Alternatively, a statically linked library is allowed if either source code or linkable object files are provided.2

src: Differences from the GPL

cznic avatar Jun 22 '18 10:06 cznic

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.

mvrhov avatar Jun 22 '18 10:06 mvrhov

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)

ncw avatar Jun 22 '18 13:06 ncw

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 avatar Jun 22 '18 17:06 mvrhov

@mvrhov that sounds like a good plan. Fancy sending a pull request?

ncw avatar Jun 22 '18 20:06 ncw

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.

cznic avatar Jun 22 '18 21:06 cznic