[LLVMdev] linking error in LLVM C bindings.

Eli Gottlieb eligottlieb at gmail.com
Tue Nov 9 14:32:48 PST 2010


Well, now I've got another problem.  When I actually connect things up 
to *use* the binding library I built, I run into an unresolved symbol 
error with respect to the function LLVMWriteBitcodeToFile().

The assembly dump showing that my library does have that function follows:
> eli at eli-netbook:~/Programs/decac$ objdump -d 
> src/jllvm/llvm/libjllvm.so | grep LLVMWriteBitcodeToFile
> 0055cd54 <LLVMWriteBitcodeToFileHandle at plt>:
> 0058c504 <LLVMWriteBitcodeToFile at plt>:
> 0059b577 <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFile>:
>   59b5bd:    74 32                    je     59b5f1 
> <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFile+0x7a>
>   59b5e8:    75 07                    jne    59b5f1 
> <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFile+0x7a>
>   59b5ef:    eb 45                    jmp    59b636 
> <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFile+0xbf>
>   59b5fe:    e8 01 0f ff ff           call   58c504 
> <LLVMWriteBitcodeToFile at plt>
>   59b610:    74 21                    je     59b633 
> <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFile+0xbc>
> 0059b6b4 <Java_jllvm_llvm_BitWriterJNI_LLVMWriteBitcodeToFileHandle>:
>   59b6fb:    e8 54 16 fc ff           call   55cd54 
> <LLVMWriteBitcodeToFileHandle at plt>
Attempting to actually use the library, however, results in:
> java: symbol lookup error: /usr/lib/libjllvm.so: undefined symbol: 
> LLVMWriteBitcodeToFile
I am not at all sure what @plt is, nor why linking to LLVM apparently 
fails to link to LLVM.

Thanks for your help,
Eli



More information about the llvm-dev mailing list