Jump to content



Photo
Answered Go to the full post

  • Please log in to reply
10 replies to this topic

#1 rwx

rwx

    Neowinian

  • Joined: 24-February 08

Posted 27 December 2013 - 11:50

I want to distribute some software that was compiled with the MinGW compiler which is bound by the GPL but my software is closed source and my software requires the GCC run time environment. (It uses the DLLs so no static linking).

 

According to this:

 

http://www.gnu.org/l...on-3.1-faq.html

 

You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules.

 

Based on my understanding, I can keep my code closed as far as I don't mess with the original source files (which I don't, I only use the compiler to compile the program). Then it says this:

 

The GCC Runtime Library Exception covers any file that has a notice in its license headers stating that the exception applies. This includes libgcc, libstdc++, libfortran, libgomp, libdecnumber, libgcov, and other libraries distributed with GCC.

 

It doesn't meantion: libwinpthread-1 but it does say "and other libraries distributed with GCC." I spent quite some time searching for the answer but I could not find out if it's covered or not. So I had to download the MinGW source code and try to make sense (this is the first time I was looking at its source code) and I found a file called: "thread.c" in src-4.8.0-release-rev1.tar\src-4.8.0-release-rev1\src\gcc-4.8.0\gcc\ada and in it:

 

* As a special exception under Section 7 of GPL version 3, you are granted *
 * additional permissions described in the GCC Runtime Library Exception,   *
 * version 3.1, as published by the Free Software Foundation.               *

 

But I don't know if this file is responsible for "libwinpthread-1.dll" because there is also a folder called "winpthreads" and in it there some files and not one of them mentions "GCC Runtime Library Exception" so I am really really confused.

 

I have done so much research but I could not find an answer.

 

My objective is to release the software without later on being forced to release my code because if that's the case I may as well buy Vision Studio and compile it using VS.



Best Answer +snaphat (Myles Landwehr) , 28 December 2013 - 02:33

Yes, I get the point now and I agree, that is a good point.

 

In my case, the software I'd like to redistribute as a freeware (I am an independent developer) was developed with the Qt framework (which is a top-notch framework without a doubt).

 

I dynamically link to Qt DLL files as well as the MinGW DLLs. When I say dynamically, what I mean is my EXE requires the DLLs in order for it to run. So the DLL code is not built-into the exe itself. It depends on the DLLs and take one DLL away, it won't run. My app is closed source and have done zero modifications to the Qt libraries. I just #included the header files so I can utilize the API.

 

So I will need to have Qt's source code handy in case someone asks for it (which I do, it comes with installer as far as I am aware).

 

I know I am bound to include the LGPL license file with the files I am redistributing and acknowledge the use of Qt LGPL edition in the about box.

 

That's basically all I intend to do and the LGPL allows having the source closed if you dynamically link the libraries (as far as I am aware).

 

This all sounds perfectly permissible to me (and quite common). Dynamic linking is required as per the license AFAIK because of the part I highlighted in my previous post. I don't believe static linking is allowed because it would make it impossible for the user to relink to a newer revision of the library (as required under the licensing terms). Anyway, I just took a look at the specific revision that QT is using and it it looks like newer revisions of the LGPL have a stipulation that exempts you from having to directly redistribute the source after all (this is not in the older versions: https://www.gnu.org/licenses/lgpl.html). So you can go ahead and do what you were thinking and just provide a link:

 

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

-http://www.gnu.org/l...s/lgpl-2.1.html

 

Be careful though, if the version or the license the software is under doesn't have that stipulation then you should be wary of doing doing it that way. It's important to check the terms exactly.

Go to the full post



#2 +snaphat (Myles Landwehr)

snaphat (Myles Landwehr)

    Electrical & Computer Engineer

  • Tech Issues Solved: 29
  • Joined: 23-August 05
  • OS: Win/Lin/Bsd/Osx
  • Phone: dumb phone

Posted 27 December 2013 - 22:52

There are two pthread libraries that are typically used with MinGW and MinGW-w64*: winpthreads and pthreads-win32. Neither are from the GNU Project so they don't necessarily have the same licensing. Most of the compilation runtime related aspects of GCC are under the GCC exception clause you found; however, that doesn't mean winpthreads and pthreads-win32 are (since they aren't from the GNU Project). Winpthreads is actually under a 3 clause BSD-style license so it has almost no restrictions: http://sourceforge.n...threads/COPYING. So you can link to it statically/dynamically without issue. Pthreads-win32 on the other hand is an LGPL licensed software and does not have an exception. What this means is that if you happen to use it that you have to distribute the source code for version of the DLL you are distributing. You don't have to distribute your own source code in that scenario (unless you are taking a very liberal interpretation of copy-left...).

 

That ada/thread.c code is not related. It just defines some ADA language specific setup code for pthreads (i.e. to use CLOCK_RT_Ada for the clock of pthread_condattr: http://www.sourcewar...dattr_init.htmlhttp://linux.die.net...ndattr_setclock)

 

 

* You probably shouldn't be use MinGW if you are, and should instead be using MinGW-w64 (even for 32-bit targets). The former is out of date last I heard and chronically slow at incorporating new features, etc.



#3 +snaphat (Myles Landwehr)

snaphat (Myles Landwehr)

    Electrical & Computer Engineer

  • Tech Issues Solved: 29
  • Joined: 23-August 05
  • OS: Win/Lin/Bsd/Osx
  • Phone: dumb phone

Posted 27 December 2013 - 22:57

Make sure you include the relevant copyright notices in any distribution though. For example for MinGW-w64:

https://gitorious.or...G.MinGW-w64.txt



#4 OP rwx

rwx

    Neowinian

  • Joined: 24-February 08

Posted 28 December 2013 - 00:37

snaphat, thank you for taking your time to answer this. I appreciate it. I have been all over Google for this one and I didn't find the required info but I certainly learned quite a bit of the licensing restrictions of GPL and LGPL.

 

In relation to LGPL, I think you are right, but I believe providing a link to the sources' web page "should" be enough rather than providing the actual source code of the version that one would be using.

 

Take this for example, If I was using a DLL compiled by someone else, I do not have the source code for that DLL so if someone "asks" for the source code of that DLL, does that mean I am required to do "his" work? This would involve me personally studying the MinGW source code and make sense (understand the code on his behalf) and pin point literally what files are responsible for the DLL? It just doesn't sound right.

 

In my case, I just copied the DLLs of the MinGW's bin directory (which were compiled by the MinGW team) so if I was distributing the exact unmodified DLLs compiled by someone else, the someone else interested about the source code should seek the answer from the MinGW source code hosting page.



#5 +snaphat (Myles Landwehr)

snaphat (Myles Landwehr)

    Electrical & Computer Engineer

  • Tech Issues Solved: 29
  • Joined: 23-August 05
  • OS: Win/Lin/Bsd/Osx
  • Phone: dumb phone

Posted 28 December 2013 - 01:12

snaphat, thank you for taking your time to answer this. I appreciate it. I have been all over Google for this one and I didn't find the required info but I certainly learned quite a bit of the licensing restrictions of GPL and LGPL.

 

In relation to LGPL, I think you are right, but I believe providing a link to the sources' web page "should" be enough rather than providing the actual source code of the version that one would be using.

 

Take this for example, If I was using a DLL compiled by someone else, I do not have the source code for that DLL so if someone "asks" for the source code of that DLL, does that mean I am required to do "his" work? This would involve me personally studying the MinGW source code and make heads and tales and pin point literally what files are responsible for the DLL? It just doesn't sound right.

 

In my case, I just copied the DLLs of the MinGW's bin directory (which were compiled by the MinGW team) so if I was distributing the exact unmodified DLLs compiled by someone else, that someone interested about the source code should seek the answer from the MinGW source code hosting page.

 

Under LGPL, you are required to provide the source code even for DLLs you didn't compile yourself. You are still bound by the terms of the license regardless of whether or not you actually compiled the software. I'm not sure why you'd think otherwise. You don't get to ignore that part just because someone else already distributed the source code at some point*.

 

In any case, it wouldn't be all that difficult since library code is generally self-contained. Providing an web link to MinGW's source code is not enough because you need a specific revision of the source code (the one that corresponds to the build) and you have to guarantee that the code is going to be available. Ubuntu and other Linux distributions skirt the issue of distributing the binary package and source code from the same location.

 

That being said, MinGW's runtime components don't have that restriction. Like I said in my previous post, winpthreads has a BSD-style license. And my understanding is that most of the runtime components are public domain anyway so they wouldn't have any restriction.

 

*See:

4. Combined Works.

You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:

  • a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
  • b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
  • c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
  • 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.
  • e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)

 



#6 +snaphat (Myles Landwehr)

snaphat (Myles Landwehr)

    Electrical & Computer Engineer

  • Tech Issues Solved: 29
  • Joined: 23-August 05
  • OS: Win/Lin/Bsd/Osx
  • Phone: dumb phone

Posted 28 December 2013 - 01:20

Here's a good example of why you are bound to redistribute the source code. Imagine that a vendor privately did modifications and then compiled some LGPL software. If they distribute the binaries then they are required to distribute the source code right? Now, suppose they only distribute the binaries/source code to their customers. And now imagine their costumers decide to redistribute the same binaries. If the customers were exempt from redistributing the source code, then the entire purpose of copy-left licensing is circumvented.

 

Now another good example: imagine you simply link to MinGW's source code instead of hosting/providing the source code yourself (supposing that MingGW was simply LGPL). And then imagine that MinGW closes shop and stops providing binaries and source code all together. Now, you are distributing binary and you can't distribute the source code because you don't have it and were actually relying on someone else to distribute it for you.



#7 OP rwx

rwx

    Neowinian

  • Joined: 24-February 08

Posted 28 December 2013 - 02:13

 

Now another good example: imagine you simply link to MinGW's source code instead of hosting/providing the source code yourself (supposing that MingGW was simply LGPL). And then imagine that MinGW closes shop and stops providing binaries and source code all together. Now, you are distributing binary and you can't distribute the source code because you don't have it and were actually relying on someone else to distribute it for you.

 

Yes, I get the point now and I agree, that is a good point.

 

In my case, the software I'd like to redistribute as a freeware (I am an independent developer) was developed with the Qt framework (which is a top-notch framework without a doubt).

 

I dynamically link to Qt DLL files as well as the MinGW DLLs. When I say dynamically, what I mean is my EXE requires the DLLs in order for it to run. So the DLL code is not built-into the exe itself. It depends on the DLLs and take one DLL away, it won't run. My app is closed source and have done zero modifications to the Qt libraries. I just #included the header files so I can utilize the API.

 

So I will need to have Qt's source code handy in case someone asks for it (which I do).

 

My understanding is that I am bound to include the LGPL license file with the files I am redistributing and acknowledge the use of Qt LGPL edition in the about box and I have done all this.

 

That's basically all I intend to do and the LGPL allows having the source closed if you dynamically link the libraries (as far as I am aware).



#8 +snaphat (Myles Landwehr)

snaphat (Myles Landwehr)

    Electrical & Computer Engineer

  • Tech Issues Solved: 29
  • Joined: 23-August 05
  • OS: Win/Lin/Bsd/Osx
  • Phone: dumb phone

Posted 28 December 2013 - 02:33   Best Answer

Yes, I get the point now and I agree, that is a good point.

 

In my case, the software I'd like to redistribute as a freeware (I am an independent developer) was developed with the Qt framework (which is a top-notch framework without a doubt).

 

I dynamically link to Qt DLL files as well as the MinGW DLLs. When I say dynamically, what I mean is my EXE requires the DLLs in order for it to run. So the DLL code is not built-into the exe itself. It depends on the DLLs and take one DLL away, it won't run. My app is closed source and have done zero modifications to the Qt libraries. I just #included the header files so I can utilize the API.

 

So I will need to have Qt's source code handy in case someone asks for it (which I do, it comes with installer as far as I am aware).

 

I know I am bound to include the LGPL license file with the files I am redistributing and acknowledge the use of Qt LGPL edition in the about box.

 

That's basically all I intend to do and the LGPL allows having the source closed if you dynamically link the libraries (as far as I am aware).

 

This all sounds perfectly permissible to me (and quite common). Dynamic linking is required as per the license AFAIK because of the part I highlighted in my previous post. I don't believe static linking is allowed because it would make it impossible for the user to relink to a newer revision of the library (as required under the licensing terms). Anyway, I just took a look at the specific revision that QT is using and it it looks like newer revisions of the LGPL have a stipulation that exempts you from having to directly redistribute the source after all (this is not in the older versions: https://www.gnu.org/licenses/lgpl.html). So you can go ahead and do what you were thinking and just provide a link:

 

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

-http://www.gnu.org/l...s/lgpl-2.1.html

 

Be careful though, if the version or the license the software is under doesn't have that stipulation then you should be wary of doing doing it that way. It's important to check the terms exactly.



#9 OP rwx

rwx

    Neowinian

  • Joined: 24-February 08

Posted 28 December 2013 - 03:29

Thank you! Yes I am using the latest version.



#10 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 12
  • Joined: 26-October 05

Posted 28 December 2013 - 04:04

Thank you! Yes I am using the latest version.

Just a reminder: if your question has been answered, please click "Mark Solved" on the answer.



#11 OP rwx

rwx

    Neowinian

  • Joined: 24-February 08

Posted 28 December 2013 - 04:31

Done,

 

Cheers