This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: updated for unwind-libunwind.c
>>>>> On 17 Nov 2003 18:31:33 -0800, Jim Wilson <wilson@tuliptree.org> said:
Jim> See SHLIB_LINK in gcc/config/t-slibgcc-elf-ver. Maybe you can
Jim> override SHLIB_LC to include -lunwind in the t-libunwind file?
Jim> t-libunwind gets put at the end, so it seems like this should
Jim> work. An alternative would be to add another Makefile variable
Jim> for optional libraries, and then set that in t-libunwind.
Cool, this seems to work great! Patch attached (it replaces my
earlier patch from today). Please apply if it looks OK.
Jim> The whole story goes something like this... mklibgcc.in gets
Jim> processed by configure into mklibgcc which depends on configure
Jim> options. This gets run at build time to create libgcc.mk which
Jim> is the Makefile used to build libgcc. This inherits SHLIB_LINK
Jim> and other target dependent makefile variables from
Jim> gcc/config/t-slibgcc-elf-ver.
Wow, thanks for explaining that. Not sure I would have figured this
out on my own...
--david
2003-11-17 David Mosberger <davidmD@hpl.hp.com>
* config/t-libunwind: Mention unwind-c.c.
(SHLIB_LC): Overwrite the default-value from t-slibgcc-elf-ver
and mention -lunwind so that the resulting libgcc_s.so has
the necessary DT_NEEDED entry for libunwind.
* unwind-libunwind.c (_Unwind_GetCFA): Implement.
(_Unwind_GetBSP) [UNW_TARGET_IA64]: New function.
Index: unwind-libunwind.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/unwind-libunwind.c,v
retrieving revision 1.6
diff -u -r1.6 unwind-libunwind.c
--- unwind-libunwind.c 8 May 2003 01:15:40 -0000 1.6
+++ unwind-libunwind.c 18 Nov 2003 06:00:43 -0000
@@ -110,9 +110,11 @@
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
- /* ??? Is there any way to get this information? */
- return NULL;
-}
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_IA64_SP, &ret);
+ return ret;
+}
/* Overwrite the saved value for register REG in CONTEXT with VAL. */
@@ -166,6 +168,19 @@
{
return NULL;
}
+
+#ifdef UNW_TARGET_IA64
+
+_Unwind_Word
+_Unwind_GetBSP (struct _Unwind_Context *context)
+{
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_IA64_BSP, &ret);
+ return ret;
+}
+
+#endif
#include "unwind.inc"
Index: config/t-libunwind
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/t-libunwind,v
retrieving revision 1.2
diff -u -r1.2 t-libunwind
--- config/t-libunwind 16 Dec 2002 18:20:44 -0000 1.2
+++ config/t-libunwind 18 Nov 2003 06:00:43 -0000
@@ -1 +1,3 @@
-LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c
+SHLIB_LC = -lunwind -lc
+LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c \
+ $(srcdir)/unwind-c.c