[LLVMdev] Getting lld to compile on Mac OS X Lion

Filipe Cabecinhas filcab at gmail.com
Mon Apr 23 17:43:28 PDT 2012


Hi,  

What are the steps I have to follow to compile lld on a mac?

I've compiled and installed llvm+clang+libc++, but clang won't use the updated version that I installed in /usr/local/
If I just hack it and put the updated headers in lld's directory, it will compile it, so I suppose it's the libc++ that's bundled with Mac OS X that is too old.

The steps I took were:
compile and install llvm+clang+libcxx (using ToT for all of them, compiled and installed using cake).
I had to add -std=c++0x to the compilation flags and -lc++abi to the linker flags, for the libcxx dir.

Put lld in llvm/projects/lld
[dev/llvm-build]% cmake -DLLVM_TARGETS_TO_BUILD="ARM;PowerPC;CellSPU;X86" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm

[dev/llvm-build]% make
...

The error I get when I'm trying to compile is http://pastie.org/3841810
If I symlink the updated libcxx headers into lld/tools/lld-core, the file compiles cleanly (but fails linking becausee I'm not tweaking the linker flags).

How can I make clang use the libcxx library at /usr/local/lib? I would prefer if I didn't have to replace the system library with my (possibly buggy) version…

Thanks,

  Filipe






More information about the llvm-dev mailing list