<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 4, 2015, at 2:36 PM, Alex S <<a href="mailto:alexmountain13@gmail.com" class="">alexmountain13@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Mehdi,<div class=""><br class=""></div><div class="">I meant when I build the LLVM and it will give the following errors:</div><div class=""><br class=""></div><div class=""><div class="">make[2]: Entering directory `/home/alex/new/llvm-obj/tools/llc'</div><div class="">llvm[2]: Linking Debug+Asserts executable llc</div><div class="">/home/alex/new/llvm-obj/Debug+Asserts/lib/libLLVMCodeGen.a(Passes.o): In function `llvm::TargetPassConfig::addIRPasses()':</div><div class="">/home/alex/new/llvm-3.1.src/lib/CodeGen/Passes.cpp:295: undefined reference to `llvm::createMyAliasAnalysisPass()'</div><div class="">collect2: ld returned 1 exit status</div><div class="">make[2]: *** [/home/alex/new/llvm-obj/Debug+Asserts/bin/llc] Error 1</div><div class="">make[2]: Leaving directory `/home/alex/new/llvm-obj/tools/llc'</div><div class="">make[1]: *** [llc/.makeall] Error 2</div><div class="">make[1]: Leaving directory `/home/alex/new/llvm-obj/tools'</div><div class="">make: *** [all] Error 1</div></div></div></div></blockquote><div><br class=""></div><div>Since you created a new library, you need to add it as a dependency wherever you’re calling into it: see lib/CodeGen/LLVMBuild.txt </div><br class=""><div>Also, on a side note, the Makefile/autotools build is deprecated, you may want to look at cmake.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alex</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Dec 4, 2015 at 5:17 PM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
> On Dec 4, 2015, at 1:37 PM, Alex S via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> Hi all,<br class="">
><br class="">
> I create a folder containing my new alias analysis pass in the lib/Analysis folder of the source tree.<br class="">
> I mimic the way IPA did to create a LLVMipa.a library. That is, I write a Makefile to create my library<br class="">
> and I change the Makefile correspondingly in the Analysis folder.<br class="">
><br class="">
> However, when I want to use my new alias analysis in the Codegen. The compiler will complain<br class="">
> "undefined error" during the link phase.  Could anyone point me out where I need to change in order<br class="">
> to use my new alias analysis pass in the Codegen?<br class="">
<br class="">
<br class="">
</span>Can you provide the link command that fails and the output?<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
<br class="">
Mehdi<br class="">
<br class="">
</font></span></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>