File pr27880.diff of Package gcc46

2006-06-19  Andreas Schwab  <schwab@suse.de>

	PR target/27880
	* unwind-compat.c: Wrap everything except _Unwind_GetIPInfo inside
	SHARED.
	* config/t-libunwind (LIB2ADDEHSTATIC): Add
	$(srcdir)/unwind-compat.c.

Index: gcc/config/t-libunwind
===================================================================
--- gcc/config/t-libunwind.orig	2009-04-29 17:23:02.000000000 +0200
+++ gcc/config/t-libunwind	2010-07-01 16:26:39.000000000 +0200
@@ -24,7 +24,8 @@
 SHLIB_LC = -lunwind -lc
 LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
   $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
-LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
Index: gcc/unwind-compat.c
===================================================================
--- gcc/unwind-compat.c.orig	2009-11-26 17:07:42.000000000 +0100
+++ gcc/unwind-compat.c	2010-07-01 16:26:39.000000000 +0200
@@ -30,6 +30,7 @@
 #include "unwind-dw2-fde.h"
 #include "unwind-compat.h"
 
+#ifdef SHARED
 extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
   (_Unwind_Trace_Fn, void *);
 
@@ -131,13 +132,6 @@ _Unwind_GetIP (struct _Unwind_Context *c
 }
 symver (_Unwind_GetIP, GCC_3.0);
 
-_Unwind_Ptr
-_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
-{
-  *ip_before_insn = 0;
-  return __libunwind_Unwind_GetIP (context);
-}
-
 extern void *__libunwind_Unwind_GetLanguageSpecificData
   (struct _Unwind_Context *);
 
@@ -207,4 +201,14 @@ _Unwind_SetIP (struct _Unwind_Context *c
   return __libunwind_Unwind_SetIP (context, val);
 }
 symver (_Unwind_SetIP, GCC_3.0);
+#endif /* SHARED */
+
+extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
+
+_Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+  *ip_before_insn = 0;
+  return __libunwind_Unwind_GetIP (context);
+}
 #endif
openSUSE Build Service is sponsored by