Sorry for the delay, I missed this somehow. So, when c++ is g++ (as is the case on Ubuntu), it will not recognize the -stdlib=libstdc++ option. Now since you say that cc is actually clang on FreeBSD, I do not think my patch is correct. http://reviews.llvm.org/D6218