Page MenuHomePhabricator

gkm (Greg McGary)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 13 2020, 11:31 AM (50 w, 16 h)

Recent Activity

Yesterday

gkm updated the diff for D97610: [lld-macho] check minimum header length when opening linkable input files.
  • resubmit to catch parent-diff dependence
Fri, Feb 26, 11:53 PM · Restricted Project, Restricted Project
gkm requested review of D97610: [lld-macho] check minimum header length when opening linkable input files.
Fri, Feb 26, 11:51 PM · Restricted Project, Restricted Project
gkm updated the diff for D97600: [lld-macho] Implement options -rename_section -rename_segment.
  • revise according to review feedback
Fri, Feb 26, 9:45 PM · Restricted Project, Restricted Project
gkm added inline comments to D97600: [lld-macho] Implement options -rename_section -rename_segment.
Fri, Feb 26, 9:44 PM · Restricted Project, Restricted Project
gkm added inline comments to D97600: [lld-macho] Implement options -rename_section -rename_segment.
Fri, Feb 26, 5:54 PM · Restricted Project, Restricted Project
gkm requested review of D97600: [lld-macho] Implement options -rename_section -rename_segment.
Fri, Feb 26, 5:42 PM · Restricted Project, Restricted Project

Wed, Feb 24

gkm committed rG151990dd94e5: [lld-macho] add code signature for native arm64 macOS (authored by gkm).
[lld-macho] add code signature for native arm64 macOS
Wed, Feb 24, 5:05 PM
gkm closed D96164: [lld-macho] add code signature for native arm64 macOS.
Wed, Feb 24, 5:05 PM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • final alignment & comment tweaks
Wed, Feb 24, 5:05 PM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • expand some comments, improve some alignment expressions
Wed, Feb 24, 11:37 AM · Restricted Project, Restricted Project

Sun, Feb 21

gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • wrap #if defined(__APPLE__) around <sys/mman.h> and msync()
Sun, Feb 21, 10:31 PM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • revise according to review feedback
Sun, Feb 21, 7:21 PM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

I won't complain if someone accepts the diff! ;)

Sun, Feb 21, 1:31 PM · Restricted Project, Restricted Project
gkm added inline comments to D96164: [lld-macho] add code signature for native arm64 macOS.
Sun, Feb 21, 11:56 AM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • set version as ... s/0x20400/CS_SUPPORTSEXECSEG/
Sun, Feb 21, 9:42 AM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • revise according to review feedback
Sun, Feb 21, 9:36 AM · Restricted Project, Restricted Project

Sat, Feb 20

gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • revise according to review feedback
Sat, Feb 20, 12:44 PM · Restricted Project, Restricted Project

Fri, Feb 19

gkm added inline comments to D96164: [lld-macho] add code signature for native arm64 macOS.
Fri, Feb 19, 7:01 PM · Restricted Project, Restricted Project

Thu, Feb 18

gkm added inline comments to D96164: [lld-macho] add code signature for native arm64 macOS.
Thu, Feb 18, 12:09 PM · Restricted Project, Restricted Project
gkm added inline comments to D96164: [lld-macho] add code signature for native arm64 macOS.
Thu, Feb 18, 11:36 AM · Restricted Project, Restricted Project

Tue, Feb 16

gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • import code signing structs & enums into llvm/include/llvm/BinaryFormat/MachO.h
Tue, Feb 16, 10:24 AM · Restricted Project, Restricted Project

Mon, Feb 15

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/BinaryFormat/MachO.h
seems to be inspired by the Apple headers. It is not a one-to-one copy.

Mon, Feb 15, 10:09 AM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

I could use some advice regarding import of the the Apple C (not C++) header cs_blobs.h:

  • Some struct decls contain zero-length array members as offset markers. These are invalid C++, and LLD doesn't need them.
  • Some struct decls contain flexible array members. These are invalid C++, and LLD doesn't need them.
  • Some flag bit sets are specified via sequences of #define. LLVM prefers enum.
  • All struct decls have __attribute__((aligned(1))). LLD does not need or want these.
  • Struct definition pattern is typedef struct __TAG { ... } NAME; C++ prefers struct NAME { ... };
  • The linter complains about case style for struct names.
Mon, Feb 15, 9:31 AM · Restricted Project, Restricted Project

Sun, Feb 14

gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • Invalidate signature-verification cache after writing hashes.
  • replace CodeSigningTypes.h with augmented cs_blobs.h
  • use appropriate constant symbols from cs_blobs.h rather than magic integers
Sun, Feb 14, 10:34 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sun, Feb 14, 9:54 PM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.
In D96164#2562701, @gkm 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).

Sun, Feb 14, 9:54 PM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

Re the copy stuff: See the CL desc and openradar link in https://reviews.llvm.org/rGba3bc2fd41b8428904fc779e353d3769074d8982

Sun, Feb 14, 8:54 PM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

Does codesign.go make any differences?

Sun, Feb 14, 5:12 PM · Restricted Project, Restricted Project
gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

Hmm, this is indeed very weird. I have seen "similar" behavior with codesign. codesign can actually fail. The only way to "get it working" again is to copy the file and codesign the copy, then replacing the original file (a different inode fixes codesigning).

Does the segfault happen with each linking step?

Sun, Feb 14, 2:29 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sun, Feb 14, 12:05 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sun, Feb 14, 12:02 PM · Restricted Project, Restricted Project

Sat, Feb 13

gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:21 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:20 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:20 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:19 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:18 PM · Restricted Project, Restricted Project
gkm updated the summary of D96164: [lld-macho] add code signature for native arm64 macOS.
Sat, Feb 13, 2:16 PM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • remove SHA256, which is added separately in D96540
Sat, Feb 13, 2:04 PM · Restricted Project, Restricted Project
gkm updated the diff for D96164: [lld-macho] add code signature for native arm64 macOS.
  • drop the fork+exec of /usr/bin/codesign and rewrite in C++
Sat, Feb 13, 1:59 PM · Restricted Project, Restricted Project

Thu, Feb 11

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

Perhaps this might help: SHA256 impl for LLVM. This is based on botan's sha256 implementation and mimics the current SHA1 api design. It should be compatible with LLVM's license since it's based on botan's implementation, which is BSD-2 licensed.

Thu, Feb 11, 10:37 AM · Restricted Project, Restricted Project

Wed, Feb 10

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

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.

Wed, Feb 10, 5:51 PM · Restricted Project, Restricted Project

Mon, Feb 8

gkm committed rG87104faac433: [lld-macho] Add ARM64 target arch (authored by gkm).
[lld-macho] Add ARM64 target arch
Mon, Feb 8, 5:14 PM
gkm closed D88629: [lld-macho] Add ARM64 target arch.
Mon, Feb 8, 5:14 PM · Restricted Project, Restricted Project
gkm updated the diff for D88629: [lld-macho] Add ARM64 target arch.
  • Make RelocAttrBits::LLVM_BITMASK_LARGEST_ENUMERATOR adequate to escape assertions.
Mon, Feb 8, 4:35 PM · Restricted Project, Restricted Project
gkm updated the diff for D88629: [lld-macho] Add ARM64 target arch.
  • rebase
Mon, Feb 8, 2:27 PM · Restricted Project, Restricted Project
gkm updated the diff for D88629: [lld-macho] Add ARM64 target arch.
  • rebase & remove incomplete+failing test (will add later)
Mon, Feb 8, 11:59 AM · Restricted Project, Restricted Project

Sun, Feb 7

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

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).

Sun, Feb 7, 10:01 PM · Restricted Project, Restricted Project

Sat, Feb 6

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

In order to perform ad-hoc codesign, I will need to compute sha256 of the program's pages. I see no other part of LLVM that uses a sha256 library. What library should I use?

Sat, Feb 6, 5:08 PM · Restricted Project, Restricted Project

Fri, Feb 5

gkm added a comment to D96164: [lld-macho] add code signature for native arm64 macOS.

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

Fri, Feb 5, 11:36 PM · Restricted Project, Restricted Project
gkm committed rGc3e4f3b231db: [lld-macho] Fix alignment & layout to match ld64 and satisfy kernel & codesign (authored by gkm).
[lld-macho] Fix alignment & layout to match ld64 and satisfy kernel & codesign
Fri, Feb 5, 4:23 PM
gkm closed D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.
Fri, Feb 5, 4:23 PM · Restricted Project
gkm updated the diff for D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.
  • nit + rebase
Fri, Feb 5, 4:22 PM · Restricted Project
gkm requested review of D96164: [lld-macho] add code signature for native arm64 macOS.
Fri, Feb 5, 11:08 AM · Restricted Project, Restricted Project
gkm updated the diff for D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.
  • revise according to review feedback
Fri, Feb 5, 10:51 AM · Restricted Project
Herald added a reviewer for D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign: int3.
Fri, Feb 5, 10:35 AM · Restricted Project

Wed, Feb 3

gkm added a comment to D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.

@compnerd: I am uncertain how to structure a good test. A good test for satisfactory load-command order is already implicit: lld-linked programs don't run on ARM64 macOS otherwise.

Wed, Feb 3, 7:51 PM · Restricted Project
gkm updated the diff for D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.
  • remove PageSize change, which is premature.
Wed, Feb 3, 7:00 PM · Restricted Project

Tue, Feb 2

gkm committed rG3a9d2f1488f0: [lld-macho][NFC] refactor relocation handling (authored by gkm).
[lld-macho][NFC] refactor relocation handling
Tue, Feb 2, 9:56 AM
gkm closed D95121: [lld-macho][NFC] refactor relocation handling.
Tue, Feb 2, 9:55 AM · Restricted Project

Mon, Feb 1

gkm updated the diff for D95121: [lld-macho][NFC] refactor relocation handling.
  • rebase to see if seemingly-unrelated test failures resolve.
Mon, Feb 1, 4:34 PM · Restricted Project
gkm updated subscribers of D95121: [lld-macho][NFC] refactor relocation handling.

@int3 @smeenai
Regarding test failures x64 debian > libarcher.races ... These look unrelated to anything I have done in this diff, but looks can be deceiving.

Mon, Feb 1, 4:11 PM · Restricted Project

Sun, Jan 31

gkm updated the diff for D95121: [lld-macho][NFC] refactor relocation handling.
  • revise according to review feedback
  • rewrite prepareSymbolRelocation() and resolveSymbolVA() as reloc-attribute-driven rather than target-specific
Sun, Jan 31, 7:04 PM · Restricted Project
gkm added a comment to D95121: [lld-macho][NFC] refactor relocation handling.

I also completed the TODO(gkm): hoist into target-independent code driven by RelocAttrBits refactors for prepareSymbolRelocation() and resolveSymbolVA()

Sun, Jan 31, 7:00 PM · Restricted Project

Fri, Jan 29

gkm committed rG0ef25cf558bf: [lld-macho][NFC] Add new option group for versions (authored by gkm).
[lld-macho][NFC] Add new option group for versions
Fri, Jan 29, 9:29 PM
gkm committed rG61a5502a93ab: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind… (authored by gkm).
[llvm-objdump-macho] print per-second-level-page encodings for option --unwind…
Fri, Jan 29, 9:29 PM
gkm closed D94938: [lld-macho][NFC] Add some new version options, plus a new option group for versions.
Fri, Jan 29, 9:29 PM · Restricted Project
gkm closed D93265: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info.
Fri, Jan 29, 9:28 PM · Restricted Project

Thu, Jan 28

gkm requested review of D94938: [lld-macho][NFC] Add some new version options, plus a new option group for versions.

@compnerd, I updated the title and summary as requested.

Thu, Jan 28, 9:24 PM · Restricted Project
gkm updated the summary of D94938: [lld-macho][NFC] Add some new version options, plus a new option group for versions.
Thu, Jan 28, 9:23 PM · Restricted Project
gkm retitled D94938: [lld-macho][NFC] Add some new version options, plus a new option group for versions from [lld-macho][NFC] Add new option group for versions to [lld-macho][NFC] Add some new version options, plus a new option group for versions.
Thu, Jan 28, 9:22 PM · Restricted Project
gkm updated the diff for D88629: [lld-macho] Add ARM64 target arch.
  • revise according to review feedback
Thu, Jan 28, 2:50 PM · Restricted Project, Restricted Project
gkm updated the diff for D95121: [lld-macho][NFC] refactor relocation handling.
  • revise according to review feedback
Thu, Jan 28, 1:49 PM · Restricted Project
gkm added inline comments to D95121: [lld-macho][NFC] refactor relocation handling.
Thu, Jan 28, 1:29 PM · Restricted Project

Jan 27 2021

gkm added inline comments to D88629: [lld-macho] Add ARM64 target arch.
Jan 27 2021, 5:54 PM · Restricted Project, Restricted Project

Jan 22 2021

gkm updated the summary of D95204: [lld-macho] Switch default to new Darwin backend.
Jan 22 2021, 5:21 PM · Restricted Project, Restricted Project
gkm planned changes to D95204: [lld-macho] Switch default to new Darwin backend.

Pulling this back from review ... Not ready for prime time.

Jan 22 2021, 5:19 PM · Restricted Project, Restricted Project

Jan 21 2021

gkm updated the summary of D95204: [lld-macho] Switch default to new Darwin backend.
Jan 21 2021, 10:52 PM · Restricted Project, Restricted Project
gkm updated the summary of D95204: [lld-macho] Switch default to new Darwin backend.
Jan 21 2021, 10:52 PM · Restricted Project, Restricted Project
gkm requested review of D95204: [lld-macho] Switch default to new Darwin backend.
Jan 21 2021, 10:42 PM · Restricted Project, Restricted Project
gkm updated the diff for D88629: [lld-macho] Add ARM64 target arch.
  • Update according to refactored reloc handling
Jan 21 2021, 2:44 AM · Restricted Project, Restricted Project
gkm requested review of D95121: [lld-macho][NFC] refactor relocation handling.
Jan 21 2021, 2:39 AM · Restricted Project

Jan 18 2021

gkm requested review of D94938: [lld-macho][NFC] Add some new version options, plus a new option group for versions.
Jan 18 2021, 7:00 PM · Restricted Project
gkm updated the diff for D93265: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info.
  • Pare CHECK lines to the essentials. Add comments to the test: purpose, plus rationale for binary input.
Jan 18 2021, 4:17 PM · Restricted Project
gkm requested review of D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign.
Jan 18 2021, 3:06 PM · Restricted Project

Jan 11 2021

gkm added a comment to D93263: [lld-macho] Implement option: -undefined TREATMENT.

@thakis, that's a bug. There is no reason to deviate from ld64.

Jan 11 2021, 6:06 PM · Restricted Project

Dec 25 2020

gkm added a comment to D93265: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info.

@MaskRay?

Dec 25 2020, 6:41 AM · Restricted Project

Dec 21 2020

gkm added inline comments to D93265: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info.
Dec 21 2020, 11:57 AM · Restricted Project
gkm updated the diff for D93265: [llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info.
  • add test case
Dec 21 2020, 12:12 AM · Restricted Project

Dec 19 2020

gkm added a comment to D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.

I fixed the clang-tidy failures before landing. Unfortunately, I neglected to update the diff with the final version, which is why you see the notice that I landed with ongoing build failures. Oops. :(

Dec 19 2020, 8:30 PM · Restricted Project
gkm committed rG99930719c66d: Handle overflow beyond the 127 common encodings limit (authored by gkm).
Handle overflow beyond the 127 common encodings limit
Dec 19 2020, 2:55 PM
gkm closed D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.
Dec 19 2020, 2:55 PM · Restricted Project

Dec 18 2020

gkm updated the diff for D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.
  • rewrite encoding-index maps to use .find() rather than .lookup() so we can remove the crufty size_tx
Dec 18 2020, 11:33 PM · Restricted Project
gkm added inline comments to D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.
Dec 18 2020, 11:29 PM · Restricted Project
gkm added a comment to D93462: [DebugInfo] Support Fortran 'use <external module>' statement..

Awesome! Thank you @cchen15 !

Dec 18 2020, 12:12 PM · debug-info, Restricted Project
gkm added a comment to D93462: [DebugInfo] Support Fortran 'use <external module>' statement..

This diff breaks git source trees on case-insensitive filesystems, such as on macOS.
I did this on Linux, which is case-sensitive:

$ find . |fgrep -i llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/DIModule.ll
./llvm/test/DebugInfo/X86/dimodule.ll

On a case-insensitive filesystem, these names collide and one overwrites the other, yeilding a tree with irreconcilable conflicts.

Dec 18 2020, 11:53 AM · debug-info, Restricted Project
gkm updated the diff for D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.
  • revise according to review feedback
Dec 18 2020, 12:46 AM · Restricted Project
gkm added inline comments to D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit.
Dec 18 2020, 12:26 AM · Restricted Project

Dec 17 2020

gkm committed rGd4ec3346b1ba: [lld-macho][nfc] Refactor to accommodate paired relocs (authored by gkm).
[lld-macho][nfc] Refactor to accommodate paired relocs
Dec 17 2020, 8:22 PM
gkm closed D90614: [lld-macho][nfc] Refactor to accommodate paired relocs.
Dec 17 2020, 8:22 PM · Restricted Project
gkm committed rGcc1cf6332a30: [lld-macho] Implement option: -undefined TREATMENT (authored by gkm).
[lld-macho] Implement option: -undefined TREATMENT
Dec 17 2020, 5:51 PM