custom clang++ build + custom libc++ build = quirky

Hi,

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?

Best wishes,

Luc Bourhis