summaryrefslogtreecommitdiff
path: root/libgfortran/configure
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 16:04:42 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 16:04:42 +0000
commit0ecf494e1d3f03814e7c555818fe3401c9edc6ab (patch)
treeb0dcabb54361e5e3a6242e307bb50ceb26cba8ef /libgfortran/configure
parent8619429b974718689f613aa9343d12a15aeebe41 (diff)
downloadgcc-0ecf494e1d3f03814e7c555818fe3401c9edc6ab.tar.gz
PR 46686 Implement backtrace with _Unwind_Backtrace from libgcc.
2011-11-09 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/46686 * configure.ac: Don't check execinfo.h, backtrace, backtrace_symbols_fd. Check execve instead of execvp. Call GCC_CHECK_UNWIND_GETIPINFO. * runtime/backtrace.c: Don't include unused headers, include limits.h and unwind.h. (CAN_FORK): Check execve instead of execvp. (GLIBC_BACKTRACE): Remove. (bt_header): Conform to gdb backtrace format. (struct bt_state): New struct. (trace_function): New function. (show_backtrace): Use _Unwind_Backtrace from libgcc instead of glibc backtrace functions. * Makefile.in: Regenerated. * aclocal.m4: Regenerated. * config.h.in: Regenerated. * configure: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181209 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/configure')
-rwxr-xr-xlibgfortran/configure63
1 files changed, 44 insertions, 19 deletions
diff --git a/libgfortran/configure b/libgfortran/configure
index 3a1174a1237..0ee67d5d1a7 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -766,6 +766,7 @@ with_gnu_ld
enable_libtool_lock
enable_largefile
enable_libquadmath_support
+with_system_libunwind
'
ac_precious_vars='build_alias
host_alias
@@ -1424,6 +1425,7 @@ Optional Packages:
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-system-libunwind use installed libunwind
Some influential environment variables:
CC C compiler command
@@ -12112,7 +12114,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12115 "configure"
+#line 12117 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12218,7 +12220,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12221 "configure"
+#line 12223 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15919,7 +15921,7 @@ fi
done
-for ac_header in fenv.h fptrap.h float.h execinfo.h pwd.h
+for ac_header in fenv.h fptrap.h float.h pwd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -16419,7 +16421,7 @@ _ACEOF
fi
done
-for ac_func in wait setmode execvp pipe dup2 close fdopen strcasestr getrlimit
+for ac_func in wait setmode execve pipe dup2 close fdopen strcasestr getrlimit
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16472,21 +16474,6 @@ fi
done
-# Check for glibc backtrace functions
-for ac_func in backtrace backtrace_symbols_fd
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
# Check libc for getgid, getpid, getuid
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgid in -lc" >&5
$as_echo_n "checking for getgid in -lc... " >&6; }
@@ -25880,6 +25867,44 @@ $as_echo "#define HAVE_CRLF 1" >>confdefs.h
fi
+# Check whether we have _Unwind_GetIPInfo for backtrace
+
+
+# Check whether --with-system-libunwind was given.
+if test "${with_system_libunwind+set}" = set; then :
+ withval=$with_system_libunwind;
+fi
+
+ # 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
+ # Darwin before version 9 does not have _Unwind_GetIPInfo.
+
+ case ${target} in
+ *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
+ *) have_unwind_getipinfo=yes ;;
+ esac
+
+ fi
+
+ if test x$have_unwind_getipinfo = xyes; then
+
+$as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
+
+ fi
+
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure