<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 18, 2015 at 3:20 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 18 December 2015 at 18:13, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a>> wrote:<br>
> samsonov added a comment.<br>
><br>
> In <a href="http://reviews.llvm.org/D15598#314127" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15598#314127</a>, @rafael wrote:<br>
><br>
>> I am not sure what is "expected" is here:<br>
><br>
><br>
> Interesting.<br>
> 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}".<br>
> For instance,<br>
><br>
> clang a.cc -lstdc++ -stdlib=libc++<br>
><br>
> will effectively replace "-lstdc++" with "-lc++", and<br>
><br>
> clang++ a.cc -stdlib=libc++ -static-libstdc++<br>
><br>
> will link against libc++ statically. In that sense, it makes sense to assume that "-static-libstdc++" will bind to "-lstdc++" argument.<br>
><br>
> Apparently, it's not what GCC does :( Do you think we should keep being compatible here?<br>
<br>
</span>My preference would be for -lstdc++ to be as least special as<br>
possible.</blockquote><div><br></div><div>Got it. I can always use "-Bstatic -lstdc++ -Bdynamic" to manually link against my explicitly passed libstdc++,</div><div>I just wanted to make it less ugly.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Do you know why -stdlib=libc++ is not a clang++ only option?<br></blockquote><div><br></div><div>Not really. However, I believe there are setups which only use "clang" (w/o even --driver-mode=g++) and</div><div>pass include/library directories manually, and -stdlib=libc++ might be handy to choose between standard lib version.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Cheers,<br>
Rafael<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>