[PATCH] D76760: Do export symbols when LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is on.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 03:13:12 PDT 2020


simon_tatham created this revision.
simon_tatham added reviewers: efriedma, john.brawn.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.

In D76527 <https://reviews.llvm.org/D76527>, we stopped exporting symbols from clang, opt and llc unless
the `LLVM_ENABLE_PLUGINS` cmake variable is true (which causes clang's
own plugin collection to be built).

But another reasonable build configuration is to ask clang to export
its symbols for out-of-tree plugins to use, without building the
in-tree ones. That is, you might set `LLVM_EXPORT_SYMBOLS_FOR_PLUGINS`
without also setting `LLVM_ENABLE_PLUGINS` (at least if you're using
MSVC, where you need to ask explicitly for the symbols to be
exported).

In that situation, the symbols should still be exported, but after
D76527 <https://reviews.llvm.org/D76527>, they weren't being.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76760

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1031,7 +1031,7 @@
 
 # Export symbols if LLVM plugins are enabled.
 function(export_executable_symbols_for_plugins target)
-  if(LLVM_ENABLE_PLUGINS)
+  if(LLVM_ENABLE_PLUGINS OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS)
     export_executable_symbols(${target})
   endif()
 endfunction()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76760.252523.patch
Type: text/x-patch
Size: 466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200325/06211339/attachment.bin>


More information about the llvm-commits mailing list