]> granicus.if.org Git - clang/commitdiff
Effectively revert r151058 which caused Clang's unwind.h to defer to
authorChandler Carruth <chandlerc@gmail.com>
Mon, 29 Dec 2014 13:29:38 +0000 (13:29 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 29 Dec 2014 13:29:38 +0000 (13:29 +0000)
libunwind in all cases when installed.

At the time, Clang's unwind.h didn't provide huge chunks of the
LSB-specified unwind interface, and was generally too aenemic to use for
real software. However, it has since then become a strict superset of
the APIs provided by libunwind on Linux. Notably, you cannot compile
llgo's libgo library against libunwind, but you can against Clang's
unwind.h. So let's just use our header. =] I've checked pretty
thoroughly for any incompatibilities, and I am not aware of any.

An open question is whether or not we should continue to munge
GNU_SOURCE here. I didn't touch that as it potentially has compatibility
implications on systems I cannot easily test -- Darwin. If a Darwin
maintainer can verify that this is in fact unnecessary and remove it,
cool. Until then, leaving it in makes this change a no-op there, and
only really relevant on Linux systems where it is pretty clearly the
right way to go.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224934 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/unwind.h

index d388ef3cb410d129596f9bf49b7e002bcf377c01..90aca16aca398ae7277151f1e56eed46f68898f4 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef __CLANG_UNWIND_H
 #define __CLANG_UNWIND_H
 
-#if __has_include_next(<unwind.h>)
-/* Darwin (from 11.x on) and libunwind provide an unwind.h. If that's available,
+#if defined(__APPLE__) && __has_include_next(<unwind.h>)
+/* Darwin (from 11.x on) provide an unwind.h. If that's available,
  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
  * so define that around the include.*/
 # ifndef _GNU_SOURCE