summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-08-11 13:25:20 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-08-11 13:25:20 +0000
commit348240536ffedfbf303b8a9375bcff6fe8034ccb (patch)
tree82bb952274b7eb8f9eff4f0f2a4827f0b20f8e4f /llvm/lib/ExecutionEngine
parent0a48e5d506a726bab80bc9ff73ebba5a79446308 (diff)
downloadbcm5719-llvm-348240536ffedfbf303b8a9375bcff6fe8034ccb.tar.gz
bcm5719-llvm-348240536ffedfbf303b8a9375bcff6fe8034ccb.zip
[cmake] Expose the dependencies of ExecutionEngine as PUBLIC
Expose the dependencies of LLVMExecutionEngine library as PUBLIC rather than PRIVATE when building a shared library. This is necessary because the library is not contained but exposes API of other LLVM libraries via its headers. This causes other libraries to fail to link if the linker verifies for correctness of -l flags (i.e. fails on indirect dependencies). This e.g. happens when building LLDB against shared LLVM: lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager' lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN4llvm18MCJITMemoryManagerE[_ZTVN4llvm18MCJITMemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()' lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x48): undefined reference to `llvm::RTDyldMemoryManager::deregisterEHFrames()' lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()' lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0xd0): undefined reference to `llvm::JITSymbolResolver::anchor()' collect2: error: ld returned 1 exit status Declaring the dependencies as PUBLIC guarantees that any package using the ExecutionEngine library will also get explicit -l flags for the dependent libraries guaranteeing that the symbols exposed in headers could be resolved. Patch originally written by NAKAMURA Takumi. Differential Revision: https://reviews.llvm.org/D36211 llvm-svn: 310712
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/CMakeLists.txt b/llvm/lib/ExecutionEngine/CMakeLists.txt
index 2d9337bbefd..84b34919e44 100644
--- a/llvm/lib/ExecutionEngine/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/CMakeLists.txt
@@ -14,6 +14,10 @@ add_llvm_library(LLVMExecutionEngine
intrinsics_gen
)
+if(BUILD_SHARED_LIBS)
+ target_link_libraries(LLVMExecutionEngine PUBLIC LLVMRuntimeDyld)
+endif()
+
add_subdirectory(Interpreter)
add_subdirectory(MCJIT)
add_subdirectory(Orc)
OpenPOWER on IntegriCloud