[PATCH] D96164: [lld-macho] add code signature for native arm64 macOS

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 03:22:51 PST 2021


kristof.beyls added a comment.

In D96164#2547858 <https://reviews.llvm.org/D96164#2547858>, @gkm wrote:

> df>>! In D96164#2547480 <https://reviews.llvm.org/D96164#2547480>, @smeenai wrote:
>
>> In D96164#2547390 <https://reviews.llvm.org/D96164#2547390>, @thakis wrote:
>>
>>> LLVM tries to not depend on external libraries if possible. Given that sha256 isn't that much code (https://golang.org/src/crypto/sha256/), just adding a fresh implementation of it (to lld/MachO for now) is probably the way to go.
>>
>> Agreed. There's some prior art here too ... LLVM has a SHA1 implementation in `llvm/include/llvm/Support/SHA1.h` and `llvm/lib/Support/SHA1.cpp`. That was adapted from an existing public-domain implementation, and we could do the same here (find a SHA256 implementation with a license that allows it to copied into LLVM).
>
> Openssl has a C implementation of sha256 with Apache 2.0 license. Unless someone knows of a better candidate, I'll go with that.

I'm afraid that just copying an Apache-2.0 licensed implementation is not an option.

As described at https://llvm.org/docs/DeveloperPolicy.html#relicensing, "....In the interim, all contributions to the project will be made under the terms of both the new license and the legacy license scheme...", so code contributions must be covered by both the new and legacy license scheme.
The SPDX identifier for the new license is "Apache-2.0 WITH LLVM-exception"; for the legacy license it is "NCSA".

Therefore, just copying code that is covered by an Apache-2.0 license into the LLVM code base is not an option I'm afraid.
Apache-2.0 is a different license to "Apache-2.0 with LLVM exception" and to "NCSA".
I guess the most obvious options to get a sha256 implementation into the code base are:

1. get the copyright holder of an existing implementation to contribute it to LLVM, under both the "Apache-2.0 WITH LLVM-exception" and "NCSA" license.
2. write an implementation from scratch and contribute that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96164/new/

https://reviews.llvm.org/D96164



More information about the llvm-commits mailing list