<div dir="ltr">> <span style="font-size:12.8px"> Does libc++ also rely on this macro to work on Linux?</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Yes. Adding -U_GNU_SOURCE during the libc++ build results in a litany of errors.</span></div><div><span style="font-size:12.8px">The libc++ headers depend on a number of C library symbols that only get defined when -D_GNU_SOURCE=1 is present.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">/Eric</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 14, 2016 at 2:40 AM, Lei Zhang via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I noticed that clang++ unconditionally defines _GNU_SOURCE on Linux,<br>
even when I'm not including any headers in my code. Switching from<br>
stdlibc++ to libc++ doesn't change this, either.<br>
<br>
I understand that g++ does this because stdlibc++ heavily relies on<br>
_GNU_SOURCE. But what is the reason for clang++ to do so when using<br>
libc++? Does libc++ also rely on this macro to work on Linux?<br>
<br>
<br>
Regards,<br>
Lei<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>