mhjacobson created this revision. mhjacobson added a reviewer: chandlerc. Herald added a project: All. mhjacobson requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Darwin's unwind.h has never surrounded declarations with _GNU_SOURCE guards. The _GNU_SOURCE stuff removed here was introduced by a09e62a042, which expanded the #include_next branch to non-Darwin platforms, including those that use https://github.com/libunwind/libunwind (which *does* use _GNU_SOURCE guards). That change was partially reverted by 032d422d2e, which left the _GNU_SOURCE stuff as an "open question". Therefore: close the question; remove the _GNU_SOURCE define. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D136575 Files: clang/lib/Headers/unwind.h Index: clang/lib/Headers/unwind.h =================================================================== --- clang/lib/Headers/unwind.h +++ clang/lib/Headers/unwind.h @@ -14,12 +14,8 @@ #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 -# define _SHOULD_UNDEFINE_GNU_SOURCE -# define _GNU_SOURCE -# endif + * use it. */ + // libunwind's unwind.h reflects the current visibility. However, Mozilla // builds with -fvisibility=hidden and relies on gcc's unwind.h to reset the // visibility to default and export its contents. gcc also allows users to @@ -33,10 +29,6 @@ # include_next <unwind.h> # pragma GCC visibility pop # endif -# ifdef _SHOULD_UNDEFINE_GNU_SOURCE -# undef _GNU_SOURCE -# undef _SHOULD_UNDEFINE_GNU_SOURCE -# endif #else #include <stdint.h>
Index: clang/lib/Headers/unwind.h =================================================================== --- clang/lib/Headers/unwind.h +++ clang/lib/Headers/unwind.h @@ -14,12 +14,8 @@ #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 -# define _SHOULD_UNDEFINE_GNU_SOURCE -# define _GNU_SOURCE -# endif + * use it. */ + // libunwind's unwind.h reflects the current visibility. However, Mozilla // builds with -fvisibility=hidden and relies on gcc's unwind.h to reset the // visibility to default and export its contents. gcc also allows users to @@ -33,10 +29,6 @@ # include_next <unwind.h> # pragma GCC visibility pop # endif -# ifdef _SHOULD_UNDEFINE_GNU_SOURCE -# undef _GNU_SOURCE -# undef _SHOULD_UNDEFINE_GNU_SOURCE -# endif #else #include <stdint.h>
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits