[PATCH] D111164: Regenerate LC_CODE_SIGNATURE during llvm-objcopy operations

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 16:39:22 PDT 2021


alexander-shaposhnikov added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test:16
+## Verify that the copy still includes the load command
+# RUN: cat %t.copy.yaml | FileCheck %s --check-prefix=CHECK-COPY
+# CHECK-COPY:      - cmd:             LC_CODE_SIGNATURE
----------------
just in case - wouldn't FileCheck %s --check-prefix=CHECK-COPY <%t.copy.yaml work ? (get rid of  `cat`)


================
Comment at: llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test:27-35
+# RUN: sed -e '/__LINKEDIT/,+4d' \
+# RUN:     -e '/LC_CODE_SIGNATURE/,+3d' \ 
+# RUN:     -e '/n_strx/d' \ 
+# RUN:     -e '/dyld_stub_binder/d' %t.yaml > %t.clean.yaml
+
+# RUN: sed -e '/__LINKEDIT/,+4d' \
+# RUN:     -e '/LC_CODE_SIGNATURE/,+3d' \ 
----------------
drodriguez wrote:
> We are aware that one of these seems not to work with macOS `sed`. We are looking into how to fix. If somebody feels this need to be reverted, please do.
fwiw, if one day this test breaks it might be hard to debug (especially on windows), perhaps, another approach would be to replace `RUN: diff`
with a more granular check, e.g. it doesn't need to check all the parts of the binary


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111164



More information about the llvm-commits mailing list