[cfe-dev] custom clang++ build + custom libc++ build = quirky
luc_j_bourhis at mac.com
Thu May 24 05:44:23 PDT 2012
this post of mine follows from a discussion in another thread with Jean-Daniel Dupas and others.
I built my own clang from the 3.1 branch and installed it in /usr/local, then I built my own libc++ from the trunk and installed it in /usr/local too, i.e. the headers in /usr/local/lib/c++/v1 and the dylib's in /usr/local/lib. Now any /usr/local/clang++ -o foo -stdlib=libc++ foo.cpp will pick the headers from /usr/local whereas it will link against /usr/lib/libc++.dylib instead of /usr/local/lib/libc++.dylib. At the moment, this actually does not cause any trouble.
However imho this is not sustainable. As suggested by Jean-Daniel one could add -L/usr/local/lib to force the linker to search there first but that means that my build system would have to discriminate between /usr/bin/clang++ and /usr/local/bin/clang++, which to me feels like doing the job that the clang++ driver should be doing. I mean the standard library should be the responsibility of the compiler, shouldn't it?
More information about the cfe-dev