[PATCH] D78332: Fix interaction of static plugins with -DLLVM_LINK_LLVM_DYLIB=ON.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 01:35:18 PDT 2020


efriedma marked an inline comment as done.
efriedma added inline comments.


================
Comment at: llvm/cmake/modules/AddLLVM.cmake:886
     # object library as of now
-    add_llvm_library(${name} OBJECT ${ARG_UNPARSED_ARGUMENTS})
+    add_llvm_component_library(${name} OBJECT ${ARG_UNPARSED_ARGUMENTS})
     target_compile_definitions(${name} PRIVATE LLVM_${name_upper}_LINK_INTO_TOOLS)
----------------
serge-sans-paille wrote:
> Conceptually, do we want Extensions to be considered as component?
An alternative way to state this question is, should LLVMLTO depend on statically linked plugins directly?

One way of thinking about it is that static plugins are a way to write LLVM components outside the llvm/ tree.  Therefore, we statically link them into LTO, and use them automatically.

Alternatively, we could say that plugins are part of the calling tool.  In that case, we'd need to remove most of the changes from the LTO library, add some sort of callback, and stick the code to call into the plugins into each tool that calls LTO instead.

Either way works; the end result isn't hugely different. But I think I'd prefer the approach that doesn't involve copy-pasting the plugin registration code into every tool that runs LTO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78332/new/

https://reviews.llvm.org/D78332





More information about the llvm-commits mailing list