<div dir="ltr"><div><div><div>(Replying to llvm-dev as well - it is part of the normal mailing-list etiquette to reply-all, so that replies go to list as well as the individual - then others can see the replies and any follow up)<br><br></div>So, I tried the chapter8/toy.cpp from release_38, and it works on my setup [I didn't rebuild the compiler, I used mine, built from sources with changes from February 5th.<br><br></div>I think you need to do some clang++ -v to see that it actually links to the things you think it will link with, for example. My best guess is that there is another LLVM installation and the linker finds the wrong one. Could of course be many other things wrong too, it's just a guess. <br><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2016 at 14:41, vivek pandya <span dir="ltr"><<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><i><font face="monospace, monospace" size="2"><b>Vivek Pandya</b></font></i><div><br></div></div></div></div></div></div>
<br><div class="gmail_quote"><span class="">On Tue, Feb 16, 2016 at 7:47 PM, mats petersson <span dir="ltr"><<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>I should add that in my git version 393c3c6b687d0d92a24afe888bca6995f41f381a chapter8/toy.cpp compiles with the command you posted.<br><br>--<br></div>Mats<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2016 at 14:15, mats petersson <span dir="ltr"><<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Are you compiling the actual Kaleidoscope in the llvm 3.8 directory? Or a version from a different version of LLVM?<br></div></div></blockquote></div></div></div></div></blockquote></span><div>Hi Mats,</div><div>Yes I am compiling Kaleidoscope in example folder it self on release_38 branch.</div><div>Apart from that my one other project which uses LLVM  is also not compiling ( it used to compile earlier )<br></div><div>It fails with following :</div><div><span class=""><div>Undefined symbols for architecture x86_64:</div></span><div>  "_LLVMInt128TypeInContext", referenced from:</div><div>      _D1d4llvm4type7TypeGen5visitMFE1d6common11builtintype11BuiltinTypeZPS4llvm1c5types16__LLVMOpaqueType in libd-llvm.a(libd-llvm.o)</div><span class=""><div>ld: symbol(s) not found for architecture x86_64</div></span><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Vivek</div></font></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 16 February 2016 at 13:48, vivek pandya via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr">Hello ,<div><br></div><div>I have build llvm from release_38 branch ( only llvm and clang ) and install it. My DYLD_LIBRARY_PATH points to installation-directory/lib. </div><div><br></div><div>I am compiling example files for Kaleidoscope with following command :</div><div><br></div><div><div>clang++ -g toy.cpp -std=c++11 `llvm-config --cxxflags --ldflags --system-libs --libs core mcjit native` -O3 -o toy</div><div><br></div><div>but it fails with following error:</div><div>Undefined symbols for architecture x86_64:</div><div> <font face="monospace, monospace"> "llvm::CmpInst::CmpInst(llvm::Type*, llvm::Instruction::OtherOps, llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::Instruction*)", referenced from:</font></div><div><font face="monospace, monospace">      llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateFCmp(llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::MDNode*) in toy-1f302b.o</font></div><div><font face="monospace, monospace">  "llvm::DIBuilder::createFunction(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DISubroutineType*, bool, bool, unsigned int, unsigned int, bool, llvm::MDTupleTypedArrayWrapper<llvm::DITemplateParameter>, llvm::DISubprogram*)", referenced from:</font></div><div><font face="monospace, monospace">      (anonymous namespace)::FunctionAST::codegen() in toy-1f302b.o</font></div><div><font face="monospace, monospace">  "vtable for llvm::PHINode", referenced from:</font></div><div><font face="monospace, monospace">      llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreatePHI(llvm::Type*, unsigned int, llvm::Twine const&) in toy-1f302b.o</font></div><div><font face="monospace, monospace">  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.</font></div><div><font face="monospace, monospace">ld: symbol(s) not found for architecture x86_64</font></div><div><font face="monospace, monospace">clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)</font></div></div><div><br></div><div>With previous version 3.8.0svn it used to build successfully. Can someone help me what I am doing wrong ?</div><div><br></div><div>Sincerely,</div><div><div><div><div dir="ltr"><div><div dir="ltr"><i><font face="monospace, monospace" size="2"><b>Vivek Pandya</b></font></i><div><br></div></div></div></div></div></div>
</div></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>