klee/0004-cmake-expand-library-dependencies-with-USE_CMAKE_FIN.patch

37 lines
1.4 KiB
Diff

From: Jiri Slaby <jirislaby@gmail.com>
Date: Tue, 20 Jun 2017 08:52:56 +0200
Subject: cmake: expand library dependencies with USE_CMAKE_FIND_PACKAGE_LLVM
Patch-mainline: no
When we use -DUSE_CMAKE_FIND_PACKAGE_LLVM=ON, we do not expand
dependecies and build fails with linker errors like:
/usr/bin/ld: lib/libkleeModule.a(ModuleUtil.cpp.o): undefined reference to symbol '_ZNK4llvm6object7Archive5Child7getNameEv'
/usr/lib64/../lib64/libLLVMObject.so.4: error adding symbols: DSO missing from command line
clang-4.0.0: error: linker command failed with exit code 1 (use -v to see invocation)
So let LLVM compute also the transitive close as it used to do so in
LLVM < 3.5.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
cmake/find_llvm.cmake | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmake/find_llvm.cmake b/cmake/find_llvm.cmake
index 49ca51d40fa8..1276947a6c77 100644
--- a/cmake/find_llvm.cmake
+++ b/cmake/find_llvm.cmake
@@ -29,7 +29,8 @@ if (USE_CMAKE_FIND_PACKAGE_LLVM)
if (${LLVM_PACKAGE_VERSION} VERSION_LESS "3.5")
llvm_map_components_to_libraries(${output_var} ${ARGN})
else()
- llvm_map_components_to_libnames(${output_var} ${ARGN})
+ llvm_map_components_to_libnames(LLVM_LIBS_TMP ${ARGN})
+ llvm_expand_dependencies(${output_var} ${LLVM_LIBS_TMP})
endif()
set(${output_var} ${${output_var}} PARENT_SCOPE)
endfunction()
--
2.14.1