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

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 14 21:54:07 PST 2021


gkm added a comment.

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

> In D96164#2562655 <https://reviews.llvm.org/D96164#2562655>, @thakis wrote:
>
>> Re the copy stuff: See the CL desc and openradar link in https://reviews.llvm.org/rGba3bc2fd41b8428904fc779e353d3769074d8982
>
> That is good to know. This case differs: LLD is not overwriting an existing file, so is not reusing an vnode. There is something funky in `FileOutputBuffer`, which creates the LLD output file via mmap(2).

Travis Hill <travis at xojo.com> fed me the answer. The Go peeps had the same problem: https://go-review.googlesource.com/c/go/+/272258
The Darwin kernel caches signature verification results by vnode. mmap(2) creates the cache entry, before we have written anything to the output. The fix is to invalidate the cache after writing via `msync(..., MS_INVALIDATE);`


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