I would like to build a recent clang + llvm + libc++. I'm currently on a system (based on CentOS 6.6) where I can't easily get binary packages of clang, but where I can set up a GCC recent enough for building clang (for example 4.9), by setting some environment variables.
I'd like my version of clang to be
-rpath $ORIGIN
)I can do this, but it involves putting clang, llvm, libc++, libc++abi (and things I might have forgotten) in one tree, building clang from one build directory, then setting a lot of flags blindly and building it again from a second build directory.
Is there another proper way of bootstrapping clang with libc++? I believe there must be, since the official binaries of llvm & clang are self-sufficient as I described above.
I've been curious about this myself and don't think there is a proper, "blessed" way of bootstraping clang with li bc++.
In my experience, clang installed from repositories depends on libstdc++, and so does clang installed from binary distributions available at http://www.llvm.org/releases/download.html#3.7.0 (I've tried the one for Ubuntu 14.04). A few differences between repo clang and that from llvm.org:
Considering that clang from repositories and llvm.org depends on libstdc++, I would say that there is no proper wa y of getting rid of that dependency, at least not on Linux systems I've played with, which include Ubuntu, Amazon Linux, CentOS, and Fedora.
Having said this, however, I find that even using clang dependent on libstdc++ allows one to produce programs that depend on libc++ instead of libstdc++. Even though it is possible to build a clang+llvm setup that does not itself depend on libstdc++, as you have found already, I don't think it's necessary to jump through all those hoops.
In case you find it helpful, I have a brief article on this at http://www.omniprog.info/clang_no_gcc.html (also see this)
I'm still experimenting with all this and will update this answer if I come across something interesting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With