[LLVMdev] Problem linking with llvm on mac os 10.6

Garrison Venn gvenn.cfe.dev at gmail.com
Mon Mar 15 04:22:41 PDT 2010


I'm not sure why you are getting mixed architecture (bit size) results on 10.6.x but you can also build the examples
as part of the llvm build.

Set the environmental var BUILD_EXAMPLES to 1before executing the llvm make.

Garrison

On Mar 14, 2010, at 11:00, Romain Pechayre wrote:

> Hello all,
> 
> I am trying to build the kaleidoscope sample code on Mac os (10.6).
> What I have done to get llvm libraries :
> 
> 1) Downloaded llvm-2.6 source code
> 2) ./configure
> 3)make
> 4) make intall
> 
> Then I tried to build kaleidoscope as described in the tutorial:
> g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy
> I get  typical link time errors (undefined symbols: ...)  as if the linked libraries were not found ( llvm-config seems to work fine)
> 
> The very first errors are the following:
> ld: warning: in /usr/local/lib/libLLVMCore.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
> ld: warning: in /usr/local/lib/libLLVMSupport.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
> ld: warning: in /usr/local/lib/libLLVMSystem.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
> 
> Then I guess libraries are not linked and I get classical errors.
> By the way, I get the same errors (apart from the first ones) if I build like this (omitting libraries flags):
> 
> g++ -g -O3 toy.cpp -I/usr/local/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -o toy
> 
> There must be something wrong with the libraries and I assume I have not compiled them the right way. Please let me know if you have any ideas.
> 
> Regards,
> 
> romain
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100315/7627865f/attachment.html>


More information about the llvm-dev mailing list