Thread overview
Licensing of PGO instrumented code.
Sep 15, 2016
Johan Engelen
Sep 15, 2016
David Nadlinger
Sep 16, 2016
Johan Engelen
Sep 16, 2016
Johan Engelen
Sep 16, 2016
Johan Engelen
Sep 17, 2016
Intersteller
Sep 19, 2016
Kagamin
Sep 19, 2016
Johan Engelen
September 15, 2016
Hi all,
  I just discovered an important licensing issue with the use of LLVM compiler-rt's code for _instrumenting_ code for PGO. The problem is that with -fprofile-instr-generate, we link with a piece of LLVM's compiler-rt code. The compiler-rt license reads:
"Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."

Basically, a program compiled with `-fprofile-instr-generate` will have a piece of compiler-rt inside of it, and redistributing that file will need to be accompanied with the compiler-rt license and the other requirements.

Important note: this does not concern programs compiled with `-fprofile-instr-use`. So only PGO instrumented binaries need the compiler-rt license when distributed, not PGO optimized binaries. In practice, I think it is rare to distribute instrumented binaries, but not unthinkable.

There is currently an LLVM discussion about relicensing compiler-rt to allow unattributed binary form distribution, to solve this problem as far as I understand.
http://lists.llvm.org/pipermail/llvm-dev/2016-September/104778.html

How do we address this issue?

(I think we need to have information on this ASAP in our LICENSE file. Tomorrow, I will work on it.)

-Johan

September 15, 2016
On 15 Sep 2016, at 23:23, Johan Engelen via digitalmars-d-ldc wrote:
> There is currently an LLVM discussion about relicensing compiler-rt to allow unattributed binary form distribution, to solve this problem as far as I understand.
> http://lists.llvm.org/pipermail/llvm-dev/2016-September/104778.html
>
> How do we address this issue?

What are the Rust people doing? (IIRC they depend on compiler-rt by default, right?)

 — David
September 16, 2016
On Thursday, 15 September 2016 at 22:37:55 UTC, David Nadlinger wrote:
> On 15 Sep 2016, at 23:23, Johan Engelen via digitalmars-d-ldc wrote:
>> There is currently an LLVM discussion about relicensing compiler-rt to allow unattributed binary form distribution, to solve this problem as far as I understand.
>> http://lists.llvm.org/pipermail/llvm-dev/2016-September/104778.html
>>
>> How do we address this issue?
>
> What are the Rust people doing? (IIRC they depend on compiler-rt by default, right?)

Thanks for that pointer.
It lead me to this:
https://www.reddit.com/r/rust/comments/2db531/how_to_display_the_rust_copyright_notice_in/

Which lead me to this:
http://llvm.org/docs/DeveloperPolicy.html#license
"In addition to the UIUC license, the runtime library components of LLVM (compiler_rt, libc++, and libclc) are also licensed under the MIT License, which does not contain the binary redistribution clause. As a user of these runtime libraries, it means that you can choose to use the code under either license (and thus don’t need the binary redistribution clause), and as a contributor to the code that you agree that any contributions to these libraries be licensed under both licenses. We feel that this is important for runtime libraries, because they are implicitly linked into applications and therefore should not subject those applications to the binary redistribution clause."

Thus, I think we should copy the text above into our LICENSE file, specifying it for profile-rt (our copy of compiler-rt's lib/profile) and include the MIT License. And then we are good to go.
Also see Rust's license file: https://github.com/rust-lang/rust/blob/master/COPYRIGHT

(Upon further thought I think the relicensing effort in LLVM is about being able to move code from LLVM to compiler-rt. The issue I am discussing here is actually already solved the dual license.)

-Johan

September 16, 2016
On Friday, 16 September 2016 at 09:22:54 UTC, Johan Engelen wrote:
> 
> Thus, I think we should copy the text above into our LICENSE file, specifying it for profile-rt (our copy of compiler-rt's lib/profile) and include the MIT License.

To simplify matters, I could relicense my own D code (/profile-rt/d/ldc/*) under the same license as compiler-rt.
Is that OK?


September 16, 2016
On Friday, 16 September 2016 at 09:46:12 UTC, Johan Engelen wrote:
> 
> Is that OK?

I'm the sole author :-)


PR here: https://github.com/ldc-developers/ldc/pull/1765


September 17, 2016
On Friday, 16 September 2016 at 10:15:04 UTC, Johan Engelen wrote:
> On Friday, 16 September 2016 at 09:46:12 UTC, Johan Engelen wrote:
>> 
>> Is that OK?
>
> I'm the sole author :-)
>
>
> PR here: https://github.com/ldc-developers/ldc/pull/1765

The solution to all this BS is for everyone to simply stop believing in the copyright myth!  No one owns anything... God owns it all.


September 19, 2016
On Friday, 16 September 2016 at 10:15:04 UTC, Johan Engelen wrote:
> PR here: https://github.com/ldc-developers/ldc/pull/1765

You could keep it as boost, it can be sublicensed as MIT at will. AFAIK, boost is a nobrainer license, it's compatible with anything. Unless you prefer a stricter one, that is :)
September 19, 2016
On Monday, 19 September 2016 at 18:42:21 UTC, Kagamin wrote:
> On Friday, 16 September 2016 at 10:15:04 UTC, Johan Engelen wrote:
>> PR here: https://github.com/ldc-developers/ldc/pull/1765
>
> You could keep it as boost, it can be sublicensed as MIT at will. AFAIK, boost is a nobrainer license, it's compatible with anything. Unless you prefer a stricter one, that is :)

I prefer it to be the same as the rest of profile-rt. For less confusion.