Skip to content

LLD plugins not working on mac #65085

Open
@samuelpmishLLNL

Description

@samuelpmishLLNL

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: EnzymeAD/Enzyme#1389 (comment), 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions