Tuesday 15 January 2013

developing an llvm pass with cmake out of llvm source directory -


I am trying to develop an LLVM pass under my project directory. For this, I follow these information. I make my CMakeFiles appropriately as this link and like my final project directory;

  | - src | | - CMakeLists.txt | | - bigForPass | | | - CMakeLists.txt | | | - bigForPass.cpp | | | - Merged.BC | | - Build   

I have linked my source files with the Live Route Directory without any problems. Finally I create the build under the 'build' folder and my shared library is successfully created with any name (under the Build / Bin folder) with the name LLVMHello1.dylib. However, when I try to run my passport on the merged BB file (which contains my LLMM code)

  opt-load ../build/bin/LLVMHello1.dylib -bishe_insert & Lt; Merged.bc & gt; Final.bc   

I keep getting an error;

  Error opening '../build/bin/LLVMHello1.dylib': dlopen (../ build / bin / LLVMHello1.dylib, 9): Symbol not found: __ZTIN4llvm10ModulePassE Referenced from:. Expected in ./build/bin/LLVMHello1.dylib: flat namespace in the ../build/bin/LLVMHello1.dylib-load request.   

Any ideas and tips on this appreciated?

Thank you very much earlier.

to

The LLVM binaries runtime type information is created without "-fno-rtti." Therefore, the out-of-source pass should be made in the same way otherwise choose The symbol "_ZTIN4llvm12FunctionPassE" is undefined.

To resolve this problem, LLVM has to Add "-DLLVM_REQUIRES_RTTI = 1" to create, or add "REQUIRES_RTTI = 1" to create the RTTI enabled.

I therefore sent the code -Wall -fno-rtti ") added to CMakeLists.txt of my library and then it is working.

No comments:

Post a Comment