11

So, libstdc++ has the runtime exception that permits even proprietary software to use libstdc++.

But, hypothetically, can I actually distribute a non-modified binary of libstdc++ along with a binary of my proprietary program? (Given that I make the source code for libstdc++ available to anyone that asks, and that I distribute a copy of its license).

A specific example: Let's say I use MinGW to compile a Windows binary. This requires libstdc++ (and other libraries, such as libgcc) to function. To make it easy for end-users to install this program, I'd like to just distribute the app along with libstdc++, libgcc etc. I'm asking of this is possible (as for it being ethical is another issue; I support free software, that's why I say it's hypothetical). Also, I'm thinking about dynamic linking instead of static.

1
  • 1
    Instead of just downvoting, can people please explain why so I can imrpove the answer?
    – csl
    Sep 21, 2015 at 12:54

2 Answers 2

8

From the documentation:

  1. Grant of Additional Permission.

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.

So, you can distribute the combination of your code and the library.

2
  • So, the question is whether compiling with MinGW is an "eligible compilation process". But what does combining mean here? Does it mean static or dynamic linkage?
    – csl
    Sep 21, 2015 at 13:10
  • 2
    I am not your lawyer. I believe that MinGW is more than eligible, and any kind of linking is OK.
    – bmargulies
    Sep 21, 2015 at 15:01
5

I disagree with the answer marked as correct[1]:

Note that if you distribute libstdc++ as an independent library, you will need to follow the terms of the GPL when doing so. For example, if you distribute the library itself in object code form, you will need to provide source code to your recipients using one of the methods listed in section 6 of GPLv3.

The Exception has to do with being able to combine (== link) stuff from GCC into the final binary without altering its license. But shipping libstdc++.so alongside your binary requires fulfilling the GPLv3 terms.

[1]https://www.gnu.org/licenses/gcc-exception-3.1-faq.en.html

3
  • Maybe a nitpick, but on SE sites, marking an answer shouldn't be taken to mean it's 'correct'; the checkmark really just means that it was accepted by the author as the best answer at the time. For this case it was the only answer submitted at the time, until yours.
    – Brandin
    Oct 4, 2022 at 7:11
  • I agree with this answer. Though the old answer might still be OK, depending on the details of "Given that I make the source code for libstdc++ available to anyone that asks".
    – Brandin
    Oct 4, 2022 at 7:23
  • For your answer I would also look at the quote above (in the accepted answer) and draw attention to this part: "You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules." That's why the FAQ says what it says -- i.e. you still have to comply with the independent module license (i.e. the libstdc++ GPL license).
    – Brandin
    Oct 4, 2022 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.