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