Hi:
We're compiling NDK downstream r26 on Darwin @ arm64.
In base_builders.LLVMBuilder.cmake_defines:
``LLVM_CODESIGNING_IDENTITY`` should not be set. I'll explain below:
On modern Darwin, the whole traditional linking / signing process goes:
1. Linker generates an linker signature for the binary automatically
2. Optionally, codesign the signature with a non-local(a.k.a. real) identity
3. Other MachO modifications like install_name_tool, etc
When Step 2 is not executed:
The binary is still signed with a local identity, which gets picked up by upcoming tools like install_name_tool that automatically re-applies the ad-hoc signature, therefore the binary is still able to function
However, if Step 2 is involved (Which is the case when the original buildsystem explicitly passed ``-`` as the signing identity) :
The linker signature is lost, thus upcoming tools like install_name_tool won't be able to resign the binary. In fact, install_name_tool explicitly warns about this case. This results in a broken toolchain and especially breaks multi-stage building.
This works on X64_macOS host because X64 doesn't enforce codesigning, but breaks on arm64_macOS due to a valid codesign is required.