[LLVMdev] Problem linking with llvm on mac os 10.6

Daniel Dunbar daniel at zuster.org
Mon Mar 15 17:33:11 PDT 2010


LLVM 2.6 hadn't updated configure, and would build as 32-bit by
default. The easy fix is to always force the desired triple when
configuring, I generally use:
  configure --{build,host,target}=x86_64-apple-darwin10

 - Daniel

On Mon, Mar 15, 2010 at 4:22 AM, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list