This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: small fixes for libunwind support


Hi Jim,

Thanks for reviewing the patch and for the feedback.

>>>>> On 10 Dec 2003 23:01:49 -0800, Jim Wilson <wilson@specifixinc.com> said:

  Jim> The patch adds configure support for a t-libunwind-no-eh file,
  Jim> but does not include it.

Argh, I must have used cvs diff rather than cvsdo diff... ;-(
Fixed in the patch below.

  Jim> I gather that t-libunwind-no-eh is supposed to be the same as
  Jim> the current t-libunwind file without the attached patch.  Is
  Jim> that right?

Yup.

  Jim> Otherwise this seems fine to me.  I see a typo in the ChangeLog
  Jim> entry "it"->"if", and it needs to mention that configure is
  Jim> rebuilt.

OK, I fixed the typo.  I'm not quite sure I understood what you want
me to do about configure.  Below, I just added a Changelog entry that
configure needs to be regenerated, without actually including the diff
for configure.  Hope that's OK.

Thanks,

	--david

ChangeLog

2003-12-10  David Mosberger  <davidm@hpl.hp.com>

	* unwind-libunwind.c (_Unwind_SetGR): Clear the NaT bit as
	required by C++ ABI for Itanium.

	* t-libunwind (LIB2ADDEH): Remove unwind-libunwind.c.
	* t-libunwind-no-eh: New file.

	* configure.in: Check libunwind for _Unwind_Resume() and if it's
	present, set libunwind_has_eh_support to "yes".
	* configure: Regenerate.

	* config.gcc (ia64*-*-linux*): If $libunwind_has_eh_support is
	set to yes, use t-libunwind, otherwise, use t-libunwind-no-eh.

 2003-12-10  Geoffrey Keating  <geoffk@apple.com>
Index: config.gcc
--- config.gcc
+++ config.gcc
@@ -1245,7 +1245,11 @@
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	if test x"$use_libunwind_exceptions" = xyes; then
-	  tmake_file="$tmake_file t-libunwind"
+	  if test x"$libunwind_has_eh_support" = xyes; then
+	    tmake_file="$tmake_file t-libunwind"
+	  else
+	    tmake_file="$tmake_file t-libunwind-no-eh"
+	  fi
 	fi
 	;;
 ia64*-*-hpux*)
Index: configure.in
--- configure.in
+++ configure.in
@@ -957,6 +957,8 @@
 if test x"$use_libunwind_exceptions" = xyes; then
    AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
 	[Define if gcc should use -lunwind.])
+   AC_CHECK_LIB(unwind, _Unwind_Resume, libunwind_has_eh_support=yes,
+	libunwind_has_eh_support=no)
 fi
 
 # --------------------------------------------------------
Index: unwind-libunwind.c
--- unwind-libunwind.c
+++ unwind-libunwind.c
@@ -124,6 +124,11 @@
   /* Note: here we depend on the fact that general registers are
      expected to start with register number 0!  */
   unw_set_reg (&context->cursor, index, val);
+#ifdef UNW_TARGET_IA64
+  if (index >= UNW_IA64_GR && index <= UNW_IA64_GR + 127)
+    /* Clear the NaT bit. */
+    unw_set_reg (&context->cursor, UNW_IA64_NAT + (index - UNW_IA64_GR), 0);
+#endif
 }
 
 /* Retrieve the return address for CONTEXT.  */
Index: config/t-libunwind
--- config/t-libunwind
+++ config/t-libunwind
@@ -2,5 +2,4 @@
 # 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
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
Index: config/t-libunwind-no-eh
--- /dev/null
+++ config/t-libunwind-no-eh
@@ -0,0 +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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]