On Fri, Dec 18, 2015 at 3:20 PM, Rafael Espíndola < rafael.espind...@gmail.com> wrote:
> On 18 December 2015 at 18:13, Alexey Samsonov <vonos...@gmail.com> wrote: > > samsonov added a comment. > > > > In http://reviews.llvm.org/D15598#314127, @rafael wrote: > > > >> I am not sure what is "expected" is here: > > > > > > Interesting. > > I was assuming that Clang tends to understand "-lstdc++" as a special > argument that says "link against C++ standard library", not "link against > libstdc++.{a,so}". > > For instance, > > > > clang a.cc -lstdc++ -stdlib=libc++ > > > > will effectively replace "-lstdc++" with "-lc++", and > > > > clang++ a.cc -stdlib=libc++ -static-libstdc++ > > > > will link against libc++ statically. In that sense, it makes sense to > assume that "-static-libstdc++" will bind to "-lstdc++" argument. > > > > Apparently, it's not what GCC does :( Do you think we should keep being > compatible here? > > My preference would be for -lstdc++ to be as least special as > possible. Got it. I can always use "-Bstatic -lstdc++ -Bdynamic" to manually link against my explicitly passed libstdc++, I just wanted to make it less ugly. > Do you know why -stdlib=libc++ is not a clang++ only option? > Not really. However, I believe there are setups which only use "clang" (w/o even --driver-mode=g++) and pass include/library directories manually, and -stdlib=libc++ might be handy to choose between standard lib version. > Cheers, > Rafael > -- Alexey Samsonov vonos...@gmail.com
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits