[llvm-dev] [RFC] Generalize out-of-tree pass support

Andrzej Warzynski via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 29 09:32:01 PDT 2019



On 25/09/2019 04:59, Michael Kruse wrote:
> PLUGIN_TOOL must be used to allow plugins such as "Hello" to link
> against symbols of an executable. On Windows, import symbols need to
> know which library it is imported from. "Hello" defines the executable
> opt as source of its symbols, consequently it cannot be imported in
> other executables such as bugpoint, llvm-reduce or clang. In addition
> to use it, one must also set cmake -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS
> to make the executable export those symbols. However, Windows dlls
> have a limit of 2^16 imported symbols and LLVM exceeds that by far.
> Therefore there is a util script extract_symbols.py to limit the
> exports to those that are most probably used. However, I could not
> (yet) make this work with Polly, there are always symbols missing.

Cheers for clarifying - makes sense. I've tried mixing PLUGIN_TOOL and 
the new pass manager and I was also getting errors due to missing 
symbols. That mechanism is a bit fragile and ingenious at the same time.

> 
> tl;dr: They are different: D61446 for statically linking a plugin,
> PLUGIN_TOOL is for dynamically linking a plugin.

Right, thank you, all clear!

-Andrzej


More information about the llvm-dev mailing list