Skip to content

Commit

Permalink
add WindowsDriver to llvm_raw_libs
Browse files Browse the repository at this point in the history
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::StringRef>, llvm::Optional<llvm::StringRef>,
     llvm::Optional<llvm::StringRef>,
     std::__cxx11::basic_string<char, std::char_traits<char>,
     std::allocator<char> >&,
     std::__cxx11::basic_string<char, std::char_traits<char>,
     std::allocator<char> >&)'
  /home/yhs/work/bcc/build/src/cc/libbcc.so: undefined reference to
     `llvm::useUniversalCRT(llvm::ToolsetLayout,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > const&, llvm::Triple::ArchType,
      llvm::vfs::FileSystem&)'
  ...

Add this library explicitly for llvm >= 15 and
Compilation succeeded.

Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Feb 17, 2022
1 parent 05fdb24 commit a9fc750
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/clang_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a9fc750

Please sign in to comment.