3

My question is related to GPLv3 and GCC runtime exception. I need to include GCC source code in my project.

I am an author of an embedded library that is intended to be built using GCC C++ compiler from GNU ARM Embedded Toolchain.

During the build process, linker complains that certain functions from GCC compiler are undefined. I realized that I need include two files from GCC source code, mutex.cc and future.cc, to have my project build.

The two files, mutex.cc and future.cc, are part of GCC C++ STL implementation. The license inside of those files says GPLv3 and include the GCC runtime library exception.

Normally, the code from those files would be included in the prebuilt GCC stdlibc++ library. However, for the GNU ARM Embedded Toolchain, those files are excluded in the tool's build configuration (technically, the files are included, just the required functions are excluded due to conditional build). The two files are not delivered with the released binary version of GCC. I needed to download them from GCC source code repository.

End users, in order for their project to build, need to include source code of my library and the two GCC files in their build. My library does not modify the two files, does not add or remove functionality. The files will stay as they are. If they were linked with stdlibc++, I would not need the source code.

As I understand GCC runtime exception allows the end users not to publish source code (closed-source?) of their product even if some parts of GCC code is included during the compile or build process.

Now,

  1. What is the situation when the end user has to include this code explicitly? Is the exception still triggered or this automatically force him to use GPLv3?
  2. If answer to 1 is GPLv3 is needed - What if I rebuild the GNU ARM Embedded Toolchain, including the required files and publish my modification with GPLv3 with GCC runtime exception? Users would need to use my version of the compiler. Will this still force users to use GPLv3?
  3. If answer to 1 is no, GPLv3 is not needed - Can I release my library as MIT and, for simplicity, include the two files in my repository? Is dual license possible? Is dual license needed?
  4. The code in the two files is simple. I could potentially provide my implementation of the files. What would I need to avoid doing this to avoid GPLv3?
  5. Is there any other way for the user to use those two files without falling into GPLv3?
2
  • When users build (an application using) your library, are those STL implementation files automatically included in the build, or do they need to take explicit steps to build those as well? What license is your library released under? Commented Feb 1, 2021 at 8:33
  • The STL files are not part of my library. They are from GCC. There are two options. First option, user would need to download it from GCC repository and build himself/herself. Second opinion, for simplicity I could deliver those files together with my library. Still user would need to build all himself. In both cases all is delivered as source. I would like to release my library under MIT license. Commented Feb 1, 2021 at 21:31

1 Answer 1

1
  1. What is the situation when the end user has to include this code explicitly? Is the exception still triggered or this automatically force him to use GPLv3?

I believe the linking exception will remain in effect, as long as neither you nor the end-user rely on the specific implementation in those files, but only that they provide a implementation for a set of functions.

  1. If answer to 1 is GPLv3 is needed - What if I rebuild the GNU ARM Embedded Toolchain, including the required files and publish my modification with GPLv3 with GCC runtime exception? Users would need to use my version of the compiler. Will this still force users to use GPLv3?

Providing your users with a modified, GCC-based toolchain does not force your users to use the GPL license (unless you deliberately removed the linking exceptions from the library part you distribute).

  1. If answer to 1 is no, GPLv3 is not needed - Can I release my library as MIT and, for simplicity, include the two files in my repository? Is dual license possible? Is dual license needed?

If those GCC files are not automatically built when someone builds your library and they are merely included so that your users don't need to hunt the internet for those files, then that is called "mere aggregation". Your library and the GCC files are considered to be independent works as far as copyright is concerned.

This means that your library can use any license you like.

  1. The code in the two files is simple. I could potentially provide my implementation of the files. What would I need to avoid doing this to avoid GPLv3?

As you are now aware of the implementation of those files, it can be tricky to create a new implementation that would not be considered a derived work of the GCC version. You would need to prove somehow that you didn't copy the GCC implementation, with your memory as an intermediate, or you would have to prove that there is only one way to write those functions.

2
  • Great answer! Just for clarification... "If those GCC files are not automatically built when someone builds your library and they are merely included [...]". Well, they are cc files and must be compiled at some stage by user as a separate library and linked all together. Does this make a difference? They are still independent work though. Commented Feb 2, 2021 at 7:23
  • @PiotrGrygorczuk, if you integrate those files in the build of your library, it can be argued that they have become part of your library. That would make your library a derivative work and requires that you license your library under the GPL with or without the linking exception. Commented Feb 2, 2021 at 8:57

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.