ncw / gmp

Go language interface to GMP - GNU Multiprecision Library (golang)
BSD 3-Clause "New" or "Revised" License
115 stars 26 forks source link

License warning #9

Open mvrhov opened 6 years ago

mvrhov commented 6 years ago

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!

cznic commented 6 years ago

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

ncw commented 6 years ago

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

mvrhov commented 6 years ago

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.

cznic commented 6 years ago

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

src: Differences from the GPL

mvrhov commented 6 years ago

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.

ncw commented 6 years ago

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)
mvrhov commented 6 years ago

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.

ncw commented 6 years ago

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

cznic commented 6 years ago

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.