Hi,
We shouldn't assume that we can define x86_64_fallback_frame_state
for other x86-64 C libraries, like Bionic. OK for trunk?
Thanks.
H.J.
---
2012-03-27 H.J. Lu <[email protected]>
* config/i386/linux-unwind.h (x86_64_fallback_frame_state): Define
only for glibc.
diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
index c5f7ea0..61b4ebf 100644
--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -28,11 +28,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively.
If not, see
#ifndef inhibit_libc
-#ifdef __x86_64__
+/* There's no sys/ucontext.h for glibc 2.0, so no
+ signal-turned-exceptions for them. There's also no configure-run for
+ the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the
+ target libc version macro should be enough. */
+#if defined __GLIBC__ && !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
#include <signal.h>
#include <sys/ucontext.h>
+#ifdef __x86_64__
+
#define MD_FALLBACK_FRAME_STATE_FOR x86_64_fallback_frame_state
static _Unwind_Reason_Code
@@ -102,15 +108,6 @@ x86_64_fallback_frame_state (struct _Unwind_Context
*context,
#else /* ifdef __x86_64__ */
-/* There's no sys/ucontext.h for glibc 2.0, so no
- signal-turned-exceptions for them. There's also no configure-run for
- the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the
- target libc version macro should be enough. */
-#if defined __GLIBC__ && !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
-
-#include <signal.h>
-#include <sys/ucontext.h>
-
#define MD_FALLBACK_FRAME_STATE_FOR x86_fallback_frame_state
static _Unwind_Reason_Code
@@ -191,6 +188,6 @@ x86_frob_update_context (struct _Unwind_Context *context,
_Unwind_SetSignalFrame (context, 1);
}
-#endif /* not glibc 2.0 */
#endif /* ifdef __x86_64__ */
+#endif /* not glibc 2.0 */
#endif /* ifdef inhibit_libc */