diff options
author | Ian Lance Taylor <iant@google.com> | 2012-10-24 21:09:55 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-24 21:09:55 +0000 |
commit | 32061319f77b80e9a52855fa990856f6bfce682b (patch) | |
tree | c53daad197d3a091ed98e30d079c0242bd7c1e81 /libbacktrace | |
parent | 45c29893a678fe93a54ce82718a7d3839d69b8c4 (diff) | |
download | gcc-32061319f77b80e9a52855fa990856f6bfce682b.tar.gz |
re PR target/55061 (libbacktrace build fails during bootstrap on powerpc-apple-darwin9)
PR target/55061
* configure.ac: Check whether -funwind-tables option works.
* configure: Rebuild.
From-SVN: r192782
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/ChangeLog | 6 | ||||
-rwxr-xr-x | libbacktrace/configure | 34 | ||||
-rw-r--r-- | libbacktrace/configure.ac | 15 |
3 files changed, 53 insertions, 2 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index 952c96fbfea..729123d8bb0 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,9 @@ +2012-10-24 Ian Lance Taylor <iant@google.com> + + PR target/55061 + * configure.ac: Check whether -funwind-tables option works. + * configure: Rebuild. + 2012-10-11 Ian Lance Taylor <iant@google.com> * configure.ac: Do not use dl_iterate_phdr on Solaris 10. diff --git a/libbacktrace/configure b/libbacktrace/configure index 9a88e8e48e8..e2797370186 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -11490,8 +11490,40 @@ fi EXTRA_FLAGS= -if test "x$GCC" = "xyes"; then +if test -n "${with_target_subdir}"; then EXTRA_FLAGS=-funwind-tables +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -funwind-tables option" >&5 +$as_echo_n "checking for -funwind-tables option... " >&6; } +if test "${libbacktrace_cv_c_unwind_tables+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS_hold="$CFLAGS" + CFLAGS="$CFLAGS -funwind-tables" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +static int f() { return 0; } +int +main () +{ +return f(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libbacktrace_cv_c_unwind_tables=yes +else + libbacktrace_cv_c_unwind_tables=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$CFLAGS_hold" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_c_unwind_tables" >&5 +$as_echo "$libbacktrace_cv_c_unwind_tables" >&6; } + if test "$libbacktrace_cv_c_unwind_tables" = "yes"; then + EXTRA_FLAGS=-funwind-tables + fi fi diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 9633afd5ac3..6867ecffb89 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -97,8 +97,21 @@ fi AC_SUBST(BACKTRACE_FILE) EXTRA_FLAGS= -if test "x$GCC" = "xyes"; then +if test -n "${with_target_subdir}"; then EXTRA_FLAGS=-funwind-tables +else + AC_CACHE_CHECK([for -funwind-tables option], + [libbacktrace_cv_c_unwind_tables], + [CFLAGS_hold="$CFLAGS" + CFLAGS="$CFLAGS -funwind-tables" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([static int f() { return 0; }], [return f();])], + [libbacktrace_cv_c_unwind_tables=yes], + [libbacktrace_cv_c_unwind_tables=no]) + CFLAGS="$CFLAGS_hold"]) + if test "$libbacktrace_cv_c_unwind_tables" = "yes"; then + EXTRA_FLAGS=-funwind-tables + fi fi AC_SUBST(EXTRA_FLAGS) |