[LLVMdev] Porting pass from llvm 3.1 to 3.4

Reid Kleckner rnk at google.com
Wed Jul 2 13:02:00 PDT 2014


Most likely LLVM is built with RTTI disabled, which LLVM does by the
default, and your code is built with RTTI enabled.  Make sure the RTTI
settings match.  The easiest fix for you is probably to add -fno-rtti to
CFLAGS.


On Wed, Jul 2, 2014 at 9:17 AM, Diogo Sampaio <dnsampaio at gmail.com> wrote:

> Dear llvmers
>
> I'm trying to port some code that was written for llvm 3.1 to 3.4.2.
> I'm having two linking problems and I couldn't find the source of the
> problem. Usually it is an error for a virtual method not declared. The
> error starts even when changing llvm version from 3.1 to 3.2.
>
> The current line declaring an command line option:
> -----
> static cl::opt<string> InputFilename(cl::Positional, cl::Required,
> cl::desc("<input bitcode file>"), cl::init("-"),
> cl::value_desc("filename"));
>
> And the class declaration:
> class Ids : public ModulePass {
> }
> -----
> Gives me these linking time errors:
>
>
> cd /home/sampaio/3.2/ddg/build/tools/dynamic-graph && /usr/bin/cmake
> -E cmake_link_script CMakeFiles/cdag_disk.dir/link.txt --verbose=1
> /usr/bin/g++-4.6       CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o  -o
> cdag_disk -rdynamic -L/home/sampaio/llvm/lib
> ../../lib/analysis/libddg-analysis.a -lLLVMBitReader -lLLVMAsmParser
> -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMMC -lLLVMObject
> -lLLVMSupport -ldl -lpthread -lboost_iostreams-mt
> -Wl,-rpath,/home/sampaio/llvm/lib:
>
> CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o:(.data.rel.ro._ZTIN4llvm2cl15OptionValueCopyISsEE[typeinfo
> for llvm::cl::OptionValueCopy<std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > >]+0x10): undefined
> reference to `typeinfo for llvm::cl::GenericOptionValue'
>
> ../../lib/analysis/libddg-analysis.a(Ids.cxx.o):(.data.rel.ro._ZTIN3ddg3IdsE[typeinfo
> for ddg::Ids]+0x10): undefined reference to `typeinfo for
> llvm::ModulePass'alue'
>
> -----
> Thank you very much
> --
> Diogo Nunes Sampaio
> _______________________________________________
> 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/20140702/b86f9f1d/attachment.html>


More information about the llvm-dev mailing list