Questions regarding copyright and license of with emscripten compiled code

116 views
Skip to first unread message

paw

unread,
Apr 25, 2022, 4:51:23 AM4/25/22
to emscripten-discuss
Hello everyone,

At my work, we create a tool which runs in the Web Browser but uses native components. These are compiled with emscripten to asm.js (we plan to transition to wasm in the future).

As a company we want to provide the as correct as possible list of our used open source software and respect the licenses as well as the copyrights.

Therefore we want to add the necessary information that we use the code which is compiled with emscripten. We do not and are currently not planning to ship emscripten, therefore we are at the moment only interested in the code emitted by emscripten. Therefore I have these questions:

  1. Under which license and copyright is the from emscripten generated code?
  2. As far as I know, there are JavaScript / Browser implementations of libc in order to be able to execute code which uses these APIs. Under which license and copyright is this code? Is there a specific source code folder which holds this implementation so that I can focus my intention on this particular folder?
  3. Is there a difference regarding emitting asm.js and WASM in the context of license and copyright? (there is obviously a technical difference, but I am not interested in this at the moment)
  4. Is in the generated code anything which was copied or otherwise added which orignally stems from another open source software? What comes to my mind are things like polyfills which could be generated into the code in order "to make things work" etc.. (I am aware of emscripten ports and we specifically use FreeType, Harfbuzz and ICU. But is there more than that).
Thank you very much in advance for your answers.

Best regards,

paw

paw

unread,
Apr 25, 2022, 4:54:03 AM4/25/22
to emscripten-discuss
Addendum:
I know and respect that you cannot give me legal advice. At the end it comes down, that we don't want to add emscripten to our software Bill of Material if we don't intend to ship it and if the generated code (and its dependencies) may be licensed differently.

Floh

unread,
Apr 26, 2022, 1:19:11 PM4/26/22
to emscripten-discuss
I'm neither part of the Emscripten team or a lawyer, so take my answers with a huge grain of salt.
  1. Under which license and copyright is the from emscripten generated code?
Emscripten doesn't matter in this case, only the license of the source code that's compiled.
  1. As far as I know, there are JavaScript / Browser implementations of libc in order to be able to execute code which uses these APIs. Under which license and copyright is this code? Is there a specific source code folder which holds this implementation so that I can focus my intention on this particular folder?
AFAIK Emscripten uses MUSL as libc (https://musl.libc.org/) which is liberally licensed (MIT License: https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT).

Standard MIT license may require attribution, at least that's what I've been told is the main difference to the even more liberal zlib/libpng license.
  1. Is there a difference regarding emitting asm.js and WASM in the context of license and copyright? (there is obviously a technical difference, but I am not interested in this at the moment)
I don't think so.
  1. Is in the generated code anything which was copied or otherwise added which orignally stems from another open source software? What comes to my mind are things like polyfills which could be generated into the code in order "to make things work" etc.. (I am aware of emscripten ports and we specifically use FreeType, Harfbuzz and ICU. But is there more than that).
This is actually something the Emscripten team needs to answer. The toolchain license itself should not "bleed into" the compiler output, but there may be some sources compiled into the resulting program where the license matters (such as MUSL).

paw

unread,
Apr 26, 2022, 3:51:41 PM4/26/22
to emscripten-discuss
Thanks Floh. Most of the source code is our own besides the mentioned emscripten ports.

I am not sure for what emscripten uses libc, but I guess it is not compiled to asm.js / WASM since its actual implementation cannot be simply realized in the browser. Or maybe I am missunderstanding and this is exactly what they do.

Alon Zakai

unread,
Apr 26, 2022, 3:57:16 PM4/26/22
to emscripte...@googlegroups.com
On Mon, Apr 25, 2022 at 1:51 AM 'paw' via emscripten-discuss <emscripte...@googlegroups.com> wrote:
Hello everyone,

At my work, we create a tool which runs in the Web Browser but uses native components. These are compiled with emscripten to asm.js (we plan to transition to wasm in the future).

As a company we want to provide the as correct as possible list of our used open source software and respect the licenses as well as the copyrights.

Therefore we want to add the necessary information that we use the code which is compiled with emscripten. We do not and are currently not planning to ship emscripten, therefore we are at the moment only interested in the code emitted by emscripten. Therefore I have these questions:

I'll try to answer these as best I can. I am not a lawyer, to be clear, but I am the creator of Emscripten and I am the one that chose the license for the project back in 2010.

Before getting to specific answers, the bottom line to all of this is that I chose the MIT license for Emscripten, and only picked similarly-permissively-licensed projects to bundle like musl and LLVM libraries, because my goal was for licensing to not ever be a problem for users. So my hope is that for you, and anyone else, licensing causes no issues.
 

  1. Under which license and copyright is the from emscripten generated code?
First, note that Emscripten itself is under the MIT license,


(and also the NCSA open source license, but that is for historical reasons and does not matter here). When you use Emscripten to generate code, some parts of Emscripten may appear in the generated code, like snippets of JS library logic, etc. The MIT license says this:

"The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software."

I have never considered the generated code to contain a "substantial portion" of Emscripten (it's just small snippets compared to all of Emscripten, and they are modified and combined with user code during compilation anyhow, etc.). So I have never expected people to keep a copyright notice around, like Floh was saying. From my point of view, the point of Emscripten is to be a tool that is as easy to use as possible, and in particular that does not require a copyright notice in every compiler output or any other burden. That is, the compiler has an open source license, but when the user creates an output, I didn't want to place any requirements on that output. For that reason I chose MIT.
  1. As far as I know, there are JavaScript / Browser implementations of libc in order to be able to execute code which uses these APIs. Under which license and copyright is this code? Is there a specific source code folder which holds this implementation so that I can focus my intention on this particular folder?
Emscripten uses the musl libc (MIT licensed, see https://github.com/emscripten-core/emscripten/blob/main/system/lib/libc/musl/COPYRIGHT). The JS side of the libc and other API support is Emscripten's JS library logic, which was mentioned before (all that is under src/library_*.js).
  1. Is there a difference regarding emitting asm.js and WASM in the context of license and copyright? (there is obviously a technical difference, but I am not interested in this at the moment)
As a non-lawyer I can't really say, but as the person that chose the license, I would hope there is no difference between asm.js and wasm in anything here... :)
  1. Is in the generated code anything which was copied or otherwise added which orignally stems from another open source software? What comes to my mind are things like polyfills which could be generated into the code in order "to make things work" etc.. (I am aware of emscripten ports and we specifically use FreeType, Harfbuzz and ICU. But is there more than that).
Aside from the musl libc there are a few LLVM libraries used like libc++, libc++abi, and compiler-rt. Those are necessary to build a full toolchain. All use the LLVM standard license (Apache 2 + LLVM exception), e.g. https://github.com/emscripten-core/emscripten/blob/main/system/lib/libcxx/LICENSE.TXT

Doing a search in src/ for copyright (and filtering out Emscripten's) I see that the Promise polyfill has a license text (https://github.com/emscripten-core/emscripten/blob/main/src/polyfill/promise.js) but that is not included normally (only to polyfill for old browsers, if a setting is set for that). It is also MIT just like Emscripten.

- Alon

Thank you very much in advance for your answers.

Best regards,

paw

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/fef7b40d-6f7f-400c-ba36-7b8ff6753850n%40googlegroups.com.

paw

unread,
Apr 28, 2022, 3:59:11 PM4/28/22
to emscripten-discuss
Thanks Alon, that helps a lot.
Reply all
Reply to author
Forward
0 new messages