Skip to content

Commit

Permalink
[llvm] Build llvm with rtti enabled.
Browse files Browse the repository at this point in the history
Recent llvm versions use llvm::Error as a facility for error handling. It
includes an ErrorInfoBase class which has virtual methods (with a pinned vtable
in the object file). This makes it harder to include headers that use
transitively include llvm/Support/Error.h crossing rtti/no-rtti worlds (that is
llvm is compiled with -fno-rtti and TCling and friends with -frtti).

Newer llvm versions have a lot of usage of llvm::Error in its header files and
it is practically impossible to solve this problem by avoiding the headers
that use ErrorInfoBase.

There are two other alternatives. First we can outline the functions in Error.h
which use ErrorInfoBase but then we will hit other things like RTTIRoot which
also needs special treatment. Secondly, we can enable llvm's RTTI builds for
ROOT and this is what this patch does.
  • Loading branch information
vgvassilev committed Apr 5, 2022
1 parent d43ff2e commit 0a5b6c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if (NOT builtin_clang)
endif()

#---Define the way we want to build and what of llvm/clang/cling------------------------------------
set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
set(LLVM_APPEND_VC_REV OFF CACHE BOOL "")
set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "")
set(LLVM_ENABLE_FFI OFF CACHE BOOL "")
Expand Down

0 comments on commit 0a5b6c6

Please sign in to comment.