Hi Guys, I am using the Postdom pass and I would like to get the root of the tree. However, everytime I try to get the root, I get a segfault. I don't know why the environment can't find DominatorTreeBase. Below is the code that generates the Segfault. In my .h file I include Dominators.h PDT.getRootNode(); //PDT is a reference to a PostDominatorTree dyld: lazy symbol binding failed: Symbol not found: __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv Referenced from: /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib Expected in: flat namespace dyld: Symbol not found: __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv Referenced from: /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib Expected in: flat namespace George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120820/e9de8c1e/attachment.html>
Oh, one more thing, I am running llvm in debug mode -- Debug+Asserts. Thanks for your help. On Mon, Aug 20, 2012 at 5:38 PM, George Baah <georgebaah at gmail.com> wrote:> Hi Guys, > I am using the Postdom pass and I would like to get the root of the > tree. However, > everytime I try to get the root, I get a segfault. I don't know why the > environment can't > find DominatorTreeBase. > > Below is the code that generates the Segfault. In my .h file I include > Dominators.h > > > > PDT.getRootNode(); //PDT is a reference to a PostDominatorTree > > > dyld: lazy symbol binding failed: Symbol not found: > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > Referenced from: > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > Expected in: flat namespace > > dyld: Symbol not found: > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > Referenced from: > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > Expected in: flat namespace > > > George >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120820/cf04cf29/attachment.html>
Hi George, ...> dyld: lazy symbol binding failed: Symbol not found: > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > Referenced from: > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > Expected in: flat namespace > > dyld: Symbol not found: > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > Referenced from: > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > Expected in: flat namespacelooks like you forgot to link with the library defining this symbol. Ciao, Duncan.
That is what I don't understand. This symbol is defined in Dominators.h, which I include in my file. I don't understand why I am getting this error. Here is my opt command, "opt -load LLVMMyDomPass.dylib -mdp < test.bc > test.d.bc" George On Tue, Aug 21, 2012 at 3:25 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi George, > > ... > > dyld: lazy symbol binding failed: Symbol not found: > > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > > Referenced from: > > > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > > Expected in: flat namespace > > > > dyld: Symbol not found: > > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > > Referenced from: > > > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > > Expected in: flat namespace > > looks like you forgot to link with the library defining this symbol. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/ecba9dc3/attachment.html>
Hi George,> That is what I don't understand. This symbol is defined in Dominators.h, which I > include > in my file. I don't understand why I am getting this error. Here is my opt command, > > "opt -load LLVMMyDomPass.dylib -mdp < test.bc > test.d.bc"did you compile your pass with the same optimization level, debug flags etc as opt was compiled with? Ciao, Duncan.> > George > > > On Tue, Aug 21, 2012 at 3:25 AM, Duncan Sands <baldrick at free.fr > <mailto:baldrick at free.fr>> wrote: > > Hi George, > > ... > > dyld: lazy symbol binding failed: Symbol not found: > > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > > Referenced from: > > > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > > Expected in: flat namespace > > > > dyld: Symbol not found: > > __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv > > Referenced from: > > > /Users/georgebaah/Software/llvm3.1/build/Debug+Asserts/bin/../lib/LLVMNshira.dylib > > Expected in: flat namespace > > looks like you forgot to link with the library defining this symbol. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >
On 08/21/2012 10:35 AM, George Baah wrote:> That is what I don't understand. This symbol is defined in Dominators.h, > which I include > in my file. I don't understand why I am getting this error. Here is my > opt command, > > "opt -load LLVMMyDomPass.dylib -mdp < test.bc > test.d.bc"It may also be that the relevant code is dead code eliminated, as it is not used within LLVM. I would try to compile LLVM with --enable-shared (autoconf) or BUILD_SHARED_LIBS (cmake). If this works, the dead code elimination is probably the problem. Tobi