[GDB] Use AC_CHECK_SIZEOF to test for PRFPREGSET_T_BROKEN

Andreas Schwab schwab@suse.de
Mon Sep 26 14:29:00 GMT 2016


On Sep 26 2016, Matthew Wahab <matthew.wahab@foss.arm.com> wrote:

> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index e451e60..b162d87 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1573,21 +1573,14 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
>  
>    if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
>      AC_MSG_CHECKING(whether prfpregset_t type is broken)
> -    AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
> -      [AC_TRY_RUN([#include <sys/procfs.h>
> -       int main ()
> -       {
> -         if (sizeof (prfpregset_t) == sizeof (void *))
> -           return 1;
> -         return 0;
> -       }],
> -       gdb_cv_prfpregset_t_broken=no,
> -       gdb_cv_prfpregset_t_broken=yes,
> -       gdb_cv_prfpregset_t_broken=yes)])
> -    AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
> -    if test $gdb_cv_prfpregset_t_broken = yes; then
> +    AC_CHECK_SIZEOF(prfpregset_t, [], [ #include <sys/procfs.h> ])
> +    AC_CHECK_SIZEOF(void *)
> +    if test "${ac_cv_sizeof_prfpregset_t}" = "${ac_cv_sizeof_void_p}"; then
> +      AC_MSG_RESULT(yes)
>        AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
>        [Define if the prfpregset_t type is broken.])
> +    else
> +      AC_MSG_RESULT(no)

That will mangle the configure output, interspersing the results from
AC_CHECK_SIZEOF with the output of this test.  You should not nest
configure checks.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the Binutils mailing list