diff mbox

Fix libgfortran build on hppa64-hp-hpux11.11

Message ID 25FAAB78-C4F3-412F-8492-08C1891E02AD@bell.net
State New
Headers show

Commit Message

John David Anglin Dec. 5, 2015, 6:01 p.m. UTC
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.anglin@bell.net
2015-12-05  John David Anglin  <danglin@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.

Comments

Ian Lance Taylor Dec. 7, 2015, 2:29 p.m. UTC | #1
John David Anglin <dave.anglin@bell.net> writes:

> 2015-12-05  John David Anglin  <danglin@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.

This is OK.

Thanks.

Ian
diff mbox

Patch

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)