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

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 23:36:00 PST 2021


gkm added a comment.

In D96164#2546549 <https://reviews.llvm.org/D96164#2546549>, @int3 wrote:

> hm is this that much more convenient than invoking codesign after LLD finishes running in whatever build we're testing?

ld64 signs automatically. Config & build systems of all kinds assume that linked programs are runnable. On arm64 macOS, if lld doesn't sign, then programs don't run without explicit `codesign -s - ...`, and every config & build system needs to be taught that. No thank you.

In D96164#2546586 <https://reviews.llvm.org/D96164#2546586>, @thakis wrote:

> I think `codesign -s` also doesn't set the magic "codesigned by linker" bit that makes strip etc work better (and if doesn't work in cross builds from non-mac hosts). I kind of agree that putting this in as is isn't super useful.

FYI, it is super useful for testing self-hosted native arm64 macOS builds of LLVM and other packages (e.g., GNU coreutils). If you don't want it committed to LLVM, that's fine with me. I have been using it productively as a local change and others who want to work on native arm64 macOS can place it at the base of their local diff stacks too.

> (Don't know if you've seen it, but golang has a from scratch impl of this for 1.16 -- and there's ld64 too of course.)

I briefly looked at ld64-530 (the most recent Apple code drop), and could not find any code that generates `LC_CODE_SIGNATURE`. I will look harder this weekend.


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