[llvm] 6a94699 - Do export symbols when LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is on.

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 02:07:28 PDT 2020


Author: Simon Tatham
Date: 2020-03-26T09:07:02Z
New Revision: 6a946993d519a395e45e0af4a730c521b94e7dfb

URL: https://github.com/llvm/llvm-project/commit/6a946993d519a395e45e0af4a730c521b94e7dfb
DIFF: https://github.com/llvm/llvm-project/commit/6a946993d519a395e45e0af4a730c521b94e7dfb.diff

LOG: Do export symbols when LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is on.

Summary:
In 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, they weren't being.

Reviewers: efriedma, john.brawn

Reviewed By: efriedma, john.brawn

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76760

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 8cd71eef2332..238aa3eab9f4 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1031,7 +1031,7 @@ endfunction()
 
 # 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()


        


More information about the llvm-commits mailing list