re PR target/27880 (undefined reference to `_Unwind_GetIPInfo')

PR target/27880
	* unwind-c.c (PERSONALITY_FUNCTION): Ifdef use of _Unwind_GetIPInfo.
	* configure.ac (HAVE_GETIPINFO): Check for _Unwind_GetIPInfo.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r117576
This commit is contained in:
Steve Ellcey 2006-10-09 15:55:38 +00:00 committed by Steve Ellcey
parent f4935db5d7
commit e64f5acfaf
5 changed files with 188 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-10-09 Steve Ellcey <sje@cup.hp.com>
PR target/27880
* unwind-c.c (PERSONALITY_FUNCTION): Ifdef use of _Unwind_GetIPInfo.
* configure.ac (HAVE_GETIPINFO): Check for _Unwind_GetIPInfo.
* configure: Regenerate.
* config.in: Regenerate.
2006-10-09 Aldy Hernandez <aldyh@redhat.com>
* tree-mudflap.c (mf_xform_derefs_1): Add parentheses around TREE_TYPE.

View File

@ -793,6 +793,9 @@
#endif
/* Define to 1 if system unwind library has _Unwind_GetIPInfo. */
#undef HAVE_GETIPINFO
/* Define to 1 if you have the `getrlimit' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_GETRLIMIT

153
gcc/configure vendored
View File

@ -12177,6 +12177,15 @@ if test "${with_system_libunwind+set}" = set; then
fi;
# config.gcc also contains tests of with_system_libunwind.
if test x$with_system_libunwind = xyes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETIPINFO 1
_ACEOF
fi
# --------------------------------------------------------
# Build, host, and target specific configuration fragments
# --------------------------------------------------------
@ -12529,6 +12538,150 @@ _ACEOF
fi
fi
use_getipinfo=yes
if test x$with_system_libunwind = xyes; then
if test x$host = x$target; then
echo "$as_me:$LINENO: checking for library containing _Unwind_GetIPInfo" >&5
echo $ECHO_N "checking for library containing _Unwind_GetIPInfo... $ECHO_C" >&6
if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search__Unwind_GetIPInfo=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char _Unwind_GetIPInfo ();
int
main ()
{
_Unwind_GetIPInfo ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search__Unwind_GetIPInfo="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search__Unwind_GetIPInfo" = no; then
for ac_lib in unwind; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char _Unwind_GetIPInfo ();
int
main ()
{
_Unwind_GetIPInfo ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search__Unwind_GetIPInfo="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search__Unwind_GetIPInfo" >&5
echo "${ECHO_T}$ac_cv_search__Unwind_GetIPInfo" >&6
if test "$ac_cv_search__Unwind_GetIPInfo" != no; then
test "$ac_cv_search__Unwind_GetIPInfo" = "none required" || LIBS="$ac_cv_search__Unwind_GetIPInfo $LIBS"
else
use_getipinfo=no
fi
fi
fi
if test x$use_getipinfo = xyes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETIPINFO 1
_ACEOF
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}

View File

@ -1229,6 +1229,12 @@ AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
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
# --------------------------------------------------------
# Build, host, and target specific configuration fragments
# --------------------------------------------------------
@ -1439,6 +1445,20 @@ 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}

View File

@ -157,7 +157,11 @@ PERSONALITY_FUNCTION (int version,
/* Parse the LSDA header. */
p = parse_lsda_header (context, language_specific_data, &info);
#ifdef HAVE_GETIPINFO
ip = _Unwind_GetIPInfo (context, &ip_before_insn);
#else
ip = _Unwind_GetIP (context);
#endif
if (! ip_before_insn)
--ip;
landing_pad = 0;