Creates thin output file of specified arch_type from the fat input file.
Test Plan: check-llvm
Paths
| Differential D63341
[llvm-lipo] Implement -thin ClosedPublic Authored by anushabasana on Jun 14 2019, 9:45 AM.
Details Summary Creates thin output file of specified arch_type from the fat input file. Test Plan: check-llvm
Diff Detail
Event Timeline
Comment Actions I'll have a look Monday / early next week. Meanwhile, here are some quick thoughts.
Comment Actions Regarding the error messages, should should they replicate cctools lipo exactly?
Comment Actions i think that we should not "replicate cctools lipo error messages exactly", ours could be better / more convenient or informative where it makes sense. anushabasana added inline comments.
Comment Actions Would be nice if "llvm-lipo -thin" printed a reasonable error message before dumping usage. Apple lipo will print "missing argument to -thin option" Another difference is llvm-lipo will not validate the arch until all arguments are received, whereas Apple lipo will validate archs immediately. ("lipo -arch asdf") Would be nice if "llvm-lipo" printed a list of valid archs when the arch is invalid. Currently it prints "llvm-lipo: error: Invalid architecture: asdf" and it exits. Apple lipo prints "unknown architecture specification flag: asdf in specifying thin operation: -thin asdf. known architecture flags are: ..." PLEASE FIX: llvm-lipo does not support using "-o" in place of "-output" Note: "llvm-lipo" does not work properly with certain Mach-O executables, such as those built with the -hideARM64 flag. This revision now requires changes to proceed.Jun 18 2019, 9:13 PM Comment Actions
I agree with all these points.
Comment Actions
Fixed most of these issues, but for printing a list of knows architectures I am planning to make a change in a separate diff that returns a list of valid architectures, since I will no longer be modifying llvm-lipo code. For the MachO executables built with -hideARM64 flag, I filed a bug for MachOUniversalBinary: https://bugs.llvm.org/show_bug.cgi?id=42343. Comment Actions
Sounds good. Note that it's relevant for all lipo flags, not just '-thin' This revision is now accepted and ready to land.Jun 21 2019, 12:18 AM Closed by commit rL364107: [llvm-lipo] Implement -thin (authored by smeenai). · Explain WhyJun 21 2019, 3:00 PM This revision was automatically updated to reflect the committed changes. Comment Actions
D63735 implements the nicer error message for an invalid architecture.
Revision Contents
Diff 206088 llvm/trunk/test/tools/llvm-lipo/Inputs/i386-slice.yaml
llvm/trunk/test/tools/llvm-lipo/Inputs/i386-x86_64-universal.yaml
llvm/trunk/test/tools/llvm-lipo/help-error-messages.test
llvm/trunk/test/tools/llvm-lipo/thin-executable-universal-binary.test
llvm/trunk/test/tools/llvm-lipo/thin-macho-binary.test
llvm/trunk/test/tools/llvm-lipo/thin-universal-binary.test
llvm/trunk/tools/llvm-lipo/LipoOpts.td
llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp
|