[LLVMdev] Problem linking with llvm on mac os 10.6

Romain Pechayre rpechayr at gmail.com
Sun Mar 14 12:02:45 PDT 2010


Indeed it works. Thanks ! 
Is LLVM built with m32 by default ? 

Cheers,

Romain 
On Mar 14, 2010, at 5:42 PM, Chris Lattner wrote:

> 
> On Mar 14, 2010, at 8:00 AM, 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.
> 
> This sounds like LLVM is being built as x86-32, but toy.cpp is being built as x86-64.  Try compiling toy.cpp with "-m32".
> 
> -Chris

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


More information about the llvm-dev mailing list