[LLVMdev] Building pass out of source with cmake: undefined symbol error

Charles Jacobsen charlie.jacobsen at utah.edu
Fri Jun 14 10:34:10 PDT 2013


Still no go. I'm going to experiment building out of source manually with the cmake build and autotools build. I should've mentioned that I'm attempting this with the hello world pass example.

________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] on behalf of Charles Jacobsen [charlie.jacobsen at utah.edu]
Sent: Friday, June 14, 2013 8:25 AM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Building pass out of source with cmake: undefined symbol error

Hmmm, I just thought of something. Perhaps I need to set the MODULE cmake flag (via -DMODULE=ON)? I will try this today. (I remembered the LOADABLE_MODULE=1 flag in the makefile, and the if ( MODULE ) check in the AddLLVM cmake module.)

________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] on behalf of Charles Jacobsen [charlie.jacobsen at utah.edu]
Sent: Friday, June 14, 2013 7:55 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Building pass out of source with cmake: undefined symbol error

After building the pass out of source with cmake, when I load it with opt, I get an undefined symbol error: _ZTIN4llvm12FunctionPassE undefined in the .so.

(_ZTVN4llvm12FunctionPassE is also undefined -- a "U" when I run nm. This symbol -is- in all of the llvm libraries.)

Platform: ubuntu 12.10 LTS, x86 64
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Build: LLVM 3.2 (svn), tried debug and release
Test suite builds and runs without error
No other versions of llvm or clang are present

I also tried building debug and release versions of the pass. No build errors or warnings when producing the pass .so.

I don't see this symbol in any of the llvm libraries, so I have no idea how it is being introduced into the pass .so.

Interestingly, when I build llvm in source with autotools, and build the pass in source with the provided makefile template, it works, and _ZTIN4llvm12FunctionPassE is not in the pass .so. (Also, _ZTVN4llvm12FunctionPassE is now "B" when I run nm.).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130614/3df371d2/attachment.html>


More information about the llvm-dev mailing list