<div class="gmail_quote">On Sat, Feb 18, 2012 at 7:36 PM, Jeffrey Yasskin <span dir="ltr"><<a href="mailto:jyasskin@gmail.com">jyasskin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When trying to build libcxxabi on linux, I discovered that clang's<br>
unwind.h doesn't provide enough definitions. This patch allows linux<br>
builds to take advantage of libunwind if that's installed.<br>
<br>
Another option would be to just copy the interfaces out of<br>
<a href="http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libgcc-s-ddefs.html" target="_blank">http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libgcc-s-ddefs.html</a>,<br>

but since we're relying on the system to provide definitions anyway,<br>
it seems more sensible to try to pull the interface from the system<br>
too.<br></blockquote><div><br></div><div>Personally, I'd rather see us do all of the above. Use libunwind's header if present, and provide the right interfaces otherwise. Still, this patch is clearly an improvement.</div>
<div><br></div><div>Can you only define _GNU_SOURCE (and associated silliness) on Linux? Or would BSDs need this as well? Essentially, I'd like to only define _GNU_SOURCE if absolutely necessary.</div><div><br></div><div>
Can we name _SHOULD_UNDEFINE_GNU_SOURCE something still less likely to collide? I could see exactly that macro used in other GNU_SOURCE manipulating contexts... Maybe just prefix with _CLANG_UNWIND_H? No strong opinion here.</div>
</div>