The following command line linked correctly:
/usr/local/clang30/bin/clang -stdlib=libc++ -fPIC -g -Wl,-rpath
-Wl,/usr/local/lib -L/usr/local/clang30/lib -shared -lLLVMARMCodeGen
-lLLVMAlphaCodeGen -lLLVMAnalysis -lLLVMCodeGen -lLLVMCore
-lLLVMMBlazeCodeGen -lLLVMMC -lLLVMMCDisassembler -lLLVMMipsCodeGen
-lLLVMSelectionDAG -lLLVMSupport -lLLVMSystemZCodeGen -lLLVMX86CodeGen
-lclang -lclangAST -lclangAnalysis -lclangBasic -lclangDriver
-lclangFrontend -lclangLex -lclangParse -lclangSema
-lclangSerialization /usr/lib/libstdc++.6.dylib dxr-index.o sha1.o -o
libclang-index-plugin.so -shared
Notes:
1. The OS X ld(1) seems not to support -R, but -rpath works.
2.
http://llvm.org/releases/3.0/clang+llvm-3.0-x86_64-apple-darwin11.tar.gz
doesn't include a standard C++ runtime library.
3. I don't know whether to use libc++ or libstdc++. I don't
understand the consequences, if any, of linking to the one
in /usr/lib.
--jkl