• 0

Is libwinpthread-1.dll covered by the "GCC Runtime Library Exception"


Question

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/licenses/gcc-exception-3.1-faq.html

 

  Quote

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:

 

  Quote

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:

 

  Quote

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

10 answers to this question

Recommended Posts

  • 0
  On 28/12/2013 at 02:13, rwx said:

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:

 

  Quote
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/licenses/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.

  • 0

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.net/p/mingw-w64/code/6184/tree/trunk/mingw-w64-libraries/winpthreads/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.sourceware.org/pthreads-win32/manual/pthread_condattr_init.htmlhttp://linux.die.net/man/3/pthread_condattr_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.

  • 0
  • 0

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.

  • 0
  On 28/12/2013 at 00:37, rwx said:

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:

  Quote
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.)

 

  • 0

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.

  • 0
  Quote

 

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

  • 0
  On 28/12/2013 at 03:29, rwx said:

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.

  • Like 1
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Shouldn't using "High Performance" mode prevent c-states from initializing? Maybe AMD hasn't built a proper power plan for their x3d processors like they used to for their ryzen chips.
    • Vivetool also has a GUI. Literally took me three clicks to enable this from there.
    • Microsoft Weekly: OneDrive horror stories, ramblings about Start menu, and more by Taras Buria This week's news recap is here, delivering you a roundup of the most important Microsoft stories, including a bunch of odd stuff and bugs in Windows, OneDrive horror stories, ramblings about the Start menu, a couple of new Windows 11 preview builds, important news from AMD, and a lot more. Quick links: Windows 10 and 11 Windows Insider Program Updates are available Reviews are in Gaming news Windows 11 and Windows 10 Here, we talk about everything happening around Microsoft's latest operating system in the Stable channel and preview builds: new features, removed features, controversies, bugs, interesting findings, and more. And, of course, you may find a word or two about older versions. Microsoft released a new out-of-band update to fix boot issues on certain Surface devices. The company announced certain Windows 365 updates, such as VBS and HVCI support (by default) and app provisioning in Windows 365 instead of entire cloud PCs. Microsoft is also removing legacy drivers from Windows Update in a new "strategic move." This is the default Windows 365 wallpaper On the negative side, we have the latest Patch Tuesday updates breaking the DHCP Server in all Windows Server editions. Also, there is some bad news for PC users with Windows Hello cameras: after the April 2025 Patch Tuesday updates, Windows Hello does not work in the dark. The change was quietly introduced to address security issues. Windows Goodbye That is not all, though. As it turned out, solid-state drives from WD could still block your computer from installing Windows 11 version 24H2, which was released in October 2024. Also, Microsoft's Family Safety feature is now blocking Chrome, for some reason. Here is an editorial from Usama Jawad (welcome back) about how, four years after the initial release, Windows 11 still does not offer strong enough reasons to upgrade from the outgoing Windows 10. Also, Usama shared his thoughts about the Start menu and why he had stopped caring about its changes altogether. Speaking of the Start menu, check out our overview of what users wanted from Microsoft and what the company delivered in the redesigned Start menu, which was recently announced. Windows Insider Program Here is what Microsoft released for Windows Insiders this week: Builds Canary Channel Build 27881 This week's Canary build introduced context menu improvements, new accessibility features, Settings app tweaks, and more. Dev Channel Nothing in the Dev Channel this week Beta Channel Nothing in the Beta Channel this week Release Preview Channel Build 26100.4482 (KB5060829) This build improves File Explorer and search performance, adds some changes to default browser settings, and fixes multiple bugs. Some hidden stuff in the recent Windows 11 preview builds includes a new adaptive battery saver. This feature dynamically adapts battery saver mode according to your workflow, but in its current form, it is not fully operational. Even though Microsoft acknowledged its existence, the adaptive part still needs improvements. Another useful change in the recent builds is the return of a clock in the notification center. This time, however, Microsoft makes it more customizable, and you can toggle it on or off. Also, the company is moving more Control Panel bits to the Settings app and adding a rather unexpected customization feature that will let you select where system indicators (flyouts and sliders) appear on the screen. Microsoft started rolling out a new update for the Snipping Tool app. The latest release lets you save screen recordings as GIFs. Shortly after that, we posted a guide with a bit more detail about the feature. Updates are available This section covers software, firmware, and other notable updates (released and coming soon) from Microsoft and third parties, delivering new features, security fixes, improvements, patches, and more. Microsoft is working on a Dashboard redesign for PowerToys. Developers published an early look at what is coming to the app in future updates, revealing a better-organized page with quick links, a shortcut overview, and a list of available modules. This week's Office updates are rather mixed. OneDrive, for one, is having problems finding files. Microsoft acknowledged the issue, which affects users on Windows, iOS, Android, and the web. Unfortunately, that is not the only negative story about OneDrive. A new report from a frustrated user revealed a scary tale of Microsoft locking them out of an account full of invaluable content. Outlook also has some issues, this time, with opening emails, and Microsoft 365 will soon disable outdated protocols for file access. Finally, Copilot in Excel received a major update for context awareness, which made the assistant more useful when answering questions about data. This week's browser updates include several releases. Firefox announced a new method for pinning and unpinning tabs. It is now available for testing in the Nightly channel. Microsoft Edge was updated with fixes for two security vulnerabilities (high severity) originating from Chromium. Finally, here is this week's Microsoft 365 Roadmap with an overview of all the new stuff that Microsoft added to the website. Here are other updates and releases you may find interesting: Microsoft 365 security in the spotlight after Washington Post hack. Microsoft expands European sovereign cloud offerings with new data and key controls. Microsoft Defender XDR received TITAN-powered Security Copilot recommendations. Microsoft reportedly plans more layoffs. Watchdog found Microsoft guilty of confusing advertising when it comes to Copilot. Here are the latest drivers and firmware updates released this week: AMD released a new chipset driver for Ryzen processors under version 7.06.02.123, which followed a security update for TPM-Pluton. Nvidia 576.80 WHQL with fixes for the RTX 5090 FE, new game support, and a long list of fixes. You can get some extra performance on certain AMD Ryzen chips with a simple system tweak. Surface Pro 11 and Surface Laptop 7 received big firmware updates with multiple fixes and improvements. Reviews are in Here is the hardware and software we reviewed this week This week, Steven Parker reviewed the TerraMaster D4 SSD, a palm-sized DAS with up to 32TB of storage that you can connect over USB4. This thing is rather impressive, and for a modest price tag, it delivers a tiny footprint, great looks, full RAID support in TOS 6, quick connection, and more. On the gaming side Learn about upcoming game releases, Xbox rumors, new hardware, software updates, freebies, deals, discounts, and more. AMD and Microsoft announced some big news this week. The two companies revealed a new multi-year partnership, which secures AMD as the future maker of chips for Xbox consoles and other hardware. Sarah Bond announced the partnership in a new video on the official Xbox media channels. Turn 10 Studios announced a new Forza Motorsport update. Update 21 brings IndyCar content, Career mode expansion, Featured Tours, new reward cars, and more. It is now available on Xbox and PC via the Microsoft Store and Steam. Minecraft is another Microsoft-owned game that received a big update this week. The long-anticipated graphics overhaul is finally here with directional lighting, volumetric fog, improved shadows, reflections, godrays, and a lot more. In addition, Mojang released Chase the Skies, the latest content drop, which adds happy ghasts, new music disks, a locator bar for players, environmental fog in the overworld, new background music, and all sorts of small gameplay changes. Microsoft announced new games for Game Pass. The latest additions include FBC: Firebreak, Crash Bandicoot 4: It's About Time, Start Trucker, Wildfrost, Rematch, Call of Duty: WWII, Rise of the Tomb Raider, and more. As usual, some games are leaving the subscription. Valve released a big update for the Steam overlay. The latest version introduced major upgrades to CPU and VRAM usage, temperatures, and other important metrics that you might want to track when playing games on your gaming rig. Deals and freebies Also, be sure to check out this week's Weekend PC Game Deals article, which features rhythm bundles, fishing festivals, DRM-free summer sales, and more. Other gaming news includes the following: Take-Two confirmed Borderlands 4 will not cost $80 for the base game. The Coalition expanded the Gears of War: Reloaded beta after its rocky start. Ara: History Untold 1.4 update delivered overhauls to AI, map generation, combat, and more. Star Citizen Alpha 4.2 update lands with radiation hazards, dynamic rain, and more. This link will take you to other issues of the Microsoft Weekly series. You can also support Neowin by registering a free member account or subscribing for extra member benefits, along with an ad-free tier option. Microsoft Weekly image background by steve_a_johnson on Pixabay
  • Recent Achievements

    • First Post
      Johnny Mrkvička earned a badge
      First Post
    • Week One Done
      viraltui earned a badge
      Week One Done
    • One Month Later
      serfegyed earned a badge
      One Month Later
    • Dedicated
      firey earned a badge
      Dedicated
    • Dedicated
      fettermanj earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      635
    2. 2
      ATLien_0
      230
    3. 3
      Michael Scrip
      218
    4. 4
      Xenon
      149
    5. 5
      Steven P.
      140
  • Tell a friend

    Love Neowin? Tell a friend!