<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59552>59552</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Allow selecting llvm-lipo (and possibly other llvm tools) before the host toolchain equivalents
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sztomi
      </td>
    </tr>
</table>

<pre>
    In #59535 I noted that the lipo binary is [hardcoded](https://github.com/llvm/llvm-project/blob/7aa9b335d63caf61bc0f2de5ace5b48008f5f509/clang/lib/Driver/ToolChains/Darwin.cpp#L835) in the Darwin driver. In a distribution I build, I can ensure that llvm-lipo is selected if I symlink `llvm-lipo` to `lipo` in the install dir, [or](https://github.com/llvm/llvm-project/issues/59535#issuecomment-1353680594) by putting it into a separate directory, also named `lipo` and adding a `-B` argument.  This led to a separate discussion about how it would be best to handle this situation. As I understand, the following suggestions emerged:

1. Add a `-fuse-lipo=llvm-lipo` flag
2. Add a more generic `-fuse-llvm-darwin-tools` flag that opts in to using all the llvm equivalents of the tools in the Xcode toolchain. 

In my opinion, option 2 is better if all the llvm tools are production-ready replacements. If not, it would be better to use a singular flag that allows more refined selection of the tools.

Also, the discussion so far was only about llvm-lipo and llvm-libtool-darwin. Which other tools would the more generic flag enable? Would it imply `-fuse-ld=lld` as well? 


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVM1u67YSfhp6M4ggkaZjL7xITmDAwF0e4NwtJQ4lthSpcqgY7tMXQ9uN02W7saERZ_T9DQ2RHyPiUeh3oT82Zi1Tykf6s6TZb_pkr8dzBCGVPmil4QwxFbRQJlOgTAjBLwl6H02-gicQ-n0y2Q7JohX6Q8j9VMpCQr0JeRLyNPoyrX0zpFnIUwifj7-XJaffcChCnvqQeiFPr8YceqW03anBuF3XD62TFrUZUPfbfdvunXa6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