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

    <tr>
        <th>Summary</th>
        <td>
            LLD plugins not working on mac
        </td>
    </tr>

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

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

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

<pre>
    Hi, 

I'm using a plugin (https://github.com/EnzymeAD/Enzyme) to perform some custom passes at link time with LLD. On my linux machines, I pass the flag `--load-pass-plugin=/path/to/my/plugin.so`, and everything seems to be working. However, on my mac, when I do `--load-pass-plugin=/path/to/my/plugin.dylib`, I get an error message:

```
ld64.lld: error: unknown argument '--load-pass-plugin=/path/to/my/plugin.dylib'
```

Initially, I thought this was an issue with the Enzyme plugin itself, but @wsmoses did some investigation and believes that the issue might be in LLVM proper. See original discussion here: https://github.com/EnzymeAD/Enzyme/issues/1389#issuecomment-1697347166, duplicated below for completeness

-----

> Yeah though the actual LLVM linker only has support for plugins inside the ELF subcomponent itself, and not the MachO (macOS) subcomponent, so there is no support for plugins.

> Recompiling LLVM won't add support, its a feature that needs to be added to upstream LLVM.

> The old pass manager pipeline exists across all versions, but the new pass manager only exists for ELF.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2P2zYQ_TX0ZWBDpmzLPuiw7cbIAkoXaIoCPVLiWGKXHwKHtOL--mIkb7LbBgUaw7BFkTPvzZs3VESm94i12P8k9o8rldMQYk3KZbSjMzQ0zS_Nqg36Vn80Qv4MongUxcPy-yRk5SCT8T0oGG3ujQchj0NKI4nyQcizkOfepCG3my44Ic8f_F83hw-PXx-FPEEKMGK8hOiAgkPoMqXgYFRESKASWONfIBmHMJk0QNM8buDZg7vxTv4CTnWD8UhM8GmOgzQgXKzqQRyK9doGpdf8fr2wFCUzGFUahDynIOTZ3fjF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