From 1df311abbacd77d7a9a97deb8b2e807f069de8cb Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Thu, 17 Feb 2022 09:22:40 -0800 Subject: [PATCH] add WindowsDriver to llvm_raw_libs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Upstream https://reviews.llvm.org/D118070 added a new llvm raw lib LLVMWindowsDriver and this caused bcc compilation error like below: ... /home/yhs/work/bcc/build/src/cc/libbcc.so: undefined reference to `llvm::getUniversalCRTSdkDir(llvm::vfs::FileSystem&, llvm::Optional, llvm::Optional, llvm::Optional, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&)' /home/yhs/work/bcc/build/src/cc/libbcc.so: undefined reference to `llvm::useUniversalCRT(llvm::ToolsetLayout, std::__cxx11::basic_string, std::allocator > const&, llvm::Triple::ArchType, llvm::vfs::FileSystem&)' ... Add this library explicitly for llvm >= 15 and Compilation succeeded. Change-Id: If3f65f14ea316ace356ff15c1160ef61ccfd4171 Origin: upstream, https://github.com/iovisor/bcc/commit/a9fc750f95de89bba70d9637e787c966897d7523 Signed-off-by: Yonghong Song Signed-off-by: Łukasz Stelmach --- cmake/clang_libs.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/clang_libs.cmake b/cmake/clang_libs.cmake index 3f1523b7..f1b1261b 100644 --- a/cmake/clang_libs.cmake +++ b/cmake/clang_libs.cmake @@ -22,6 +22,9 @@ if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_G list(APPEND llvm_raw_libs bpfasmparser) list(APPEND llvm_raw_libs bpfdisassembler) endif() +if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 15 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 15) + list(APPEND llvm_raw_libs windowsdriver) +endif() llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs}) llvm_expand_dependencies(llvm_libs ${_llvm_libs}) endif() -- 2.34.1