[llvm-dev] [help] Kaleidoscope build fails after llvm-3.8

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 16 07:17:31 PST 2016


(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)

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.

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.

--
Mats

On 16 February 2016 at 14:41, vivek pandya <vivekvpandya at gmail.com> wrote:

>
>
> *Vivek Pandya*
>
>
> On Tue, Feb 16, 2016 at 7:47 PM, mats petersson <mats at planetcatfish.com>
> wrote:
>
>> I should add that in my git version
>> 393c3c6b687d0d92a24afe888bca6995f41f381a chapter8/toy.cpp compiles with the
>> command you posted.
>>
>> --
>> Mats
>>
>> On 16 February 2016 at 14:15, mats petersson <mats at planetcatfish.com>
>> wrote:
>>
>>> Are you compiling the actual Kaleidoscope in the llvm 3.8 directory? Or
>>> a version from a different version of LLVM?
>>>
>> Hi Mats,
> Yes I am compiling Kaleidoscope in example folder it self on release_38
> branch.
> Apart from that my one other project which uses LLVM  is also not
> compiling ( it used to compile earlier )
> It fails with following :
> Undefined symbols for architecture x86_64:
>   "_LLVMInt128TypeInContext", referenced from:
>
> _D1d4llvm4type7TypeGen5visitMFE1d6common11builtintype11BuiltinTypeZPS4llvm1c5types16__LLVMOpaqueType
> in libd-llvm.a(libd-llvm.o)
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Vivek
>
>> --
>>> Mats
>>>
>>> On 16 February 2016 at 13:48, vivek pandya via llvm-dev <
>>> llvm-dev at lists.llvm.org> wrote:
>>>
>>>> Hello ,
>>>>
>>>> I have build llvm from release_38 branch ( only llvm and clang ) and
>>>> install it. My DYLD_LIBRARY_PATH points to installation-directory/lib.
>>>>
>>>> I am compiling example files for Kaleidoscope with following command :
>>>>
>>>> clang++ -g toy.cpp -std=c++11 `llvm-config --cxxflags --ldflags
>>>> --system-libs --libs core mcjit native` -O3 -o toy
>>>>
>>>> but it fails with following error:
>>>> Undefined symbols for architecture x86_64:
>>>>   "llvm::CmpInst::CmpInst(llvm::Type*, llvm::Instruction::OtherOps,
>>>> llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, llvm::Twine const&,
>>>> llvm::Instruction*)", referenced from:
>>>>       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
>>>>   "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:
>>>>       (anonymous namespace)::FunctionAST::codegen() in toy-1f302b.o
>>>>   "vtable for llvm::PHINode", referenced from:
>>>>       llvm::IRBuilder<true, llvm::ConstantFolder,
>>>> llvm::IRBuilderDefaultInserter<true> >::CreatePHI(llvm::Type*, unsigned
>>>> int, llvm::Twine const&) in toy-1f302b.o
>>>>   NOTE: a missing vtable usually means the first non-inline virtual
>>>> member function has no definition.
>>>> ld: symbol(s) not found for architecture x86_64
>>>> clang-3.8: error: linker command failed with exit code 1 (use -v to see
>>>> invocation)
>>>>
>>>> With previous version 3.8.0svn it used to build successfully. Can
>>>> someone help me what I am doing wrong ?
>>>>
>>>> Sincerely,
>>>> *Vivek Pandya*
>>>>
>>>>
>>>> _______________________________________________
>>>> LLVM Developers mailing list
>>>> llvm-dev at lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160216/028479c7/attachment.html>


More information about the llvm-dev mailing list