developing an llvm pass with cmake out of llvm source directory

后端 未结 1 951
不思量自难忘°
不思量自难忘° 2021-01-01 06:14

I am trying to develop an llvm pass under my project directory. For that, I follow the info in http://llvm.org/docs/CMake.html#developing-llvm-pass-out-of-source. I create m

相关标签:
1条回答
  • 2021-01-01 06:59

    from http://www.jiang925.com/node/28

    Undefined Symbol: _ZTIN4llvm12FunctionPassE There is an inconsistency between LLVM main build system and the cmake support for building out-of-source. The LLVM binaries are built without runtime type info "-fno-rtti". Therefore, the out-of-source passes have to be built the same way otherwise opt will complain that symbol "_ZTIN4llvm12FunctionPassE" is undefined.

    To solve this problem, LLVM must be compile with RTTI enabled. Add "-DLLVM_REQUIRES_RTTI=1" to cmake, or add "REQUIRES_RTTI=1" to make.

    So I added SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti") to CMakeLists.txt of my pass library and then it's working.

    0 讨论(0)
提交回复
热议问题