summaryrefslogtreecommitdiff
path: root/lld/tools
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2020-03-23 12:20:05 -0700
committerEli Friedman <efriedma@quicinc.com>2020-03-23 14:18:32 -0700
commitf3018068517e350f509b40f50207db25f80ff6fc (patch)
tree0b75b980ac838e627f9005877b557e6cdd1f3095 /lld/tools
parentdefd96f1e36df9e3bbb7be7b55a14b843c3090c6 (diff)
downloadllvm-f3018068517e350f509b40f50207db25f80ff6fc.tar.gz
[lld] Enabling loading LLVM pass plugins
Add the relevant magic bits to allow "-mllvm=-load=plugin.so" etc. This is now using export_executable_symbols_for_plugins, so symbols are only exported if plugins are enabled. Differential Revision: https://reviews.llvm.org/D75879
Diffstat (limited to 'lld/tools')
-rw-r--r--lld/tools/lld/CMakeLists.txt4
-rw-r--r--lld/tools/lld/lld.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index a15e296e31df..a37c2c702bd5 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -4,7 +4,11 @@ set(LLVM_LINK_COMPONENTS
add_lld_tool(lld
lld.cpp
+
+ ENABLE_PLUGINS
+ SUPPORT_PLUGINS
)
+export_executable_symbols_for_plugins(lld)
target_link_libraries(lld
PRIVATE
diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp
index 72ff758164d8..646fc3d6468e 100644
--- a/lld/tools/lld/lld.cpp
+++ b/lld/tools/lld/lld.cpp
@@ -36,6 +36,7 @@
#include "llvm/Support/Host.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Path.h"
+#include "llvm/Support/PluginLoader.h"
#include <cstdlib>
using namespace lld;