The use of libbacktrace in libgfortran exposed a libgfortran build issue on 
hppa64-hp-hpux11.11.
This target doesn't have any __sync builtins, so we need to set 
libbacktrace_cv_sys_sync to no
when with_target_subdir is set and configure tests are not done.

This exposed a compilation issue in elf.c which  is fixed by a void cast.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11 with no observed 
regressions.
Okay for trunk?

Regards,
Dave
--
John David Anglin       dave.ang...@bell.net


2015-12-05  John David Anglin  <dang...@gcc.gnu.org>

        PR 68115/libfortran
        * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
        * configure: Regenerate.
        * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
        to void.

Index: configure.ac
===================================================================
--- configure.ac        (revision 230990)
+++ configure.ac        (working copy)
@@ -172,7 +172,10 @@
 AC_CACHE_CHECK([__sync extensions],
 [libbacktrace_cv_sys_sync],
 [if test -n "${with_target_subdir}"; then
-   libbacktrace_cv_sys_sync=yes
+   case "${host}" in
+   hppa*-*-hpux*) libbacktrace_cv_sys_sync=no ;;
+   *) libbacktrace_cv_sys_sync=yes ;;
+   esac
  else
    AC_LINK_IFELSE(
      [AC_LANG_PROGRAM([int i;],
Index: elf.c
===================================================================
--- elf.c       (revision 231044)
+++ elf.c       (working copy)
@@ -955,7 +955,8 @@
       if (found_sym)
        backtrace_atomic_store_pointer (&state->syminfo_fn, elf_syminfo);
       else
-       __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, elf_nosyms);
+       (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,
+                                            elf_nosyms);
     }
 
   if (!state->threaded)

Reply via email to