[cfe-commits] [patch] Use the system unwind.h when that's available

Chandler Carruth chandlerc at google.com
Sat Feb 18 20:05:13 PST 2012


On Sat, Feb 18, 2012 at 7:36 PM, Jeffrey Yasskin <jyasskin at gmail.com> wrote:

> When trying to build libcxxabi on linux, I discovered that clang's
> unwind.h doesn't provide enough definitions. This patch allows linux
> builds to take advantage of libunwind if that's installed.
>
> Another option would be to just copy the interfaces out of
>
> http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libgcc-s-ddefs.html
> ,
> but since we're relying on the system to provide definitions anyway,
> it seems more sensible to try to pull the interface from the system
> too.
>

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.

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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120218/0e482033/attachment.html>


More information about the cfe-commits mailing list