This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3_3-branch PATCH to libunwind
- From: gdr at integrable-solutions dot net
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Mosberger <davidm at hpl dot hp dot com>
- Date: 04 Dec 2003 03:24:52 +0100
- Subject: 3_3-branch PATCH to libunwind
- Organization: Integrable Solutions
I have applied the patch attached below on the behalf of David
Mosberger. The patch is described as follows:
I have a small patch consisting of fixes backported from pre-v3.4
which are needed on IA-64 to get the libunwind support working.
Working libunwind support is getting more important on IA-64 now
because the latest versions of glibc stress the unwinder much more
and the built-in unwinder for IA-64 (config/ia64/unwind-ia64.c) is
hopelessly broken (I looked into fixing the built-in unwinder, but
the scope of the fixes would be large and would have a real
potential of introducing a new set of bugs so I concluded it's
better to leave the built-in unwinder as is and switch to libunwind
instead). The patch should be completely safe because it won't
affect the building of GCC in any fashion unless libunwind is
installed. And even then libunwind support could easily be turned
off with --disable-libunwind-exceptions, should there be some
unexpected problems. Also, I have tested this patch with an
NPTL-enabled glibc and "make check" passes all tests with this
patch applied.
He had regressiond-tested the patch according to the following scheme:
OK, here are the results: I did "make boostrap; cd gcc; make
check" in 3 configurations:
(1) CVS v3.3 branch as of this morning, configured without
libunwind
(2) same as (1), but with the attached patch applied
(3) same as (2), but with libunwind enabled
The test-suite produced the exact same results for all three
cases. In particular:
=== g++ Summary ===
# of expected passes 7886
# of expected failures 95
# of untested testcases 23
# of unsupported tests 28
=== g77 Summary ===
# of expected passes 1686
# of unsupported tests 8
=== gcc Summary ===
# of expected passes 21090
# of unexpected failures 10
# of unexpected successes 5
# of expected failures 78
# of unresolved testcases 4
# of unsupported tests 173
=== objc Summary ===
# of expected passes 1155
-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.16114.2.822
diff -p -r1.16114.2.822 ChangeLog
*** ChangeLog 3 Dec 2003 22:37:38 -0000 1.16114.2.822
--- ChangeLog 4 Dec 2003 02:12:14 -0000
***************
*** 1,3 ****
--- 1,17 ----
+ 2003-12-03 James E Wilson <wilson@specifixinc.com>
+
+ 2003-11-29 James E Wilson <wilson@specifixinc.com>
+ * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name
+ instead of in shared_name.
+
+ 2003-12-03 David Mosberger <davidm@hpl.hp.com>
+
+ 2003-11-20 David Mosberger <davidm@hpl.hp.com>
+ * config/t-libunwind (LIB2ADDEH): Add unwind-c.c.
+ (SHLIB_LC): Define.
+ * unwind-libunwind.c (_Unwind_GetCFA): Implement.
+ (_Unwind_GetBSP) [UNW_TARGET_IA64]: New function.
+
2003-12-03 Jakub Jelinek <jakub@redhat.com>
* expr.c (store_constructor): Only set RTX_UNCHANGING_P for
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.350.2.6
diff -p -r1.350.2.6 gcc.c
*** gcc.c 6 Nov 2003 23:13:31 -0000 1.350.2.6
--- gcc.c 4 Dec 2003 02:12:18 -0000
*************** init_spec ()
*** 1570,1581 ****
#else
"-lgcc_s%M"
#endif
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
! ,
! "-lgcc",
! "-lgcc_eh");
p += 5;
in_sep = 0;
}
--- 1570,1583 ----
#else
"-lgcc_s%M"
#endif
+ ,
+ "-lgcc",
+ "-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
! );
!
p += 5;
in_sep = 0;
}
*************** init_spec ()
*** 1591,1597 ****
#endif
,
"libgcc.a%s",
! "libgcc_eh.a%s");
p += 10;
in_sep = 0;
}
--- 1593,1603 ----
#endif
,
"libgcc.a%s",
! "libgcc_eh.a%s"
! #ifdef USE_LIBUNWIND_EXCEPTIONS
! "libunwind.a%s"
! #endif
! );
p += 10;
in_sep = 0;
}
Index: unwind-libunwind.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-libunwind.c,v
retrieving revision 1.6.8.1
diff -p -r1.6.8.1 unwind-libunwind.c
*** unwind-libunwind.c 10 Aug 2003 23:11:26 -0000 1.6.8.1
--- unwind-libunwind.c 4 Dec 2003 02:12:18 -0000
*************** _Unwind_GetGR (struct _Unwind_Context *c
*** 110,118 ****
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
! /* ??? Is there any way to get this information? */
! return NULL;
! }
/* Overwrite the saved value for register REG in CONTEXT with VAL. */
--- 110,120 ----
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
! 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. */
*************** _Unwind_FindEnclosingFunction (void *pc)
*** 166,171 ****
--- 168,186 ----
{
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: /cvs/gcc/gcc/gcc/config/t-libunwind,v
retrieving revision 1.2.16.1
diff -p -r1.2.16.1 t-libunwind
*** config/t-libunwind 10 Aug 2003 23:11:27 -0000 1.2.16.1
--- config/t-libunwind 4 Dec 2003 02:12:19 -0000
***************
*** 1 ****
! LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c
--- 1,6 ----
! # Override 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.
! SHLIB_LC = -lunwind -lc
! LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c \
! $(srcdir)/unwind-c.c