<span style='font-family:Verdana'><span style='font-size:12px'><div><span style="font-size:12px;">Check out the bug report at <a href="http://llvm.org/bugs/show_bug.cgi?id=13144" style="font-size: 12px;">http://llvm.org/bugs/show_bug.cgi?id=13144</a> and try adding <span style="background-color: rgb(255, 255, 255); white-space: pre-wrap;">KEEP_SYMBOLS := 1 to </span></span><span style="font-size: 12px;">tools/opt/Makefile </span><span style="background-color: rgb(255, 255, 255); white-space: pre-wrap; font-size: 12px;">like the OP suggests.</span></div><div><p style="margin:0px; padding:0px;" >Good luck.</p><p style="margin:0px; padding:0px;" > </p><blockquote style="border-left: 1px solid #CCC; padding-left: 5px; margin-left: 5px; margin-bottom: 0px; margin-top: 0px; margin-right: 0px;" type="cite"><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">----- Original Message -----</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">From: Raphael Ernani Rodrigues</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">Sent: 02/28/13 05:59 PM</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">To: LLVM Developers Mailing List</span></span></p><p style="margin:0px; padding:0px;" ><span style="font-family:Verdana"><span style="font-size:12px">Subject: Problem linking class to a pass in a loadable module</span></span></p> <div><div><pre style="white-space: pre-wrap; word-wrap: break-word; font-size:11;pre">Dear LLVMers,
I have a class X that represents a set of Value* in a specific way.
That class is stored in two files: X.cpp and X.h
The class X works perfectly in a pass that I already have.
However, I need to use that class in some other passes, but I don't
want to have a copy of X.cpp and X.h in every pass folder.
I've tried to do the following:
- put X.h in the folder <llvm_root>/include/lllvm/Analysis
- put X.cpp in the folder <llvm_root>/lib/Analysis
- go to <llvm_root> and execute "make", to compile everything again,
with my new files
- change the includes of my passes to replace #include "X.h" by
#include "llvm/Analysis/X.h"
- compile my pass again
Until this point everything works fine. Although everything compiles
without any warnings,
I can't run my pass after I change the location of the source code of
the class X.
When I use the command:
raphael@ubuntu:~/$ opt -f -load myPassModule.so -myPass test.bc
I get the following error message:
opt: symbol lookup error:
/host/Raphael/bin/llvm-3.2/Release+Asserts/bin/../lib/myPassModule.so:
undefined symbol: _ZN4llvm5GraphC1Ei
I know that this error message means that X.h was successfully linked
to myPass, but when I call opt, opt can't find the actual
implementation
of the class and the methods declared in the header file.
Does anybody know what I did wrong or what I should do to make this work?</pre></div></div></blockquote><p style="margin:0px; padding:0px;" > </p></div></span></span>