[LLVMdev] How to run LLVM3.6.1 on OS X (Yosemite, Xcode6.4) OR how to link bitcode generated by OS X clang with LLVM3.6.1

Tim Northover t.p.northover at gmail.com
Tue Jul 7 17:31:26 PDT 2015


> "/Users/meister/Development/externals-clasp/build/release/bin/clang" -v \
>     -resource-dir "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.1.0" \

I still think this is asking for trouble. It might help clang to find
the libc++ headers (iostream etc, under ../../../include/c++/v1), but
you're also providing it incorrect copies of its internal headers. A
better way is to either build libc++ with your Clang or symlink
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
into your compiler's real resource hierarchy. (I usually symlink,
myself).

> I say partial answer because when I try to compile all of my C++ source files some headers are still not found.

Which headers are missing? I'd hope anything critical in
XcodeDefault.xctoolchain/usr/include could be provided by your own
built clang.

> Do you know what you would set “-isysroot” to on OS X to get clang3.6.1 to run on OS X?

I think you got it right with the SDK path you used above:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk

(modified for the actual SDK version you have installed).

Cheers.

Tim.




More information about the llvm-dev mailing list