[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
This commit is contained in:
Eli Friedman 2020-03-23 12:20:05 -07:00
parent defd96f1e3
commit f301806851
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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;