This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GDB] Use AC_CHECK_SIZEOF to test for PRFPREGSET_T_BROKEN


On Sep 28 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)

This mangles the configure output.  The output of the AC_CHECK_SIZEOF
checks occurs in the middle of the output of the prfpregset_t check.
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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]