<div dir="ltr">Yeah, this is a very reasonable question.<div>I've looked at `strip` and `bitcode_strip`,</div><div>there is a conflict of the command line options - e.g. on OSX they both have "-r" </div><div>(<a href="https://www.unix.com/man-page/osx/1/strip/">https://www.unix.com/man-page/osx/1/strip/</a> , <a href="https://www.manpagez.com/man/1/bitcode_strip/">https://www.manpagez.com/man/1/bitcode_strip/</a>) and the semantics are completely different.<br></div><div>Some functionality (e.g. "-l") of bitcode_strip appears to be out of place for `strip`, thus it seems like having a separate driver would be a cleaner solution.</div><div>Regarding the symlinks structure - right, the plan is to create a new symlink to llvm-objcopy (similarly to llvm-strip which is a symlink as well)</div><div>and if it's invoked as `bitcode_strip` we will parse the command line arguments accordingly.</div><div><br></div><div>Kind regards,</div><div>Alexander Shaposhnikov</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 21, 2020 at 3:04 AM James Henderson <<a href="mailto:jh7370.2008@my.bristol.ac.uk">jh7370.2008@my.bristol.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">No issues from me in adding it, though I don't know anything about the tool itself. Would it make sense to integrate this fully into llvm-strip's interface (so that llvm-strip can do strip and bitcode_strip things by default)? Are the two sufficiently compatible? You could then have a bitcode_strip symlink when creating cctools symlinks, much like there exists already for the other tools.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 21 Aug 2020 at 05:03, Alexander Shaposhnikov via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><b>bitcode_strip</b> is a utility which is used to manipulate (leave / remove) <br>
bitcode segments in a Mach-O file. It is a part of Apple’s cctools and it is also distributed with Xcode.<br>
The man page of the tool is available here <a href="https://www.manpagez.com/man/1/bitcode_strip/" target="_blank">https://www.manpagez.com/man/1/bitcode_strip/</a>.<br>
The functionality of <b>bitcode_strip</b> naturally maps onto llvm-objcopy’s model and requires only minimal additions to it.<br>
Therefore, similarly to llvm-strip and llvm-install-name-tool <u>we propose adding a new driver  to llvm-objcopy (for Mach-O) with the goal to make it a drop-in replacement for cctools’ <b>bitcode_strip</b></u>. Among other benefits this approach enables us to save space in toolchain distributions (no extra binaries added) and reuse some llvm-objcopy’s features.<br><div>We already have llvm-lipo, llvm-install-name-tool, llvm-strip, llvm-libtool-darwin and llvm-bitcode-strip appears to be one of the last missing tools commonly used for Mach-O.</div><div><br></div><div>Any feedback / comments / suggestions would be greatly appreciated.</div><div><br></div><div>Kind regards,</div><div>Alexander Shaposhnikov</div><div><br></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div>