1

I'm trying building LLVM master on Ubuntu 22.04. But there's an error of libunwind.

CMake Error at /home/hxf0223/tmp/llvm-project/libunwind/src/CMakeLists.txt:109 (message):
  Compiler doesn't support generation of unwind tables if exception support
  is disabled.  Building libunwind DSO with runtime dependency on C++ ABI
  library is not supported.

The build command is:

CC=clang CXX=clang++ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON  -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libclc;lld;lldb;mlir;polly;pstl" -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXX_USE_COMPILER_RT=ON -DLIBUNWIND_USE_COMPILER_RT=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_RUNTIMES=all ../llvm

Does anyone have build success on the update master? Thanks!

roderick
  • 21
  • 3

1 Answers1

0

From libunwind/src/CMakeLists.txt:

if (LIBUNWIND_ENABLE_SHARED AND
    NOT (LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG AND
         LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG))
  message(FATAL_ERROR
          "Compiler doesn't support generation of unwind tables if exception "
          "support is disabled.  Building libunwind DSO with runtime dependency "
          "on C++ ABI library is not supported.")
endif()

It appears that the error appears when one (or both, I'm not an expert at this) of LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG or LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG is not set while LIBUNWIND_ENABLE_SHARED is enabled.

You can try setting them manually or use a different compiler.

tch69
  • 11
  • 1
  • 2