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]

[Patch] PR target/27880, _Unwind_GetIPInfo, 4.2/4.3/4.3 regression


This is a formal checkin request for a patch to fix PR target/27880, the
_Unwind_GetIPInfo bug.  This bug is on the GCC list of serious regressions.

I submitted it once before looking for comments and got some feedback
from Paolo and Mark saying that it looked OK but it wasn't clear that
either of those constituted an actual approval so I wanted to send it
out again and ask.

The novel feature to this patch is that the GCC_CHECK_UNWIND_GETIPINFO
macro in the config directory is being changed to look at the $target
macro to decide what to do.  No other macros in config look at this
variable.

See my earlier mail,
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00647.html, for my rational
on why I did it this way.

At Paolo's suggestion I changed this patch from the previous submission
to include a change to libstdc++-v3/configure.ac in order to call
GCC_CHECK_UNWIND_GETIPINFO on native and cross builds instead of just
for native builds since it will now work for both.

Tested on IA64 HP-UX and Linux with no regressions.

OK to checkin?

Steve Ellcey
sje@cup.hp.com



config/ChangeLog

2008-10-15  Steve Ellcey  <sje@cup.hp.com>

	PR target/27880
	* unwind_ipinfo.m4 (GCC_CHECK_UNWIND_GETIPINFO): Change from
	link test to target based test.

gcc/ChangeLog

2008-10-15  Steve Ellcey  <sje@cup.hp.com>

	PR target/27880
	* configure.ac (GCC_CHECK_UNWIND_GETIPINFO): Use this macro
	to set HAVE_GETIPINFO.
	* configure: Regenerate.

libstdc++-v3/ChangeLog
	
2008-10-15  Steve Ellcey  <sje@cup.hp.com>

	* configure.ac: Move call to GCC_CHECK_UNWIND_GETIPINFO.
	* configure: Regenerate to get new GCC_CHECK_UNWIND_GETIPINFO.

libjava/ChangeLog
	
2008-10-15  Steve Ellcey  <sje@cup.hp.com>

	* configure: Regenerate to get new GCC_CHECK_UNWIND_GETIPINFO.



Index: config/unwind_ipinfo.m4
===================================================================
--- config/unwind_ipinfo.m4	(revision 141779)
+++ config/unwind_ipinfo.m4	(working copy)
@@ -1,22 +1,31 @@
 dnl
-dnl Check whether _Unwind_GetIPInfo is available.
+dnl Check whether _Unwind_GetIPInfo is available without doing a link
+dnl test so we can use this with libstdc++-v3 and libjava.  Need to
+dnl use $target to set defaults because automatic checking is not possible
+dnl without a link test (and maybe even with a link test).
 dnl
+
 AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
-  AC_LANG_SAVE
-  AC_LANG_CPLUSPLUS
-  ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -fno-exceptions"
-  AC_MSG_CHECKING([for _Unwind_GetIPInfo])
-  AC_CACHE_VAL(gcc_cv_getipinfo, [
-  AC_TRY_LINK([extern "C" { extern void _Unwind_GetIPInfo(); }],
-      [_Unwind_GetIPInfo();],
-      [gcc_cv_getipinfo=yes],
-      [gcc_cv_getipinfo=no])
-  ])
-  if test $gcc_cv_getipinfo = yes; then
+  AC_ARG_WITH(system-libunwind,
+  [  --with-system-libunwind use installed libunwind])
+  # If system-libunwind was not specifically set, pick a default setting.
+  if test x$with_system_libunwind = x; then
+    case ${target} in
+      ia64-*-hpux*) with_system_libunwind=yes ;;
+      *) with_system_libunwind=no ;;
+    esac
+  fi
+  # Based on system-libunwind and target, do we have ipinfo?
+  if  test x$with_system_libunwind = xyes; then
+    case ${target} in
+      ia64-*-*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
+  else
+     have_unwind_getipinfo=yes
+  fi
+
+  if test x$have_unwind_getipinfo = xyes; then
     AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.])
   fi
-  AC_MSG_RESULT($gcc_cv_getipinfo)
-  CXXFLAGS="$ac_save_CXXFLAGS"
-  AC_LANG_RESTORE
 ])
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 141779)
+++ gcc/configure.ac	(working copy)
@@ -1188,14 +1188,8 @@ fi
 
 # For platforms with the unwind ABI which includes an unwind library,
 # libunwind, we can choose to use the system libunwind.
-AC_ARG_WITH(system-libunwind,
-[  --with-system-libunwind use installed libunwind])
-
 # config.gcc also contains tests of with_system_libunwind.
-if test x$with_system_libunwind = xyes; then
-        AC_DEFINE(HAVE_GETIPINFO, 1,
-[Define to 1 if system unwind library has _Unwind_GetIPInfo.])
-fi
+GCC_CHECK_UNWIND_GETIPINFO
 
 # --------------------------------------------------------
 # Build, host, and target specific configuration fragments
@@ -1421,20 +1415,6 @@ if test x$enable___cxa_atexit = xyes || 
   fi
 fi
 
-use_getipinfo=yes
-if test x$with_system_libunwind = xyes; then
-   if test x$host = x$target; then
-     AC_SEARCH_LIBS(_Unwind_GetIPInfo, unwind,, [use_getipinfo=no])
-   fi
-fi
-GCC_TARGET_TEMPLATE(HAVE_GETIPINFO)
-if test x$use_getipinfo = xyes; then
-   AC_DEFINE(HAVE_GETIPINFO, 1,
-	[Define to 1 if system unwind library has _Unwind_GetIPInfo.])
-else
-   echo "The system unwind library does not support _Unwind_GetIPInfo."
-fi
-
 # Look for a file containing extra machine modes.
 if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
   extra_modes_file='$(srcdir)'/config/${extra_modes}
Index: libstdc++-v3/configure.ac
===================================================================
--- libstdc++-v3/configure.ac	(revision 141779)
+++ libstdc++-v3/configure.ac	(working copy)
@@ -182,9 +182,6 @@ if $GLIBCXX_IS_NATIVE; then
   # For TLS support.
   GCC_CHECK_TLS
 
-  # For _Unwind_GetIPInfo.
-  GCC_CHECK_UNWIND_GETIPINFO
-
   # For iconv support.
   AM_ICONV
 
@@ -286,11 +283,12 @@ else
     AC_DEFINE(HAVE_TANL)
     AC_DEFINE(HAVE_TANHL)
   fi
-
-  # Assume we have _Unwind_GetIPInfo for cross-compiles.
-  AC_DEFINE(HAVE_GETIPINFO)
 fi
 
+# Check for _Unwind_GetIPInfo.
+GCC_CHECK_UNWIND_GETIPINFO
+
+
 GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
 
 GCC_HEADER_STDINT(include/gstdint.h)


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