Comments
Patch
===================================================================
@@ -34,4 +34,8 @@ AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
if test x$have_unwind_getipinfo = xyes; then
AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.])
fi
+
+ if test x$with_system_libunwind = xyes; then
+ AC_DEFINE(USE_SYSTEM_LIBUNWIND, 1, [Define if using system unwind library.])
+ fi
])
===================================================================
@@ -1184,6 +1184,11 @@ if test $force_sjlj_exceptions = yes; th
[Define 0/1 to force the choice for exception handling model.])
fi
+# For platforms with the unwind ABI which includes an unwind library,
+# libunwind, we can choose to use the system libunwind.
+# This macro sets USE_SYSTEM_LIBUNWIND that is used in gcc.c.
+GCC_CHECK_UNWIND_GETIPINFO
+
# --------------------------------------------------------
# Build, host, and target specific configuration fragments
# --------------------------------------------------------
@@ -3231,6 +3236,14 @@ elif test x$gcc_cv_ld != x; then
gcc_cv_ld_static_option="-noso"
gcc_cv_ld_dynamic_option="-so_archive"
;;
+ # HP-UX ld uses -a flags to select between shared and archive.
+ *-*-hpux*)
+ if test x"$gnu_ld" = xno; then
+ gcc_cv_ld_static_dynamic=yes
+ gcc_cv_ld_static_option="-aarchive"
+ gcc_cv_ld_dynamic_option="-adefault"
+ fi
+ ;;
# IRIX 6 ld supports -Bstatic/-Bdynamic.
mips-sgi-irix6*)
gcc_cv_ld_static_dynamic=yes
===================================================================
@@ -1391,7 +1391,7 @@ init_spec (void)
"-lgcc",
"-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
-# ifdef HAVE_LD_STATIC_DYNAMIC
+# if defined(HAVE_LD_STATIC_DYNAMIC) && !defined(USE_SYSTEM_LIBUNWIND)
" %{!static:" LD_STATIC_OPTION "} -lunwind"
" %{!static:" LD_DYNAMIC_OPTION "}"
# else